Files
MoonPro.net/MP-ADM/GestKIT.aspx.cs
T
2019-04-19 11:32:08 +02:00

67 lines
2.1 KiB
C#

using SteamWare;
using System;
namespace MP_ADM
{
public partial class GestKIT : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
checkEnabled();
string codPre = memLayer.ML.CRS("OptAdmKit_CodPre");
mod_barcode.codOrdPre = codPre != "" ? codPre : "KIT";
mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre;
mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase");
mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo");
mod_barcode.eh_comandoRegistrato += Mod_barcode_eh_comandoRegistrato;
mod_barcode.eh_dataRead += Mod_barcode_eh_dataRead;
mod_gestKIT.eh_selKit += Mod_gestKIT_eh_selKit;
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmKitEnabled");
divContent.Visible = optPar;
lblDataImportOut.Visible = !optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: Gestione KIT disabilitata";
lblDataImportOut.Text = messaggio;
}
}
private void Mod_gestKIT_eh_selKit(object sender, EventArgs e)
{
// invio ultimo kit creato a barcode...
mod_barcode.BCodeVal = mod_gestKIT.lastKitMade;
mod_barcode.processInput();
}
private void Mod_barcode_eh_dataRead(object sender, EventArgs e)
{
// verifico input su KIT x lettura "grezza"
string rawInput = mod_barcode.rawInput;
mod_gestKIT.lastInput = rawInput;
mod_gestKIT.doUpdate();
}
private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e)
{
// verifico input su KIT x comando completo
string BCodeVal = mod_barcode.BCodeVal;
// se è un ORDINE... procedo!
if (BCodeVal.IndexOf("OPR") == 0)
{
// aggiungo ordine...
mod_gestKIT.addOrdArt(mod_barcode.codOrd, mod_barcode.codArt, mod_barcode.descArt, mod_barcode.qta);
mod_gestKIT.lastInput = "";
}
else
{
mod_gestKIT.lastInput = mod_barcode.BCodeVal;
}
mod_gestKIT.doUpdate();
}
}
}