private void executeDatiGenerali() { //TheSite.Classi.ManProgrammata.SfogliaRdlOdl _SfogliaRdlOdl=new TheSite.Classi.ManProgrammata.SfogliaRdlOdl(Context.User.Identity.Name); TheSite.Classi.GestioneCP.SfogliaRdlOdl _SfogliaRdlOdl = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(Context.User.Identity.Name); // WO_ID DataSet _Ds = _SfogliaRdlOdl.GetSingleRdl(int.Parse(wo_id)); if (_Ds.Tables[0].Rows.Count > 0) { this.DataGrid1.DataSource = _Ds.Tables[0]; this.DataGrid1.DataBind(); DataGrid1.Visible = true; } else { DataGrid1.Visible = false; } }
private void execute() { //TheSite.Classi.ManProgrammata.SfogliaRdlOdl _SfogliaRdlOdl=new TheSite.Classi.ManProgrammata.SfogliaRdlOdl(Context.User.Identity.Name); TheSite.Classi.GestioneCP.SfogliaRdlOdl _SfogliaRdlOdl = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(Context.User.Identity.Name); // WO_ID DataSet _Ds = _SfogliaRdlOdl.GetDettailSingleRdl1(int.Parse(wo_id)); if (_Ds.Tables[0].Rows.Count > 0) { GridTitle1.Visible = true; GridTitle1.hplsNuovo.Visible = false; GridTitle1.NumeroRecords = _Ds.Tables[0].Rows.Count.ToString(); this.DataGrid2.DataSource = _Ds.Tables[0]; this.DataGrid2.DataBind(); DataGrid2.Visible = true; } else { GridTitle1.Visible = false; DataGrid2.Visible = false; } }
private void Ricerca(bool reset) { S_Controls.Collections.S_ControlsCollection CollezioneControlli = new S_Controls.Collections.S_ControlsCollection(); // Data Da string giornoDA = "01"; string meseDA = cmbsMeseDa.SelectedValue; string annoDA = cmbsAnnoDa.SelectedValue; string dataDA = giornoDA + "/" + meseDA + "/" + annoDA; S_Controls.Collections.S_Object s_P_DaData = new S_Object(); s_P_DaData.ParameterName = "P_DaData"; s_P_DaData.DbType = CustomDBType.VarChar; s_P_DaData.Direction = ParameterDirection.Input; s_P_DaData.Index = 0; s_P_DaData.Size = 10; s_P_DaData.Value = dataDA; CollezioneControlli.Add(s_P_DaData); // Data a string giornoA = DateTime.DaysInMonth(Int32.Parse(cmbsAnnoA.SelectedValue), Int32.Parse(cmbsMeseA.SelectedValue)).ToString(); string meseA = cmbsMeseA.SelectedValue; string annoA = cmbsAnnoA.SelectedValue; string dataA = giornoA + "/" + meseA + "/" + annoA; S_Controls.Collections.S_Object s_P_AData = new S_Object(); s_P_AData.ParameterName = "P_AData"; s_P_AData.DbType = CustomDBType.VarChar; s_P_AData.Direction = ParameterDirection.Input; s_P_AData.Index = 1; s_P_AData.Size = 10; s_P_AData.Value = dataA; CollezioneControlli.Add(s_P_AData); // DITTA S_Controls.Collections.S_Object s_P_ditta = new S_Object(); s_P_ditta.ParameterName = "P_ditta"; s_P_ditta.DbType = CustomDBType.Integer; s_P_ditta.Direction = ParameterDirection.Input; s_P_ditta.Index = 3; s_P_ditta.Value = (cmbsDitta.SelectedValue == "0")?0:int.Parse(cmbsDitta.SelectedValue); CollezioneControlli.Add(s_P_ditta); // Ordine di Lavoro S_Controls.Collections.S_Object s_P_odl = new S_Object(); s_P_odl.ParameterName = "P_odl"; s_P_odl.DbType = CustomDBType.Integer; s_P_odl.Direction = ParameterDirection.Input; s_P_odl.Index = 4; s_P_odl.Value = (txtOrdineLavoro.Text == "")?0:int.Parse(txtOrdineLavoro.Text); CollezioneControlli.Add(s_P_odl); // Bl codice dell'edificio S_Controls.Collections.S_Object s_P_bl_id = new S_Object(); s_P_bl_id.ParameterName = "P_bl_id"; s_P_bl_id.DbType = CustomDBType.VarChar; s_P_bl_id.Direction = ParameterDirection.Input; s_P_bl_id.Index = 5; s_P_bl_id.Size = 50; s_P_bl_id.Value = RicercaModulo1.TxtCodice.Text; CollezioneControlli.Add(s_P_bl_id); // Bl Descrizione dell'edificio S_Controls.Collections.S_Object s_P_campus = new S_Object(); s_P_campus.ParameterName = "P_campus"; s_P_campus.DbType = CustomDBType.VarChar; s_P_campus.Direction = ParameterDirection.Input; s_P_campus.Index = 6; s_P_campus.Size = 50; s_P_campus.Value = RicercaModulo1.Campus; CollezioneControlli.Add(s_P_campus); // Cognome e nome dell'addetto S_Controls.Collections.S_Object s_P_addetto_id = new S_Object(); s_P_addetto_id.ParameterName = "P_addetto_id"; s_P_addetto_id.DbType = CustomDBType.VarChar; s_P_addetto_id.Direction = ParameterDirection.Input; s_P_addetto_id.Index = 7; s_P_addetto_id.Size = 250; s_P_addetto_id.Value = Addetti1.NomeCompleto; CollezioneControlli.Add(s_P_addetto_id); // Richiesta di Lavoro S_Controls.Collections.S_Object s_P_rdl = new S_Object(); s_P_rdl.ParameterName = "P_rdl"; s_P_rdl.DbType = CustomDBType.Integer; s_P_rdl.Direction = ParameterDirection.Input; s_P_rdl.Index = 8; s_P_rdl.Value = (txtRichiestaLavoro.Text == "")?0:int.Parse(txtRichiestaLavoro.Text); CollezioneControlli.Add(s_P_rdl); // Descrizione S_Controls.Collections.S_Object s_P_descrizione = new S_Object(); s_P_descrizione.ParameterName = "P_descrizione"; s_P_descrizione.DbType = CustomDBType.VarChar; s_P_descrizione.Direction = ParameterDirection.Input; s_P_descrizione.Index = 9; s_P_descrizione.Size = 250; s_P_descrizione.Value = PMPCP1.Matricola.Text.Trim().ToUpper(); //txtDescrizione.Text; CollezioneControlli.Add(s_P_descrizione); // Stato della richiesta S_Controls.Collections.S_Object s_P_statoric = new S_Object(); s_P_statoric.ParameterName = "P_statoric"; s_P_statoric.DbType = CustomDBType.Integer; s_P_statoric.Direction = ParameterDirection.Input; s_P_statoric.Index = 10; s_P_statoric.Value = (cmbsstatolavoro.SelectedValue == "")?0:int.Parse(cmbsstatolavoro.SelectedValue); CollezioneControlli.Add(s_P_statoric); // Stato della OdL S_Controls.Collections.S_Object s_P_statoOdl = new S_Object(); s_P_statoOdl.ParameterName = "P_statoOdl"; s_P_statoOdl.DbType = CustomDBType.Integer; s_P_statoOdl.Direction = ParameterDirection.Input; s_P_statoOdl.Index = CollezioneControlli.Count + 1; s_P_statoOdl.Value = cmbsstatolavoro_odl.SelectedValue; CollezioneControlli.Add(s_P_statoOdl); S_Controls.Collections.S_Object s_p_pageindex = new S_Object(); s_p_pageindex.ParameterName = "pageindex"; s_p_pageindex.DbType = CustomDBType.Integer; s_p_pageindex.Direction = ParameterDirection.Input; s_p_pageindex.Index = CollezioneControlli.Count + 1; s_p_pageindex.Value = DataGrid1.CurrentPageIndex + 1; CollezioneControlli.Add(s_p_pageindex); S_Controls.Collections.S_Object s_p_pagesize = new S_Object(); s_p_pagesize.ParameterName = "pagesize"; s_p_pagesize.DbType = CustomDBType.Integer; s_p_pagesize.Direction = ParameterDirection.Input; s_p_pagesize.Index = CollezioneControlli.Count + 1; s_p_pagesize.Value = DataGrid1.PageSize; CollezioneControlli.Add(s_p_pagesize); //TheSite.Classi.ManProgrammata.SfogliaRdlOdl _SfogliaRdlOdl=new TheSite.Classi.ManProgrammata.SfogliaRdlOdl(Context.User.Identity.Name); TheSite.Classi.GestioneCP.SfogliaRdlOdl _SfogliaRdlOdl = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(Context.User.Identity.Name); DataSet _Ds = _SfogliaRdlOdl.GetData(CollezioneControlli); if (reset == true) { CollezioneControlli.RemoveAt(CollezioneControlli.Count - 1); CollezioneControlli.RemoveAt(CollezioneControlli.Count - 1); CollezioneControlli.RemoveAt(CollezioneControlli.Count - 1); int _totalRecords = _SfogliaRdlOdl.GetDataCount(CollezioneControlli); this.GridTitle1.NumeroRecords = _totalRecords.ToString(); } DataGrid1.DataSource = _Ds.Tables[0]; this.DataGrid1.VirtualItemCount = int.Parse(this.GridTitle1.NumeroRecords); this.DataGrid1.DataBind(); if (int.Parse(GridTitle1.NumeroRecords) > 0) { this.GridTitle1.Visible = true; DataGrid1.Visible = true; } else { this.GridTitle1.Visible = true; this.GridTitle1.DescriptionTitle = "Nessun Record trovato"; DataGrid1.Visible = false; } }
private void Page_Load(object sender, System.EventArgs e) { //this.btnSalva.Attributes.Add("onclick","controllaValori();"); PageTitle1.Title = "Completamento Controlli Periodici"; _ClManCorrettiva = new TheSite.Classi.ManCorrettiva.ClManCorrettiva(); FunId = Int32.Parse(Request["FunId"]); btImgDeleteCons.Visible = false; LkCons.Visible = false; if (Request["ItemID"] != null) { itemId = Int32.Parse(Request["ItemID"]); } if (!Page.IsPostBack) { LoadFrequenze(); if (itemId != 0) { //Classi.ClassiAnagrafiche.Ditte _Ditte = new TheSite.Classi.ClassiAnagrafiche.Ditte(); Classi.GestioneCP.SfogliaRdlOdl _GCP = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(HttpContext.Current.User.ToString()); DataSet _MyDs = _GCP.GETWRCP(itemId).Copy(); if (_MyDs.Tables[0].Rows.Count > 0) { DataRow _Dr = _MyDs.Tables[0].Rows[0]; // id_wr_cp, id_wo_cp, descrizione, // data_inizio_prevista, data_completamento_fine, // id_bl, id_eq, id_freq this.LbCPnr.Text = _Dr["id_wr_cp"].ToString(); //descrizione CP this.txtsCP.Text = _Dr["descrizione"].ToString(); //this.lblFreq.Text=_Dr["frequenza"].ToString(); this.Dropdownlist1.SelectedValue = _Dr["cl"].ToString(); //Data Inizio Lavori if (_Dr["data_inizio_prevista"] != DBNull.Value) { CalendarPicker1.Datazione.Text = _Dr["data_inizio_prevista"].ToString(); } //Data Fine Lavori if (_Dr["data_completamento_fine"] != DBNull.Value) { CalendarPicker3.Datazione.Text = _Dr["data_completamento_fine"].ToString(); } //Data Fine Lavori if (_Dr["note_completamento"] != DBNull.Value) { this.txtsNoteCompletamento.Text = (string)_Dr["note_completamento"]; } //LoadEdificio(); //if (_Dr["id_bl"]!= DBNull.Value) if (_Dr["bl_id"] != DBNull.Value) { this.RicercaModulo1.TxtCodice.Text = _Dr["bl_id"].ToString(); } if (_Dr["id_freq"] != DBNull.Value) { this.cmbs_Frequenza.SelectedValue = _Dr["id_freq"].ToString(); } if (_Dr["nomefilecp"] != DBNull.Value) { LkCons.Text = _Dr["nomefilecp"].ToString(); btImgDeleteCons.CommandArgument = _Dr["id_wr_cp"].ToString(); btImgDeleteCons.Visible = true; LkCons.Visible = true; string destDir = "../Doc_DB/cp/" + _Dr["nomefilecp"].ToString(); LkCons.NavigateUrl = destDir; } else { btImgDeleteCons.Visible = false; LkCons.Visible = false; } //LoadApparato(); //if (_Dr["id_eq"]!= DBNull.Value && !_Dr["id_eq"].Equals("0")) // LoadStatoLavoro(); // cmbsstatolavoro.SelectedValue=_Dr["id_stato_richiesta"].ToString(); // if (cmbsstatolavoro.SelectedValue=="4") // cmbsstatolavoro.Enabled=false; } } else { btnCancella.Visible = false; LbCPnr.Text = ""; txtsCP.Text = ""; txtsNoteCompletamento.Text = ""; //LoadEdificio(); LoadFrequenze(); //string s_Messagggio = "- Nessun Apparato -"; //this.cmbs_Apparato.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty)); } ViewState["UrlReferrer"] = Request.UrlReferrer.ToString(); if (Context.Handler is TheSite.GestioneControlliPeriodici.CP) { _fp = (TheSite.GestioneControlliPeriodici.CP)Context.Handler; this.ViewState.Add("mioContenitore", _fp._Contenitore); } } }
// private void LoadTipoCP() // { // this.cmbs_TipoCP.Items.Clear(); // // Classi.GestioneCP.CompletamentoCP _CompletamentoCP = new TheSite.Classi.GestioneCP.CompletamentoCP(Context.User.Identity.Name); // // DataSet _MyDs = _CompletamentoCP.GetDataTipoCP().Copy(); // // if (_MyDs.Tables[0].Rows.Count > 0) // { // this.cmbs_TipoCP.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource( // _MyDs.Tables[0], "descrizione","id", "- Selezionare un Tipo Controllo Periodico-", "0"); // this.cmbs_TipoCP.DataTextField = "descrizione"; // this.cmbs_TipoCP.DataValueField = "id"; // this.cmbs_TipoCP.DataBind(); // } // else // { // string s_Messagggio = "- Nessuna Frequenza -"; // this.cmbs_TipoCP.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty)); // } // } private void Ricerca() { Classi.GestioneCP.SfogliaRdlOdl SfogliaRdlOdl = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(HttpContext.Current.User.ToString()); // DataSet _MyDs = _GCP.GETWRCP_SF(itemId).Copy(); //Classi.ClassiAnagrafiche.DestUso _DestUso = new TheSite.Classi.ClassiAnagrafiche.DestUso(); this.txtsCodice.DBDefaultValue = "%"; this.txtsDescrizione.DBDefaultValue = "%"; this.txtsCodice.Text = this.txtsCodice.Text.Trim(); this.txtsDescrizione.Text = this.txtsDescrizione.Text.Trim(); int index = 0; S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection(); S_Object p_id_wr_cp = new S_Object(); p_id_wr_cp.ParameterName = "p_id_wr_cp"; p_id_wr_cp.DbType = CustomDBType.VarChar; p_id_wr_cp.Direction = ParameterDirection.Input; p_id_wr_cp.Index = index; p_id_wr_cp.Size = 100; p_id_wr_cp.Value = txtsCodice.Text; _SCollection.Add(p_id_wr_cp); S_Object p_descrizione = new S_Object(); p_descrizione.ParameterName = "p_descrizione"; p_descrizione.DbType = CustomDBType.VarChar; p_descrizione.Direction = ParameterDirection.Input; p_descrizione.Index = index++; p_descrizione.Size = 250; p_descrizione.Value = txtsDescrizione.Text; _SCollection.Add(p_descrizione); S_Object p_data_inizio = new S_Object(); p_data_inizio.ParameterName = "p_data_inizio"; p_data_inizio.DbType = CustomDBType.VarChar; p_data_inizio.Direction = ParameterDirection.Input; p_data_inizio.Index = index++; p_data_inizio.Size = 255; p_data_inizio.Value = CalendarPicker1.Datazione.Text; _SCollection.Add(p_data_inizio); S_Object p_data_fine = new S_Object(); p_data_fine.ParameterName = "p_data_fine"; p_data_fine.DbType = CustomDBType.VarChar; p_data_fine.Direction = ParameterDirection.Input; p_data_fine.Index = index++; p_data_fine.Size = 255; p_data_fine.Value = CalendarPicker2.Datazione.Text; _SCollection.Add(p_data_fine); S_Object p_completato = new S_Object(); p_completato.ParameterName = "p_completato"; p_completato.DbType = CustomDBType.Integer; p_completato.Direction = ParameterDirection.Input; p_completato.Size = 225; p_completato.Index = index++; p_completato.Value = ListCompl.SelectedValue; _SCollection.Add(p_completato); S_Controls.Collections.S_Object s_CurrentUser = new S_Object(); s_CurrentUser.ParameterName = "p_username"; s_CurrentUser.DbType = CustomDBType.VarChar; s_CurrentUser.Direction = ParameterDirection.Input; s_CurrentUser.Index = index++; s_CurrentUser.Value = System.Web.HttpContext.Current.User.Identity.Name; _SCollection.Add(s_CurrentUser); S_Object p_nomeFile = new S_Object(); p_nomeFile.ParameterName = "p_nomeFile"; p_nomeFile.DbType = CustomDBType.VarChar; p_nomeFile.Direction = ParameterDirection.Input; p_nomeFile.Index = index++; p_nomeFile.Size = 250; p_nomeFile.Value = nomeFile.Text; _SCollection.Add(p_nomeFile); S_Controls.Collections.S_Object s_p_ID_BL = new S_Controls.Collections.S_Object(); s_p_ID_BL.ParameterName = "p_ID_BL"; s_p_ID_BL.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_ID_BL.Direction = ParameterDirection.Input; s_p_ID_BL.Size = 50; s_p_ID_BL.Index = index++; s_p_ID_BL.Value = (this.RicercaModulo1._txthidbl.Value == "")?0:Int32.Parse(this.RicercaModulo1._txthidbl.Value); _SCollection.Add(s_p_ID_BL); // S_Controls.Collections.S_Object s_p_BL_ID = new S_Controls.Collections.S_Object(); // s_p_BL_ID.ParameterName = "p_BL_ID"; // s_p_BL_ID.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; // s_p_BL_ID.Direction = ParameterDirection.Input; // s_p_BL_ID.Size =50; // s_p_BL_ID.Index = index++; // s_p_BL_ID.Value = (RicercaModulo1.TxtCodice.Text=="")?"0":RicercaModulo1.TxtCodice.Text; // _SCollection.Add(s_p_BL_ID); S_Controls.Collections.S_Object s_Cursor = new S_Object(); s_Cursor.ParameterName = "IO_CURSOR"; s_Cursor.DbType = CustomDBType.Cursor; s_Cursor.Direction = ParameterDirection.Output; s_Cursor.Index = index++; _SCollection.Add(s_Cursor); DataSet _MyDs = SfogliaRdlOdl.GETWRCP_SF_BL(_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) { PageTitle1.Title = "Completamento Controlli Periodici"; _ClManCorrettiva = new TheSite.Classi.ManCorrettiva.ClManCorrettiva(); FunId = Int32.Parse(Request["FunId"]); cmbsstatolavoro.Enabled = true; if (Request["ItemID"] != null) { itemId = Int32.Parse(Request["ItemID"]); } if (!Page.IsPostBack) { //Classi.ClassiAnagrafiche.Ditte _Ditte = new TheSite.Classi.ClassiAnagrafiche.Ditte(); Classi.GestioneCP.SfogliaRdlOdl _GCP = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(HttpContext.Current.User.ToString()); DataSet _MyDs = _GCP.GETWRCP(itemId).Copy(); if (_MyDs.Tables[0].Rows.Count == 1) { DataRow _Dr = _MyDs.Tables[0].Rows[0]; this.lblOdl.Text = _Dr["id_wo_cp"].ToString(); this.LblRdl.Text = _Dr["id_wr_cp"].ToString(); //descrizione CP this.txtsCP.Text = _Dr["cp"].ToString(); this.lblFreq.Text = _Dr["frequenza"].ToString(); //Data Prevista Inizio Lavori if (_Dr["data_inizio_prevista"] != DBNull.Value) { CalendarPicker1.Datazione.Text = _Dr["data_inizio_prevista"].ToString(); } //Data Prevista Fine Lavori if (_Dr["data_fine_prevista"] != DBNull.Value) { CalendarPicker2.Datazione.Text = _Dr["data_fine_prevista"].ToString(); } LoadAddettiDitta(_Dr["bl_id"].ToString(), Int32.Parse(_Dr["ditta_id"].ToString()), Int32.Parse(_Dr["id_servizio"].ToString())); if (_Dr["addetto_id"] != DBNull.Value) { this.cmbsAddetto.SelectedValue = _Dr["addetto_id"].ToString(); } //Data Inizio Lavori if (_Dr["data_completamento_inizio"] != DBNull.Value) { CalendarPicker3.Datazione.Text = _Dr["data_completamento_inizio"].ToString(); } //Data Fine Lavori if (_Dr["data_completamento_fine"] != DBNull.Value) { CalendarPicker4.Datazione.Text = _Dr["data_completamento_fine"].ToString(); } if (_Dr["note_completamento"] != DBNull.Value) { this.txtsNoteCompletamento.Text = (string)_Dr["note_completamento"]; } LoadStatoLavoro(); cmbsstatolavoro.SelectedValue = _Dr["id_stato_richiesta"].ToString(); if (cmbsstatolavoro.SelectedValue == "4") { cmbsstatolavoro.Enabled = false; } } ViewState["UrlReferrer"] = Request.UrlReferrer.ToString(); if (Context.Handler is TheSite.GestioneControlliPeriodici.sfogliaCP) { _fp = (TheSite.GestioneControlliPeriodici.sfogliaCP)Context.Handler; this.ViewState.Add("mioContenitore", _fp._Contenitore); } } }