Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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 + 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 = GetDatiAprrarecchiature();
                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)
            {
                setvisiblecontrol(true);
                GridTitle1.DescriptionTitle = "";
            }
            else
            {
                GridTitle1.DescriptionTitle = "Nessun dato trovato.";
                setvisiblecontrol(false);
            }
        }