diff --git a/XPS/App_Code/DS_applicazione.xsd b/XPS/App_Code/DS_applicazione.xsd index 614ed04..a4a4c65 100644 --- a/XPS/App_Code/DS_applicazione.xsd +++ b/XPS/App_Code/DS_applicazione.xsd @@ -850,6 +850,17 @@ WHERE (TraEv2Stati.CodEvento = @CodEvento) + + + + SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show, descrComando FROM dbo.TraEv2Stati +where CodMappa=@CodMappa + + + + + + diff --git a/XPS/App_Code/DS_applicazione.xss b/XPS/App_Code/DS_applicazione.xss index 0d2c058..34313f6 100644 --- a/XPS/App_Code/DS_applicazione.xss +++ b/XPS/App_Code/DS_applicazione.xss @@ -17,7 +17,7 @@ - + diff --git a/XPS/barcode.aspx.cs b/XPS/barcode.aspx.cs index 118a247..cab62aa 100644 --- a/XPS/barcode.aspx.cs +++ b/XPS/barcode.aspx.cs @@ -35,13 +35,12 @@ public partial class barcode : System.Web.UI.Page /// private void setupComandiBarcode() { - // !!! RIFARE CON LE TAB NUOVE... - DS_applicazioneTableAdapters.TransizioneEventiTableAdapter taTran = new DS_applicazioneTableAdapters.TransizioneEventiTableAdapter(); - DS_applicazione.TransizioneEventiDataTable _tabTran = taTran.GetData(); + DS_applicazioneTableAdapters.TraEv2StatiTableAdapter taTrEv2St = new DS_applicazioneTableAdapters.TraEv2StatiTableAdapter(); + DS_applicazione.TraEv2StatiDataTable _tabTran = taTrEv2St.getByCodMappa("E_BC"); Dictionary comandi = new Dictionary(); - foreach (DS_applicazione.TransizioneEventiRow riga in _tabTran) + foreach (DS_applicazione.TraEv2StatiRow riga in _tabTran) { - comandi.Add(riga.codInviato, user_std.UtSn.Traduci(riga.text2show)); + comandi.Add(riga.CodEvento, user_std.UtSn.Traduci(riga.text2show)); } // impongo i comandi al barcode... mod_barcode1.comandiAmmessi = comandi; @@ -95,24 +94,22 @@ public partial class barcode : System.Web.UI.Page { // in primis: sono in esecuzione, x cui il comando è valido... string msg2show = ""; - // invio richiesta al gestore della state machine e in risposta avrò un oggetto esito string currState = ""; + DS_applicazione.IstObjRow rigaIstObj; // calcolo lo stato dell'oggetto... try { - currState = XPS.obj.taObj.getByIdxObj(mod_barcode1.comandoRegistrato.valore)[0].CodStato; + rigaIstObj = XPS.obj.taObj.getByIdxObj(mod_barcode1.comandoRegistrato.valore)[0]; + currState = rigaIstObj.CodStato; } catch { } - tipoEsito esito = stateMachine.st.doAction("E_Stati", mod_barcode1.comandoRegistrato.valore - , currState, mod_barcode1.comandoRegistrato.prevCmdIn); - // reset e mostro output... - mod_barcode1.resetMe(); + tipoEsito esito = stateMachine.st.doAction("E_Stati", mod_barcode1.comandoRegistrato.valore, currState, mod_barcode1.comandoRegistrato.prevCmdIn); if (esito == tipoEsito.ok) { msg2show = string.Format("{0}: {1}", mod_barcode1.comandoRegistrato.valore, user_std.UtSn.Traduci("chgStateDone")); } - else if(esito == tipoEsito.error) + else if (esito == tipoEsito.error) { msg2show = user_std.UtSn.Traduci("cannotStateChange"); } @@ -120,44 +117,9 @@ public partial class barcode : System.Web.UI.Page { msg2show = user_std.UtSn.Traduci("unknownCmd"); } - if (msg2show != "") mod_barcode1.txtInput2show = msg2show; -#if false - // lookUp tabella transizione... - string toDo = ""; - DS_applicazioneTableAdapters.AnagraficaEventiTableAdapter taAE = new DS_applicazioneTableAdapters.AnagraficaEventiTableAdapter(); - try - { - toDo = taAE.getByCodInviato(mod_barcode1.comandoRegistrato.prevCmdIn)[0].Nome; - } - catch - { } - DS_applicazioneTableAdapters.IstObjTableAdapter taIstObj = new DS_applicazioneTableAdapters.IstObjTableAdapter(); - string msg2show = ""; - // in base al contenuto del comando scelgo cosa fare... - switch (toDo) - { - case "Barcode - cambio stato": - // verifico se lo stato sia corretto (cioè successivo a quello corrente...) - if (chkCommandValid(mod_barcode1.comandoRegistrato.valore, mod_barcode1.comandoRegistrato.prevCmdIn)) - { - string codObjCommon = mod_barcode1.comandoRegistrato.valore.Replace("D", "%"); - XPS.obj.taObj.UpdStatoTree(mod_barcode1.comandoRegistrato.prevCmdIn, user_std.UtSn.utente, DateTime.Now, codObjCommon); - msg2show = string.Format("{0}: {1}", mod_barcode1.comandoRegistrato.valore, user_std.UtSn.Traduci("chgStateDone")); - } - else // altrimenti segnalo errore... - { - msg2show = user_std.UtSn.Traduci("cannotStateChange"); - } - break; - case "Barcode - interrogazione": - // mostro il dettaglio direttamente in detComm.aspx - break; - default: - break; - } + // reset e mostro output... mod_barcode1.resetMe(); - if (msg2show != "") mod_barcode1.txtInput2show = msg2show; -#endif + if (msg2show != "") mod_barcode1.txtInput2show = msg2show; } /// /// verifica se il comando richiesto sia corretto, ovvero che si stia avanzando di 1 solo stato rispetto a quello corrente...