Verifica post finiti
This commit is contained in:
@@ -6,470 +6,482 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace GMW.WebUserControls
|
||||
{
|
||||
public partial class mod_PostFinMultIN : GMW_data.UserControl
|
||||
public partial class mod_PostFinMultIN : GMW_data.UserControl
|
||||
{
|
||||
public event EventHandler eh_nuovaRicerca;
|
||||
public event EventHandler eh_reqUpdate;
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
public event EventHandler eh_nuovaRicerca;
|
||||
public event EventHandler eh_reqUpdate;
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
fixRicercaUdc();
|
||||
traduciObj();
|
||||
idxCella = Postazione.currIdxCella;
|
||||
}
|
||||
doChecks();
|
||||
}
|
||||
/// <summary>
|
||||
/// IDX cella associata alla linea corrente
|
||||
/// </summary>
|
||||
protected int idxCella
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (memLayer.ML.isInSessionObject("IdxCellaFinMult_IN"))
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
fixRicercaUdc();
|
||||
traduciObj();
|
||||
idxCella = Postazione.currIdxCella;
|
||||
}
|
||||
doChecks();
|
||||
answ = memLayer.ML.IntSessionObj("IdxCellaFinMult_IN");
|
||||
}
|
||||
/// <summary>
|
||||
/// IDX cella associata alla linea corrente
|
||||
/// </summary>
|
||||
protected int idxCella
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxCellaFinMult_IN", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se si debab mostrare un campo ricerca UDC attivo...
|
||||
/// </summary>
|
||||
private void fixRicercaUdc()
|
||||
{
|
||||
if (memLayer.ML.isInSessionObject("valoreCercatoFMI"))
|
||||
{
|
||||
testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoFMI");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta (ri)stampa UDC
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void ristampa()
|
||||
{
|
||||
// non deve ristampare quelli in IN...
|
||||
}
|
||||
/// <summary>
|
||||
/// udc da stampare
|
||||
/// </summary>
|
||||
protected string udcReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("udcSelSAO");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua controlli visibilità
|
||||
/// </summary>
|
||||
private void doChecks()
|
||||
{
|
||||
checkBarcode();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo labels oggetti
|
||||
/// </summary>
|
||||
private void traduciObj()
|
||||
{
|
||||
btnCerca.Text = traduci("btnSearch");
|
||||
}
|
||||
/// <summary>
|
||||
/// decodifica il tipo barcode acquisito
|
||||
/// </summary>
|
||||
public tipoCodiceBarcode tipoBCode
|
||||
{
|
||||
get
|
||||
{
|
||||
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
|
||||
int trovati = 0;
|
||||
// controllo non si tratti di un comando...
|
||||
string preCmd = memLayer.ML.AppConf["prefComandi"];
|
||||
if (barcodeIn.StartsWith(preCmd))
|
||||
{
|
||||
get
|
||||
answ = tipoCodiceBarcode.Comando;
|
||||
}
|
||||
else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima...
|
||||
{
|
||||
answ = tipoCodiceBarcode.Particolare;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// cerco tra UDC
|
||||
trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count;
|
||||
if (trovati > 0)
|
||||
{
|
||||
int answ = 0;
|
||||
if (memLayer.ML.isInSessionObject("IdxCellaFinMult_IN"))
|
||||
answ = tipoCodiceBarcode.UDC;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore barcode
|
||||
/// </summary>
|
||||
public string barcodeIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtBarcode.Text.Trim();
|
||||
}
|
||||
set
|
||||
{
|
||||
txtBarcode.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore barcode
|
||||
/// </summary>
|
||||
public string lastBarcodeIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfLastBCode.Value = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// controlla se ci sia un barcode
|
||||
/// </summary>
|
||||
private void checkBarcode()
|
||||
{
|
||||
if (barcodeIn != "")
|
||||
{
|
||||
Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn);
|
||||
Postazione.warningText = "";
|
||||
switch (tipoBCode)
|
||||
{
|
||||
case tipoCodiceBarcode.UDC:
|
||||
// se linea non selezionata ERRORE!!!
|
||||
if (Postazione.currCodLinea == "W2500")
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
// procedo solo se UDC esistente
|
||||
if (MagClass.magazzino.checkUDC(barcodeIn))
|
||||
{
|
||||
// controllo se NON ci siano NC "pending"
|
||||
if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc)
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("IdxCellaFinMult_IN");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxCellaFinMult_IN", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se si debab mostrare un campo ricerca UDC attivo...
|
||||
/// </summary>
|
||||
private void fixRicercaUdc()
|
||||
{
|
||||
if (memLayer.ML.isInSessionObject("valoreCercatoFMI"))
|
||||
{
|
||||
testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoFMI");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta (ri)stampa UDC
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void ristampa()
|
||||
{
|
||||
// non deve ristampare quelli in IN...
|
||||
}
|
||||
/// <summary>
|
||||
/// udc da stampare
|
||||
/// </summary>
|
||||
protected string udcReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("udcSelSAO");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua controlli visibilità
|
||||
/// </summary>
|
||||
private void doChecks()
|
||||
{
|
||||
checkBarcode();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo labels oggetti
|
||||
/// </summary>
|
||||
private void traduciObj()
|
||||
{
|
||||
btnCerca.Text = traduci("btnSearch");
|
||||
}
|
||||
/// <summary>
|
||||
/// decodifica il tipo barcode acquisito
|
||||
/// </summary>
|
||||
public tipoCodiceBarcode tipoBCode
|
||||
{
|
||||
get
|
||||
{
|
||||
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
|
||||
int trovati = 0;
|
||||
// controllo non si tratti di un comando...
|
||||
string preCmd = memLayer.ML.AppConf["prefComandi"];
|
||||
if (barcodeIn.StartsWith(preCmd))
|
||||
{
|
||||
answ = tipoCodiceBarcode.Comando;
|
||||
}
|
||||
else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima...
|
||||
{
|
||||
answ = tipoCodiceBarcode.Particolare;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
// calcolo nuovo particolare
|
||||
string origParticolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare;
|
||||
|
||||
// verifico che il particolare NON SIA in veto...
|
||||
if (checkPartVetoByLinea(origParticolare))
|
||||
{
|
||||
Postazione.messaggiText += $" - Attenzione, PARTICOLARE {origParticolare} NON ATTIVATO / NON PERMESSO sulla LINEA!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
// controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x trattati (pre lavorazioni meccaniche)
|
||||
int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione;
|
||||
if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneTrattati"))
|
||||
{
|
||||
// cerco tra UDC
|
||||
trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count;
|
||||
if (trovati > 0)
|
||||
int idxCellaCurr = 0;
|
||||
try
|
||||
{
|
||||
idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc
|
||||
if (idxCellaCurr == Postazione.currIdxCella)
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
string codBloccoCurr = "";
|
||||
int idxBlocco = 0;
|
||||
try
|
||||
{
|
||||
answ = tipoCodiceBarcode.UDC;
|
||||
idxBlocco = MagClass.magazzino.taCelle.getByIdxCella(idxCellaCurr)[0].IdxBlocco;
|
||||
codBloccoCurr = MagClass.magazzino.taBlocchi.getByIdx(idxBlocco)[0].CodBlocco;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore barcode
|
||||
/// </summary>
|
||||
public string barcodeIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtBarcode.Text.Trim();
|
||||
}
|
||||
set
|
||||
{
|
||||
txtBarcode.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore barcode
|
||||
/// </summary>
|
||||
public string lastBarcodeIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfLastBCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfLastBCode.Value = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// controlla se ci sia un barcode
|
||||
/// </summary>
|
||||
private void checkBarcode()
|
||||
{
|
||||
if (barcodeIn != "")
|
||||
{
|
||||
Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn);
|
||||
Postazione.warningText = "";
|
||||
switch (tipoBCode)
|
||||
{
|
||||
case tipoCodiceBarcode.UDC:
|
||||
// se linea non selezionata ERRORE!!!
|
||||
if (Postazione.currCodLinea == "W2500")
|
||||
catch
|
||||
{ }
|
||||
// 2015.01.12 controllo UDC non già su altre postazioni...
|
||||
if (codBloccoCurr == Postazione.currCodBlocco && idxCellaCurr != Postazione.currIdxCella)
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA (dello stesso gruppo)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else if (codBloccoCurr != Postazione.currCodBlocco && codBloccoCurr.StartsWith("W"))
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA (di altro gruppo)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
// procedo solo se UDC esistente
|
||||
if (MagClass.magazzino.checkUDC(barcodeIn))
|
||||
// altrimenti procedo...
|
||||
string codSogg = "";
|
||||
string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare;
|
||||
decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta;
|
||||
string noteTrim = "";
|
||||
try
|
||||
{
|
||||
codSogg = MagClass.magazzino.CodSoggCurrUser;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim();
|
||||
}
|
||||
catch
|
||||
{
|
||||
noteTrim = "";
|
||||
}
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
// verifico per eventuale consumo vecchio UDC... cerco nella posizione
|
||||
DS_magazzino.v_UdcDetailDataTable tabUdcDet = null;
|
||||
try
|
||||
{
|
||||
// cerco nella posizione
|
||||
tabUdcDet = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// cerco se NON ci sia l'UDC letto...
|
||||
if (tabUdcDet.Select(string.Format("UDC = '{0}'", barcodeIn)).Length == 0)
|
||||
{
|
||||
string oldUdc = "";
|
||||
try
|
||||
{
|
||||
// controllo se NON ci siano NC "pending"
|
||||
if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc)
|
||||
{
|
||||
// controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x trattati (pre lavorazioni meccaniche)
|
||||
int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione;
|
||||
if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneTrattati"))
|
||||
{
|
||||
int idxCellaCurr = 0;
|
||||
try
|
||||
{
|
||||
idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc
|
||||
if (idxCellaCurr == Postazione.currIdxCella)
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
string codBloccoCurr = "";
|
||||
int idxBlocco = 0;
|
||||
try
|
||||
{
|
||||
idxBlocco = MagClass.magazzino.taCelle.getByIdxCella(idxCellaCurr)[0].IdxBlocco;
|
||||
codBloccoCurr = MagClass.magazzino.taBlocchi.getByIdx(idxBlocco)[0].CodBlocco;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// 2015.01.12 controllo UDC non già su altre postazioni...
|
||||
if (codBloccoCurr == Postazione.currCodBlocco && idxCellaCurr != Postazione.currIdxCella)
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA (dello stesso gruppo)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else if (codBloccoCurr != Postazione.currCodBlocco && codBloccoCurr.StartsWith("W"))
|
||||
{
|
||||
Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA (di altro gruppo)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti procedo...
|
||||
string codSogg = "";
|
||||
string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare;
|
||||
decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta;
|
||||
string noteTrim = "";
|
||||
try
|
||||
{
|
||||
codSogg = MagClass.magazzino.CodSoggCurrUser;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim();
|
||||
}
|
||||
catch
|
||||
{
|
||||
noteTrim = "";
|
||||
}
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
// verifico per eventuale consumo vecchio UDC... cerco nella posizione
|
||||
DS_magazzino.v_UdcDetailDataTable tabUdcDet = null;
|
||||
try
|
||||
{
|
||||
// cerco nella posizione
|
||||
tabUdcDet = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// cerco se NON ci sia l'UDC letto...
|
||||
if (tabUdcDet.Select(string.Format("UDC = '{0}'", barcodeIn)).Length == 0)
|
||||
{
|
||||
string oldUdc = "";
|
||||
try
|
||||
{
|
||||
oldUdc = ((DS_magazzino.v_UdcDetailRow)tabUdcDet.Select(string.Format("Particolare = '{0}'", particolare))[0]).UDC;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
// se trovo un altro UDC dello stesso particolare...
|
||||
if (oldUdc != "")
|
||||
{
|
||||
// consumo UDC
|
||||
consumaUdc(oldUdc);
|
||||
}
|
||||
// se ho cod cella sposto!
|
||||
MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName);
|
||||
// registro spostamento UDC
|
||||
MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Trattati su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea));
|
||||
}
|
||||
Postazione.CssClass = "stileComandoOk";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// udc NON corretto, mostro errore...
|
||||
Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
|
||||
// controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG...
|
||||
if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc)
|
||||
{
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
Postazione.messaggiText += string.Format("<br />{0}", traduci("ERR-NC-001"));
|
||||
// recupero l'NC associata...
|
||||
Postazione.warningText += string.Format("<br />{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
Postazione.messaggiText += string.Format("<br />{0}", traduci("ERR-NC-001"));
|
||||
// recupero l'NC associata...
|
||||
Postazione.warningText += string.Format("<br />{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn));
|
||||
}
|
||||
oldUdc = ((DS_magazzino.v_UdcDetailRow)tabUdcDet.Select(string.Format("Particolare = '{0}'", particolare))[0]).UDC;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
// se trovo un altro UDC dello stesso particolare...
|
||||
if (oldUdc != "")
|
||||
{
|
||||
// consumo UDC
|
||||
consumaUdc(oldUdc);
|
||||
}
|
||||
// se ho cod cella sposto!
|
||||
MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName);
|
||||
// registro spostamento UDC
|
||||
MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Trattati su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea));
|
||||
}
|
||||
Postazione.CssClass = "stileComandoOk";
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
Postazione.messaggiText += " - codice <b>non riconosciuto</b>!";
|
||||
Postazione.CssClass = "stileComandoND";
|
||||
break;
|
||||
}
|
||||
barcodeIn = "";
|
||||
lastBarcodeIn = "-";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastBarcodeIn == "")
|
||||
{
|
||||
Postazione.messaggiText = traduci("AttesaBCode");
|
||||
Postazione.CssClass = "stileAttesa";
|
||||
}
|
||||
lastBarcodeIn = "";
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua consumo UDC
|
||||
/// </summary>
|
||||
/// <param name="oldUdc"></param>
|
||||
private void consumaUdc(string oldUdc)
|
||||
{
|
||||
// se è consumabile (IdxPosizione > 0)...
|
||||
if (MagClass.magazzino.udcMpIsConsumabile(oldUdc))
|
||||
{
|
||||
// consumo UDC
|
||||
MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna tabella + focus a barcode
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
idxCella = Postazione.currIdxCella;
|
||||
grView.DataBind();
|
||||
txtBarcode.Focus();
|
||||
// raise dell'evento
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua reset dati
|
||||
/// </summary>
|
||||
public void doResetData()
|
||||
{
|
||||
// resetto i dati QtaTot e particolare...
|
||||
testoRicerca = "";
|
||||
doChecks();
|
||||
}
|
||||
/// <summary>
|
||||
/// cambiato valore in ricerca
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtCerca_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettuato reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
testoRicerca = "";
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// pressione del button di ricerca
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCerca_Click(object sender, EventArgs e)
|
||||
{
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// testo ricerca trimmato da spazi
|
||||
/// </summary>
|
||||
protected string testoRicerca
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtCerca.Text.Trim();
|
||||
}
|
||||
set
|
||||
{
|
||||
txtCerca.Text = value;
|
||||
}
|
||||
}
|
||||
protected void salvaCerca()
|
||||
{
|
||||
if (testoRicerca == "")
|
||||
{
|
||||
SteamWare.memLayer.ML.emptySessionVal("valoreCercatoFMI");
|
||||
}
|
||||
else
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("valoreCercatoFMI", testoRicerca);
|
||||
}
|
||||
// raise dell'evento
|
||||
if (eh_nuovaRicerca != null)
|
||||
{
|
||||
eh_nuovaRicerca(this, new EventArgs());
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
protected void grView_Sorted(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorno ods al binding..
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_DataBinding(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se attivo filtro company e imposta ods di conseguenza...
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
else
|
||||
{
|
||||
// udc NON corretto, mostro errore...
|
||||
Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!";
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
}
|
||||
|
||||
// controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG...
|
||||
if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc)
|
||||
{
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
Postazione.messaggiText += string.Format("<br />{0}", traduci("ERR-NC-001"));
|
||||
// recupero l'NC associata...
|
||||
Postazione.warningText += string.Format("<br />{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn));
|
||||
}
|
||||
}
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
else
|
||||
{
|
||||
Postazione.CssClass = "stileComandoKo";
|
||||
Postazione.messaggiText += string.Format("<br />{0}", traduci("ERR-NC-001"));
|
||||
// recupero l'NC associata...
|
||||
Postazione.warningText += string.Format("<br />{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
Postazione.messaggiText += " - codice <b>non riconosciuto</b>!";
|
||||
Postazione.CssClass = "stileComandoND";
|
||||
break;
|
||||
}
|
||||
barcodeIn = "";
|
||||
lastBarcodeIn = "-";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastBarcodeIn == "")
|
||||
{
|
||||
Postazione.messaggiText = traduci("AttesaBCode");
|
||||
Postazione.CssClass = "stileAttesa";
|
||||
}
|
||||
lastBarcodeIn = "";
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua consumo UDC
|
||||
/// </summary>
|
||||
/// <param name="oldUdc"></param>
|
||||
private void consumaUdc(string oldUdc)
|
||||
{
|
||||
// se è consumabile (IdxPosizione > 0)...
|
||||
if (MagClass.magazzino.udcMpIsConsumabile(oldUdc))
|
||||
{
|
||||
// consumo UDC
|
||||
MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna tabella + focus a barcode
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
idxCella = Postazione.currIdxCella;
|
||||
grView.DataBind();
|
||||
txtBarcode.Focus();
|
||||
// raise dell'evento
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua reset dati
|
||||
/// </summary>
|
||||
public void doResetData()
|
||||
{
|
||||
// resetto i dati QtaTot e particolare...
|
||||
testoRicerca = "";
|
||||
doChecks();
|
||||
}
|
||||
/// <summary>
|
||||
/// cambiato valore in ricerca
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtCerca_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettuato reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
testoRicerca = "";
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// pressione del button di ricerca
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCerca_Click(object sender, EventArgs e)
|
||||
{
|
||||
salvaCerca();
|
||||
}
|
||||
/// <summary>
|
||||
/// testo ricerca trimmato da spazi
|
||||
/// </summary>
|
||||
protected string testoRicerca
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtCerca.Text.Trim();
|
||||
}
|
||||
set
|
||||
{
|
||||
txtCerca.Text = value;
|
||||
}
|
||||
}
|
||||
protected void salvaCerca()
|
||||
{
|
||||
if (testoRicerca == "")
|
||||
{
|
||||
SteamWare.memLayer.ML.emptySessionVal("valoreCercatoFMI");
|
||||
}
|
||||
else
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("valoreCercatoFMI", testoRicerca);
|
||||
}
|
||||
// raise dell'evento
|
||||
if (eh_nuovaRicerca != null)
|
||||
{
|
||||
eh_nuovaRicerca(this, new EventArgs());
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
protected void grView_Sorted(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorno ods al binding..
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_DataBinding(object sender, EventArgs e)
|
||||
{
|
||||
// fix dell'ODS
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se attivo filtro company e imposta ods di conseguenza...
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,5 +76,65 @@ namespace GMW_data
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica un particolare SE ABBIA un veto data la linea
|
||||
/// </summary>
|
||||
/// <param name="codParticolare"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool checkPartVetoByLinea(string codParticolare)
|
||||
{
|
||||
bool answ = false;
|
||||
// cerco se avessi già in redis un controllo particolare/linea attivo e il suo risultato...
|
||||
string mHash = memLayer.ML.redHash($"lineePartVeto:{Postazione.currCodLinea}:{codParticolare}");
|
||||
if (memLayer.ML.getRSV(mHash) != null && memLayer.ML.getRSV(mHash) != "")
|
||||
{
|
||||
// recupero info...
|
||||
bool.TryParse(memLayer.ML.getRSV(mHash), out answ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// se non ho attributi sulal linea è già SENZA veto...
|
||||
DS_magazzino.ConfLineaDataTable tabConf = MagClass.magazzino.taConfLin.getByLinea(Postazione.currCodLinea);
|
||||
if (tabConf.Count > 0)
|
||||
{
|
||||
// verifico PRIMO RECORD x capire se sono in modalità "passa"
|
||||
if (tabConf[0].Modo == 1)
|
||||
{
|
||||
//--> IMPOSTO VETO
|
||||
answ = true;
|
||||
// cerco il recordo del particolare x TOGLIERE VETO
|
||||
foreach (var item in tabConf)
|
||||
{
|
||||
// se trovo il record corrente
|
||||
if (item.Valore == codParticolare)
|
||||
{
|
||||
// tolgo veto ed esco!
|
||||
answ = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// modalità NON PASSA
|
||||
else
|
||||
{
|
||||
// cerco il recordo del particolare x METTERE IL VETO
|
||||
foreach (var item in tabConf)
|
||||
{
|
||||
// se trovo il record corrente
|
||||
if (item.Valore == codParticolare)
|
||||
{
|
||||
// metto veto ed esco!
|
||||
answ = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// salvo in redis x 5 minuti il controllo fatto...
|
||||
memLayer.ML.setRSV(mHash, answ.ToString(), 5 * 60);
|
||||
}
|
||||
// restituisco risultato!
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=2129']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=2131']) {
|
||||
// impiego numero di build del SINGOLO RAMO
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '4.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
// forzo numero di build x tutti rami uguali
|
||||
|
||||
Reference in New Issue
Block a user