public static int DeleteProfile(ChiTietPhieuXuatObj qh) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", qh.MaPX), new SqlParameter("@masp", qh.MaSP) }; return(ConectToSQL_Datvd.Execute_NonQuery("XoaPhieuXuatCT", para)); }
public static int UpdateProfile(ChiTietPhieuXuatObj qh) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@ma", qh.MaPX), new SqlParameter("@masp", qh.MaSP), new SqlParameter("@sl", qh.SoLuong), new SqlParameter("@ChungLoai", qh.ChungLoai) }; return(ConectToSQL_Datvd.Execute_NonQuery("SuaPhieuXuatCT", para)); }
private void btnLuu1_Click(object sender, EventArgs e) { if (cboTenSP.Text == "" || comboBox1.Text == "" || txtSL.Text == "") { MessageBox.Show("Bạn Cần Điền Đầy Đủ Thông Tin Trước Khi Lưu", "Thông Báo"); } else if (check1 == 1) { ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; qh.MaSP = cboTenSP.SelectedValue.ToString(); qh.SoLuong = int.Parse(txtSL.Text); qh.ChungLoai = comboBox1.Text; if (PhieuXuatChiTietCtrl.InsertProfile(qh) > 0) { MessageBox.Show("Thêm mới thành công"); frmPhieuXuat_Load(sender, e); LoadDataChiTiet(); dgvPhieuXuat.Enabled = true; } else { MessageBox.Show("Không thể thêm mới"); } } else { ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; qh.MaSP = cboTenSP.SelectedValue.ToString(); qh.SoLuong = int.Parse(txtSL.Text); qh.ChungLoai = comboBox1.Text; if (PhieuXuatChiTietCtrl.UpdateProfile(qh) > 0) { MessageBox.Show("Sửa thành công"); frmPhieuXuat_Load(sender, e); LoadDataChiTiet(); dgvPhieuXuat.Enabled = true; } else { MessageBox.Show("Không thể Sửa"); } } }
private void btnXoa1_Click(object sender, EventArgs e) { if (cboTenSP.Text == "") { MessageBox.Show("Bạn cần chọn Sản Phẩm để xóa !", "Thông Báo"); } else if (MessageBox.Show("Bạn có chắc chắn muốn xóa Sản Phẩm " + cboTenSP.Text + "?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj(); qh.MaPX = txtMaPhieu.Text; qh.MaSP = cboTenSP.SelectedValue.ToString(); if (PhieuXuatChiTietCtrl.DeleteProfile(qh) > 0) { MessageBox.Show("Xóa thành công"); LoadDataChiTiet(); } else { MessageBox.Show("Không thể Xóa"); } } }
public static int DeleteProfile(ChiTietPhieuXuatObj qh) { return(PhieuXuatChiTietMod.DeleteProfile(qh)); }
public static int InsertProfile(ChiTietPhieuXuatObj qh) { return(PhieuXuatChiTietMod.InsertProfile(qh)); }