Files
NKC/NKC_WF/WebUserControls/cmp_KS_Items.ascx.cs
T
2020-08-11 13:22:58 +02:00

137 lines
3.3 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_KS_Items : BaseUserControl
{
/// <summary>
/// Cart selezionato
/// </summary>
public int CartID
{
get
{
int answ = 0;
int.TryParse(hfCartID.Value, out answ);
return answ;
}
set
{
hfCartID.Value = value.ToString();
}
}
/// <summary>
/// Matrix Bin selezionato
/// </summary>
public string CartDtmx
{
get
{
return hdCartDtmx.Value;
}
set
{
hdCartDtmx.Value = value;
}
}
public int ItemID
{
get
{
int answ = 0;
int.TryParse(hfItemID.Value, out answ);
return answ;
}
set
{
hfItemID.Value = value.ToString();
// se 0 --> annullo validità
if(value == 0)
{
ItemValid = false;
}
}
}
protected bool ItemValid
{
get
{
bool answ = false;
bool.TryParse(hfItemValid.Value, out answ);
return answ;
}
set
{
hfItemValid.Value = value.ToString();
}
}
public bool NeedSecOp
{
get
{
bool answ = false;
bool.TryParse(hfNeedSecOp.Value, out answ);
return answ;
}
set
{
hfNeedSecOp.Value = value.ToString();
}
}
public bool NeedPaint
{
get
{
bool answ = false;
bool.TryParse(hfNeedPaint.Value, out answ);
return answ;
}
set
{
hfNeedPaint.Value = value.ToString();
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Veriofico item sia valido...
/// </summary>
private void checkItemValidated()
{
bool showConfirmItem = false;
// se NON è già validato...
if (!ItemValid)
{
showConfirmItem = NeedPaint || NeedSecOp;
}
divItemValid.Visible = showConfirmItem;
// moastro messaggi errore secondo caso
lblNeedSecOp.Visible = NeedSecOp;
lblNeedPaint.Visible = NeedPaint;
}
public void doUpdate()
{
// effettua controlli vari
checkItemValidated();
}
protected void lbtConfItemValid_Click(object sender, EventArgs e)
{
ItemValid = true;
}
protected void lbtCancelItemValid_Click(object sender, EventArgs e)
{
ItemValid = false;
}
}
}