public static int DeleteProfile(PhieuXuatObj qh) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", qh.MaPX) }; return(ConectToSQL_Datvd.Execute_NonQuery("XoaPhieuXuat", para)); }
public static int UpdateProfile(PhieuXuatObj qh) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", qh.MaPX), new SqlParameter("@makh", qh.MaKH), new SqlParameter("@manv", qh.MaNV), new SqlParameter("@ngay", qh.NgayXuat), }; return(ConectToSQL_Datvd.Execute_NonQuery("SuaPhieuXuat", para)); }
private void btnLuu_Click(object sender, EventArgs e) { if (txtMaPhieu.Text == "" || cboNhanVien.Text == "" || cboKhachHang.Text == "" || dtpNgay.Text == "") { MessageBox.Show("Bạn Cần Điền Đầy Đủ Thông Tin Trước Khi Lưu", "Thông Báo"); } else if (check == 1) { PhieuXuatObj qh = new PhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; qh.MaNV = cboNhanVien.SelectedValue.ToString(); qh.MaKH = cboKhachHang.SelectedValue.ToString(); qh.NgayXuat = DateTime.Parse(dtpNgay.Text); if (PhieuXuatCtrl.InsertProfile(qh) > 0) { MessageBox.Show("Thêm mới thành công"); frmPhieuXuat_Load(sender, e); dgvPhieuXuat.Enabled = true; } else { MessageBox.Show("Không thể thêm mới"); } } else { PhieuXuatObj qh = new PhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; qh.MaNV = cboNhanVien.SelectedValue.ToString(); qh.MaKH = cboKhachHang.SelectedValue.ToString(); qh.NgayXuat = DateTime.Parse(dtpNgay.Text); if (PhieuXuatCtrl.UpdateProfile(qh) > 0) { MessageBox.Show("Sửa thành công"); frmPhieuXuat_Load(sender, e); dgvPhieuXuat.Enabled = true; } else { MessageBox.Show("Không thể Sửa"); } } }
private void btnXoa_Click(object sender, EventArgs e) { if (txtMaPhieu.Text == "") { MessageBox.Show("Bạn cần chọn Phiếu để xóa !", "Thông Báo"); } else if (MessageBox.Show("Bạn có chắc chắn muốn xóa PHiếu " + txtMaPhieu.Text + "?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { PhieuXuatObj qh = new PhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; if (PhieuXuatCtrl.DeleteProfile(qh) > 0) { MessageBox.Show("Xóa thành công"); frmPhieuXuat_Load(sender, e); } else { MessageBox.Show("Không thể Xóa"); } } }
public static int DeleteProfile(PhieuXuatObj qh) { return(PhieuXuatMod.DeleteProfile(qh)); }
public static int UpdateProfile(PhieuXuatObj qh) { return(PhieuXuatMod.UpdateProfile(qh)); }
public static int InsertProfile(PhieuXuatObj qh) { return(PhieuXuatMod.InsertProfile(qh)); }