Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (_khService.ThemKhachHang(getKhachHang()))
     {
         _main.dataGridView.DataSource = _khService.DanhSachKhachHang();
         this.Close();
     }
     ViewErrors();
 }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            KhachHang kh = _main.getKhachHang();

            kh.tenkh     = txtTenKH.Text.Trim();
            kh.diachi    = txtDiaChi.Text.Trim();
            kh.dienthoai = txtDienThoai.Text.Trim();
            if (cbTiemNang.Checked)
            {
                kh.tiemnang = 1;
            }
            else
            {
                kh.tiemnang = 0;
            }

            if (_khService.SuaKhachHang(kh))
            {
                _main.dataGridView.DataSource = _khService.DanhSachKhachHang();
                this.Close();
            }
            ViewErrors();
        }
Esempio n. 3
0
 private void btnKhachHang_Click(object sender, EventArgs e)
 {
     txtTimKiem.Clear();
     lblHienHanh.Text        = "Khách hàng";
     dataGridView.DataSource = _khService.DanhSachKhachHang();
 }