private void but_xoa_Click(object sender, EventArgs e) { if (cmbmacs.Text == "") { MessageBox.Show("chưa có thông tin"); return; } chitietphieumuon ctpm = new chitietphieumuon(); ctpm.macs = cmbmacs.Text; ctpm.tinhtrangtruocchomuon = cmbtruoc.Text; ctpm.tinhtrangsauchomuon = cmbsau.Text; if (MessageBox.Show(string.Format("xóa chi tiết phiếu"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.DeleteProfile(ctpm) > 0) { MessageBox.Show("Đã xóa"); Chitietphieumuon_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
private void but_luu_Click(object sender, EventArgs e) { if (txt_macs.Text == "" || txt_maphieu.Text == "") { MessageBox.Show("chưa nhập thông tin"); return; } chitietphieumuon ctpm = new chitietphieumuon(); ctpm.macs = txt_macs.Text; ctpm.maphieu = txt_maphieu.Text; ctpm.tinhtrangtruocchomuon = txt_tinhtrangtruoc.Text; ctpm.tinhtrangsauchomuon = txt_tinhtrangsau.Text; if (MessageBox.Show(string.Format("Thêm chi tiết phiếu"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(ctpm) > 0) { MessageBox.Show("Đã thêm"); Chitietphieumuon_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
private void but_sua_Click(object sender, EventArgs e) { if (cmbmacs.Text == "") { MessageBox.Show("chưa nhập thông tin"); return; } chitietphieumuon ctpm = new chitietphieumuon(); ctpm.macs = cmbmacs.Text; ctpm.maphieu = cmbmaphieu.Text; ctpm.tinhtrangtruocchomuon = txttruocchomuon.Text; ctpm.tinhtrangsauchomuon = txtsauchomuon.Text; ctpm.songayhethan = txtsongayqua.Text; ctpm.socuon = txtsocuon.Text; ctpm.ngaymuon = datengaymuon.Value; ctpm.ngaytra = datengayhentra.Value; ctpm.ngayhentra = datengayhentra.Value; if (MessageBox.Show(string.Format("sửa thông tin chi tiết phiếu"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.UpdateProfile(ctpm) > 0) { MessageBox.Show("Đã sửa"); Chitietphieumuon_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
public static int DeleteProfile(chitietphieumuon ctpm) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", ctpm.maphieu), new SqlParameter("@macs", ctpm.macs) }; return(DataProvider.ExecuteNonQuery("xoachitietphieumuon", para)); }
public static int UpdateProfile(chitietphieumuon ctpm) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", ctpm.maphieu), new SqlParameter("@macs", ctpm.macs), new SqlParameter("@tinhtrangsau", ctpm.tinhtrangsauchomuon) }; return(DataProvider.ExecuteNonQuery("suachitietphieumuon", para)); }
public static int DeleteProfile(chitietphieumuon ctpm) { return(Dao.DeleteProfile(ctpm)); }
public static int UpdateProfile(chitietphieumuon ctpm) { return(Dao.UpdateProfile(ctpm)); }
public static int InsertProfile(chitietphieumuon ctpm) { return(Dao.InsertProfile(ctpm)); }