diff --git a/GIM_site/WebUserControls/mod_dettInt_default.ascx b/GIM_site/WebUserControls/mod_dettInt_default.ascx index 6ea9fea..c465bb1 100644 --- a/GIM_site/WebUserControls/mod_dettInt_default.ascx +++ b/GIM_site/WebUserControls/mod_dettInt_default.ascx @@ -182,8 +182,10 @@
+ +
- + <%# traduci("ReschMtzProg") %>
diff --git a/GIM_site/WebUserControls/mod_dettInt_full.ascx b/GIM_site/WebUserControls/mod_dettInt_full.ascx index e61bf08..8a360b1 100644 --- a/GIM_site/WebUserControls/mod_dettInt_full.ascx +++ b/GIM_site/WebUserControls/mod_dettInt_full.ascx @@ -12,7 +12,21 @@
- +
+
+ +
+
+
+
+ + <%# traduci("ReschMtzProg") %> + +
+
+ +
+
diff --git a/GIM_site/WebUserControls/mod_dettInt_full.ascx.cs b/GIM_site/WebUserControls/mod_dettInt_full.ascx.cs index f0e9242..7a22a6a 100644 --- a/GIM_site/WebUserControls/mod_dettInt_full.ascx.cs +++ b/GIM_site/WebUserControls/mod_dettInt_full.ascx.cs @@ -1,60 +1,129 @@ -using System; +using GIM_dataLayer; +using SteamWare; +using System; using System.Web.UI.WebControls; namespace GIM_site.WebUserControls { - public partial class mod_dettInt_full : SteamWare.UserControl + public partial class mod_dettInt_full : SteamWare.UserControl + { + public event EventHandler eh_updated; + + private void raiseEventUpd() { - public event EventHandler eh_updated; - - private void raiseEventUpd() - { - if (eh_updated != null) - { - eh_updated(this, new EventArgs()); - } - } - - protected void Page_Load(object sender, EventArgs e) - { - - } - - public void doUpdate() - { - frmView_full.DataBind(); - } - - public FormViewMode currMode - { - get - { - return frmView_full.CurrentMode; - } - set - { - frmView_full.ChangeMode(value); - } - } - - protected void odsCausali_DataBinding(object sender, EventArgs e) - { - - } - - /// - /// impostazione visibilità modulo ricambi - /// - public bool showMR { get; set; } - /// - /// modificabilità controlli da parte dell'utente - /// - public bool userCanEditData { get; set; } - - - protected void ods_full_Updated(object sender, ObjectDataSourceStatusEventArgs e) - { - raiseEventUpd(); - } + if (eh_updated != null) + { + eh_updated(this, new EventArgs()); + } } + + protected void Page_Load(object sender, EventArgs e) + { + + } + + public void doUpdate() + { + frmView_full.DataBind(); + } + + public FormViewMode currMode + { + get + { + return frmView_full.CurrentMode; + } + set + { + frmView_full.ChangeMode(value); + } + } + + protected void odsCausali_DataBinding(object sender, EventArgs e) + { + + } + + /// + /// impostazione visibilità modulo ricambi + /// + public bool showMR { get; set; } + /// + /// modificabilità controlli da parte dell'utente + /// + public bool userCanEditData { get; set; } + + + protected void ods_full_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + raiseEventUpd(); + } + /// + /// Verifica se sia possibile rischedulare intervento (deve essere ULTIMO della serie di mtz programmata...) + /// + /// + /// + public bool checkResch(object _numInt, object _scheduled) + { + bool answ = false; + try + { + bool scheduled = Convert.ToBoolean(_scheduled); + if (scheduled) + { + int numMtz = Convert.ToInt32(_numInt); + // in primis: VERIFICO se sia ultimo della serie... + answ = true; + } + } + catch + { } + return answ; + } + + public int numIntMtz + { + get + { + int answ = 0; + try + { + answ = memLayer.ML.QSI("numIntMtz"); + } + catch + { } + return answ; + } + } + + protected void frmView_default_ItemUpdating(object sender, FormViewUpdateEventArgs e) + { + // se è rischedula mi fermo... + if (e.CommandArgument.ToString() == "Reschedule") + { + try + { + // salvo record corrente con nota rischedulazione alla data + DS_applicazione.v_intervExpDataTable tab = TA_app.obj.taInterventiMtz.getByIdx(numIntMtz); + if (tab.Rows.Count > 0) + { + int idxStChiuso = 3; + DS_applicazione.v_intervExpRow riga = tab[0]; + FormView frm = (FormView)sender; + mod_dataOra dataOra = (mod_dataOra)frm.FindControl("dtDataRisc"); + DateTime newData = dataOra.valore; + string notaRisched = string.Format("{0} {1:yyyy.MM.dd}", traduci("notaRiscIntMtzPro"), newData); + TA_app.obj.taInterventiMtz.updateIntervento(numIntMtz, idxStChiuso, riga.inizioIntervento, DateTime.Now, riga.isPreventivabile, notaRisched, riga.isFermo, riga.isExt, riga.idxAmbito, riga.idxCausale); + e.Cancel = true; + // ...sposto intervento alla data schedulata... + DS_applicazione.MtzProg_ScadenzeDataTable tabMtzProg = TA_app.obj.taScadenze.GetData(riga.idxIntPro); + mtzProgr.obj.taMtzPend.updDataScad(tabMtzProg[0].idxPending, newData, true); + } + } + catch + { } + } + raiseEventUpd(); + } + } } \ No newline at end of file