Files
MoonPro.net/MP-ADM/WebUserControls/cmp_TechSheetDetail.ascx.cs
T

78 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class cmp_TechSheetDetail : BaseUserControl
{
#region Public Properties
public int IdxST
{
get
{
int answ = 0;
int.TryParse(hfIdxST.Value, out answ);
return answ;
}
set
{
hfIdxST.Value = $"{value}";
doUpdate();
}
}
#endregion Public Properties
#region Private Methods
private void checkVisibility()
{
divDetail.Visible = IdxST > 0;
}
#endregion Private Methods
#region Protected Methods
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
raiseNewVal();
}
protected void lbtAddTemplate_Click(object sender, EventArgs e)
{
// recupero argomento...
LinkButton lbt = (LinkButton)sender;
if (!string.IsNullOrEmpty(lbt.CommandArgument))
{
// chiamo stored x aggiungere da template...
DataLayerObj.taSTAR.addByTemplate(IdxST, lbt.CommandArgument);
}
doUpdate();
raiseNewVal();
}
protected void Page_Load(object sender, EventArgs e)
{
checkVisibility();
}
#endregion Protected Methods
#region Public Methods
public void doUpdate()
{
grView.SelectedIndex = -1;
grView.DataBind();
checkVisibility();
}
#endregion Public Methods
}
}