예제 #1
0
        /// <summary>
        /// Effettua il Binding delle Apparecchiaure sulla combo
        /// </summary>
        private void BindApparecchiature()
        {
            this.cmbsApparecchiatura.Items.Clear();

            Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);

            DataSet _MyDs = _Apparecchiature.GetData().Copy();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                this.cmbsApparecchiatura.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                    _MyDs.Tables[0], "DESCRIZIONE", "ID", "- Selezionare una Apparecchiatura -", "");
                this.cmbsApparecchiatura.DataTextField  = "DESCRIZIONE";
                this.cmbsApparecchiatura.DataValueField = "ID";
                this.cmbsApparecchiatura.DataBind();
                if (this.ID_APPARECCHIATURA != "0")
                {
                    this.cmbsApparecchiatura.SelectedValue = this.ID_APPARECCHIATURA;
                }
                BindingGrid();
            }
            else
            {
                string s_Messagggio = "- Nessuna Apparecchiatura -";
                this.cmbsApparecchiatura.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty));
            }
        }
예제 #2
0
        private void RicaricaComboServizio()
        {
            DataSet Myds_;

            Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            Myds_ = _Apparecchiature.GetAppDataServizi(cmbsApparecchiatura.SelectedValue.ToString());
            this.cmbsServizio.SelectedValue = Myds_.Tables[0].Rows[0]["id_servizio"].ToString();
        }
예제 #3
0
        private void BindApparecchiatura()
        {
            if (cmbsServizio.SelectedValue != "")
            {
                this.cmbsApparecchiatura.Items.Clear();

                Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);

                DataSet _MyDs;

                if (!IsPostBack)
                {
                    _MyDs = _Apparecchiature.GetData();
                }
                else
                {
                    S_ControlsCollection _SColl = new S_ControlsCollection();

                    S_Controls.Collections.S_Object s_BlId = new S_Object();
                    s_BlId.ParameterName = "p_Bl_Id";
                    s_BlId.DbType        = CustomDBType.VarChar;
                    s_BlId.Direction     = ParameterDirection.Input;
                    s_BlId.Size          = 50;
                    s_BlId.Index         = 0;
                    s_BlId.Value         = "";
                    _SColl.Add(s_BlId);

                    S_Controls.Collections.S_Object s_Servizio = new S_Object();
                    s_Servizio.ParameterName = "p_Servizio";
                    s_Servizio.DbType        = CustomDBType.Integer;
                    s_Servizio.Direction     = ParameterDirection.Input;
                    s_Servizio.Index         = 1;
                    s_Servizio.Value         = (cmbsServizio.SelectedValue == "")? 0:Int32.Parse(cmbsServizio.SelectedValue);
                    _SColl.Add(s_Servizio);

                    _MyDs = _Apparecchiature.GetData(_SColl).Copy();
                }

                if (_MyDs.Tables[0].Rows.Count > 0)
                {
                    this.cmbsApparecchiatura.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                        _MyDs.Tables[0], "DESCRIZIONE", "ID", "- Selezionare uno Standard -", "");
                    this.cmbsApparecchiatura.DataTextField  = "DESCRIZIONE";
                    this.cmbsApparecchiatura.DataValueField = "ID";
                    this.cmbsApparecchiatura.DataBind();
                }
                else
                {
                    string s_Messagggio = "- Nessuno Standard -";
                    this.cmbsApparecchiatura.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty));
                }
            }
            else
            {
                string s_Messagggio = "- Nessuno Standard -";
                this.cmbsApparecchiatura.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, String.Empty));
            }
        }
예제 #4
0
        private bool Execute(bool reset)
        {
            bool chech = true;



            Classi.AnagrafeImpianti.Apparecchiature     _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            S_Controls.Collections.S_ControlsCollection _SCollection     = riempiDatasetRicerca();


            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         = _SCollection.Count + 1;
            s_p_pageindex.Value         = MyDataGrid1.CurrentPageIndex + 1;
            _SCollection.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         = _SCollection.Count + 1;
            s_p_pagesize.Value         = MyDataGrid1.PageSize;
            _SCollection.Add(s_p_pagesize);

            DataSet Ds = _Apparecchiature.RicercaApparecchiatura(_SCollection).Copy();

            GridTitle1.Visible = true;

            if (reset == true)
            {
                _SCollection = riempiDatasetRicerca();
                int _totalRecords = _Apparecchiature.RicercaApparecchiaturaCount(_SCollection);
                this.GridTitle1.NumeroRecords = _totalRecords.ToString();
            }
            MyDataGrid1.DataSource            = Ds.Tables[0];
            this.MyDataGrid1.VirtualItemCount = int.Parse(this.GridTitle1.NumeroRecords);
            this.MyDataGrid1.DataBind();

            if (int.Parse(this.GridTitle1.NumeroRecords) > 0 && int.Parse(this.GridTitle1.NumeroRecords) < MaxRecord + 1)
            {
                setvisiblecontrol(true);
                GridTitle1.DescriptionTitle = "";
                chech = true;
            }
            else if (int.Parse(this.GridTitle1.NumeroRecords) > MaxRecord)
            {
                setvisiblecontrol(true);
                chech = false;
            }
            else
            {
                setvisiblecontrol(false);
                chech = false;
            }
            return(chech);
        }
예제 #5
0
        private void BindApparecchiatura(string CodEdificio)
        {
            this.cmbsApparecchiatura.Items.Clear();
            Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);

            DataSet _MyDs;

            if (CodEdificio != string.Empty && cmbsServizio.SelectedValue != "0")
            {
                S_ControlsCollection _SColl = new S_ControlsCollection();

                S_Controls.Collections.S_Object s_BlId = new S_Object();
                s_BlId.ParameterName = "p_Bl_Id";
                s_BlId.DbType        = CustomDBType.VarChar;
                s_BlId.Direction     = ParameterDirection.Input;
                s_BlId.Size          = 50;
                s_BlId.Index         = 0;
                s_BlId.Value         = RicercaModulo1.TxtCodice.Text;
                _SColl.Add(s_BlId);

                S_Controls.Collections.S_Object s_Servizio = new S_Object();
                s_Servizio.ParameterName = "p_Servizio";
                s_Servizio.DbType        = CustomDBType.Integer;
                s_Servizio.Direction     = ParameterDirection.Input;
                s_Servizio.Index         = 1;
                string[] codice = cmbsServizio.SelectedValue.Split(Convert.ToChar(" "));

                s_Servizio.Value = (cmbsServizio.SelectedValue == "")? 0:Int32.Parse(codice[0]);
                _SColl.Add(s_Servizio);

                _MyDs = _Apparecchiature.GetDataServizi(_SColl).Copy();


                if (_MyDs.Tables[0].Rows.Count > 0)
                {
                    this.cmbsApparecchiatura.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                        _MyDs.Tables[0], "DESCRIZIONE", "ID", "- Selezionare uno Standard -", "-1");
                    this.cmbsApparecchiatura.DataTextField  = "DESCRIZIONE";
                    this.cmbsApparecchiatura.DataValueField = "ID";
                    this.cmbsApparecchiatura.DataBind();
                }
                else
                {
                    string s_Messagggio = "- Nessuno Standard -";
                    this.cmbsApparecchiatura.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, "0"));
                }

                cmbsApparecchiatura.Enabled    = true;
                CodiceApparecchiature1.Visible = true;
            }
            else
            {
                string s_Messagggio = "- Nessuno Standard -";
                this.cmbsApparecchiatura.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, "0"));
            }
        }
예제 #6
0
        private void BtExport_Click(object sender, System.EventArgs e)
        {
            Csy.WebControls.Export _objExport = new Csy.WebControls.Export();
            DataTable _dt = new DataTable();

            Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);


            int bl_id = 0;

            if (RicercaModulo1._txthidbl.Value != "")
            {
                bl_id = int.Parse(RicercaModulo1._txthidbl.Value);
            }

            DataSet Ds = _Apparecchiature.GetReport(int.Parse(DrTipoRep.SelectedValue), bl_id);

            _dt = Ds.Tables[0].Copy();

            if (_dt.Rows.Count != 0)
            {
                _objExport.ExportDetails(_dt, Csy.WebControls.Export.ExportFormat.Excel, "exp.xls");
            }
            else
            {
                String scriptString = "<script language=JavaScript>alert('Nessun elemento da esportare');";
                scriptString += "<";
                scriptString += "/";
                scriptString += "script>";

                if (!this.IsClientScriptBlockRegistered("clientScriptexp"))
                {
                    this.RegisterStartupScript("clientScriptexp", scriptString);
                }
            }
//
//
//			if (_dt.Rows.Count > 65536)
//			{
//				String scriptString = "<script language=JavaScript>alert('I record trovati sono in numero maggiore di 65536 e non possono entrare in un solo foglio excel. Impostare filtri più restrittivi');";
//				scriptString += "<";
//				scriptString += "/";
//				scriptString += "script>";
//
//				if(!this.IsClientScriptBlockRegistered("clientScriptexp"))
//					this.RegisterStartupScript ("clientScriptexp", scriptString);
//			}
//			else
//			{
//
//
//			}
        }
예제 #7
0
        private void Execute(bool reset)
        {
            ///Istanzio la Classe per eseguire la Strore Procedure
            Classi.AnagrafeImpianti.Apparecchiature     _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            S_Controls.Collections.S_ControlsCollection _SCollection     = GetDatiAprrarecchiature();


            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         = _SCollection.Count;
            s_p_pageindex.Value         = MyDataGrid1.CurrentPageIndex + 1;
            _SCollection.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         = _SCollection.Count;
            s_p_pagesize.Value         = MyDataGrid1.PageSize;
            _SCollection.Add(s_p_pagesize);

            DataSet Ds = _Apparecchiature.RicercApparecchiatura(_SCollection).Copy();


            GridTitle1.Visible = true;

            if (reset == true)
            {
                _SCollection = GetDatiAprrarecchiature();
                int _totalRecords = _Apparecchiature.RicercApparecchiaturaCount(_SCollection);
                this.GridTitle1.NumeroRecords = _totalRecords.ToString();
            }
            MyDataGrid1.DataSource            = Ds.Tables[0];
            this.MyDataGrid1.VirtualItemCount = int.Parse(this.GridTitle1.NumeroRecords);
            this.MyDataGrid1.DataBind();

            if (int.Parse(this.GridTitle1.NumeroRecords) > 0)
            {
                setvisiblecontrol(true);
                GridTitle1.DescriptionTitle = "";
            }
            else
            {
                GridTitle1.DescriptionTitle = "Nessun dato trovato.";
                setvisiblecontrol(false);
            }
        }
예제 #8
0
        private void S_Button1_Click(object sender, System.EventArgs e)
        {
            //esporta in excel
            Csy.WebControls.Export _objExport = new Csy.WebControls.Export();
            DataTable _dt = new DataTable();

            Classi.AnagrafeImpianti.Apparecchiature     _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            S_Controls.Collections.S_ControlsCollection _SCollection     = GetDatiAprrarecchiature();


            DataSet Ds = _Apparecchiature.RicercaApparecchiaturaExcel(_SCollection).Copy();

            _dt = Ds.Tables[0].Copy();

//			if (_dt.Rows.Count > 180000)
//			{
//				String scriptString = "<script language=JavaScript>alert('I record trovati sono in numero maggiore di 65536 e non possono entrare in un solo foglio excel. Impostare filtri più restrittivi');";
//				scriptString += "<";
//				scriptString += "/";
//				scriptString += "script>";
//
//				if(!this.IsClientScriptBlockRegistered("clientScriptexp"))
//					this.RegisterStartupScript ("clientScriptexp", scriptString);
//			}
//			else
//			{
//
//
//			}

            if (_dt.Rows.Count != 0)
            {
                _objExport.ExportDetails(_dt, Csy.WebControls.Export.ExportFormat.Excel, "exp.xls");
            }
            else
            {
                String scriptString = "<script language=JavaScript>alert('Nessun elemento da esportare');";
                scriptString += "<";
                scriptString += "/";
                scriptString += "script>";

                if (!this.IsClientScriptBlockRegistered("clientScriptexp"))
                {
                    this.RegisterStartupScript("clientScriptexp", scriptString);
                }
            }
        }
예제 #9
0
        private void SelezionaTutti(bool val)
        {
            DataSet ds = new DataSet();

            //ds = riempiDatasetRicerca();
            if (!val)
            {
                Session.Remove("CheckedList");
                Session.Remove("DatiList");
                lblElementiSelezionati.Text = "Elementi Selezionati - 0 -";
                EnableControl(false);
                //txtTotSelezionati.Text="0";
            }
            else
            {
                SetControlli();
            }
            Classi.AnagrafeImpianti.Apparecchiature     _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            S_Controls.Collections.S_ControlsCollection _SCollection     = riempiDatasetRicerca();

            DataSet Ds = _Apparecchiature.RicercaAppar(_SCollection).Copy();

            for (int Pagine = 0; Pagine <= MyDataGrid1.PageCount; Pagine++)
            {
                MyDataGrid1.DataSource = Ds.Tables[0];               //Session["DataSet"];
                MyDataGrid1.DataBind();
                MyDataGrid1.CurrentPageIndex = Pagine;

                SetDati(val);

                if (val)
                {
                    SetControlli();
                }
            }

            MyDataGrid1.CurrentPageIndex = 0;
            Execute(true);
            GetControlli();
        }
예제 #10
0
        private void Ricerca(bool reset)
        {
            //esporta in excel
            Csy.WebControls.Export _objExport = new Csy.WebControls.Export();
            DataTable _dt = new DataTable();

            Classi.AnagrafeImpianti.Apparecchiature     _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);
            S_Controls.Collections.S_ControlsCollection _SCollection     = GetDatiAprrarecchiature();


            DataSet Ds = _Apparecchiature.RicercaAttPMPExcel(_SCollection).Copy();

            _dt = Ds.Tables[0].Copy();

            if (_dt.Rows.Count > 300000)
            {
                String scriptString = "<script language=JavaScript>alert('I record trovati sono in numero maggiore di 300.000. Impostare filtri più restrittivi');";
                scriptString += "<";
                scriptString += "/";
                scriptString += "script>";

                if (!this.IsClientScriptBlockRegistered("clientScriptexp"))
                {
                    this.RegisterStartupScript("clientScriptexp", scriptString);
                }
            }
            else
            {
                if (_dt.Rows.Count != 0)
                {
                    _objExport.ExportDetails(_dt, Csy.WebControls.Export.ExportFormat.Excel, "exp.xls");
                }
                else
                {
                    String scriptString = "<script language=JavaScript>alert('Nessun elemento da esportare per le date scelte');";
                    scriptString += "<";
                    scriptString += "/";
                    scriptString += "script>";

                    if (!this.IsClientScriptBlockRegistered("clientScriptexp"))
                    {
                        this.RegisterStartupScript("clientScriptexp", scriptString);
                    }
                }
            }



            //			S_Controls.Collections.S_ControlsCollection CollezioneControlli = new S_Controls.Collections.S_ControlsCollection();
            //			int mindex=0;
            //			// Data Da
            //			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 = mindex;
            //			s_p_DataDa.Size= 20;
            //			s_p_DataDa.Value = (CalendarPicker1.Datazione.Text =="")? "":CalendarPicker1.Datazione.Text;
            //			CollezioneControlli.Add(s_p_DataDa);
            //			mindex++;
            //			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 = mindex;
            //			s_p_DataA.Size= 20;
            //			s_p_DataA.Value = (CalendarPicker2.Datazione.Text =="")? "":CalendarPicker2.Datazione.Text;
            //			CollezioneControlli.Add(s_p_DataA);

            //			mindex++;
            //			// Servizio
            //			S_Controls.Collections.S_Object s_P_servizio = new S_Object();
            //			s_P_servizio.ParameterName = "P_servizio";
            //			s_P_servizio.DbType = CustomDBType.Integer;
            //			s_P_servizio.Direction = ParameterDirection.Input;
            //			s_P_servizio.Index = mindex;
            //			s_P_servizio.Value=(cmbsServizio.SelectedValue=="0")?0:int.Parse(cmbsServizio.SelectedValue);
            //			CollezioneControlli.Add(s_P_servizio);
            //			mindex++;


            // 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 =mindex;
            //			s_P_bl_id.Size=50;
            //			s_P_bl_id.Value=RicercaModulo1.TxtCodice.Text;
            //			CollezioneControlli.Add(s_P_bl_id);
            //			mindex++;
            //			// 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 = mindex;
            //			s_P_campus.Size=50;
            //			s_P_campus.Value=RicercaModulo1.Campus;
            //			CollezioneControlli.Add(s_P_campus);
            //			mindex++;


            //			// Standard delle apparecchiature
            //			S_Controls.Collections.S_Object s_P_standard = new S_Object();
            //			s_P_standard.ParameterName = "P_standard";
            //			s_P_standard.DbType = CustomDBType.Integer;
            //			s_P_standard.Direction = ParameterDirection.Input;
            //			s_P_standard.Index = mindex++;
            //			s_P_standard.Value=(cmbsStdApparecchiature.SelectedValue=="")?0:int.Parse(cmbsStdApparecchiature.SelectedValue);
            //			CollezioneControlli.Add(s_P_standard);
            //			mindex++;
            //
            //			// Apparecchiature
            //			S_Controls.Collections.S_Object s_P_apparecchiatura = new S_Object();
            //			s_P_apparecchiatura.ParameterName = "P_apparecchiatura";
            //			s_P_apparecchiatura.DbType = CustomDBType.VarChar;
            //			s_P_apparecchiatura.Direction = ParameterDirection.Input;
            //			s_P_apparecchiatura.Size = 50;
            //			s_P_apparecchiatura.Index =mindex++;
            //			s_P_apparecchiatura.Value=CodiceApparecchiature1.CodiceApparecchiatura;
            //			CollezioneControlli.Add(s_P_apparecchiatura);
            //			mindex++;

            //			S_Controls.Collections.S_Object s_CurrentUser = new S_Object();
            //			s_CurrentUser.ParameterName = "p_CurrentUser";
            //			s_CurrentUser.DbType = CustomDBType.VarChar;
            //			s_CurrentUser.Direction = ParameterDirection.Input;
            //			s_CurrentUser.Index = mindex++;
            //			s_CurrentUser.Value = System.Web.HttpContext.Current.User.Identity.Name;
            //			CollezioneControlli.Add(s_CurrentUser);
            //			// pageindex
            //			mindex++;



            //			TheSite.Classi.ManProgrammata.SfogliaRdlOdl _SfogliaRdlOdl=new TheSite.Classi.ManProgrammata.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);
            //
            //			}
        }
예제 #11
0
        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());
        }
예제 #12
0
        private long CalcolaTot()

        {
            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);



            DataSet _MyDsTot = _Richiesta.GetTotRDLEQ(_SCollection, DataGridRicerca.PageSize, DataGridRicerca.CurrentPageIndex).Copy();

            DataRow _DR = _MyDsTot.Tables[0].Rows[0];

            return(long.Parse(_DR[0].ToString()));
        }
예제 #13
0
        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);
        }
예제 #14
0
        private void Execute()
        {
            ///Istanzio un nuovo oggetto Collection per aggiungere i parametri
            S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection();
            ///creo i parametri

            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         = _SCollection.Count;
            if (this.blid == null || this.blid == string.Empty)
            {
                s_p_Bl_Id.Value = DBNull.Value;
            }
            else
            {
                s_p_Bl_Id.Value = this.blid;
            }
            _SCollection.Add(s_p_Bl_Id);

            S_Controls.Collections.S_Object s_p_campus = new S_Controls.Collections.S_Object();
            s_p_campus.ParameterName = "p_campus";
            s_p_campus.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            s_p_campus.Direction     = ParameterDirection.Input;
            s_p_campus.Index         = _SCollection.Count;
            s_p_campus.Size          = 50;
            if (this.campus == null || this.campus == string.Empty)
            {
                s_p_campus.Value = DBNull.Value;
            }
            else
            {
                s_p_campus.Value = this.campus;
            }
            _SCollection.Add(s_p_campus);

            S_Controls.Collections.S_Object s_p_Servizio = new S_Controls.Collections.S_Object();
            s_p_Servizio.ParameterName = "p_Servizio";
            s_p_Servizio.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            s_p_Servizio.Direction     = ParameterDirection.Input;
            s_p_Servizio.Index         = _SCollection.Count;
//			///Non filtro piu per servizio.
//			s_p_Servizio.Value = (this.servizioid ==string.Empty)? -1:Int32.Parse(this.servizioid);
            s_p_Servizio.Value = -1;
            _SCollection.Add(s_p_Servizio);

            S_Controls.Collections.S_Object s_p_eqstdid = new S_Controls.Collections.S_Object();
            s_p_eqstdid.ParameterName = "p_eqstdid";
            s_p_eqstdid.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            s_p_eqstdid.Direction     = ParameterDirection.Input;
            s_p_eqstdid.Size          = 8;
            s_p_eqstdid.Index         = _SCollection.Count;
            if (this.codStd == null || this.codStd == string.Empty)
            {
                s_p_eqstdid.Value = DBNull.Value;
            }
            else
            {
                s_p_eqstdid.Value = this.codStd;
            }
            _SCollection.Add(s_p_eqstdid);

            ///Istanzio la Classe per eseguire la Strore Procedure
            Classi.AnagrafeImpianti.Apparecchiature _Apparecchiature = new TheSite.Classi.AnagrafeImpianti.Apparecchiature(Context.User.Identity.Name);

            DataSet Ds = _Apparecchiature.RicercaStd(_SCollection);

            GridTitle1.NumeroRecords = (Ds.Tables[0].Rows.Count) == 0? "0":Ds.Tables[0].Rows.Count.ToString();
            MyDataGrid1.DataSource   = Ds;
            MyDataGrid1.DataBind();
        }