diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 9cb40ec..6ae28ed 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -5455,11 +5455,17 @@ SELECT CodFase, DescrFase, CloseTask, TimeRec FROM AnagFasi WHERE (CodFase = @Co [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT CodFase, DescrFase, CloseTask, TimeRec FROM dbo.AnagFasi"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[1].Connection = this.Connection; + this._commandCollection[1].CommandText = "dbo.stp_AF_GetByPost"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodPost", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -5486,6 +5492,23 @@ SELECT CodFase, DescrFase, CloseTask, TimeRec FROM AnagFasi WHERE (CodFase = @Co return dataTable; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.AnagFasiDataTable getByPost(string CodPost) { + this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((CodPost == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodPost)); + } + DS_App.AnagFasiDataTable dataTable = new DS_App.AnagFasiDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index a959e9c..9a98400 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -188,7 +188,19 @@ SELECT CodFase, DescrFase, CloseTask, TimeRec FROM AnagFasi WHERE (CodFase = @Co - + + + + + dbo.stp_AF_GetByPost + + + + + + + + diff --git a/C-TRACK/WebUserControls/mod_btnComandi.ascx b/C-TRACK/WebUserControls/mod_btnComandi.ascx index e1f0082..ad292b2 100644 --- a/C-TRACK/WebUserControls/mod_btnComandi.ascx +++ b/C-TRACK/WebUserControls/mod_btnComandi.ascx @@ -1,38 +1,26 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_btnComandi.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_btnComandi" %> - +
-
- - <%: comandiAmmessi["04"] %> - -
-
- - <%: comandiAmmessi["05"] %> - -
-
-
-
- - <%: comandiAmmessi["06"] %> - -
-
- - <%: comandiAmmessi["07"] %> - -
-
-
-
- - <%: comandiAmmessi["ok"] %> - -
-
- - <%: comandiAmmessi["ko"] %> - -
+ + +
+ + <%# Eval("DescrFase") %> + +
+
+ +
+ + <%# Eval("DescrFase") %> + +
+
+
+ + + + + +... diff --git a/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs b/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs index 9c833a9..d561549 100644 --- a/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs +++ b/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs @@ -1,7 +1,6 @@ -using AppData; -using SteamWare; +using SteamWare; using System; -using System.Collections.Generic; +using System.Web.UI.WebControls; namespace C_TRACK.WebUserControls { @@ -14,221 +13,9 @@ namespace C_TRACK.WebUserControls protected void Page_Load(object sender, EventArgs e) { - setupComandiBarcode(); updateBtn(); } /// - /// Restituisce email dest da codCliente + check conf da web.config con forzatura a email interna - /// - /// - /// - protected string getEmailDest(string CodCliente) - { - string answ = ""; -#if false - if (memLayer.ML.CRS("_forcedDestEmail") != "") - { - answ = memLayer.ML.CRS("_forcedDestEmail"); - } - else - { - answ = XPS_data.XPS.obj.taAnCli.getByKey(CodCliente)[0].email; - } -#endif - return answ; - } - - /// - /// Aggiorna stato buttons - /// - public void updateBtn() - { - // determino visibilità lbt4: SOLO se ho un UDC valido ed è in stato 05... - int currState = 0; - bool emailReq = false; - string emailSent = ""; - string emailDest = ""; - string CodCliente = ""; -#if false - DS_applicazione.IstObjRow rigaIstObj; - // calcolo lo stato dell'oggetto... - try - { - rigaIstObj = XPS_data.XPS.obj.taObj.getByIdxObj(comando.valore)[0]; - currState = Convert.ToInt32(rigaIstObj.CodStato); - emailReq = rigaIstObj.emailReq; - CodCliente = rigaIstObj.CodCliente; - emailDest = getEmailDest(CodCliente); - } - catch - { } - try - { - rigaIstObj = XPS_data.XPS.obj.taObj.getByIdxObj(comando.valore)[0]; - emailSent = rigaIstObj.emailSent.ToString("dd/MM/yy HH:mm"); - } - catch - { } -#endif - - switch (currState) - { - case 1: - case 2: - case 3: - lbt1.Enabled = true; - lbt2.Enabled = false; - lbt3.Enabled = false; - lbt4.Enabled = false; - break; - case 4: - lbt1.Enabled = false; - lbt2.Enabled = true; - lbt3.Enabled = false; - lbt4.Enabled = false; - break; - case 5: - lbt1.Enabled = false; - lbt2.Enabled = false; - lbt3.Enabled = true; - lbt4.Enabled = true; - break; - case 6: - case 7: - lbt1.Enabled = false; - lbt2.Enabled = false; - lbt3.Enabled = false; - lbt4.Enabled = true; - break; - default: - lbt1.Enabled = false; - lbt2.Enabled = false; - lbt3.Enabled = false; - lbt4.Enabled = false; - break; - } - - // fix CSS... inizio togliendo disabled... - lbt1.CssClass = lbt1.CssClass.Replace("disabled", "").Trim(); - lbt2.CssClass = lbt2.CssClass.Replace("disabled", "").Trim(); - lbt3.CssClass = lbt3.CssClass.Replace("disabled", "").Trim(); - lbt4.CssClass = lbt4.CssClass.Replace("disabled", "").Trim(); - lbt5.CssClass = lbt5.CssClass.Replace("disabled", "").Trim(); - lbt6.CssClass = lbt6.CssClass.Replace("disabled", "").Trim(); - - - - // rimetto dove serve disabled... - if (!lbt1.Enabled) - { - lbt1.CssClass += " disabled"; - } - - if (!lbt2.Enabled) - { - lbt2.CssClass += " disabled"; - } - - if (!lbt3.Enabled) - { - lbt3.CssClass += " disabled"; - } - - if (!lbt4.Enabled) - { - lbt4.CssClass += " disabled"; - } - - if (!lbt5.Enabled) - { - lbt5.CssClass += " disabled"; - } - - if (!lbt6.Enabled) - { - lbt6.CssClass += " disabled"; - } - - if (currState >= 5) - { - // controllo se c'è email del cliente... - if (emailDest != "") - { - lbt4.Enabled = true; - } - else - { - lbt4.Enabled = false; - } - // controllo se era indicato email richiesta! - if (emailReq) - { - lbt4.Text = string.Format("{0}{1}{2}", comandiAmmessi["07"], Environment.NewLine, user_std.UtSn.Traduci("emailReq")); - } - else - { - lbt4.Enabled = false; - } - // controllo se mai spedita email... - if (emailSent != "") - { - lbt4.Text += string.Format("{0}{1}: {2}", Environment.NewLine, user_std.UtSn.Traduci("emailSent"), emailSent); - } - } - // se autoconferma nascondo button conferma... - if (memLayer.ML.confReadBool("autoConfCmd")) - { - lbt5.Visible = false; - } - else - { - lbt5.Visible = true; - } - } - /// - /// carico da tab i comandi ammessi per il barcode... - /// - private void setupComandiBarcode() - { - // da rivedere, x ora metto BRUTALMENTE alcuni comandi... - Dictionary comandi = new Dictionary(); - - var tabCmd = dataLayer.man.taTE2S.getByMappa("E_BC"); - foreach (var rigaCmd in tabCmd) - { - comandi.Add(rigaCmd.CodEvento, devicesAuthProxy.stObj.traduci(rigaCmd.text2show)); - } -#if false - XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter taTrEv2St = new XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter(); - DS_applicazione.TraEv2StatiDataTable _tabTran = taTrEv2St.getByCodMappa("E_BC"); - Dictionary comandi = new Dictionary(); - foreach (DS_applicazione.TraEv2StatiRow riga in _tabTran) - { - comandi.Add(riga.CodEvento, user_std.UtSn.Traduci(riga.text2show)); - } - // impongo i comandi al barcode... -#endif - comandiAmmessi = comandi; - } - /// - /// dictionary comandi ammessi - /// - protected Dictionary _comandi = new Dictionary(); - /// - /// elenco dei comandi riconosciuti - /// - public Dictionary comandiAmmessi - { - get - { - return _comandi; - } - set - { - _comandi = value; - } - } - /// /// segnala click su button comando /// public void segnalaClick() @@ -240,128 +27,19 @@ namespace C_TRACK.WebUserControls } - protected void lbt1_Click(object sender, EventArgs e) + protected void lbtCmd_Click(object sender, EventArgs e) { - memLayer.ML.setSessionVal("btnCmdPress", "04", false); - segnalaClick(); - } - protected void lbt2_Click(object sender, EventArgs e) - { - memLayer.ML.setSessionVal("btnCmdPress", "05", false); - segnalaClick(); - } - protected void lbt3_Click(object sender, EventArgs e) - { - memLayer.ML.setSessionVal("btnCmdPress", "06", false); - segnalaClick(); - } - protected void lbt4_Click(object sender, EventArgs e) - { -#if false - logger.lg.scriviLog("Richiesto invio email..."); - // mi limito a mandare email e non segnalo altro... carico dati! - // determino visibilità lbt4: SOLO se ho un UDC valido ed è in stato 05... - int currState = 0; - bool emailReq = false; - string emailSent = ""; - string emailDest = ""; - string CodCliente = ""; - string ddt = ""; - string dataRif = ""; - string descr = ""; - string peso = ""; - DS_applicazione.IstObjRow rigaIstObj = null; - - // calcolo lo stato dell'oggetto... - try - { - rigaIstObj = XPS_data.XPS.obj.taObj.getByIdxObj(comando.valore)[0]; - currState = Convert.ToInt32(rigaIstObj.CodStato); - emailReq = rigaIstObj.emailReq; - CodCliente = rigaIstObj.CodCliente; - emailDest = getEmailDest(CodCliente); - logger.lg.scriviLog(string.Format("Recuperati dati per invio email: {0} | {1} | {2}", comando.valore, CodCliente, emailDest)); - } - catch (Exception exc) - { - logger.lg.scriviLog(String.Format("Eccezione in recupero dati commessa x email: {0}", exc), tipoLog.EXCEPTION); - } - try - { - rigaIstObj = XPS_data.XPS.obj.taObj.getByIdxObj(comando.valore)[0]; - emailSent = rigaIstObj.emailSent.ToString("dd/MM/yy HH:mm"); - } - catch (Exception exc) - { - logger.lg.scriviLog(String.Format("Eccezione in invio email: {0}", exc), tipoLog.EXCEPTION); - } - try - { - ddt = rigaIstObj.Nome; - dataRif = rigaIstObj.DataRif.ToString("dd/MM/yy HH:mm"); - descr = rigaIstObj.Note; - peso = rigaIstObj.Peso.ToString(); - } - catch (Exception exc) - { - ddt = "n.d."; - dataRif = "n.d."; - descr = "n.d."; - peso = "n.d."; - logger.lg.scriviLog(String.Format("Eccezione in recupero dati x email: {0}", exc), tipoLog.EXCEPTION); - } - if (currState >= 5 && emailDest != "") - { - // invio email - string subject = user_std.UtSn.Traduci("emailSubject"); // 'Notifica merce pronta' - string bodyMsg = string.Format(user_std.UtSn.Traduci("emailBody"), ddt, dataRif, descr, peso); //'Attenzione, la merce relativa al DDT {0} del {1}, ({2}, peso {3} kg) è pronta per il ritiro presso EQUA s.p.a di Pedrengo' - // se è forzato invio interno cambio subject e body... - if (memLayer.ML.CRS("_forcedDestEmail") != "") - { - DS_applicazione.v_commesseRow rigaComm = XPS_data.XPS.obj.taComm.getByCod(comando.valore)[0]; - subject += string.Format(" | cliente: {0}", rigaComm.Cliente); - bodyMsg += string.Format("

Link diretto al DDT {2} - {3}", memLayer.ML.CRS("mainSite"), rigaComm.Cod, rigaComm.DDT, rigaComm.descrizione); - } - // invio email! - bool fatto = gestEmail.geAuth.mandaEmail(memLayer.ML.confReadString("_emailUser"), emailDest, subject, bodyMsg); - if (fatto) - { - // aggiorno stato obj - XPS_data.XPS.obj.taObj.updateEmailSent(comando.valore); - } - } -#endif - updateBtn(); - } - protected void lbt5_Click(object sender, EventArgs e) - { - memLayer.ML.setSessionVal("btnCmdPress", "ok", false); - segnalaClick(); - } - protected void lbt6_Click(object sender, EventArgs e) - { - memLayer.ML.setSessionVal("btnCmdPress", "ko", false); + LinkButton lb = (LinkButton)sender; + memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false); segnalaClick(); } - /// - /// oggetto comando locale alla classe - /// - protected inputComando comando + public void updateBtn() { - get - { - inputComando answ; - if (memLayer.ML.isInSessionObject("barcodeCmd")) - { - answ = (inputComando)memLayer.ML.objSessionObj("barcodeCmd"); - } - else - { - answ = new inputComando(); - } - return answ; - } + // verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA) !!!FARE!!! + + // altrimenti imposto fasi da postazione... + repComandi.DataBind(); } } } \ No newline at end of file diff --git a/C-TRACK/WebUserControls/mod_btnComandi.ascx.designer.cs b/C-TRACK/WebUserControls/mod_btnComandi.ascx.designer.cs index 2c4e790..fec759b 100644 --- a/C-TRACK/WebUserControls/mod_btnComandi.ascx.designer.cs +++ b/C-TRACK/WebUserControls/mod_btnComandi.ascx.designer.cs @@ -13,57 +13,30 @@ namespace C_TRACK.WebUserControls { public partial class mod_btnComandi { /// - /// Controllo lbt1. + /// Controllo repComandi. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.LinkButton lbt1; + protected global::System.Web.UI.WebControls.Repeater repComandi; /// - /// Controllo lbt2. + /// Controllo odsCmd. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.LinkButton lbt2; + protected global::System.Web.UI.WebControls.ObjectDataSource odsCmd; /// - /// Controllo lbt3. + /// Controllo lblTest. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.LinkButton lbt3; - - /// - /// Controllo lbt4. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.LinkButton lbt4; - - /// - /// Controllo lbt5. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.LinkButton lbt5; - - /// - /// Controllo lbt6. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.LinkButton lbt6; + protected global::System.Web.UI.WebControls.Label lblTest; } } diff --git a/C-TRACK/barcode.aspx.cs b/C-TRACK/barcode.aspx.cs index a8dd21d..44e80e6 100644 --- a/C-TRACK/barcode.aspx.cs +++ b/C-TRACK/barcode.aspx.cs @@ -348,11 +348,20 @@ namespace C_TRACK { Dictionary comandi = new Dictionary(); + // !!!FARE!!! togleire... var tabCmd = dataLayer.man.taTE2S.getByMappa("E_BC"); foreach (var rigaCmd in tabCmd) { comandi.Add(rigaCmd.CodEvento.ToUpper(), devicesAuthProxy.stObj.traduci(rigaCmd.text2show)); } + + + var tabFasi = dataLayer.man.taAF.GetData(); + foreach (var rigaFase in tabFasi) + { + comandi.Add(rigaFase.CodFase, rigaFase.DescrFase); + } + #if false XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter taTrEv2St = new XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter(); DS_applicazione.TraEv2StatiDataTable _tabTran = taTrEv2St.getByCodMappa("E_BC"); @@ -473,6 +482,7 @@ namespace C_TRACK { CodPost = mod_barcode1.comandoRegistrato.valore; dataLayer.man.taAP.setOpr(CodPost, CodOpr); + // svuoto vallori } } }