100 lines
2.1 KiB
C#
100 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace NKC_WF.WebUserControls
|
|
{
|
|
public partial class cmp_stackList : BaseUserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
checkVisibility();
|
|
}
|
|
}
|
|
|
|
private void checkVisibility()
|
|
{
|
|
divSelected.Visible = StackIdSel > 0;
|
|
grView.Visible = !divSelected.Visible;
|
|
// imposto css titolo...
|
|
string titleClass = "row font-weight-bold";
|
|
if (divSelected.Visible)
|
|
{
|
|
titleClass += " table-info";
|
|
}
|
|
divTitle.Attributes.Remove("class");
|
|
divTitle.Attributes.Add("class", titleClass);
|
|
}
|
|
public int BatchId
|
|
{
|
|
set
|
|
{
|
|
hfBatchId.Value = value.ToString();
|
|
grView.DataBind();
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfBatchId.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
checkVisibility();
|
|
raiseEvent();
|
|
}
|
|
/// <summary>
|
|
/// comando reset
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtReset_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezione();
|
|
}
|
|
|
|
private void resetSelezione()
|
|
{
|
|
lblStack.Text = "";
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
checkVisibility();
|
|
raiseEvent();
|
|
}
|
|
/// <summary>
|
|
/// StackId selezionato
|
|
/// </summary>
|
|
public int StackIdSel
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
try
|
|
{
|
|
int.TryParse(grView.SelectedValue.ToString(), out answ);
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
|
|
{
|
|
// recupero argomento = Takt...
|
|
try
|
|
{
|
|
string stack = e.CommandArgument.ToString();
|
|
lblStack.Text = stack;
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
} |