Ejemplo n.º 1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BUBill objbill = new BUBill();
            DataTable dTable = new DataTable();
            if (ddlSearch.SelectedValue == "0")
            {
                lblError.Text = "Bạn chưa chọn tiêu chí tìm kiếm";
            }
            else if (txtSearch.Text == "")
            {
                lblError.Text = "Bạn chưa nhập từ khoá cần tìm";
            }
            else
            {
                if (ddlSearch.SelectedValue == "1")
                {
                    Function fn = new Function();
                    bool ch = fn.IsDate(txtSearch.Text);
                    if (ch == true)
                    {
                        dTable = objbill.SearchBill(Convert.ToDateTime(txtSearch.Text), 1);
                        if (dTable.Rows.Count > 0)
                        {
                            lblError.Text = "";
                            grvMain.DataSource = dTable;
                            grvMain.DataBind();
                        }
                        else
                        {
                            lblError.Text = "Không có dữ liệu cần tìm";

                        }
                    }
                    else
                    {
                        lblError.Text = "Không đúng định dạng ngày tháng";
                    }
                }
                else if (ddlSearch.SelectedValue == "2")
                {
                    dTable = objbill.SearchBill(Convert.ToDateTime("12/12/2009"), Convert.ToInt32(txtSearch.Text));
                    if (dTable.Rows.Count > 0)
                    {
                        lblError.Text = "";
                        grvMain.DataSource = dTable;
                        grvMain.DataBind();
                    }
                    else
                    {
                        lblError.Text = "Không có dữ liệu cần tìm";
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void BindGrid()
 {
     if (Request.QueryString["BillID"] != null)
     {
         DataTable dTable = new DataTable();
         BUBill bill = new BUBill();
         dTable = bill.SelectOneBillToBillDetails(Convert.ToInt32(Request.QueryString["BillID"]));
         if (dTable.Rows.Count > 0)
         {
             grvMain.DataSource = dTable;
             grvMain.DataBind();
         }
     }
 }
Ejemplo n.º 3
0
 private void BindData()
 {
     if (Request.QueryString["BillID"] != null)
     {
         En_Bill BEBill = new En_Bill();
         BUBill bill = new BUBill();
         BEBill = bill.SelectOneBill(Convert.ToInt32(Request.QueryString["BillID"]));
         if (BEBill != null)
         {
             lblBuyDate.Text = BEBill._BuyDate.ToString();
             lblEmployee.Text = BEBill._Employee.ToString();
             //lblProvName.Text = BEBill._ProvName.ToString();
             lblTotal.Text = objfun.ChangeTypeMoney(BEBill._Total.ToString());
             lblToPay.Text = objfun.ChangeTypeMoney(BEBill._Topay.ToString());
             //lblRemain.Text = BEBill._Remain.ToString();
         }
     }
 }
Ejemplo n.º 4
0
 private void BindGrid()
 {
     DataTable dTable = new DataTable();
     BUBill Bill = new BUBill();
     dTable = Bill.SelectAllBill();
     grvMain.DataSource = dTable;
     grvMain.DataBind();
 }