diff --git a/GIM_dataLayer/DS_applicazione.xsd b/GIM_dataLayer/DS_applicazione.xsd index a6e6f7c..b145569 100644 --- a/GIM_dataLayer/DS_applicazione.xsd +++ b/GIM_dataLayer/DS_applicazione.xsd @@ -658,10 +658,10 @@ ORDER BY numIntMtz DESC - + - dbo.sp_insRichiesta + dbo.stp_IntMtz_insRichiesta @@ -678,6 +678,7 @@ ORDER BY numIntMtz DESC + diff --git a/GIM_dataLayer/DS_applicazione.xss b/GIM_dataLayer/DS_applicazione.xss index 2d0a108..cd8bc18 100644 --- a/GIM_dataLayer/DS_applicazione.xss +++ b/GIM_dataLayer/DS_applicazione.xss @@ -6,53 +6,61 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - 1029 - 415 + 1110 + 477 1116 - 415 + 477 - 1233 - 278 + 1376 + 88 - 1233 + 1376 + 58 + + + 1392 + 58 + + + 1392 309 @@ -60,12 +68,20 @@ - 1221 - 61 + 1380 + 80 - 1221 - 88 + 1414 + 80 + + + 1414 + 96 + + + 1384 + 96 @@ -73,7 +89,7 @@ 679 - 141 + 165 679 @@ -85,39 +101,43 @@ 843 - 562 + 341 843 - 579 + 324 826 - 579 + 324 - 448 - 417 + 509 + 375 + + + 509 + 358 526 - 417 + 358 - 472 - 250 + 523 + 269 526 - 250 + 269 @@ -125,15 +145,15 @@ 631 - 598 + 674 631 - 637 + 682 793 - 637 + 682 @@ -153,7 +173,7 @@ 1017 - 562 + 614 1017 @@ -168,7 +188,7 @@ - 1362 + 1416 445 @@ -177,7 +197,7 @@ 1445 - 290 + 326 @@ -189,14 +209,14 @@ 922 - 129 + 165 - 1328 + 1380 -9 @@ -208,12 +228,16 @@ - 754 - 714 + 776 + 669 + + + 776 + 652 793 - 714 + 652 @@ -237,15 +261,15 @@ 569 - 598 + 674 569 - 644 + 682 - 473 - 644 + 548 + 682 diff --git a/GIM_dataLayer/DS_applicazione1.Designer.cs b/GIM_dataLayer/DS_applicazione1.Designer.cs index 0ab9ac5..0046010 100644 --- a/GIM_dataLayer/DS_applicazione1.Designer.cs +++ b/GIM_dataLayer/DS_applicazione1.Designer.cs @@ -18619,7 +18619,7 @@ namespace GIM_dataLayer.DS_applicazioneTableAdapters { this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@search", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[7].Connection = this.Connection; - this._commandCollection[7].CommandText = "dbo.sp_insRichiesta"; + this._commandCollection[7].CommandText = "dbo.stp_IntMtz_insRichiesta"; this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[7].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[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@richiesta", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); @@ -18636,6 +18636,7 @@ namespace GIM_dataLayer.DS_applicazioneTableAdapters { this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@descrizione", global::System.Data.SqlDbType.VarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxCausale", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@scheduled", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxIntPro", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numIntMtz", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.InputOutput, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[8].Connection = this.Connection; @@ -18855,7 +18856,23 @@ namespace GIM_dataLayer.DS_applicazioneTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual object sp_insRichiesta(global::System.Nullable richiesta, global::System.Nullable dataLav, global::System.Nullable turnoLav, string matr, global::System.Nullable guasto, global::System.Nullable idxAmbito, global::System.Nullable idxPriorita, global::System.Nullable isFermo, global::System.Nullable idxTipo, global::System.Nullable idxImpianto, global::System.Nullable idxMacchina, string descrizione, global::System.Nullable idxCausale, global::System.Nullable scheduled, ref global::System.Nullable numIntMtz) { + public virtual object insRichiesta( + global::System.Nullable richiesta, + global::System.Nullable dataLav, + global::System.Nullable turnoLav, + string matr, + global::System.Nullable guasto, + global::System.Nullable idxAmbito, + global::System.Nullable idxPriorita, + global::System.Nullable isFermo, + global::System.Nullable idxTipo, + global::System.Nullable idxImpianto, + global::System.Nullable idxMacchina, + string descrizione, + global::System.Nullable idxCausale, + global::System.Nullable scheduled, + global::System.Nullable idxIntPro, + ref global::System.Nullable numIntMtz) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((richiesta.HasValue == true)) { command.Parameters[1].Value = ((System.DateTime)(richiesta.Value)); @@ -18941,12 +18958,18 @@ namespace GIM_dataLayer.DS_applicazioneTableAdapters { else { command.Parameters[14].Value = global::System.DBNull.Value; } - if ((numIntMtz.HasValue == true)) { - command.Parameters[15].Value = ((int)(numIntMtz.Value)); + if ((idxIntPro.HasValue == true)) { + command.Parameters[15].Value = ((int)(idxIntPro.Value)); } else { command.Parameters[15].Value = global::System.DBNull.Value; } + if ((numIntMtz.HasValue == true)) { + command.Parameters[16].Value = ((int)(numIntMtz.Value)); + } + else { + command.Parameters[16].Value = global::System.DBNull.Value; + } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { @@ -18961,12 +18984,12 @@ namespace GIM_dataLayer.DS_applicazioneTableAdapters { command.Connection.Close(); } } - if (((command.Parameters[15].Value == null) - || (command.Parameters[15].Value.GetType() == typeof(global::System.DBNull)))) { + if (((command.Parameters[16].Value == null) + || (command.Parameters[16].Value.GetType() == typeof(global::System.DBNull)))) { numIntMtz = new global::System.Nullable(); } else { - numIntMtz = new global::System.Nullable(((int)(command.Parameters[15].Value))); + numIntMtz = new global::System.Nullable(((int)(command.Parameters[16].Value))); } if (((returnValue == null) || (returnValue.GetType() == typeof(global::System.DBNull)))) { diff --git a/GIM_dataLayer/mtzProgr.cs b/GIM_dataLayer/mtzProgr.cs index b8b74ca..f8b58e5 100644 --- a/GIM_dataLayer/mtzProgr.cs +++ b/GIM_dataLayer/mtzProgr.cs @@ -130,7 +130,7 @@ public class mtzProgr int stimaIniz = 0; double ggEquiv = 0; TimeSpan distDate; - DateTime adesso = DateTime.Now; + DateTime adesso = DateTime.Today; DateTime dataProp; foreach (GIM_dataLayer.DS_applicazione.MtzProgrammataRow rigaMtz in taMtzProg.getNotScheduled()) { @@ -226,7 +226,7 @@ public class mtzProgr logger.lg.scriviLog(string.Format("Errore nel recuperare impianto relativo alla macchina {0}, eccezione {1}", riga.idxMacchina, e), tipoLog.EXCEPTION); } // inserisco - TA_app.obj.taInterventiMtz.sp_insRichiesta(adesso, adesso.AddHours(-shift + 1), turno, "PROG", riga.data, idxAmbito, riga.idxPriorita, riga.isFermo, riga.idxTipo, idxImpianto, riga.idxMacchina, riga.descrizione, riga.idxCausale, true, ref answ); + TA_app.obj.taInterventiMtz.insRichiesta(adesso, adesso.AddHours(-shift + 1), turno, "PROG", riga.data, idxAmbito, riga.idxPriorita, riga.isFermo, riga.idxTipo, idxImpianto, riga.idxMacchina, riga.descrizione, riga.idxCausale, true, riga.idxIntPro, ref answ); return (int)answ; } } diff --git a/GIM_site/Appunti.txt b/GIM_site/Appunti.txt index f91108b..b0e2e84 100644 --- a/GIM_site/Appunti.txt +++ b/GIM_site/Appunti.txt @@ -2,7 +2,8 @@ -------------------------------- --- NUOVE -------------------------------- -- verifica a chiusura degli interventi di manutenzione preventiva/programmata SE la data di chiusura sia molto diversa da quella programmata (tipicamente +/- 1 unità di pianificazione: se è a settimane 1 settimana, se mesi 1 mese...) --> in questo caso CHIEDE SE SI VOGLIANO SPOSTARE prossime scadenze (se ho anticipato 1 mese --> ripianifica a pari scadenza anticipando allo stesso modo, se ho posticipato 2 mesi idem, ripianifica spostando 2 mesi) +- verifica a chiusura degli interventi di manutenzione preventiva/programmata SE la data di chiusura sia molto diversa da quella programmata (tipicamente +/- 1 unità di pianificazione: se è a settimane 1 settimana, se mesi 1 mese...) --> in questo caso CHIEDE SE SI VOGLIANO SPOSTARE prossime scadenze (se ho anticipato 1 mese --> ripianifica a pari scadenza anticipando allo stesso modo, se ho posticipato 2 mesi idem, ripianifica spostando 2 mesi) -> per farlo verifica TRA data chiusura e data programmata + - possibilità (SOLO x le manutenzioni programmate) di chiudere con un "riprogrammata", ovvero * se ho un intervento tipicamente di "verifica e sostituzione" * ho preso in carico, e fatta verifica (e quindi viene programmato prossimo intervento secondo solita scadenza) diff --git a/GIM_site/RegConsumoRic.aspx.cs b/GIM_site/RegConsumoRic.aspx.cs index fe3d127..4fec027 100644 --- a/GIM_site/RegConsumoRic.aspx.cs +++ b/GIM_site/RegConsumoRic.aspx.cs @@ -135,13 +135,6 @@ namespace GIM_site //2017.04.21 // nuovo metodo TA_app.obj.taInterventiMtz.stp_insRichiestaRicambi(richiesta, turno, matr, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false, ref numReq); - // vecchio metodo -#if false - // stored inserimento! - TA_app.obj.taInterventiMtz.sp_insRichiesta(richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false, ref numReq); - // porto intervento a CHIUSO... - TA_app.obj.taInterventiMtz.updateStato(numReq, 3); -#endif } catch (Exception exc) { diff --git a/GIM_site/WebUserControls/mod_insertRichiesta.ascx.cs b/GIM_site/WebUserControls/mod_insertRichiesta.ascx.cs index 143ccde..276a370 100644 --- a/GIM_site/WebUserControls/mod_insertRichiesta.ascx.cs +++ b/GIM_site/WebUserControls/mod_insertRichiesta.ascx.cs @@ -4,195 +4,195 @@ using System.Web.UI; public partial class mod_insertRichiesta : System.Web.UI.UserControl { - #region eventi + #region eventi - public event EventHandler eh_newReq; - public event EventHandler eh_done; + public event EventHandler eh_newReq; + public event EventHandler eh_done; - #endregion + #endregion - protected bool _causVis = false; - /// - /// determina la visibilità del panel causali - /// - public bool causaliVisibili + protected bool _causVis = false; + /// + /// determina la visibilità del panel causali + /// + public bool causaliVisibili + { + get { - get - { - return _causVis; - } - set - { - _causVis = value; - } + return _causVis; } - /// - /// avvio controllo - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) + set { - if (!Page.IsPostBack) - { - traduciObj(); - setFixedVal(); - fixVisibPnl(); - } + _causVis = value; } - /// - /// imposta i valori calcolati e fissi... - /// - private void setFixedVal() + } + /// + /// avvio controllo + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { - // recupero valori di riferimento - int shift = memLayer.ML.confReadInt("shiftTurno"); - int durataTurno = memLayer.ML.confReadInt("durataTurno"); - int turno = Convert.ToInt32(Math.Ceiling((double)Convert.ToDouble(DateTime.Now.AddHours(-shift + 1).Hour) / durataTurno)); - int delay = memLayer.ML.confReadInt("defaultDelay"); - // inserisco valori di default - //txtDataOra.Text = string.Format("{0:dd/MM/yyyy HH:mm}", DateTime.Now); - //txtDataLav.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddHours(-shift + 1)); - txtDataOra.Text = DateTime.Now.ToString(memLayer.ML.CRS("ddMMyyyyHHmm")); - txtDataLav.Text = DateTime.Now.AddHours(-shift + 1).ToString(memLayer.ML.CRS("ddMMyyyy")); - txtTurnoLav.Text = turno.ToString(); - mod_dataOra1.valore = DateTime.Now.AddMinutes(-delay); - chkImpFermo.Checked = false; + traduciObj(); + setFixedVal(); + fixVisibPnl(); } - /// - /// sistema la visibilità dei controlli - /// - private void fixVisibPnl() + } + /// + /// imposta i valori calcolati e fissi... + /// + private void setFixedVal() + { + // recupero valori di riferimento + int shift = memLayer.ML.confReadInt("shiftTurno"); + int durataTurno = memLayer.ML.confReadInt("durataTurno"); + int turno = Convert.ToInt32(Math.Ceiling((double)Convert.ToDouble(DateTime.Now.AddHours(-shift + 1).Hour) / durataTurno)); + int delay = memLayer.ML.confReadInt("defaultDelay"); + // inserisco valori di default + //txtDataOra.Text = string.Format("{0:dd/MM/yyyy HH:mm}", DateTime.Now); + //txtDataLav.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddHours(-shift + 1)); + txtDataOra.Text = DateTime.Now.ToString(memLayer.ML.CRS("ddMMyyyyHHmm")); + txtDataLav.Text = DateTime.Now.AddHours(-shift + 1).ToString(memLayer.ML.CRS("ddMMyyyy")); + txtTurnoLav.Text = turno.ToString(); + mod_dataOra1.valore = DateTime.Now.AddMinutes(-delay); + chkImpFermo.Checked = false; + } + /// + /// sistema la visibilità dei controlli + /// + private void fixVisibPnl() + { + divCausali.Visible = _causVis; + } + /// + /// traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// sistema le labels + /// + private void traduciObj() + { + lblTitolo.Text = traduci("lblInsRichiestaMtz"); + lblDataOra.Text = traduci("lblDataOraRich"); + lblDataLav.Text = traduci("lblDataLav"); + lblTurnoLav.Text = traduci("lblTurnoLav"); + btnSend.Text = traduci("btnInviaRichiesta"); + lblImpianto.Text = traduci("lblImpianto"); + lblMacchina.Text = traduci("lblMacchina"); + lblDescrGuasto.Text = traduci("lblDescrGuasto"); + lblDettagliGuasto.Text = traduci("lblDettagliGuasto"); + lblMatr.Text = traduci("lblMatr"); + lblPrior.Text = traduci("lblPrior"); + lblFermaDalleData.Text = traduci("lblFermaDalle"); + lblAmbito.Text = traduci("lblAmbito"); + lblTipoGuasto.Text = traduci("lblTipoGuasto"); + chkImpFermo.Text = traduci("chkImpFermo"); + // setup stringhe rimando link + lnkbInsertNewReq.Text = traduci("lnkbInsertNewReq"); + lnkGoToReqList.Text = traduci("lnkGoToReqList"); + lblEsitoInserimento.Text = traduci("lblEsitoInserimento"); + // setup stringhe validazione + valSummary.HeaderText = traduci("errori"); + rfvReparto.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("reparto")); + rfvMacchina.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("macchina")); + rfvMatr.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("matricola")); + rfvCausali.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("causali")); + rfvDescrizione.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("descrizione")); + } + /// + /// aggiorna elenco macchine selezionato impianto + /// + /// + /// + protected void listImpianti_SelectedIndexChanged(object sender, EventArgs e) + { + // aggiorno altro selettore... + listMacchine.DataBind(); + } + /// + /// salva ed invia richeista + /// + /// + /// + protected void btnSend_Click(object sender, EventArgs e) + { + // salvare valori... + int? numReq = 0; + try { - divCausali.Visible = _causVis; - } - /// - /// traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// sistema le labels - /// - private void traduciObj() - { - lblTitolo.Text = traduci("lblInsRichiestaMtz"); - lblDataOra.Text = traduci("lblDataOraRich"); - lblDataLav.Text = traduci("lblDataLav"); - lblTurnoLav.Text = traduci("lblTurnoLav"); - btnSend.Text = traduci("btnInviaRichiesta"); - lblImpianto.Text = traduci("lblImpianto"); - lblMacchina.Text = traduci("lblMacchina"); - lblDescrGuasto.Text = traduci("lblDescrGuasto"); - lblDettagliGuasto.Text = traduci("lblDettagliGuasto"); - lblMatr.Text = traduci("lblMatr"); - lblPrior.Text = traduci("lblPrior"); - lblFermaDalleData.Text = traduci("lblFermaDalle"); - lblAmbito.Text = traduci("lblAmbito"); - lblTipoGuasto.Text = traduci("lblTipoGuasto"); - chkImpFermo.Text = traduci("chkImpFermo"); - // setup stringhe rimando link - lnkbInsertNewReq.Text = traduci("lnkbInsertNewReq"); - lnkGoToReqList.Text = traduci("lnkGoToReqList"); - lblEsitoInserimento.Text = traduci("lblEsitoInserimento"); - // setup stringhe validazione - valSummary.HeaderText = traduci("errori"); - rfvReparto.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("reparto")); - rfvMacchina.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("macchina")); - rfvMatr.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("matricola")); - rfvCausali.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("causali")); - rfvDescrizione.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("descrizione")); - } - /// - /// aggiorna elenco macchine selezionato impianto - /// - /// - /// - protected void listImpianti_SelectedIndexChanged(object sender, EventArgs e) - { - // aggiorno altro selettore... - listMacchine.DataBind(); - } - /// - /// salva ed invia richeista - /// - /// - /// - protected void btnSend_Click(object sender, EventArgs e) - { - // salvare valori... - int? numReq = 0; - try - { - // sistemo i valori - // 2015.02.16 fix datetime!!! - //DateTime richiesta = Convert.ToDateTime(txtDataOra.Text.Trim()); - //DateTime dataLav = Convert.ToDateTime(txtDataLav.Text.Trim()); + // sistemo i valori + // 2015.02.16 fix datetime!!! + //DateTime richiesta = Convert.ToDateTime(txtDataOra.Text.Trim()); + //DateTime dataLav = Convert.ToDateTime(txtDataLav.Text.Trim()); - DateTime richiesta = WebGimUtils.convDate(txtDataOra.Text.Trim(), memLayer.ML.CRS("ddMMyyyy"), memLayer.ML.CRS("culture"), true); - DateTime dataLav = WebGimUtils.convDate(txtDataLav.Text.Trim(), memLayer.ML.CRS("ddMMyyyy"), memLayer.ML.CRS("culture")); - - DateTime inizioGuasto = mod_dataOra1.valore; - if (memLayer.ML.confReadInt("_logLevel") > 5) - { - logger.lg.scriviLog(string.Format("richiesta: {0} -> {1}", txtDataOra.Text, richiesta)); - logger.lg.scriviLog(string.Format("dataLav: {0} -> {1}", txtDataLav.Text, dataLav)); - logger.lg.scriviLog(string.Format("inizioGuasto: {0}", mod_dataOra1.valore)); - } - int turno = Convert.ToInt32(txtTurnoLav.Text); - string matr = txtMatr.Text.Trim(); - int idxAmbito = Convert.ToInt32(ddlAmbito.SelectedValue); - int idxPrior = Convert.ToInt32(ddlPrior.SelectedValue); - bool isFermo = chkImpFermo.Checked; - int idxTipo = Convert.ToInt32(ddlTipo.SelectedValue); - int idxImpianto = Convert.ToInt32(listImpianti.SelectedValue); - int idxMacchina = Convert.ToInt32(listMacchine.SelectedValue); - string descrizione = txtDescrizione.Text.Trim(); - int idxCausale = 1; - // cerco se ci sia un altro valore selezionato... - try - { - idxCausale = Convert.ToInt32(listCausali.SelectedValue); - } - catch - { } - if (memLayer.ML.confReadInt("_logLevel") > 5) - { - logger.lg.scriviLog(string.Format("sp_insRichiesta, valori: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8} | {9} | {10} | {11} | {12} | {13}", richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false)); - } - // stored inserimento! - TA_app.obj.taInterventiMtz.sp_insRichiesta(richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false, ref numReq); - } - catch (Exception exc) - { - logger.lg.scriviLog("Errore inserimento nuova richiesta!", tipoLog.ERROR); - logger.lg.scriviLog(exc.ToString(), tipoLog.EXCEPTION); - } - //poi mostrare pnl richiesta con "ticket" generato + link x vedere elenco oppure nuova... - pnlMain_InsRichiesta.Visible = false; - pnlMain_ShowTicket.Visible = true; - lblNumRichInserted.Text = string.Format("{0} {1}", traduci("newReqInserted"), (int)numReq); - if (eh_done != null) - { - eh_done(this, new EventArgs()); - } + DateTime richiesta = WebGimUtils.convDate(txtDataOra.Text.Trim(), memLayer.ML.CRS("ddMMyyyy"), memLayer.ML.CRS("culture"), true); + DateTime dataLav = WebGimUtils.convDate(txtDataLav.Text.Trim(), memLayer.ML.CRS("ddMMyyyy"), memLayer.ML.CRS("culture")); + + DateTime inizioGuasto = mod_dataOra1.valore; + if (memLayer.ML.confReadInt("_logLevel") > 5) + { + logger.lg.scriviLog(string.Format("richiesta: {0} -> {1}", txtDataOra.Text, richiesta)); + logger.lg.scriviLog(string.Format("dataLav: {0} -> {1}", txtDataLav.Text, dataLav)); + logger.lg.scriviLog(string.Format("inizioGuasto: {0}", mod_dataOra1.valore)); + } + int turno = Convert.ToInt32(txtTurnoLav.Text); + string matr = txtMatr.Text.Trim(); + int idxAmbito = Convert.ToInt32(ddlAmbito.SelectedValue); + int idxPrior = Convert.ToInt32(ddlPrior.SelectedValue); + bool isFermo = chkImpFermo.Checked; + int idxTipo = Convert.ToInt32(ddlTipo.SelectedValue); + int idxImpianto = Convert.ToInt32(listImpianti.SelectedValue); + int idxMacchina = Convert.ToInt32(listMacchine.SelectedValue); + string descrizione = txtDescrizione.Text.Trim(); + int idxCausale = 1; + // cerco se ci sia un altro valore selezionato... + try + { + idxCausale = Convert.ToInt32(listCausali.SelectedValue); + } + catch + { } + if (memLayer.ML.confReadInt("_logLevel") > 5) + { + logger.lg.scriviLog(string.Format("stp_IntMtz_insRichiesta, valori: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8} | {9} | {10} | {11} | {12} | {13} | {14}", richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false, 0)); + } + // stored inserimento! + TA_app.obj.taInterventiMtz.insRichiesta(richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, false, 0, ref numReq); } - /// - /// inverte visibilità pannelli - /// - /// - /// - protected void lnkbtnInsertNewReq_Click(object sender, EventArgs e) + catch (Exception exc) { - pnlMain_InsRichiesta.Visible = true; - pnlMain_ShowTicket.Visible = false; - if (eh_newReq != null) - { - eh_newReq(this, new EventArgs()); - } + logger.lg.scriviLog("Errore inserimento nuova richiesta!", tipoLog.ERROR); + logger.lg.scriviLog(exc.ToString(), tipoLog.EXCEPTION); } + //poi mostrare pnl richiesta con "ticket" generato + link x vedere elenco oppure nuova... + pnlMain_InsRichiesta.Visible = false; + pnlMain_ShowTicket.Visible = true; + lblNumRichInserted.Text = string.Format("{0} {1}", traduci("newReqInserted"), (int)numReq); + if (eh_done != null) + { + eh_done(this, new EventArgs()); + } + } + /// + /// inverte visibilità pannelli + /// + /// + /// + protected void lnkbtnInsertNewReq_Click(object sender, EventArgs e) + { + pnlMain_InsRichiesta.Visible = true; + pnlMain_ShowTicket.Visible = false; + if (eh_newReq != null) + { + eh_newReq(this, new EventArgs()); + } + } }