private void but_luu_Click(object sender, EventArgs e) { if (txt_maphieu.Text == "") { MessageBox.Show("thông tin chưa được nhập"); return; } phieumuontra pmt = new phieumuontra(); pmt.maphieu = txt_maphieu.Text; pmt.ngaymuon = datengaymuon.Value; pmt.ngaytra = datengaytra.Value; pmt.ngayhentra = datengaytra.Value; pmt.madg = txt_madg.Text; pmt.matt = txt_matt.Text; if (MessageBox.Show(string.Format("thêm thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(pmt) > 0) { MessageBox.Show("thông tin đã thêm"); Phieumuontra_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
private void but_xoa_Click(object sender, EventArgs e) { if (txt_maphieu.Text == "") { MessageBox.Show("Thông tin chưa được chọn"); return; } phieumuontra pmt = new phieumuontra(); pmt.maphieu = txt_maphieu.Text; pmt.ngaymuon = datengaymuon.Value; pmt.madg = cmbmadg.Text; pmt.matt = cmbmatt.Text; pmt.ngaytra = datengaytra.Value; pmt.ngayhentra = datengayhentra.Value; if (MessageBox.Show(string.Format("Xóa thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.DeleteProfile(pmt) > 0) { MessageBox.Show("Đã Xóa"); Phieumuontra_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
private void btnxoa_Click(object sender, EventArgs e) { if (txtmaphieu.Text == "") { MessageBox.Show("Thông tin chưa được chọn"); return; } phieumuontra pmt = new phieumuontra(); pmt.maphieu = txtmaphieu.Text; pmt.matt = cmbmatt.Text; pmt.madg = cmbmadg.Text; pmt.socuonmuonve = Convert.ToInt32(txtsocuonmuonve.Text); if (MessageBox.Show(string.Format("Xóa thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.DeleteProfile(pmt) > 0) { MessageBox.Show("Đã Xóa"); Phieumuontra_Load(sender, e); } else { MessageBox.Show("Lỗi"); } } }
public static int DeleteProfile(phieumuontra pmt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", pmt.maphieu) }; return(DataProvider.ExecuteNonQuery("xoaphieumuontra", para)); }
public static int UpdateProfile(phieumuontra pmt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", pmt.maphieu), new SqlParameter("@ngaymuon", pmt.ngaymuon), new SqlParameter("@ngaytra", pmt.ngaytra), new SqlParameter("@ngayhentra", pmt.ngayhentra) }; return(DataProvider.ExecuteNonQuery("suaphieumuontra", para)); }
public static int InsertProfile(phieumuontra pmt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", pmt.maphieu), new SqlParameter("@ngaymuon", pmt.ngaymuon), new SqlParameter("@ngaytra", pmt.ngaytra), new SqlParameter("@ngayhentra", pmt.ngayhentra), new SqlParameter("@matt", pmt.matt), new SqlParameter("@madg", pmt.madg) }; return(DataProvider.ExecuteNonQuery("themphieumuontra", para)); }
public static int DeleteProfile(phieumuontra pmt) { return(Dao.DeleteProfile(pmt)); }
public static int UpdateProfile(phieumuontra pmt) { return(Dao.UpdateProfile(pmt)); }
public static int InsertProfile(phieumuontra pmt) { return(Dao.InsertProfile(pmt)); }