public DataTable ChiTietPhieuXuat_Load(ChiTiet_PhieuXuat ctphieuxuat) { string query = "pro_ChiTietPhieuXuatSelect '" + ctphieuxuat.MaPX + "'"; DataTable result = DataProvider.Instance.ExecuteQuery(query); return(result); }
//private void txtMaMH_TextChanged(object sender, EventArgs e) //{ // string MaMH = txtMaMH.Text; // string MaLo = txtMaLo.Text; // string MaPX = lbMaPX.Text; // MatHang mathang = new MatHang(MaMH, ""); // PhieuXuatBLL.TenMH(mathang); // txtTenMH.DataBindings.Clear(); // txtTenMH.DataBindings.Add("Text", PhieuXuatBLL.TenMH(mathang), "Tên mặt hàng"); // ChiTiet_PhieuXuat ctphieuxuat = new ChiTiet_PhieuXuat(MaPX, MaMH, MaLo, -1); // if (ctphieuxuatBLL.CheckMaCTPhieuXuat(ctphieuxuat)) // { // btnThemCTPX.Enabled = false; // btnSuaCTPX.Enabled = true; // btnXoaCTPX.Enabled = true; // btnReport.Enabled = true; // } // else // { // btnThemCTPX.Enabled = true; // btnSuaCTPX.Enabled = false; // btnXoaCTPX.Enabled = false; // btnReport.Enabled = false; // } //} void ChiTietPX_Load() { Clear_Binding_ChiTiet(); int MaPX = Convert.ToInt32(txtMaPX.Text); ChiTiet_PhieuXuat ctphieuxuat = new ChiTiet_PhieuXuat(MaPX, "", -1, -1, -1); dtgChiTietPhieuXuat.DataSource = ChiTietPhieuXuat; ChiTietPhieuXuat.DataSource = ctphieuxuatBLL.ChittietPhieuxuat_Load(ctphieuxuat); Binding_ChiTiet(); dtgChiTietPhieuXuat.Refresh(); }
public bool ChiTietPhieuXuat_Delete(ChiTiet_PhieuXuat ctphieuxuat) { try { string query = "pro_ChiTietPhieuXuatDelete '" + ctphieuxuat.MaPX + "','" + ctphieuxuat.MaLo + "'"; DataTable result = DataProvider.Instance.ExecuteQuery(query); return(true); } catch (Exception e) { } return(false); }
private void btnSuaCTPX_Click(object sender, EventArgs e) { string DVT = txtDVT.Text; int MaLo = Convert.ToInt32(txtMaLo.Text); int MaPX = Convert.ToInt32(txtMaPX.Text); int SLXuat = Convert.ToInt32(txtSLXuat.Text); int DonGiaXuat = Convert.ToInt32(txtDonGiaXuat.Text); ChiTiet_PhieuXuat ctphieuxuat = new ChiTiet_PhieuXuat(MaPX, DVT, MaLo, SLXuat, DonGiaXuat); if (ctphieuxuatBLL.ChittietPhieuxuat_Update(ctphieuxuat)) { ChiTietPX_Load(); } else { MessageBox.Show("Chỉnh sửa thất bại"); } }
private void btnXoaCTPX_Click(object sender, EventArgs e) { string DVT = txtDVT.Text; int MaLo = Convert.ToInt32(txtMaLo.Text); int MaPX = Convert.ToInt32(txtMaPX.Text); int SLXuat = Convert.ToInt32(txtSLXuat.Text); int DonGiaXuat = Convert.ToInt32(txtDonGiaXuat.Text); ChiTiet_PhieuXuat ctphieuxuat = new ChiTiet_PhieuXuat(MaPX, DVT, MaLo, SLXuat, DonGiaXuat); if (MessageBox.Show("Bạn có thực sự muốn xóa??", "Thông báo", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { if (ctphieuxuatBLL.ChittietPhieuxuat_Delete(ctphieuxuat)) { ChiTietPX_Load(); } else { MessageBox.Show("Xóa thất bại"); } } }
public bool ChittietPhieuxuat_Delete(ChiTiet_PhieuXuat ctphieuxuat) { return(CT_PhieuXuat.ChiTietPhieuXuat_Delete(ctphieuxuat)); }
public DataTable ChittietPhieuxuat_Load(ChiTiet_PhieuXuat ctphieuxuat) { return(CT_PhieuXuat.ChiTietPhieuXuat_Load(ctphieuxuat)); }
public bool ChiTietPhieuXuat_Insert(ChiTiet_PhieuXuat ctphieuxuat) { return(CT_PhieuXuat.ChiTietPhieuXuat_Insert(ctphieuxuat)); }