Пример #1
0
        //public delegate DataSet GetDataDelegate();

        //public void BindDDL(GetDataDelegate getMethod, DropDownList ddl)
        //{
        //    DataSet ds = getMethod();
        //    ddl.Items.Add("");
        //    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        //    {
        //        ddl.Items.Add(ds.Tables[0].Rows[i][0].ToString());
        //    }
        //}

        //public void DDLDataBind()
        //{
        //    BindDDL(DAL.FacilityDAL.GetMaching, ddlMaching);
        //    BindDDL(DAL.FacilityDAL.GetBrand, ddlBrand);
        //    BindDDL(DAL.FacilityDAL.GetModel, ddlModel);
        //    BindDDL(DAL.FacilityDAL.GetParameter, ddlParameter);
        //    BindDDL(DAL.FacilityDAL.GetSupplier, ddlSupplier);
        //}

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            paras               = new OutStocksParameters();
            paras.EventNo       = txtEventNo.Text.Trim();
            paras.StoreNo       = txtStoreNo.Text.Trim();
            paras.OutStockF     = txtOutStockF.Text.Trim();
            paras.OutStockT     = txtOutStockT.Text.Trim();
            paras.Maching       = ddlMaching.SelectedValue;
            paras.Brand         = ddlBrand.SelectedValue;
            paras.Model         = ddlModel.SelectedValue;
            paras.Parameter     = ddlParameter.SelectedValue;
            paras.Supplier      = ddlSupplier.SelectedValue;
            paras.OutStockState = ddlOutStockState.SelectedValue;

            DataSet ds        = DAL.OutStocksDAL.GetOutStocksTotal(paras.EventNo, paras.StoreNo, paras.Maching, paras.Brand, paras.Model, paras.Parameter, paras.Supplier, paras.OutStockF, paras.OutStockT, paras.OutStockState);
            int     rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > pageSize)
            {
                totalPage = (int)Math.Ceiling((double)rowsCount / (double)pageSize);
            }
            else
            {
                totalPage = 1;
            }

            GVDataBind(1);
        }
Пример #2
0
        //public delegate DataSet GetDataDelegate();
        //public void BindDDL(GetDataDelegate getMethod, DropDownList ddl)
        //{
        //    DataSet ds = getMethod();
        //    ddl.Items.Add("");
        //    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        //    {
        //        ddl.Items.Add(ds.Tables[0].Rows[i][0].ToString());
        //    }
        //}
        //public void DDLDataBind()
        //{
        //    BindDDL(DAL.FacilityDAL.GetMaching, ddlMaching);
        //    BindDDL(DAL.FacilityDAL.GetBrand, ddlBrand);
        //    BindDDL(DAL.FacilityDAL.GetModel, ddlModel);
        //    BindDDL(DAL.FacilityDAL.GetParameter, ddlParameter);
        //    BindDDL(DAL.FacilityDAL.GetSupplier, ddlSupplier);
        //}
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            paras = new OutStocksParameters();
            paras.EventNo = txtEventNo.Text.Trim();
            paras.StoreNo = txtStoreNo.Text.Trim();
            paras.OutStockF = txtOutStockF.Text.Trim();
            paras.OutStockT = txtOutStockT.Text.Trim();
            paras.Maching = ddlMaching.SelectedValue;
            paras.Brand = ddlBrand.SelectedValue;
            paras.Model = ddlModel.SelectedValue;
            paras.Parameter = ddlParameter.SelectedValue;
            paras.Supplier = ddlSupplier.SelectedValue;
            paras.OutStockState = ddlOutStockState.SelectedValue;

            DataSet ds = DAL.OutStocksDAL.GetOutStocksTotal(paras.EventNo, paras.StoreNo, paras.Maching, paras.Brand, paras.Model, paras.Parameter, paras.Supplier, paras.OutStockF, paras.OutStockT, paras.OutStockState);
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > pageSize)
            {
                totalPage = (int)Math.Ceiling((double)rowsCount / (double)pageSize);
            }
            else
            {
                totalPage = 1;
            }

            GVDataBind(1);
        }