示例#1
0
        private void btnluu_Click(object sender, EventArgs e)
        {
            bool flag;

            if (rdbnam.Checked == true)
            {
                flag = true;
            }
            else
            {
                flag = false;
            }
            using (_db = new QLSQADataContext())
            {
                db_KhachHang user = new db_KhachHang
                {
                    TenKH    = txttenkh.Text,
                    DiaChiKH = txtdiachi.Text,
                    sdtKH    = txtsdt.Text,
                    EmailKH  = txtemail.Text,
                    GioiTInh = flag,
                    NgaySinh = dateTimePicker1.Value
                };
                _db.db_KhachHangs.InsertOnSubmit(user);
                _db.SubmitChanges();
                loadata();
            };
            MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK);
            enableNutLenh(false);
            cleardata();
        }
示例#2
0
 partial void Deletedb_KhachHang(db_KhachHang instance);
示例#3
0
 partial void Updatedb_KhachHang(db_KhachHang instance);
示例#4
0
 partial void Insertdb_KhachHang(db_KhachHang instance);