コード例 #1
0
        private void _GetCustomer()
        {
            string idcard = Customer_Idcard_TBx.Text;
            string fname  = Customer_Fname_TBx.Text;
            string lname  = Customer_Lname_TBx.Text;

            cust_mng = new Customers_Manager();

            if (!string.IsNullOrEmpty(idcard) || !string.IsNullOrEmpty(fname) || !string.IsNullOrEmpty(lname))
            {
                List <Customers> list_dlr_all = cust_mng.getCustomers(idcard, fname, lname, 0, 0);

                int row = list_dlr_all.Count;

                _pageCount(row);

                List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, 0, 20);

                Session["idcard"]  = idcard;
                Session["fname"]   = fname;
                Session["lname"]   = lname;
                Session["row_str"] = 0;

                Session["List_Customers"] = list_cust;
            }
        }
コード例 #2
0
        private void _getMoreCustomer(int current_page)
        {
            string idcard = (string)Session["idcard"];
            string fname  = (string)Session["fname"];
            string lname  = (string)Session["lname"];

            if (current_page > 1)
            {
                int row_str = (current_page - 1) * 20;

                link_Previous.Enabled = true;

                cust_mng = new Customers_Manager();

                List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, row_str, 20);

                Session["row_str"] = row_str;

                Session["List_Customers"] = list_cust;
            }
            else
            {
                link_Previous.Enabled = false;

                List <Customers> list_cust = cust_mng.getCustomers(idcard, fname, lname, 0, 20);

                Session["row_str"] = 0;

                Session["List_Customers"] = list_cust;
            }

            int max_page = (int)Session["max_page"];

            if (current_page == max_page)
            {
                link_Next.Enabled = false;
            }
        }