Files
NKC/NKC_WF/WebUserControls/cmp_searchBin.ascx.cs
T
2020-08-31 15:57:17 +02:00

93 lines
2.4 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_searchBin : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Bin selezionato
/// </summary>
public int BinID
{
get
{
int answ = 0;
int.TryParse(hfBinID.Value, out answ);
return answ;
}
set
{
hfBinID.Value = value.ToString();
}
}
/// <summary>
/// INdica se sia stato chaimato in modalità painted
/// </summary>
public bool isPainted
{
get
{
bool answ = false;
bool.TryParse(hfIsPainted.Value, out answ);
return answ;
}
set
{
hfIsPainted.Value = value.ToString();
}
}
protected bool binOk
{
get
{
return BinID > 0;
}
}
public void doUpdate()
{
frmView.DataBind();
}
protected void lbtReorderParts_Click(object sender, EventArgs e)
{
LinkButton lbt = null;
int BinID = 0;
int ItemId = 0;
try
{
lbt = (LinkButton)sender;
}
catch
{ }
if (lbt != null)
{
int.TryParse(lbt.CommandArgument, out BinID);
// cerco primo da riordinare x quel BIN
var tabIL = DLMan.taIL.getLastToProduceByBin(BinID);
if (tabIL != null && tabIL.Rows.Count > 0)
{
ItemId = tabIL[0].ItemID;
// riordino item ID corrente... status 990....
if (ItemId > 0)
{
// resetto item selezionato...
DLMan.taIL.updateStatus(ItemId, 990, PlaceId);
lgInfo($"cmp_searchBin | SCRAP | Status --> 990 | itemIdSelected: {BinID} | PlaceId: {PlaceId}");
raiseEvent();
}
}
}
}
}
}