private void butsua_Click(object sender, EventArgs e) { if (txtthu.Text == "" || txttuan.Text == "") { MessageBox.Show("Chưa nhập đủ thông tin"); return; } daythay dt = new daythay(); dt.thu = txtthu.Text; dt.tuan = txttuan.Text; dt.buoi = txtbuoi.Text; dt.tiet = txttiet.Text; dt.lop = cbxlop.Text; dt.magiaoviennghi = cbxgvn.Text; dt.magiaoviendaythay = cbxgvd.Text; if (MessageBox.Show(string.Format("sửa thồng tin dạy thay của giáo viên này không?"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.UpdateProfile(dt) > 0) { MessageBox.Show("Đã sửa"); lichdaythay_Load(sender, e); } else { MessageBox.Show("Thông tin chưa được sửa"); } } }
private void butluu_Click(object sender, EventArgs e) { if (txtthu.Text == "" || txttuan.Text == "") { MessageBox.Show("Chưa nhập đủ thông tin!"); return; } daythay dt = new daythay(); dt.thu = txtthu.Text; dt.tuan = txttuan.Text; dt.buoi = txtbuoi.Text; dt.tiet = txttiet.Text; dt.lop = cbxlop.Text; dt.magiaoviennghi = cbxgvn.Text; dt.magiaoviendaythay = cbxgvd.Text; if (MessageBox.Show(string.Format("Bạn có muốn lưu lịch dạy thay mmới không?"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(dt) > 0) { MessageBox.Show("lưu thành công!"); lichdaythay_Load(sender, e); } else { MessageBox.Show("bị Lỗi"); } } }
internal static int DeleteProfile(daythay dt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@gvn", dt.magiaoviennghi), }; return(DataProvider.ExecuteNonQuery("xoalichdaythay", para)); }
public static int UpdateProfile(daythay dt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@tiet", dt.tiet), new SqlParameter("@lop", dt.lop), new SqlParameter("@gvn", dt.magiaoviennghi), new SqlParameter("@gvd", dt.magiaoviendaythay) }; return(DataProvider.ExecuteNonQuery("sualichdaythay", para)); }
public static int InsertProfile(daythay dt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@thu", dt.thu), new SqlParameter("@tuan", dt.tuan), new SqlParameter("@buoi", dt.buoi), new SqlParameter("@tiet", dt.tiet), new SqlParameter("@lop", dt.lop), new SqlParameter("@gvn", dt.magiaoviennghi), new SqlParameter("@gvd", dt.magiaoviendaythay) }; return(DataProvider.ExecuteNonQuery("themlichdaythay ", para)); }
public static int DeleteProfile(daythay dt) { return(Dao.DeleteProfile(dt)); }
public static int UpdateProfile(daythay dt) { return(Dao.UpdateProfile(dt)); }
public static int InsertProfile(daythay dt) { return(Dao.InsertProfile(dt)); }