ancora udpate a gestione postazioni
This commit is contained in:
+104
-19
@@ -36,12 +36,31 @@ namespace GMW
|
||||
fixStorico();
|
||||
// imposto pos abilitata x cancellazione
|
||||
mod_storicoAzioniOperatore1.idxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneRX");
|
||||
// se c'è imposto linea da sessione
|
||||
checkLinea();
|
||||
}
|
||||
mod_storicoAzioniOperatore1.eh_nascondi += mod_storicoAzioniOperatore1_eh_nascondi;
|
||||
mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa);
|
||||
mod_PostRX_NT1.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica linea corretta
|
||||
/// </summary>
|
||||
private void checkLinea()
|
||||
{
|
||||
// se c'è imposto linea da sessione
|
||||
if (Postazione.currCodLinea != "")
|
||||
{
|
||||
MagClass.magazzino.taAL.updatePost(Postazione.currCodLinea, Postazione.name);
|
||||
checkSelDDL(Postazione.currCodLinea, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// resetto uso postazione...
|
||||
MagClass.magazzino.taAL.resetPost(Postazione.name);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta update del controllo SAO
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
@@ -195,36 +214,100 @@ namespace GMW
|
||||
/// <param name="p"></param>
|
||||
private void checkSelDDL(string codLinea, bool doSave)
|
||||
{
|
||||
//...aggiorno ddl
|
||||
/*******************************************************
|
||||
* controllo se la linea sia libera .. OVVERO:
|
||||
* - nessuna postazione la occupa
|
||||
* - è bloccata da + di "minutiBloccoLinea" (e quindi sovrascrivo)
|
||||
*
|
||||
*******************************************************/
|
||||
bool lineaLibera = false;
|
||||
try
|
||||
{
|
||||
ddlLinea.SelectedValue = codLinea;
|
||||
pnlAll.CssClass = "stileAttesa";
|
||||
DS_magazzino.AnagLineeRow riga = MagClass.magazzino.taAL.getByKey(codLinea)[0];
|
||||
if (riga.codPostazione == "" || riga.codPostazione == Postazione.name)
|
||||
{
|
||||
lineaLibera = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// controllo se è bloccata da tempo > minutiBloccoLinea --> ignoro blocco!
|
||||
if (DateTime.Now >= riga.dtAccess.AddMinutes(memLayer.ML.confReadInt("minutiBloccoLinea")))
|
||||
{
|
||||
lineaLibera = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (lineaLibera)
|
||||
{
|
||||
// mostro errore
|
||||
lblMessaggi.Text = string.Format("Errore selezione linea: codice {0} non trovato!", codLinea);
|
||||
pnlAll.CssClass = "stileComandoKo";
|
||||
//...aggiorno ddl
|
||||
try
|
||||
{
|
||||
ddlLinea.SelectedValue = codLinea;
|
||||
pnlAll.CssClass = "stileAttesa";
|
||||
}
|
||||
catch
|
||||
{
|
||||
// mostro errore
|
||||
lblMessaggi.Text = string.Format("Errore selezione linea: codice {0} non trovato!", codLinea);
|
||||
pnlAll.CssClass = "stileComandoKo";
|
||||
}
|
||||
if (doSave)
|
||||
{
|
||||
refreshBloccoPost(codLinea);
|
||||
// continuo
|
||||
Postazione.currCodLinea = codLinea;
|
||||
#if false
|
||||
testoRicerca = "";
|
||||
grView.DataBind();
|
||||
salvaCerca();
|
||||
#endif
|
||||
}
|
||||
// salvo codice cella!
|
||||
try
|
||||
{
|
||||
codCella = MagClass.magazzino.taAL.getByKey(Postazione.currCodLinea)[0].CodCella;
|
||||
idxCella = MagClass.magazzino.taCelle.getByCodCella(codCella)[0].IdxCella;
|
||||
}
|
||||
catch
|
||||
{
|
||||
codCella = "";
|
||||
idxCella = 0;
|
||||
MagClass.magazzino.taAL.resetPost(Postazione.name);
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
if (doSave)
|
||||
{
|
||||
currCodLinea = codLinea;
|
||||
}
|
||||
// salvo codice cella!
|
||||
try
|
||||
{
|
||||
codCella = MagClass.magazzino.taAL.getByKey(currCodLinea)[0].CodCella;
|
||||
idxCella = MagClass.magazzino.taCelle.getByCodCella(codCella)[0].IdxCella;
|
||||
}
|
||||
catch
|
||||
else
|
||||
{
|
||||
codCella = "";
|
||||
idxCella = 0;
|
||||
MagClass.magazzino.taAL.resetPost(Postazione.name);
|
||||
// mostro errore
|
||||
lblMessaggi.Text = string.Format("Errore: linea {0} già impegnata, sbloccare postazione o attendere timeout!", codLinea);
|
||||
pnlAll.CssClass = "stileComandoKo";
|
||||
ddlLinea.DataBind();
|
||||
ddlLinea.SelectedIndex = 0;
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua refresh (su db) del blocco postazione
|
||||
/// </summary>
|
||||
/// <param name="codLinea"></param>
|
||||
private void refreshBloccoPost(string codLinea)
|
||||
{
|
||||
// resetto usi linee precedenti..
|
||||
MagClass.magazzino.taAL.resetPost(Postazione.name);
|
||||
// se la linea non è "base" = "Sel linea", finisce x "0"
|
||||
if (codLinea.Substring(codLinea.Length - 1) != "0")
|
||||
{
|
||||
// salvo su DB che sto occupando linea...
|
||||
MagClass.magazzino.taAL.updatePost(codLinea, Postazione.name);
|
||||
}
|
||||
// ricarico elenco postazioni...
|
||||
ddlLinea.DataBind();
|
||||
}
|
||||
private void doUpdate()
|
||||
{
|
||||
mod_PostRX_NT1.doUpdate();// HARD CODED, raddoppiare?
|
||||
@@ -267,6 +350,7 @@ namespace GMW
|
||||
memLayer.ML.setSessionVal("IdxCellaLineaRX", value);
|
||||
}
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// codice della linea corrente
|
||||
/// </summary>
|
||||
@@ -285,7 +369,8 @@ namespace GMW
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("LineaIn-{0}", uid), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// calcola postazione corrente (ip, name, printer)
|
||||
|
||||
@@ -34,15 +34,8 @@ namespace GMW.WebUserControls
|
||||
{
|
||||
fixRicercaUdc();
|
||||
traduciObj();
|
||||
#if false
|
||||
storicoVisibile = false;
|
||||
fixStorico();
|
||||
#endif
|
||||
}
|
||||
doChecks();
|
||||
#if false
|
||||
mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa);
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se si debab mostrare un campo ricerca UDC attivo...
|
||||
@@ -101,10 +94,6 @@ namespace GMW.WebUserControls
|
||||
private void traduciObj()
|
||||
{
|
||||
btnCerca.Text = traduci("btnSearch");
|
||||
#if false
|
||||
// fix storico
|
||||
fixStorico();
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce il nome della pagina corrente
|
||||
@@ -337,47 +326,6 @@ namespace GMW.WebUserControls
|
||||
// resetto i dati QtaTot e particolare...
|
||||
doChecks();
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// toggle controllo storico
|
||||
/// </summary>
|
||||
private void fixStorico()
|
||||
{
|
||||
pnlSAO.Visible = storicoVisibile;
|
||||
if (storicoVisibile)
|
||||
{
|
||||
//btnShowHideStorico.Text = traduci("btnHideStorico");
|
||||
}
|
||||
else
|
||||
{
|
||||
//btnShowHideStorico.Text = traduci("btnShowStorico");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposto visibilità pannelo storico
|
||||
/// </summary>
|
||||
protected bool storicoVisibile
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj(string.Format("showHist_{0}", this.ID));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("showHist_{0}", this.ID), value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestisco evento show/hide storico
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnShowHideStorico_Click(object sender, EventArgs e)
|
||||
{
|
||||
storicoVisibile = !storicoVisibile;
|
||||
fixStorico();
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// passo alla modalità OUT
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -67,5 +67,25 @@ namespace GMW_data
|
||||
memLayer.ML.setSessionVal("warningText", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// codice della linea corrente
|
||||
/// </summary>
|
||||
public static string currCodLinea
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject(string.Format("Linea-{0}", Postazione.IP)))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj(string.Format("Linea-{0}", Postazione.IP));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("Linea-{0}", Postazione.IP), value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user