private void btnluu_Click(object sender, EventArgs e) { bool flag; if (rdbnam.Checked == true) { flag = true; } else { flag = false; } using (_db = new QLSQADataContext()) { db_User user = new db_User { TenNV = txttnd.Text, TenDangNhap = txttdn.Text, MatKhau = txtmk.Text, EmailDK = txtemail.Text, Vaitro = cmbvaitro.SelectedItem.ToString(), GioiTinhDK = flag, NgaySinh = dateTimePicker1.Value }; _db.db_Users.InsertOnSubmit(user); _db.SubmitChanges(); loadata(); }; MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK); enableNutLenh(false); cleardata(); }
partial void Deletedb_User(db_User instance);
partial void Updatedb_User(db_User instance);
partial void Insertdb_User(db_User instance);