Ejemplo n.º 1
0
 protected void ddl_BrandName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddl_BrandName.SelectedValue.ToString() == "所有")
     {
         GoodProvider providers = new GoodProvider();
         this.ListPager1.RecordCount = providers.GetSize();
         this.BindSource(0, null);
         return;
     }
     this.BindSelect();
 }
Ejemplo n.º 2
0
 protected void btn_Result_Click(object sender, EventArgs e)
 {
     if (this.txt_Name.Text == "")
     {
         GoodProvider provider = new GoodProvider();
         this.ListPager1.RecordCount = provider.GetSize();
         this.BindSource(0);
         return;
     }
     this.BindSelect();
     this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.GridView1.Columns[5].Visible = false;
         GoodProvider provider = new GoodProvider();
         this.ListPager1.RecordCount = provider.GetSize();
         this.BindSource(0, null);
     }
     this.account.Text           = Session["LOGINED"].ToString();
     this.datetime.Text          = this.BindDayWeek();
     this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
 }
Ejemplo n.º 4
0
        private void BindSelect()
        {
            Good good = new Good();

            good.Unit_id    = Convert.ToInt32(this.ddl_Unit.SelectedValue);
            good.Brand_id   = Convert.ToInt32(this.ddl_BrandName.SelectedValue);
            good.Good_name  = "%" + this.txt_Name.Text + "%";
            good.Product_id = 2;
            GoodProvider provider = new GoodProvider();

            this.ListPager1.RecordCount = provider.GetSize(good);
            DataTable table = provider.Select(good, 0, this.ListPager1.RecordCount);

            this.GridView1.DataSource = table.DefaultView;
            this.GridView1.DataBind();
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["id"] != null)
     {
         id = Request.QueryString["id"].ToString();
     }
     if (!IsPostBack)
     {
         this.BindDDL();
         GoodProvider provider = new GoodProvider();
         this.ListPager1.RecordCount = provider.GetSize();
         this.BindSource(0, null);
     }
     this.account.Text           = Session["LOGINED"].ToString();
     this.datetime.Text          = this.BindDayWeek();
     this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
 }
Ejemplo n.º 6
0
        protected void btn_Result_Click(object sender, EventArgs e)
        {
            Good         good     = new Good();
            GoodProvider provider = new GoodProvider();

            if (this.txt_Position.Text == "")
            {
                GoodProvider providers = new GoodProvider();
                this.ListPager1.RecordCount = providers.GetSize();
                this.BindSource(0, null);
            }
            else
            {
                good.Good_name = "%" + this.txt_Position.Text + "%";
                DataTable table = provider.Select(good, 0, this.ListPager1.RecordCount);
                this.GridView1.DataSource = table.DefaultView;
                this.GridView1.DataBind();
            }
        }
Ejemplo n.º 7
0
        protected void btn_Result_Click(object sender, EventArgs e)
        {
            Good         good     = new Good();
            GoodProvider provider = new GoodProvider();

            if (this.txt_Name.Text == "")
            {
                if (this.txt_code.Text == "")
                {
                    GoodProvider providers = new GoodProvider();
                    this.ListPager1.RecordCount = providers.GetSize();
                    this.BindSource(0, null);
                }
                else
                {
                    good.Product_id = 2;
                    good.Good_code  = "%" + this.txt_code.Text + "%";
                    DataTable table = provider.Select(good, 0, this.ListPager1.RecordCount);
                    this.GridView1.DataSource = table.DefaultView;
                    this.GridView1.DataBind();
                }
            }
            else
            {
                if (this.txt_code.Text == "")
                {
                    good.Product_id             = 2;
                    good.Good_name              = "%" + this.txt_Name.Text + "%";
                    this.ListPager1.RecordCount = provider.GetSize(good);
                    this.BindSource(0, "%" + this.txt_Name.Text + "%");
                }
                else
                {
                    good.Product_id = 2;
                    good.Good_name  = "%" + this.txt_Name.Text + "%";
                    good.Good_code  = "%" + this.txt_code.Text + "%";
                    DataTable table = provider.Select(good, 0, this.ListPager1.RecordCount);
                    this.GridView1.DataSource = table.DefaultView;
                    this.GridView1.DataBind();
                }
            }
            this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
        }