public void ShowData()
    {
        WebProject.BLL.BaseData.ZT_COM_Product bll_Product = new WebProject.BLL.BaseData.ZT_COM_Product();
        DataSet ds = null;
        if (this.txtProductType.SelectedValue == "ALL")
        {
            ds = bll_Product.GetList(" 1=1 ");
        }
        else
        {
            ds = bll_Product.GetList(" TypeNo='" + this.txtProductType.SelectedValue + "'");

        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            this.GridView1.Visible = true;
            this.btnDeleteSelect.Visible = true;
            this.lblMessage.Visible = false;
            this.GridView1.DataSource = ds;
            this.GridView1.DataBind();
        }
        else
        {
            this.lblMessage.Visible = true;
            this.btnDeleteSelect.Visible = false;
            this.GridView1.Visible = false;
        }
    }
示例#2
0
 public void ShowProductInfo()
 {
     WebProject.BLL.BaseData.ZT_COM_Product bll_Product = new WebProject.BLL.BaseData.ZT_COM_Product();
     DataSet ds = bll_Product.GetList(" 1=1 ");
     this.RPProduct.DataSource = ds;
     this.RPProduct.DataBind();
 }
示例#3
0
    public void ShowProduct()
    {
        int currentPage = Convert.ToInt32(this.dang.Text);  //当前页

        WebProject.BLL.BaseData.ZT_COM_Product bll_Product = new WebProject.BLL.BaseData.ZT_COM_Product();
        DataSet ds = bll_Product.GetList(" 1=1 ");

        this.count.Text = ds.Tables[0].Rows.Count.ToString();
        if (ds.Tables[0].Rows.Count != 0)
        {
            System.Web.UI.WebControls.PagedDataSource pds = new PagedDataSource();
            pds.DataSource = ds.Tables[0].DefaultView;
            pds.AllowPaging = true;
            pds.PageSize = 6;
            pds.CurrentPageIndex = currentPage - 1; //当前页面索引,索引号从0开始
            this.countpage.Text = pds.PageCount.ToString();//总页数

            if (currentPage == 1)
            {
                this.shou.Enabled = false;
                this.shang.Enabled = false;

            }
            else
            {
                this.shou.Enabled = true;
                this.shang.Enabled = true;

            }
            if (currentPage == pds.PageCount)
            {
                this.xia.Enabled = false;
                this.last.Enabled = false;
            }
            else
            {
                this.xia.Enabled = true;
                this.last.Enabled = true;
            }

            this.DataList1.DataSource = pds;
            this.DataList1.DataBind();
        }

        else
        {
            this.lblMessage.Visible = true;
            this.countpage.Text = this.dang.Text;
            this.shou.Enabled = false;
            this.shang.Enabled = false;
            this.xia.Enabled = false;
            this.last.Enabled = false;

        }
    }
    public void ProductView()
    {
        if (Request["TypeID"] + "" == "")
        {
            Response.Redirect("ErrorPage.aspx");
        }
        else
        {
            try
            {
                int TypeID = Convert.ToInt32(Request.QueryString["TypeID"].ToString());
                WebProject.BLL.BaseData.ZT_COM_ProductType bll_ProductType = new WebProject.BLL.BaseData.ZT_COM_ProductType();
                WebProject.Model.BaseData.ZT_COM_ProductType model_ProductType = bll_ProductType.GetModel(TypeID);
                int currentPage = Convert.ToInt32(this.dang.Text);  //当前页
                WebProject.BLL.BaseData.ZT_COM_Product bll_Product = new WebProject.BLL.BaseData.ZT_COM_Product();
                DataSet ds = bll_Product.GetList(" TypeNo='" + model_ProductType.TypeNo + "'");
                this.count.Text = ds.Tables[0].Rows.Count.ToString();
                if (ds.Tables[0].Rows.Count >= 0)
                {
                    System.Web.UI.WebControls.PagedDataSource pds = new PagedDataSource();
                    pds.DataSource = ds.Tables[0].DefaultView;
                    pds.AllowPaging = true;
                    pds.PageSize = 6;
                    pds.CurrentPageIndex = currentPage - 1; //当前页面索引,索引号从0开始
                    this.countpage.Text = pds.PageCount.ToString();//总页数

                    if (currentPage == 1)
                    {
                        this.shou.Enabled = false;
                        this.shang.Enabled = false;

                    }
                    else
                    {
                        this.shou.Enabled = true;
                        this.shang.Enabled = true;

                    }
                    if (currentPage == pds.PageCount)
                    {
                        this.xia.Enabled = false;
                        this.last.Enabled = false;

                    }
                    else
                    {
                        this.xia.Enabled = true;
                        this.last.Enabled = true;

                    }

                    this.DataList1.DataSource = pds;
                    this.DataList1.DataBind();
                }

                else
                {
                    this.lblMessage.Visible = true;
                    this.countpage.Text = this.dang.Text;
                    this.shou.Enabled = false;
                    this.shang.Enabled = false;
                    this.xia.Enabled = false;
                    this.last.Enabled = false;

                }
            }
            catch
            {
                Response.Redirect("ErrorPage.aspx");
            }
        }
    }