public DataSet GetWordExcel(Classi.TipoManutenzioneType t) { Classi.AnagrafeImpianti.Apparecchiature _Richiesta = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(); S_ControlsCollection _SCollection = new S_ControlsCollection(); S_Controls.Collections.S_Object s_p_Wr_Id = new S_Controls.Collections.S_Object(); s_p_Wr_Id.ParameterName = "p_Wr_Id"; s_p_Wr_Id.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Wr_Id.Direction = ParameterDirection.Input; s_p_Wr_Id.Index = 2; s_p_Wr_Id.Size = 50; s_p_Wr_Id.Value = (this.txtsRichiesta.Text == "")?0:Int32.Parse(this.txtsRichiesta.Text); _SCollection.Add(s_p_Wr_Id); S_Controls.Collections.S_Object s_p_Addetto = new S_Controls.Collections.S_Object(); s_p_Addetto.ParameterName = "p_Addetto"; s_p_Addetto.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_Addetto.Direction = ParameterDirection.Input; s_p_Addetto.Index = 3; s_p_Addetto.Size = 50; s_p_Addetto.Value = this.Addetti1.NomeCompleto; _SCollection.Add(s_p_Addetto); S_Controls.Collections.S_Object s_p_DataDa = new S_Controls.Collections.S_Object(); s_p_DataDa.ParameterName = "p_DataDa"; s_p_DataDa.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_DataDa.Direction = ParameterDirection.Input; s_p_DataDa.Index = 4; s_p_DataDa.Size = 10; s_p_DataDa.Value = (CalendarPicker1.Datazione.Text == "")? "":CalendarPicker1.Datazione.Text; _SCollection.Add(s_p_DataDa); S_Controls.Collections.S_Object s_p_DataA = new S_Controls.Collections.S_Object(); s_p_DataA.ParameterName = "p_DataA"; s_p_DataA.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_DataA.Direction = ParameterDirection.Input; s_p_DataA.Index = 5; s_p_DataA.Size = 10; s_p_DataA.Value = (CalendarPicker2.Datazione.Text == "")? "":CalendarPicker2.Datazione.Text; _SCollection.Add(s_p_DataA); S_Controls.Collections.S_Object s_p_Wo_Id = new S_Controls.Collections.S_Object(); s_p_Wo_Id.ParameterName = "p_Wo_Id"; s_p_Wo_Id.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Wo_Id.Direction = ParameterDirection.Input; s_p_Wo_Id.Index = 6; s_p_Wo_Id.Size = 50; s_p_Wo_Id.Value = (this.txtsOrdine.Text == "")?0:Int32.Parse(this.txtsOrdine.Text); _SCollection.Add(s_p_Wo_Id); S_Controls.Collections.S_Object s_p_Status = new S_Controls.Collections.S_Object(); s_p_Status.ParameterName = "p_Status"; s_p_Status.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Status.Direction = ParameterDirection.Input; s_p_Status.Index = 8; s_p_Status.Value = (cmbsStatus.SelectedValue == string.Empty)? 0:Int32.Parse(cmbsStatus.SelectedValue); _SCollection.Add(s_p_Status); S_Controls.Collections.S_Object s_p_eq = new S_Controls.Collections.S_Object(); s_p_eq.ParameterName = "p_eq"; s_p_eq.DbType = CustomDBType.Integer; s_p_eq.Direction = ParameterDirection.Input; s_p_eq.Index = 9; s_p_eq.Value = this.eq_id; s_p_eq.Size = 50; _SCollection.Add(s_p_eq); S_Controls.Collections.S_Object s_TipoManutenzione = new S_Controls.Collections.S_Object(); s_TipoManutenzione.ParameterName = "p_TipoManutenzione"; s_TipoManutenzione.DbType = CustomDBType.Integer; s_TipoManutenzione.Direction = ParameterDirection.Input; s_TipoManutenzione.Index = 10; s_TipoManutenzione.Size = 4; s_TipoManutenzione.Value = t; _SCollection.Add(s_TipoManutenzione); return(_Richiesta.GetSfogliaRDLEQ(_SCollection).Copy()); }
private void Ricerca(Classi.TipoManutenzioneType t) { Classi.AnagrafeImpianti.Apparecchiature _Richiesta = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(); S_ControlsCollection _SCollection = new S_ControlsCollection(); S_Controls.Collections.S_Object s_p_Wr_Id = new S_Controls.Collections.S_Object(); s_p_Wr_Id.ParameterName = "p_Wr_Id"; s_p_Wr_Id.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Wr_Id.Direction = ParameterDirection.Input; s_p_Wr_Id.Index = 2; s_p_Wr_Id.Size = 50; s_p_Wr_Id.Value = (this.txtsRichiesta.Text == "")?0:Int32.Parse(this.txtsRichiesta.Text); _SCollection.Add(s_p_Wr_Id); S_Controls.Collections.S_Object s_p_Addetto = new S_Controls.Collections.S_Object(); s_p_Addetto.ParameterName = "p_Addetto"; s_p_Addetto.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_Addetto.Direction = ParameterDirection.Input; s_p_Addetto.Index = 3; s_p_Addetto.Size = 50; s_p_Addetto.Value = this.Addetti1.NomeCompleto; _SCollection.Add(s_p_Addetto); S_Controls.Collections.S_Object s_p_DataDa = new S_Controls.Collections.S_Object(); s_p_DataDa.ParameterName = "p_DataDa"; s_p_DataDa.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_DataDa.Direction = ParameterDirection.Input; s_p_DataDa.Index = 4; s_p_DataDa.Size = 10; s_p_DataDa.Value = (CalendarPicker1.Datazione.Text == "")? "":CalendarPicker1.Datazione.Text; _SCollection.Add(s_p_DataDa); S_Controls.Collections.S_Object s_p_DataA = new S_Controls.Collections.S_Object(); s_p_DataA.ParameterName = "p_DataA"; s_p_DataA.DbType = ApplicationDataLayer.DBType.CustomDBType.VarChar; s_p_DataA.Direction = ParameterDirection.Input; s_p_DataA.Index = 5; s_p_DataA.Size = 10; s_p_DataA.Value = (CalendarPicker2.Datazione.Text == "")? "":CalendarPicker2.Datazione.Text; _SCollection.Add(s_p_DataA); S_Controls.Collections.S_Object s_p_Wo_Id = new S_Controls.Collections.S_Object(); s_p_Wo_Id.ParameterName = "p_Wo_Id"; s_p_Wo_Id.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Wo_Id.Direction = ParameterDirection.Input; s_p_Wo_Id.Index = 6; s_p_Wo_Id.Size = 50; s_p_Wo_Id.Value = (this.txtsOrdine.Text == "")?0:Int32.Parse(this.txtsOrdine.Text); _SCollection.Add(s_p_Wo_Id); S_Controls.Collections.S_Object s_p_Status = new S_Controls.Collections.S_Object(); s_p_Status.ParameterName = "p_Status"; s_p_Status.DbType = ApplicationDataLayer.DBType.CustomDBType.Integer; s_p_Status.Direction = ParameterDirection.Input; s_p_Status.Index = 8; s_p_Status.Value = (cmbsStatus.SelectedValue == string.Empty)? 0:Int32.Parse(cmbsStatus.SelectedValue); _SCollection.Add(s_p_Status); S_Controls.Collections.S_Object s_p_eq = new S_Controls.Collections.S_Object(); s_p_eq.ParameterName = "p_eq"; s_p_eq.DbType = CustomDBType.Integer; s_p_eq.Direction = ParameterDirection.Input; s_p_eq.Index = 9; s_p_eq.Value = this.eq_id; s_p_eq.Size = 50; _SCollection.Add(s_p_eq); S_Controls.Collections.S_Object s_TipoManutenzione = new S_Controls.Collections.S_Object(); s_TipoManutenzione.ParameterName = "p_TipoManutenzione"; s_TipoManutenzione.DbType = CustomDBType.Integer; s_TipoManutenzione.Direction = ParameterDirection.Input; s_TipoManutenzione.Index = 10; s_TipoManutenzione.Size = 4; s_TipoManutenzione.Value = t; _SCollection.Add(s_TipoManutenzione); DataSet _MyDs = _Richiesta.GetSfogliaRDLEQ(_SCollection, DataGridRicerca.PageSize, DataGridRicerca.CurrentPageIndex).Copy(); this.DataGridRicerca.DataSource = _MyDs.Tables[0]; DataGridRicerca.Visible = true; GridTitle1.Visible = true; if (_MyDs.Tables[0].Rows.Count == 0) { DataGridRicerca.CurrentPageIndex = 0; GridTitle1.DescriptionTitle = "Nessun dato trovato."; } else { GridTitle1.DescriptionTitle = ""; 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(); //long tot = CalcolaTot(); //ImpostaPagine(tot); }