114 lines
2.2 KiB
C#
114 lines
2.2 KiB
C#
using System;
|
|
|
|
namespace NKC_WF.WebUserControls
|
|
{
|
|
public partial class cmp_ML_ShDet : BaseUserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
public int StatusReqStart
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfStatus.Value, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
hfStatus.Value = value.ToString();
|
|
// update generale
|
|
doUpdate();
|
|
}
|
|
}
|
|
public int StatusReqEnd
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfStatusEnd.Value, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
hfStatusEnd.Value = value.ToString();
|
|
// update generale
|
|
doUpdate();
|
|
}
|
|
}
|
|
public int BatchId
|
|
{
|
|
set
|
|
{
|
|
hfBatchID.Value = value.ToString();
|
|
doUpdate();
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfBatchID.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
private void fixCss()
|
|
{
|
|
string colore = "dark";
|
|
divBlock.Attributes.Remove("class");
|
|
switch (StatusReqStart)
|
|
{
|
|
case -1:
|
|
colore = "primary";
|
|
break;
|
|
case 1:
|
|
colore = "warning";
|
|
break;
|
|
case 3:
|
|
colore = "info";
|
|
break;
|
|
case 5:
|
|
colore = "dark";
|
|
break;
|
|
default:
|
|
colore = "secondary";
|
|
break;
|
|
}
|
|
string classe = $"alert alert-{colore} border border-{colore} border-thick row";
|
|
divBlock.Attributes.Add("class", classe);
|
|
}
|
|
|
|
public void doUpdate()
|
|
{
|
|
// imposto css
|
|
fixCss();
|
|
// imposto titolo
|
|
fixTitle();
|
|
// sistemo filtraggio frmView
|
|
}
|
|
|
|
private void fixTitle()
|
|
{
|
|
switch (StatusReqStart)
|
|
{
|
|
case -1:
|
|
lblTitle.Text = traduci("LoadData");
|
|
break;
|
|
case 1:
|
|
lblTitle.Text = traduci("PrintData");
|
|
break;
|
|
case 3:
|
|
lblTitle.Text = traduci("MachineData");
|
|
break;
|
|
case 5:
|
|
lblTitle.Text = traduci("UnloadData");
|
|
break;
|
|
default:
|
|
lblTitle.Text = traduci("NA");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} |