private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(cboSanPham.SelectedText))
         {
             MessageBox.Show("Chọn sản phẩm để điều chỉnh tồn kho.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         DataSet ds = new DataAccess().getIDSanPhamByTenSP(cboSanPham.SelectedText);
         if (ds == null || ds.Tables[0].Rows.Count < 0 || string.IsNullOrEmpty(ds.Tables[0].Rows[0][0].ToString()))
         {
             // bi loi...
         }
         PhieuDieuChinhTonKho obj = new PhieuDieuChinhTonKho();
         obj.IDSanpham = Convert.ToInt32(ds.Tables[0].Rows[0]["IDSanPham"]);
         obj.SoluongDC = Convert.ToInt32(txtSoLuongDC.Text);
         obj.GhiChu    = txtGhiChu.Text;
         new DataAccess().insertPhieuDieuChinhTonKho(obj);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     loadAllPhieuDieuChinh();
 }
Example #2
0
 public bool deletePhieuDieuChinhTonKho(PhieuDieuChinhTonKho objPhieuDieuChinhTonKho)
 {
     return(new PhieuDieuChinhTonKhoService().deletePhieuDieuChinhTonKho(objPhieuDieuChinhTonKho));
 }
Example #3
0
 public int insertPhieuDieuChinhTonKho(PhieuDieuChinhTonKho objPhieuDieuChinhTonKho)
 {
     return(new PhieuDieuChinhTonKhoService().insertPhieuDieuChinhTonKho(objPhieuDieuChinhTonKho));
 }