Ejemplo n.º 1
0
        private void btnTimKhachHang_Click(object sender, EventArgs e)
        {
            BULKhachHang bulKH = new BULKhachHang();

            if (txtKhachHang.Text == "")
            {
                dgvKhachHang.DataSource = bulKH.layTatCaKhachHang();
            }
            else
            {
                dgvKhachHang.DataSource = bulKH.layTatCaKhachHang(txtKhachHang.Text);
            }
        }
Ejemplo n.º 2
0
        public void loadKhachHang()
        {
            BULKhachHang bulKH = new BULKhachHang();

            dgvKhachHang.DataSource            = bulKH.layTatCaKhachHang();
            dgvKhachHang.Columns[0].HeaderText = "Mã khách hàng";
            dgvKhachHang.Columns[1].HeaderText = "Tên khách hàng";
            dgvKhachHang.Columns[2].HeaderText = "Địa chỉ";
            dgvKhachHang.Columns[3].HeaderText = "Số điện thoại";
        }
Ejemplo n.º 3
0
 private void txtMaKhachHang_TextChanged(object sender, EventArgs e)
 {
     BULKhachHang = new BULKhachHang();
     foreach (KhachHang x in BULKhachHang.layTatCaKhachHang())
     {
         if (x.MaKhachHang == txtMaKhachHang.Text)
         {
             txtTenKhachHang.Text = x.HoTen;
         }
     }
 }
Ejemplo n.º 4
0
 private KhachHang tonTaiKhachHang(string text)
 {
     foreach (KhachHang x in bulKH.layTatCaKhachHang())
     {
         if (x.MaKhachHang == text)
         {
             return(x);
         }
     }
     return(null);
 }
Ejemplo n.º 5
0
 private bool tonTaiMa(string text)
 {
     foreach (KhachHang x in bulKH.layTatCaKhachHang())
     {
         if (x.MaKhachHang == text)
         {
             return(true);
         }
     }
     return(false);
 }