private void buttonX1_Click(object sender, EventArgs e) { try { var kt = (from s in db.QUANLYNDs where s.TENDN == txttendn.Text.ToString() select new { s }); if (kt.Count() == 0) { QUANLYND qlnd = new QUANLYND(); qlnd.TENDN = txttendn.Text.ToString(); qlnd.MK = txtmk.Text.ToString(); if (rdb_hd.Checked == true) { qlnd.HOATDONG = Convert.ToBoolean(true); } else { if (rdb_khd.Checked == true) { qlnd.HOATDONG = Convert.ToBoolean(false); } } db.QUANLYNDs.InsertOnSubmit(qlnd); db.SubmitChanges(); us_TaiKhoanNV_Load(sender, e); MessageBox.Show("thành công"); } } catch { MessageBox.Show("Lỗi hệ thống"); } }
partial void DeleteQUANLYND(QUANLYND instance);
partial void UpdateQUANLYND(QUANLYND instance);
partial void InsertQUANLYND(QUANLYND instance);