private void BindTipoInterventoAter() { //Caricol il combo Del Tipo Intervento cmbsTipoIntervento.Items.Clear(); S_ControlsCollection CollezioneControlli = new S_ControlsCollection(); Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); DataSet _MyDs; _MyDs = _TipoIntervento.GetData(); if (_MyDs.Tables[0].Rows.Count > 0) { this.cmbsTipoIntervento.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource( _MyDs.Tables[0], "descrizione_breve", "ID", "- Selezionare il Tipo Intervento -", ""); this.cmbsTipoIntervento.DataTextField = "descrizione_breve"; this.cmbsTipoIntervento.DataValueField = "id"; this.cmbsTipoIntervento.DataBind(); } else { string s_Messagggio = "- Nessun Tipo Intervento -"; this.cmbsTipoIntervento.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty)); } }
private void CaricaCombo() { //Caricol il combo Del Tipo Intervento ListTipoManutenzione.Items.Clear(); S_ControlsCollection CollezioneControlli = new S_ControlsCollection(); Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); DataSet _MyDs; _MyDs = _TipoIntervento.GetData(); if (_MyDs.Tables[0].Rows.Count > 0) { this.ListTipoManutenzione.DataSource = _MyDs.Tables[0]; this.ListTipoManutenzione.DataTextField = "descrizione_breve"; this.ListTipoManutenzione.DataValueField = "id"; this.ListTipoManutenzione.DataBind(); } else { string s_Messagggio = "- Nessun Tipo Intervento -"; this.ListTipoManutenzione.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty)); } }
private void btnsElimina_Click(object sender, System.EventArgs e) { Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); this.txtsdescrizionebreve.DBDefaultValue = DBNull.Value; this.txtsdescrizionebreve.Text = this.txtsdescrizionebreve.Text.Trim(); this.txtsdescrizione.DBDefaultValue = DBNull.Value; this.txtsdescrizione.Text = this.txtsdescrizione.Text.Trim(); int i_RowsAffected = 0; S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection(); _SCollection.AddItems(this.PanelEdit.Controls); try { i_RowsAffected = _TipoIntervento.Delete(_SCollection, itemId); Server.Transfer("TipoIntervento.aspx"); } catch (Exception ex) { string s_Err = ex.Message.ToString().ToUpper(); PanelMess.ShowError(s_Err, true); } }
private void btnsSalva_Click(object sender, System.EventArgs e) { Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); this.txtsdescrizionebreve.DBDefaultValue = DBNull.Value; this.txtsdescrizionebreve.Text = this.txtsdescrizionebreve.Text.Trim().Replace("'", "`"); this.txtsdescrizione.DBDefaultValue = DBNull.Value; this.txtsdescrizione.Text = this.txtsdescrizione.Text.Trim().Replace("'", "`"); int i_RowsAffected = 0; S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection(); _SCollection.AddItems(this.PanelEdit.Controls); try { if (itemId == 0) { i_RowsAffected = _TipoIntervento.Add(_SCollection); } else { i_RowsAffected = _TipoIntervento.Update(_SCollection, itemId); } if (i_RowsAffected == -11) { Classi.SiteJavaScript.msgBox(this.Page, "Il tipo Intervento immesso é stato già inserito"); } else { Server.Transfer("TipoIntervento.aspx"); } } catch (Exception ex) { string s_Err = ex.Message.ToString().ToUpper(); PanelMess.ShowError(s_Err, true); } }
private void Ricerca() { Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); this.txtsDescrizione.DBDefaultValue = "%"; this.txtsDescrizioneBreve.DBDefaultValue = "%"; this.txtsDescrizione.Text = this.txtsDescrizione.Text.Trim(); this.txtsDescrizioneBreve.Text = this.txtsDescrizioneBreve.Text.Trim(); S_ControlsCollection _SCollection = new S_ControlsCollection(); _SCollection.AddItems(this.PanelRicerca.Controls); DataSet _MyDs = _TipoIntervento.GetData(_SCollection).Copy(); this.DataGridRicerca.DataSource = _MyDs.Tables[0]; if (_MyDs.Tables[0].Rows.Count == 0) { DataGridRicerca.CurrentPageIndex = 0; } else { int Pagina = 0; if ((_MyDs.Tables[0].Rows.Count % DataGridRicerca.PageSize) > 0) { Pagina++; } if (DataGridRicerca.PageCount != Convert.ToInt16((_MyDs.Tables[0].Rows.Count / DataGridRicerca.PageSize) + Pagina)) { DataGridRicerca.CurrentPageIndex = 0; } } this.DataGridRicerca.DataBind(); this.GridTitle1.NumeroRecords = _MyDs.Tables[0].Rows.Count.ToString(); }
private void Page_Load(object sender, System.EventArgs e) { FunId = Int32.Parse(Request["FunId"]); if (Request["itemId"] != null) { itemId = Int32.Parse(Request["itemId"]); } if (!Page.IsPostBack) { if (itemId != 0) { Classi.ClassiAnagrafiche.TipoIntervento _TipoIntervento = new TheSite.Classi.ClassiAnagrafiche.TipoIntervento(); DataSet _MyDs = _TipoIntervento.GetSingleData(itemId).Copy(); if (_MyDs.Tables[0].Rows.Count == 1) { DataRow _Dr = _MyDs.Tables[0].Rows[0]; this.txtsdescrizionebreve.Text = (string)_Dr["descrizione_breve"]; if (_Dr["Descrizione"] != DBNull.Value) { this.txtsdescrizione.Text = (string)_Dr["descrizione"]; } lblFirstAndLast.Text = _TipoIntervento.GetFirstAndLastUser(_Dr); this.lblOperazione.Text = "Modifica Tipo Intervento: " + this.txtsdescrizionebreve.Text; this.lblFirstAndLast.Visible = true; this.btnsElimina.Visible = true; this.btnsElimina.Attributes.Add("onclick", "return confirm('Si vuole effettuare la cancellazione?')"); } } else { this.lblOperazione.Text = "Inserimento Tipo Intervento"; this.lblFirstAndLast.Visible = false; this.btnsElimina.Visible = false; } ViewState["UrlReferrer"] = Request.UrlReferrer.ToString(); if (Context.Handler is TheSite.Gestione.TipoIntervento) { _fp = (TheSite.Gestione.TipoIntervento)Context.Handler; this.ViewState.Add("mioContenitore", _fp._Contenitore); } if (Request["TipoOper"] == "read") { txtsdescrizione.Enabled = false; txtsdescrizionebreve.Enabled = false; btnsElimina.Enabled = false; btnsSalva.Enabled = false; } else { txtsdescrizione.Enabled = true; txtsdescrizionebreve.Enabled = true; btnsElimina.Enabled = true; btnsSalva.Enabled = true; } } }