diff --git a/.vs/WebGIM/v15/sqlite3/storage.ide b/.vs/WebGIM/v15/sqlite3/storage.ide index 6759e75..b191515 100644 Binary files a/.vs/WebGIM/v15/sqlite3/storage.ide and b/.vs/WebGIM/v15/sqlite3/storage.ide differ diff --git a/GIM_site/WebUserControls/mod_dettMtzProg.ascx b/GIM_site/WebUserControls/mod_dettMtzProg.ascx index 806d210..5d29514 100644 --- a/GIM_site/WebUserControls/mod_dettMtzProg.ascx +++ b/GIM_site/WebUserControls/mod_dettMtzProg.ascx @@ -40,11 +40,11 @@

- + - + <%----%>

diff --git a/GIM_site/WebUserControls/mod_dettMtzProg.ascx.cs b/GIM_site/WebUserControls/mod_dettMtzProg.ascx.cs index 439cde2..e7770cf 100644 --- a/GIM_site/WebUserControls/mod_dettMtzProg.ascx.cs +++ b/GIM_site/WebUserControls/mod_dettMtzProg.ascx.cs @@ -5,132 +5,133 @@ using System.Web.UI.WebControls; public partial class mod_dettMtzProg : System.Web.UI.UserControl { - public event EventHandler eh_newInserted; + public event EventHandler eh_newInserted; - protected void Page_Load(object sender, EventArgs e) + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { - if (!Page.IsPostBack) - { - traduciObj(); - setupValori(); - } + traduciObj(); + setupValori(); } + } - private void setupValori() - { - txtDataInizio.Text = DateTime.Now.ToString("dd/MM/yy"); - txtCadenza.Text = "1"; - } + private void setupValori() + { + //txtDataInizio.Text = DateTime.Now.ToString("dd/MM/yy"); + txtDataInizio.Text = DateTime.Now.ToString("yyyy-MM-dd"); + txtCadenza.Text = "1"; + } - private void traduciObj() + private void traduciObj() + { + lblTxtCerca.Text = traduci("lblTxtCerca"); + lblInsNewIntPro.Text = traduci("lblInsNewIntPro"); + lblDescrMtzPro.Text = traduci("lblDescrMtzPro"); + lblInizioMtzPro.Text = traduci("lblInizioMtzPro"); + lblPrior.Text = traduci("lblPrior"); + chkImpFermo.Text = traduci("chkImpFermo"); + lblTipoGuasto.Text = traduci("lblTipoGuasto"); + lblFreq.Text = traduci("lblFreq"); + lblCadenza.Text = traduci("lblCadenza"); + btnCreaMtzPro.Text = traduci("btnCreaMtzPro"); + lblMacchineInteressate.Text = traduci("lblMacchineInteressate"); + rfvCad.Text = traduci("cadIntReq"); + rfvDescrizione.Text = traduci("descrIntReq"); + rfvData.Text = traduci("dataReq"); + } + /// + /// wrap traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + protected void btnCreaMtzPro_Click(object sender, EventArgs e) + { + // spazzo TUTTE le righe del controllo... + foreach (ListItem riga in listMacchine.Items) { - lblTxtCerca.Text = traduci("lblTxtCerca"); - lblInsNewIntPro.Text = traduci("lblInsNewIntPro"); - lblDescrMtzPro.Text = traduci("lblDescrMtzPro"); - lblInizioMtzPro.Text = traduci("lblInizioMtzPro"); - lblPrior.Text = traduci("lblPrior"); - chkImpFermo.Text = traduci("chkImpFermo"); - lblTipoGuasto.Text = traduci("lblTipoGuasto"); - lblFreq.Text = traduci("lblFreq"); - lblCadenza.Text = traduci("lblCadenza"); - btnCreaMtzPro.Text = traduci("btnCreaMtzPro"); - lblMacchineInteressate.Text = traduci("lblMacchineInteressate"); - rfvCad.Text = traduci("cadIntReq"); - rfvDescrizione.Text = traduci("descrIntReq"); - rfvData.Text = traduci("dataReq"); + // se è selezionata creo riga anche x lei... + if (riga.Selected) + { + creaInterventoMtzPro(Convert.ToInt32(riga.Value)); + } } - /// - /// wrap traduzione - /// - /// - /// - public string traduci(object lemma) + // resetto selezioni e controlli... + txtDescrizione.Text = ""; + txtCercaMacchine.Text = "*"; + listMacchine.SelectedIndex = -1; + if (eh_newInserted != null) { - return user_std.UtSn.Traduci(lemma.ToString()); - } - protected void btnCreaMtzPro_Click(object sender, EventArgs e) - { - // spazzo TUTTE le righe del controllo... - foreach (ListItem riga in listMacchine.Items) - { - // se è selezionata creo riga anche x lei... - if (riga.Selected) - { - creaInterventoMtzPro(Convert.ToInt32(riga.Value)); - } - } - // resetto selezioni e controlli... - txtDescrizione.Text = ""; - txtCercaMacchine.Text = "*"; - listMacchine.SelectedIndex = -1; - if (eh_newInserted != null) - { - eh_newInserted(this, new EventArgs()); - } - } - /// - /// crea un intervento di mtz programmata x la macchina con idx passato - /// - /// - private void creaInterventoMtzPro(int idx) - { - TA_app.obj.taMtzPro.insertQuery(idx, Convert.ToDateTime(txtDataInizio.Text), ddlFreq.SelectedValue, Convert.ToInt32(txtCadenza.Text), txtDescrizione.Text.Trim(), Convert.ToInt32(ddlPrior.SelectedValue), chkImpFermo.Checked, Convert.ToInt32(ddlTipo.SelectedValue), Convert.ToInt32(ddlCausale.SelectedValue)); - } - /// - /// aggiorna selezione di default - /// - /// - /// - protected void ddlPrior_DataBound(object sender, EventArgs e) - { - ddlPrior.SelectedIndex = memLayer.ML.CRI("defPriorMtzPred"); - } - protected void ddlCausale_DataBound(object sender, EventArgs e) - { - ddlCausale.SelectedValue = memLayer.ML.CRS("defCauMtzPred"); + eh_newInserted(this, new EventArgs()); } + } + /// + /// crea un intervento di mtz programmata x la macchina con idx passato + /// + /// + private void creaInterventoMtzPro(int idx) + { + TA_app.obj.taMtzPro.insertQuery(idx, Convert.ToDateTime(txtDataInizio.Text), ddlFreq.SelectedValue, Convert.ToInt32(txtCadenza.Text), txtDescrizione.Text.Trim(), Convert.ToInt32(ddlPrior.SelectedValue), chkImpFermo.Checked, Convert.ToInt32(ddlTipo.SelectedValue), Convert.ToInt32(ddlCausale.SelectedValue)); + } + /// + /// aggiorna selezione di default + /// + /// + /// + protected void ddlPrior_DataBound(object sender, EventArgs e) + { + ddlPrior.SelectedIndex = memLayer.ML.CRI("defPriorMtzPred"); + } + protected void ddlCausale_DataBound(object sender, EventArgs e) + { + ddlCausale.SelectedValue = memLayer.ML.CRS("defCauMtzPred"); + } - protected override void OnInit(EventArgs e) + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + if (!Page.IsPostBack) { - base.OnInit(e); - if (!Page.IsPostBack) - { - mod_filtroImpianto.ods = odsImpianti; - } + mod_filtroImpianto.ods = odsImpianti; } + } - /// - /// chiamato post modifica valore check/selezione nel selettore filtro impianto - /// - /// - /// - public void eh_selectedImpianto(object sender, EventArgs e) - { - checkFixOds(); - } + /// + /// chiamato post modifica valore check/selezione nel selettore filtro impianto + /// + /// + /// + public void eh_selectedImpianto(object sender, EventArgs e) + { + checkFixOds(); + } - private void checkFixOds() + private void checkFixOds() + { + if (mod_filtroImpianto.valoreInt != 0) { - if (mod_filtroImpianto.valoreInt != 0) - { - // resetto la selezione... - listMacchine.SelectedIndex = -1; - // cambio filtro su ods macchine mostrate... - if (mod_filtroImpianto.valoreInt > 0) - { - odsMacchine.FilterExpression = "(label LIKE '%{0}%') AND conditio = " + mod_filtroImpianto.valore; - odsMacchine.DataBind(); - } - } - else - { - odsMacchine.FilterExpression = "(label LIKE '%{0}%')"; - odsMacchine.DataBind(); - } + // resetto la selezione... + listMacchine.SelectedIndex = -1; + // cambio filtro su ods macchine mostrate... + if (mod_filtroImpianto.valoreInt > 0) + { + odsMacchine.FilterExpression = "(label LIKE '%{0}%') AND conditio = " + mod_filtroImpianto.valore; + odsMacchine.DataBind(); + } } - protected void txtCercaMacchine_TextChanged(object sender, EventArgs e) + else { - checkFixOds(); + odsMacchine.FilterExpression = "(label LIKE '%{0}%')"; + odsMacchine.DataBind(); } + } + protected void txtCercaMacchine_TextChanged(object sender, EventArgs e) + { + checkFixOds(); + } } diff --git a/GIM_site/WebUserControls/mod_dettMtzProg.ascx.designer.cs b/GIM_site/WebUserControls/mod_dettMtzProg.ascx.designer.cs index 193494e..282617c 100644 --- a/GIM_site/WebUserControls/mod_dettMtzProg.ascx.designer.cs +++ b/GIM_site/WebUserControls/mod_dettMtzProg.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ @@ -12,299 +12,290 @@ public partial class mod_dettMtzProg { /// - /// lblInsNewIntPro control. + /// Controllo lblInsNewIntPro. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblInsNewIntPro; /// - /// mod_filtroImpianto control. + /// Controllo mod_filtroImpianto. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::mod_filtro mod_filtroImpianto; /// - /// odsImpianti control. + /// Controllo odsImpianti. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsImpianti; /// - /// lblDescrMtzPro control. + /// Controllo lblDescrMtzPro. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblDescrMtzPro; /// - /// lblMacchineInteressate control. + /// Controllo lblMacchineInteressate. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblMacchineInteressate; /// - /// lblTxtCerca control. + /// Controllo lblTxtCerca. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblTxtCerca; /// - /// txtCercaMacchine control. + /// Controllo txtCercaMacchine. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.TextBox txtCercaMacchine; /// - /// txtDescrizione control. + /// Controllo txtDescrizione. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.TextBox txtDescrizione; /// - /// rfvDescrizione control. + /// Controllo rfvDescrizione. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.RequiredFieldValidator rfvDescrizione; /// - /// lblInizioMtzPro control. + /// Controllo lblInizioMtzPro. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblInizioMtzPro; /// - /// txtDataInizio control. + /// Controllo txtDataInizio. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.TextBox txtDataInizio; /// - /// rfvData control. + /// Controllo rfvData. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.RequiredFieldValidator rfvData; /// - /// CalendarExtender1 control. + /// Controllo lblPrior. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1; - - /// - /// lblPrior control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblPrior; /// - /// ddlPrior control. + /// Controllo ddlPrior. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.DropDownList ddlPrior; /// - /// odsPrior control. + /// Controllo odsPrior. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsPrior; /// - /// chkImpFermo control. + /// Controllo chkImpFermo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.CheckBox chkImpFermo; /// - /// lblTipoGuasto control. + /// Controllo lblTipoGuasto. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblTipoGuasto; /// - /// ddlTipo control. + /// Controllo ddlTipo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.DropDownList ddlTipo; /// - /// odsTipo control. + /// Controllo odsTipo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsTipo; /// - /// lblFreq control. + /// Controllo lblFreq. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblFreq; /// - /// ddlFreq control. + /// Controllo ddlFreq. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.DropDownList ddlFreq; /// - /// odsFreq control. + /// Controllo odsFreq. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsFreq; /// - /// lblCadenza control. + /// Controllo lblCadenza. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblCadenza; /// - /// txtCadenza control. + /// Controllo txtCadenza. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.TextBox txtCadenza; /// - /// rfvCad control. + /// Controllo rfvCad. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.RequiredFieldValidator rfvCad; /// - /// lblCausale control. + /// Controllo lblCausale. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Label lblCausale; /// - /// ddlCausale control. + /// Controllo ddlCausale. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.DropDownList ddlCausale; /// - /// odsCausali control. + /// Controllo odsCausali. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsCausali; /// - /// listMacchine control. + /// Controllo listMacchine. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ListBox listMacchine; /// - /// odsMacchine control. + /// Controllo odsMacchine. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ObjectDataSource odsMacchine; /// - /// btnCreaMtzPro control. + /// Controllo btnCreaMtzPro. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.Button btnCreaMtzPro; /// - /// valSummary control. + /// Controllo valSummary. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// 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.ValidationSummary valSummary; } diff --git a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx index 516fb68..0cf1b5f 100644 --- a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx +++ b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx @@ -19,8 +19,8 @@
- - + + <%----%>
diff --git a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.cs b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.cs index 49d7a0e..23637b6 100644 --- a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.cs +++ b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.cs @@ -6,531 +6,532 @@ using System.Web.UI.WebControls; public partial class mod_elencoMtzProg : ApplicationUserControl { - #region gestione eventi + #region gestione eventi - public event EventHandler eh_newReq; - public event EventHandler eh_resetSelezione; - public event EventHandler eh_selValore; - public event EventHandler eh_updateDone; + public event EventHandler eh_newReq; + public event EventHandler eh_resetSelezione; + public event EventHandler eh_selValore; + public event EventHandler eh_updateDone; - #endregion - protected string _idxGridView; + #endregion + protected string _idxGridView; - /// - /// traduzioni - /// - protected override void traduciObj() + /// + /// traduzioni + /// + protected override void traduciObj() + { + base.traduciObj(); + btnShowNew.Text = traduci("btnShowNew"); + btnMassEdit.Text = traduci("btnMassEditShow"); + btnEditCancel.Text = traduci("btnEditCancel"); + btnEditConfirm.Text = traduci("btnEditConfirm"); + chkInizioMtzPro.Text = traduci("chkInizioMtzPro"); + chkPrior.Text = traduci("chkPrior"); + chkSetFermo.Text = traduci("chkSetFermo"); + chkImpFermo.Text = traduci("chkImpFermo"); + chkTipoGuasto.Text = traduci("chkTipoGuasto"); + chkFreq.Text = traduci("lblFreq"); + chkCadenza.Text = traduci("lblCadenza"); + chkCausale.Text = traduci("lblCausale"); + chkDescrMtzPro.Text = traduci("chkDescrMtzPro"); + lblIstrMtzPrg.Text = traduci("lblIstrMtzPrg"); + } + + /// + /// cambio visibilità pannello new data + /// + /// + /// + protected void btnShowNew_Click(object sender, EventArgs e) + { + modoInsertMtzPrg = !modoInsertMtzPrg; + doUpdate(); + // chiamo evento + if (eh_newReq != null) { - base.traduciObj(); - btnShowNew.Text = traduci("btnShowNew"); - btnMassEdit.Text = traduci("btnMassEditShow"); - btnEditCancel.Text = traduci("btnEditCancel"); - btnEditConfirm.Text = traduci("btnEditConfirm"); - chkInizioMtzPro.Text = traduci("chkInizioMtzPro"); - chkPrior.Text = traduci("chkPrior"); - chkSetFermo.Text = traduci("chkSetFermo"); - chkImpFermo.Text = traduci("chkImpFermo"); - chkTipoGuasto.Text = traduci("chkTipoGuasto"); - chkFreq.Text = traduci("lblFreq"); - chkCadenza.Text = traduci("lblCadenza"); - chkCausale.Text = traduci("lblCausale"); - chkDescrMtzPro.Text = traduci("chkDescrMtzPro"); - lblIstrMtzPrg.Text = traduci("lblIstrMtzPrg"); + eh_newReq(this, new EventArgs()); } - - /// - /// cambio visibilità pannello new data - /// - /// - /// - protected void btnShowNew_Click(object sender, EventArgs e) + } + /// + /// aggiorno il controllo + /// + public void doUpdate() + { + if (modoInsertMtzPrg) { - modoInsertMtzPrg = !modoInsertMtzPrg; - doUpdate(); - // chiamo evento - if (eh_newReq != null) + btnShowNew.Text = traduci("btnHideNew"); + } + else + { + btnShowNew.Text = traduci("btnShowNew"); + } + setBtnEdit(); + checkFixOds(); + grView.DataBind(); + } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// gestione cambio selezione valore + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session il valore selezionato... + SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue); + // sollevo evento nuovo valore... + if (eh_selValore != null) + { + eh_selValore(this, new EventArgs()); + } + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + grView.SelectedIndex = -1; + grView.DataBind(); + lblWarning.Visible = false; + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + /// + /// restituisce un testo trimamto a maxChar caratteri + /// + /// + /// + /// + public string trimmaTesto(object _testo, object _maxChar) + { + string answ = ""; + string testo = _testo.ToString(); + int maxChar = Convert.ToInt32(_maxChar); + if (testo.Length <= maxChar) + { + answ = testo; + } + else + { + answ = string.Format("{0}...", testo.Substring(0, maxChar)); + } + return answ; + } + /// + /// traduce gli header delle colonne + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try { - eh_newReq(this, new EventArgs()); + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); } - /// - /// aggiorno il controllo - /// - public void doUpdate() + else { - if (modoInsertMtzPrg) - { - btnShowNew.Text = traduci("btnHideNew"); - } - else - { - btnShowNew.Text = traduci("btnShowNew"); - } - setBtnEdit(); - checkFixOds(); - grView.DataBind(); + lblNumRec.Text = ""; } - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - /// - /// gestione cambio selezione valore - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) + } + /// + /// setta selected alla riga il cui valore key è in session + /// + /// + /// + protected void grView_RowDataBound(object sender, GridViewRowEventArgs e) + { + // se riga di dati... + if (e.Row.RowType == DataControlRowType.DataRow) { + // ottengo la riga tipizzata... + System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem; + GIM_dataLayer.DS_applicazione.v_mtzProgExpRow riga = (GIM_dataLayer.DS_applicazione.v_mtzProgExpRow)_drv.Row; + if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.idxIntPro.ToString()) + { + grView.SelectedIndex = e.Row.RowIndex; // salvo in session il valore selezionato... - SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue); + SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView)); // sollevo evento nuovo valore... if (eh_selValore != null) { - eh_selValore(this, new EventArgs()); + eh_selValore(this, new EventArgs()); } + } } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() + } + /// + /// in caso di aggiornamento verifico se sia salvato un comando clona... + /// + /// + /// + protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) + { + // carico l'idx dell'oggetto + int _idx = Convert.ToInt32(e.Keys["numIntMtz"]); + string _comando = ""; + if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand")) { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); - grView.SelectedIndex = -1; - grView.DataBind(); - lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } + _comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand"); + SteamWare.memLayer.ML.emptySessionVal("nextObjCommand"); } - /// - /// restituisce un testo trimamto a maxChar caratteri - /// - /// - /// - /// - public string trimmaTesto(object _testo, object _maxChar) + // verifico il tipo di richiesta (up/down level, clona o update normale + switch (_comando) { - string answ = ""; - string testo = _testo.ToString(); - int maxChar = Convert.ToInt32(_maxChar); - if (testo.Length <= maxChar) - { - answ = testo; - } - else - { - answ = string.Format("{0}...", testo.Substring(0, maxChar)); - } - return answ; + case "clonaObj": + // blocco update! + e.Cancel = true; + break; + default: + // faccio update! + break; } - /// - /// traduce gli header delle colonne - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) + } + /// + /// inizializzazione valori di default + /// + /// + protected override void OnInit(EventArgs e) + { + if (!Page.IsPostBack) { - if (grView.Rows.Count > 0) - { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) - { - try - { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); - } - catch - { } - } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); - } - else - { - lblNumRec.Text = ""; - } - } - /// - /// setta selected alla riga il cui valore key è in session - /// - /// - /// - protected void grView_RowDataBound(object sender, GridViewRowEventArgs e) - { - // se riga di dati... - if (e.Row.RowType == DataControlRowType.DataRow) - { - // ottengo la riga tipizzata... - System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem; - GIM_dataLayer.DS_applicazione.v_mtzProgExpRow riga = (GIM_dataLayer.DS_applicazione.v_mtzProgExpRow)_drv.Row; - if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.idxIntPro.ToString()) - { - grView.SelectedIndex = e.Row.RowIndex; - // salvo in session il valore selezionato... - SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView)); - // sollevo evento nuovo valore... - if (eh_selValore != null) - { - eh_selValore(this, new EventArgs()); - } - } - } - } - /// - /// in caso di aggiornamento verifico se sia salvato un comando clona... - /// - /// - /// - protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) - { - // carico l'idx dell'oggetto - int _idx = Convert.ToInt32(e.Keys["numIntMtz"]); - string _comando = ""; - if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand")) - { - _comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand"); - SteamWare.memLayer.ML.emptySessionVal("nextObjCommand"); - } - // verifico il tipo di richiesta (up/down level, clona o update normale - switch (_comando) - { - case "clonaObj": - // blocco update! - e.Cancel = true; - break; - default: - // faccio update! - break; - } - } - /// - /// inizializzazione valori di default - /// - /// - protected override void OnInit(EventArgs e) - { - if (!Page.IsPostBack) - { - checkDate(); - hlExportExcel.Text = traduci("hlExportExcel"); - hlExportExcel.NavigateUrl = "~/ExcelExportMtzPrev"; - modoInsertMtzPrg = false; - doUpdate(); - } - base.OnInit(e); - _idxGridView = "idxIntPro"; - txtDataInizio.Text = DateTime.Now.ToShortDateString(); - txtCadenza.Text = "1"; - // determina visibilità edit/insert nuovi interventi - btnShowNew.Visible = isWritable(); - btnMassEdit.Visible = isWritable(); + checkDate(); + hlExportExcel.Text = traduci("hlExportExcel"); + hlExportExcel.NavigateUrl = "~/ExcelExportMtzPrev"; + modoInsertMtzPrg = false; + doUpdate(); } + base.OnInit(e); + _idxGridView = "idxIntPro"; + txtDataInizio.Text = DateTime.Now.ToString("yyyy-MM-dd"); + //txtDataInizio.Text = DateTime.Now.ToShortDateString(); + txtCadenza.Text = "1"; + // determina visibilità edit/insert nuovi interventi + btnShowNew.Visible = isWritable(); + btnMassEdit.Visible = isWritable(); + } - private void checkDate() + private void checkDate() + { + // cerco periodo, se non c'è imposto a 1 mese... + intervalloDate _intervallo; + try { - // cerco periodo, se non c'è imposto a 1 mese... - intervalloDate _intervallo; + _intervallo = (intervalloDate)Session["_intervallo"]; + } + catch + { + _intervallo = new intervalloDate(); + // in base al tipo intervallo (futuro/all) decido cosa mostrare... + _intervallo.fine = DateTime.Now.Subtract(DateTime.Now.TimeOfDay).AddDays(1); + _intervallo.inizio = _intervallo.fine.AddMonths(-1); + Session["_intervallo"] = _intervallo; + Session["_inizio"] = _intervallo.inizio; + Session["_fine"] = _intervallo.fine; + } + } + + /// + /// modalità insert mtz prog + /// + public bool modoInsertMtzPrg + { + get + { + return memLayer.ML.BoolSessionObj("modoInserMtzPrg"); + } + set + { + memLayer.ML.setSessionVal("modoInserMtzPrg", value); + } + } + void mod_filtroMacchina_eh_selValore(object sender, EventArgs e) + { + // chiamo procedura ricostruzione ods con filtri... + checkFixOds(); + } + void mod_filtroTipo_eh_selValore(object sender, EventArgs e) + { + // chiamo procedura ricostruzione ods con filtri... + checkFixOds(); + } + /// + /// sistemo filtraggio con valori selezionati + /// + private void checkFixOds() + { + ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )"; + if (memLayer.ML.isInSessionObject("idxTipo_filt")) + { + ods.FilterExpression += " AND (idxTipo = {1})"; + } + if (memLayer.ML.isInSessionObject("idxImpianto_filt")) + { + ods.FilterExpression += " AND (idxImpianto = {2})"; + } + if (memLayer.ML.isInSessionObject("idxMacchina_filt")) + { + ods.FilterExpression += " AND (idxMacchina = {3})"; + } + ods.DataBind(); + } + /// + /// controllo visibilità pannello edit in massa + /// + /// + /// + protected void btnMassEdit_Click(object sender, EventArgs e) + { + pnlMassEdit.Visible = !pnlMassEdit.Visible; + if (pnlMassEdit.Visible) + { + btnMassEdit.Text = traduci("btnMassEditHide"); + } + else + { + btnMassEdit.Text = traduci("btnMassEditShow"); + } + checkFixOds(); + } + /// + /// seleziona/deseleziona le righe indicate... + /// + /// + /// + protected void btnSelAll_Click(object sender, EventArgs e) + { + // seleziono tutti i valori visibili nel datagrid + CheckBox chkbox = ((CheckBox)sender); + bool isChecked = chkbox.Checked; + if (!isChecked) + { + chkbox.ToolTip = traduci("btnSelAll"); + } + else + { + chkbox.ToolTip = traduci("btnDeselAll"); + } + foreach (GridViewRow riga in grView.Rows) + { + ((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked; + } + } + /// + /// aggiorna selezione di default + /// + /// + /// + protected void ddlPrior_DataBound(object sender, EventArgs e) + { + ddlPrior.SelectedIndex = memLayer.ML.CRI("defPriorMtzPred"); + } + /// + /// aggiorna selezione di default + /// + /// + /// + protected void ddlCausale_DataBound(object sender, EventArgs e) + { + ddlCausale.SelectedValue = memLayer.ML.CRS("defCauMtzPred"); + } + + #region gestione checkBox edit campi + + protected void chkInizioMtzPro_CheckedChanged(object sender, EventArgs e) + { + pnlInizio.Visible = chkInizioMtzPro.Checked; + setBtnEdit(); + } + protected void chkPrior_CheckedChanged(object sender, EventArgs e) + { + pnlPrior.Visible = chkPrior.Checked; + setBtnEdit(); + } + protected void chkSetFermo_CheckedChanged(object sender, EventArgs e) + { + pnlSetFermo.Visible = chkSetFermo.Checked; + setBtnEdit(); + } + protected void chkTipoGuasto_CheckedChanged(object sender, EventArgs e) + { + pnlTipoGuasto.Visible = chkTipoGuasto.Checked; + setBtnEdit(); + } + protected void chkFreq_CheckedChanged(object sender, EventArgs e) + { + pnlFreq.Visible = chkFreq.Checked; + setBtnEdit(); + } + protected void chkCadenza_CheckedChanged(object sender, EventArgs e) + { + pnlCadenza.Visible = chkCadenza.Checked; + setBtnEdit(); + } + protected void chkCausale_CheckedChanged(object sender, EventArgs e) + { + pnlCausale.Visible = chkCausale.Checked; + setBtnEdit(); + } + protected void chkDescrMtzPro_CheckedChanged(object sender, EventArgs e) + { + pnlDescrMtzPro.Visible = chkDescrMtzPro.Checked; + setBtnEdit(); + } + /// + /// sistema btn edit (attivi se almeno 1 valore checked) + /// + protected void setBtnEdit() + { + bool saveEnabled = false; + if (chkCadenza.Checked || chkDescrMtzPro.Checked || chkFreq.Checked || chkTipoGuasto.Checked || chkInizioMtzPro.Checked || chkPrior.Checked || chkSetFermo.Checked) + { + saveEnabled = true; + } + btnEditConfirm.Enabled = saveEnabled; + btnEditCancel.Enabled = saveEnabled; + } + + #endregion + + /// + /// applica edit a tutte le righe selezionate + /// + /// + /// + protected void btnEditConfirm_Click(object sender, EventArgs e) + { + // controllo quali righe siano checked + DS_applicazione.MtzProgrammataRow rigaMtzPro; + int idxIntPro; + foreach (GridViewRow riga in grView.Rows) + { + if (((CheckBox)riga.FindControl("chkSelect")).Checked) + { try { - _intervallo = (intervalloDate)Session["_intervallo"]; + // leggo il record della riga + idxIntPro = Convert.ToInt32(((Label)riga.FindControl("lblidxIntPro")).Text); + rigaMtzPro = (DS_applicazione.MtzProgrammataRow)mtzProgr.obj.taMtzProg.getByKey(idxIntPro)[0]; + // controllo 1:1 i valori che si vogliono sovrascrivere + if (chkInizioMtzPro.Checked) + { + rigaMtzPro.inizio = Convert.ToDateTime(txtDataInizio.Text); + } + if (chkPrior.Checked) + { + rigaMtzPro.idxPriorita = Convert.ToInt32(ddlPrior.SelectedValue); + } + if (chkSetFermo.Checked) + { + rigaMtzPro.isFermo = chkSetFermo.Checked; + } + if (chkTipoGuasto.Checked) + { + rigaMtzPro.idxTipo = Convert.ToInt32(ddlTipo.Text); + } + if (chkFreq.Checked) + { + rigaMtzPro.codFrequenza = ddlFreq.SelectedValue; + } + if (chkCadenza.Checked) + { + rigaMtzPro.cadenza = Convert.ToInt32(txtCadenza.Text); + } + if (chkDescrMtzPro.Checked) + { + rigaMtzPro.descrizione = txtDescrizione.Text; + } + if (chkCausale.Checked) + { + rigaMtzPro.idxCausale = Convert.ToInt32(ddlCausale.SelectedValue); + } + // aggiorno i valori! + mtzProgr.obj.taMtzProg.updateQuery(rigaMtzPro.idxIntPro, rigaMtzPro.inizio, rigaMtzPro.codFrequenza, rigaMtzPro.cadenza, rigaMtzPro.descrizione, rigaMtzPro.idxPriorita, rigaMtzPro.isFermo, rigaMtzPro.idxTipo, rigaMtzPro.idxCausale); } catch - { - _intervallo = new intervalloDate(); - // in base al tipo intervallo (futuro/all) decido cosa mostrare... - _intervallo.fine = DateTime.Now.Subtract(DateTime.Now.TimeOfDay).AddDays(1); - _intervallo.inizio = _intervallo.fine.AddMonths(-1); - Session["_intervallo"] = _intervallo; - Session["_inizio"] = _intervallo.inizio; - Session["_fine"] = _intervallo.fine; - } + { } + } } + // a questo punto aggiorno e ricalcolo pending! + mtzProgr.obj.processaCodaMtzPro(); + ods.DataBind(); + grView.DataBind(); + UpdatePanel2.Update(); + // aggiorno + doUpdate(); + // chiamo evento + if (eh_updateDone != null) + { + eh_updateDone(this, new EventArgs()); + } + } + /// + /// annulla edit (deseleziona checkbox...) + /// + /// + /// + protected void btnEditCancel_Click(object sender, EventArgs e) + { + chkCadenza.Checked = false; + chkDescrMtzPro.Checked = false; + chkFreq.Checked = false; + chkInizioMtzPro.Checked = false; + chkPrior.Checked = false; + chkSetFermo.Checked = false; + chkTipoGuasto.Checked = false; + pnlCadenza.Visible = false; + pnlDescrMtzPro.Visible = false; + pnlFreq.Visible = false; + pnlInizio.Visible = false; + pnlPrior.Visible = false; + pnlSetFermo.Visible = false; + pnlTipoGuasto.Visible = false; + } + /// + /// update post cambio pagina + /// + /// + /// + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + doUpdate(); + } + /// + /// update post delete + /// + /// + /// + protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e) + { + doUpdate(); + } - /// - /// modalità insert mtz prog - /// - public bool modoInsertMtzPrg - { - get - { - return memLayer.ML.BoolSessionObj("modoInserMtzPrg"); - } - set - { - memLayer.ML.setSessionVal("modoInserMtzPrg", value); - } - } - void mod_filtroMacchina_eh_selValore(object sender, EventArgs e) - { - // chiamo procedura ricostruzione ods con filtri... - checkFixOds(); - } - void mod_filtroTipo_eh_selValore(object sender, EventArgs e) - { - // chiamo procedura ricostruzione ods con filtri... - checkFixOds(); - } - /// - /// sistemo filtraggio con valori selezionati - /// - private void checkFixOds() - { - ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )"; - if (memLayer.ML.isInSessionObject("idxTipo_filt")) - { - ods.FilterExpression += " AND (idxTipo = {1})"; - } - if (memLayer.ML.isInSessionObject("idxImpianto_filt")) - { - ods.FilterExpression += " AND (idxImpianto = {2})"; - } - if (memLayer.ML.isInSessionObject("idxMacchina_filt")) - { - ods.FilterExpression += " AND (idxMacchina = {3})"; - } - ods.DataBind(); - } - /// - /// controllo visibilità pannello edit in massa - /// - /// - /// - protected void btnMassEdit_Click(object sender, EventArgs e) - { - pnlMassEdit.Visible = !pnlMassEdit.Visible; - if (pnlMassEdit.Visible) - { - btnMassEdit.Text = traduci("btnMassEditHide"); - } - else - { - btnMassEdit.Text = traduci("btnMassEditShow"); - } - checkFixOds(); - } - /// - /// seleziona/deseleziona le righe indicate... - /// - /// - /// - protected void btnSelAll_Click(object sender, EventArgs e) - { - // seleziono tutti i valori visibili nel datagrid - CheckBox chkbox = ((CheckBox)sender); - bool isChecked = chkbox.Checked; - if (!isChecked) - { - chkbox.ToolTip = traduci("btnSelAll"); - } - else - { - chkbox.ToolTip = traduci("btnDeselAll"); - } - foreach (GridViewRow riga in grView.Rows) - { - ((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked; - } - } - /// - /// aggiorna selezione di default - /// - /// - /// - protected void ddlPrior_DataBound(object sender, EventArgs e) - { - ddlPrior.SelectedIndex = memLayer.ML.CRI("defPriorMtzPred"); - } - /// - /// aggiorna selezione di default - /// - /// - /// - protected void ddlCausale_DataBound(object sender, EventArgs e) - { - ddlCausale.SelectedValue = memLayer.ML.CRS("defCauMtzPred"); - } - - #region gestione checkBox edit campi - - protected void chkInizioMtzPro_CheckedChanged(object sender, EventArgs e) - { - pnlInizio.Visible = chkInizioMtzPro.Checked; - setBtnEdit(); - } - protected void chkPrior_CheckedChanged(object sender, EventArgs e) - { - pnlPrior.Visible = chkPrior.Checked; - setBtnEdit(); - } - protected void chkSetFermo_CheckedChanged(object sender, EventArgs e) - { - pnlSetFermo.Visible = chkSetFermo.Checked; - setBtnEdit(); - } - protected void chkTipoGuasto_CheckedChanged(object sender, EventArgs e) - { - pnlTipoGuasto.Visible = chkTipoGuasto.Checked; - setBtnEdit(); - } - protected void chkFreq_CheckedChanged(object sender, EventArgs e) - { - pnlFreq.Visible = chkFreq.Checked; - setBtnEdit(); - } - protected void chkCadenza_CheckedChanged(object sender, EventArgs e) - { - pnlCadenza.Visible = chkCadenza.Checked; - setBtnEdit(); - } - protected void chkCausale_CheckedChanged(object sender, EventArgs e) - { - pnlCausale.Visible = chkCausale.Checked; - setBtnEdit(); - } - protected void chkDescrMtzPro_CheckedChanged(object sender, EventArgs e) - { - pnlDescrMtzPro.Visible = chkDescrMtzPro.Checked; - setBtnEdit(); - } - /// - /// sistema btn edit (attivi se almeno 1 valore checked) - /// - protected void setBtnEdit() - { - bool saveEnabled = false; - if (chkCadenza.Checked || chkDescrMtzPro.Checked || chkFreq.Checked || chkTipoGuasto.Checked || chkInizioMtzPro.Checked || chkPrior.Checked || chkSetFermo.Checked) - { - saveEnabled = true; - } - btnEditConfirm.Enabled = saveEnabled; - btnEditCancel.Enabled = saveEnabled; - } - - #endregion - - /// - /// applica edit a tutte le righe selezionate - /// - /// - /// - protected void btnEditConfirm_Click(object sender, EventArgs e) - { - // controllo quali righe siano checked - DS_applicazione.MtzProgrammataRow rigaMtzPro; - int idxIntPro; - foreach (GridViewRow riga in grView.Rows) - { - if (((CheckBox)riga.FindControl("chkSelect")).Checked) - { - try - { - // leggo il record della riga - idxIntPro = Convert.ToInt32(((Label)riga.FindControl("lblidxIntPro")).Text); - rigaMtzPro = (DS_applicazione.MtzProgrammataRow)mtzProgr.obj.taMtzProg.getByKey(idxIntPro)[0]; - // controllo 1:1 i valori che si vogliono sovrascrivere - if (chkInizioMtzPro.Checked) - { - rigaMtzPro.inizio = Convert.ToDateTime(txtDataInizio.Text); - } - if (chkPrior.Checked) - { - rigaMtzPro.idxPriorita = Convert.ToInt32(ddlPrior.SelectedValue); - } - if (chkSetFermo.Checked) - { - rigaMtzPro.isFermo = chkSetFermo.Checked; - } - if (chkTipoGuasto.Checked) - { - rigaMtzPro.idxTipo = Convert.ToInt32(ddlTipo.Text); - } - if (chkFreq.Checked) - { - rigaMtzPro.codFrequenza = ddlFreq.SelectedValue; - } - if (chkCadenza.Checked) - { - rigaMtzPro.cadenza = Convert.ToInt32(txtCadenza.Text); - } - if (chkDescrMtzPro.Checked) - { - rigaMtzPro.descrizione = txtDescrizione.Text; - } - if (chkCausale.Checked) - { - rigaMtzPro.idxCausale = Convert.ToInt32(ddlCausale.SelectedValue); - } - // aggiorno i valori! - mtzProgr.obj.taMtzProg.updateQuery(rigaMtzPro.idxIntPro, rigaMtzPro.inizio, rigaMtzPro.codFrequenza, rigaMtzPro.cadenza, rigaMtzPro.descrizione, rigaMtzPro.idxPriorita, rigaMtzPro.isFermo, rigaMtzPro.idxTipo, rigaMtzPro.idxCausale); - } - catch - { } - } - } - // a questo punto aggiorno e ricalcolo pending! - mtzProgr.obj.processaCodaMtzPro(); - ods.DataBind(); - grView.DataBind(); - UpdatePanel2.Update(); - // aggiorno - doUpdate(); - // chiamo evento - if (eh_updateDone != null) - { - eh_updateDone(this, new EventArgs()); - } - } - /// - /// annulla edit (deseleziona checkbox...) - /// - /// - /// - protected void btnEditCancel_Click(object sender, EventArgs e) - { - chkCadenza.Checked = false; - chkDescrMtzPro.Checked = false; - chkFreq.Checked = false; - chkInizioMtzPro.Checked = false; - chkPrior.Checked = false; - chkSetFermo.Checked = false; - chkTipoGuasto.Checked = false; - pnlCadenza.Visible = false; - pnlDescrMtzPro.Visible = false; - pnlFreq.Visible = false; - pnlInizio.Visible = false; - pnlPrior.Visible = false; - pnlSetFermo.Visible = false; - pnlTipoGuasto.Visible = false; - } - /// - /// update post cambio pagina - /// - /// - /// - protected void grView_PageIndexChanged(object sender, EventArgs e) - { - doUpdate(); - } - /// - /// update post delete - /// - /// - /// - protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e) - { - doUpdate(); - } - - protected void grView_Sorted(object sender, EventArgs e) - { - doUpdate(); - } + protected void grView_Sorted(object sender, EventArgs e) + { + doUpdate(); + } } diff --git a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.designer.cs b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.designer.cs index 777efe9..5cb5526 100644 --- a/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.designer.cs +++ b/GIM_site/WebUserControls/mod_elencoMtzProg.ascx.designer.cs @@ -83,15 +83,6 @@ public partial class mod_elencoMtzProg { /// protected global::System.Web.UI.WebControls.TextBox txtDataInizio; - /// - /// Controllo CalendarExtender1. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1; - /// /// Controllo chkSetFermo. ///