protected void gridHangHoa_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { data = new dtHangHoa(); string ID = e.Keys[0].ToString(); string MaHangHoa = e.NewValues["MaHangHoa"].ToString(); string TenHangHoa = e.NewValues["TenHangHoa"].ToString(); string GiaBan = e.NewValues["GiaBan"].ToString(); string IDDonViTinh = e.NewValues["IDDonViTinh"].ToString(); string IDNhomHang = e.NewValues["IDNhomHang"].ToString(); string GhiChu = e.NewValues["GhiChu"] == null ? "" : e.NewValues["GhiChu"].ToString(); float GiaCu = data.LaySoTienCu(ID); if (GiaCu != float.Parse(GiaBan)) { dtThayDoiGia.ThemLichSu(Session["IDNhanVien"].ToString(), MaHangHoa, TenHangHoa, IDDonViTinh, GiaCu + "", GiaBan, Session["IDChiNhanh"].ToString()); dtBangGia bg = new dtBangGia(); bg.CapNhatGiaCuTrongChiTietBangGia(ID, GiaBan); } data.SuaHangHoa(ID, MaHangHoa, TenHangHoa, GiaBan, IDDonViTinh, IDNhomHang, GhiChu); e.Cancel = true; gridHangHoa.CancelEdit(); LoadGrid(); dtLichSuTruyCap.ThemLichSu(Session["IDChiNhanh"].ToString(), Session["IDNhom"].ToString(), Session["IDNhanVien"].ToString(), "Quản lý hàng hóa", "Cập nhật hàng hóa: " + ID); }
protected void gridHangHoa_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { data = new dtHangHoa(); string ID = e.Keys[0].ToString(); string MaHangHoa = e.NewValues["MaHangHoa"].ToString(); string TenHangHoa = e.NewValues["TenHangHoa"].ToString(); string GiaBan = e.NewValues["GiaBan"].ToString(); string IDDonViTinh = e.NewValues["IDDonViTinh"].ToString(); string IDNhomHang = e.NewValues["IDNhomHang"].ToString(); string GhiChu = e.NewValues["GhiChu"] == null ? "" : e.NewValues["GhiChu"].ToString(); data.SuaHangHoa(ID, MaHangHoa, TenHangHoa, GiaBan, IDDonViTinh, IDNhomHang, GhiChu); e.Cancel = true; gridHangHoa.CancelEdit(); LoadGrid(); }