Exemple #1
0
        private void btn_luu_Click(object sender, EventArgs e)
        {
            if (!CheckBeforeSave())
            {
                return;
            }
            DTO_KhachHang kh = new DTO_KhachHang();

            kh.ma_khach_hang  = txt_ma_khachhang.Text;
            kh.ten_khach_hang = txt_ten_khachhang.Text;
            kh.ma_so_thue     = Convert.ToString(txt_sothue.Text);
            kh.fax            = txt_fax.Text;
            kh.dia_chi        = txt_diachi.Text;
            kh.dien_thoai     = txt_dienthoai.Text;
            kh.ngay_tao       = DateTime.Now;
            if (txt_ma_khachhang.Enabled)
            {
                dal.Create_KH(kh);
            }
            else
            {
                dal.Update_KH(kh);
            }
            BindDataGridView();

            ResetControl();


            btn_xoa.Enabled = false;
            btn_sua.Enabled = false;
        }
Exemple #2
0
 //public DataTable GetAll_KH_ID(string KHID)
 //{
 //    return KH.GetAll_KH_ID(KHID);
 //}
 //public List<DTO_KhachHang> GetAll_KH_HD_HH()
 //{
 //    return KH.GetAll_KH_HD_HH();
 //}
 public bool Create_KH(DTO_KhachHang kh)
 {
     return(KH.Create_KH(kh));
 }