private void butsua_Click(object sender, EventArgs e) { if (txtma.Text == "" || txtten.Text == "") { MessageBox.Show("Chưa nhập đủ thông tin"); return; } giaovien gv = new giaovien(); gv.magv = txtma.Text; gv.ngayvaolam = datenl.Value; gv.ngaysinh = datens.Value; gv.tenban = cbxpb.Text; gv.tengv = txtten.Text; gv.tongiao = txttg.Text; gv.trinhdo = txttd.Text; gv.quequan = txtque.Text; gv.dantoc = txtdt.Text; gv.ngoaingu = txtnn.Text; gv.ghichu = txtghichu.Text; if (MessageBox.Show(string.Format("sửa thồng tin giáo viên"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.UpdateProfile(gv) > 0) { MessageBox.Show("Đã sửa"); giaovien_Load(sender, e); } else { MessageBox.Show("Thông tin chưa được sửa"); } } }
public static int DeleteProfile(giaovien gv) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", gv.magv), }; return(DataProvider.ExecuteNonQuery("xoathongtingiaovien", para)); }
public static int UpdateProfile(giaovien gv) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", gv.magv), new SqlParameter("@ten", gv.tengv), new SqlParameter("@td", gv.trinhdo), new SqlParameter("@ns", gv.ngaysinh) }; return(DataProvider.ExecuteNonQuery("suathongtingiaovien", para)); }
public static int InsertProfile(giaovien gv) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma ", gv.magv), new SqlParameter("@ten", gv.tengv), new SqlParameter("@ns", gv.ngaysinh), new SqlParameter("@gt", gv.gioitinh), new SqlParameter("@dt", gv.dantoc), new SqlParameter("@tg", gv.tongiao), new SqlParameter("@que ", gv.quequan), new SqlParameter("@td", gv.trinhdo), new SqlParameter("@ngay", gv.ngayvaolam), new SqlParameter("@nn", gv.ngoaingu), new SqlParameter("@ghichu", gv.ghichu), new SqlParameter("@tb", gv.tenban), }; return(DataProvider.ExecuteNonQuery("themhsgiaovien ", para)); }
private void butluu_Click(object sender, EventArgs e) { if (txtma.Text == "" || txtten.Text == "") { MessageBox.Show("Chưa nhập đủ thông tin!"); return; } giaovien gv = new giaovien(); gv.magv = txtma.Text; gv.tengv = txtten.Text; gv.ngaysinh = datens.Value; gv.gioitinh = txtgt.Text; gv.dantoc = txtdt.Text; gv.tongiao = txttg.Text; gv.quequan = txtque.Text; gv.trinhdo = txttd.Text; gv.ngayvaolam = datenl.Value; gv.ngoaingu = txtnn.Text; gv.ghichu = txtghichu.Text; gv.tenban = cbxpb.Text; if (MessageBox.Show(string.Format("Bạn có muốn lưu mã giáo viên không?"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(gv) > 0) { MessageBox.Show("lưu thành công!"); giaovien_Load(sender, e); } else { MessageBox.Show("bị Lỗi"); } } }
public static int DeleteProfile(giaovien gv) { return(Dao.DeleteProfile(gv)); }
public static int UpdateProfile(giaovien gv) { return(Dao.UpdateProfile(gv)); }
public static int InsertProfile(giaovien gv) { return(Dao.InsertProfile(gv)); }