protected void gridChiTietPhieuKiemKho_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string IDPhieuKiemKho = Request.QueryString["IDPhieuKiemKho"]; string ID = e.Keys[0].ToString(); float ThucTe = float.Parse(e.NewValues["ThucTe"].ToString()); float TonKho = float.Parse(e.NewValues["TonKho"].ToString()); if (ThucTe >= 0) { data = new dtKiemKho(); data.CapNhatPhieuKiemKho_Chinh(ID, ThucTe.ToString(), (ThucTe - TonKho).ToString()); e.Cancel = true; gridChiTietPhieuKiemKho.CancelEdit(); LoadGrid(Int32.Parse(IDPhieuKiemKho.ToString())); } else { throw new Exception("Lỗi: Số lượng thực tế phải >= 0"); } }
protected void gridChiTietPhieuKiemKho_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string IDPhieuKiemKho = Request.QueryString["IDPhieuKiemKho"]; string ID = e.Keys[0].ToString(); int ThucTe = Int32.Parse(e.NewValues["ThucTe"].ToString()); int TonKho = Int32.Parse(e.NewValues["TonKho"].ToString()); if (ThucTe >= 0) { data = new dtKiemKho(); data.CapNhatPhieuKiemKho_Chinh(ID, ThucTe, ThucTe - TonKho); e.Cancel = true; gridChiTietPhieuKiemKho.CancelEdit(); LoadGrid(Int32.Parse(IDPhieuKiemKho.ToString())); dtLichSuTruyCap.ThemLichSu(Session["IDNhanVien"].ToString(), Session["IDNhom"].ToString(), "Chi tiết phiếu kiểm kho", Session["IDKho"].ToString(), "Nhập xuất tồn", "Cập nhật"); } else { throw new Exception("Lỗi: Số lượng thực tế phải >= 0"); } }