private void Page_Load(object sender, System.EventArgs e) { lblMessaggi.Text = ""; FunId = Int32.Parse(Request["FunId"]); if (Request["ItemId"] != null) { itemId = Int32.Parse(Request["ItemId"]); } if (!Page.IsPostBack) { //leggo le info del pmp e le metto nel datagrid del dettaglio //string id_pmp =""; Classi.ClassiAnagrafiche.Pmp _Pmp = new TheSite.Classi.ClassiAnagrafiche.Pmp(); DataSet _MyDsPmp = _Pmp.GetSingleData(itemId).Copy(); //id_pmp = _MyDsPmp.Tables[0].Rows[0]["pmp_id"].ToString(); this.DataGridDettaglio.DataSource = _MyDsPmp.Tables[0]; this.DataGridDettaglio.DataBind(); //leggo i passi Classi.PmpS _PmpS = new TheSite.Classi.PmpS(); //this.lblFirstAndLast.Text = _PmpS.GetFirstAndLastUser(_Dr); DataSet _MyDsPmpS = _PmpS.GetSingleData(itemId).Copy(); DataView _dv = new DataView(_MyDsPmpS.Tables[0]); _dv.Sort = "PASSO ASC"; this.DataGridEsegui.DataSource = _dv; //_MyDsPmpS.Tables[0]; this.DataGridEsegui.DataBind(); Session.Add("PmpS", _MyDsPmpS.Tables[0]); this.lblRecord.Text = _MyDsPmpS.Tables[0].Rows.Count.ToString(); this.DataGridEsegui.Columns[1].Visible = true; this.DataGridEsegui.Columns[2].Visible = false; this.DataGridEsegui.Columns[3].Visible = false; this.lblOperazione.Text = ""; this.PageTitle1.Title = "Passi per Procedura di Manutenzione Programmata "; // + id_pmp; //this.lblFirstAndLast.Visible = true; ViewState["UrlReferrer"] = Request.UrlReferrer.ToString(); if (Context.Handler is TheSite.Gestione.Pmp) { _fp = (TheSite.Gestione.Pmp)Context.Handler; this.ViewState.Add("mioContenitore", _fp._Contenitore); } } }
private void Page_Load(object sender, System.EventArgs e) { check_caselle_testo(); FunId = Int32.Parse(Request["FunId"]); if (Request["ItemId"] != null) { itemId = Int32.Parse(Request["ItemId"]); } //Disabilito le combo prima del postback System.Text.StringBuilder sbValid = new System.Text.StringBuilder(); sbValid.Append("document.getElementById('" + this.cmbspmp.ClientID + "').disabled = true;"); sbValid.Append("document.getElementById('" + this.cmbseq_std.ClientID + "').disabled = true;"); this.cmbsServ.Attributes.Add("onchange", sbValid.ToString()); sbValid = new System.Text.StringBuilder(); sbValid.Append("document.getElementById('" + this.cmbspmp.ClientID + "').disabled = true;"); sbValid.Append("document.getElementById('" + this.cmbsServ.ClientID + "').disabled = true;"); this.cmbseq_std.Attributes.Add("onchange", sbValid.ToString()); sbValid = new System.Text.StringBuilder(); sbValid.Append("document.getElementById('" + this.cmbsServ.ClientID + "').disabled = true;"); sbValid.Append("document.getElementById('" + this.cmbseq_std.ClientID + "').disabled = true;"); this.cmbspmp.Attributes.Add("onchange", sbValid.ToString()); if (!Page.IsPostBack) { BindServizio(); //BindSpecStd();//BindTr(); BindPmPFrequenza(); if (itemId != 0) { DataSet _MyDs = new DataSet(); Classi.ClassiAnagrafiche.Pmp _Pmp = new TheSite.Classi.ClassiAnagrafiche.Pmp(); _MyDs = _Pmp.GetSingleData(itemId); if (_MyDs.Tables[0].Rows.Count == 1) { DataRow _Dr = _MyDs.Tables[0].Rows[0]; this.txtsdescrizione.Text = _Dr["DES"].ToString(); if (_Dr["UH"] != DBNull.Value) { this.txtsunitshour.Text = _Dr["UH"].ToString(); } if (_Dr["servizi_id"] != DBNull.Value) { this.cmbsServ.SelectedValue = _Dr["servizi_id"].ToString(); } BindEqstd(int.Parse(this.cmbsServ.SelectedValue)); if (_Dr["eq_std"] != DBNull.Value) { this.cmbseq_std.SelectedValue = _Dr["eq_std"].ToString(); } BindSpecStd(int.Parse(this.cmbsServ.SelectedValue)); if (_Dr["freq"] != DBNull.Value) { this.cmbspmp.SelectedValue = _Dr["freq"].ToString(); } if (_Dr["tr"] != DBNull.Value) { BindSpecStd(); this.cmbstr.SelectedValue = _Dr["tr"].ToString(); } if (_Dr["pmp_id"] != DBNull.Value) { this.txtspmp_id.Text = _Dr["pmp_id"].ToString(); } if (_Dr["ac_id"] != DBNull.Value) { this.ChekDismesso.Checked = true; } this.lblOperazione.Text = "Modifica Procedura di Manutenzione: " + _Dr["pmp_id"].ToString(); this.lblFirstAndLast.Visible = true; this.btnsElimina.Attributes.Add("onclick", "return confirm('Si vuole effettuare la cancellazione?')"); lblFirstAndLast.Text = _Pmp.GetFirstAndLastUser(_Dr); } } else { this.lblOperazione.Text = "Inserimento Procedura di Manutenzione"; BindEqstd(0); BindSpecStd(); this.lblFirstAndLast.Visible = false; this.btnsElimina.Visible = false; } if (Request["TipoOper"] == "read") { AbilitaControlli(false); this.lblOperazione.Text = "Visualizzazione Procedura di Manutenzione: " + this.txtspmp_id.Text; } ViewState["UrlReferrer"] = Request.UrlReferrer.ToString(); if (Context.Handler is TheSite.Gestione.Pmp) { _fp = (TheSite.Gestione.Pmp)Context.Handler; this.ViewState.Add("mioContenitore", _fp._Contenitore); } } }