protected void gridChiTietPhieuKiemKho_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            string    ID     = e.Keys[0].ToString();
            string    GiaMoi = e.NewValues["GiaMoi"] == null ? "0" : e.NewValues["GiaMoi"].ToString();
            dtHangHoa dt     = new dtHangHoa();

            data = new dtBangGia();

            DataTable da = dt.LayDanhSachHangHoa_MaHang(e.NewValues["MaHangHoa"].ToString());

            if (da.Rows.Count != 0)
            {
                DataRow dr    = da.Rows[0];
                float   GiaCu = dt.LaySoTienCu_ChiTietGia(ID);
                if (float.Parse(GiaMoi) != GiaCu)
                {
                    dtThayDoiGia.ThemLichSu(Session["IDNhanVien"].ToString(), dr["MaHangHoa"].ToString(), dr["TenHangHoa"].ToString(), dr["IDDonViTinh"].ToString(), GiaCu + "", GiaMoi, Session["IDChiNhanh"].ToString());
                }
            }

            data.CapNhatGiaChiTiet(ID, GiaMoi);
            e.Cancel = true;
            gridChiTietPhieuKiemKho.CancelEdit();
            string IDBangGia = Request.QueryString["IDBangGia"];

            if (IDBangGia != null)
            {
                LoadGrid(IDBangGia);
            }
        }
        protected void gridChiTietPhieuKiemKho_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            string    ID       = e.Keys[0].ToString();
            string    GiaBanLe = e.NewValues["GiaBanLe"] == null ? "0" : e.NewValues["GiaBanLe"].ToString();
            string    GiaBanSi = e.NewValues["GiaBanSi"] == null ? "0" : e.NewValues["GiaBanSi"].ToString();
            dtHangHoa dt       = new dtHangHoa();

            data = new dtBangGia();

            DataTable da = dt.LayDanhSachHangHoa_MaHang(e.NewValues["MaHang"].ToString());

            if (da.Rows.Count != 0)
            {
                DataRow dr         = da.Rows[0];
                double  GiaBanSiCu = dt.LaySoTienCu_ChiTietGia_GiaBanSi(ID);
                double  GiaBanLeCu = dt.LaySoTienCu_ChiTietGia_GiaBanLe(ID);
                if (double.Parse(GiaBanLe) != GiaBanLeCu)
                {
                    dtThayDoiGia.ThemLichSu(dr["MaHang"].ToString(), dr["TenHangHoa"].ToString(), dr["IDDonViTinhSi"].ToString(), GiaBanLeCu.ToString(), GiaBanLe, Session["IDNhanVien"].ToString(), "Thay đổi giá bán lẻ trong bảng giá");
                }
                if (double.Parse(GiaBanSi) != GiaBanSiCu)
                {
                    dtThayDoiGia.ThemLichSu(dr["MaHang"].ToString(), dr["TenHangHoa"].ToString(), dr["IDDonViTinhSi"].ToString(), GiaBanSiCu.ToString(), GiaBanSi, Session["IDNhanVien"].ToString(), "Thay đổi giá bán sỉ trong bảng giá");
                }
            }

            data.CapNhatGiaChiTiet(ID, GiaBanLe, GiaBanSi);
            e.Cancel = true;
            gridChiTietPhieuKiemKho.CancelEdit();
            string IDBangGia = Request.QueryString["IDBangGia"];

            if (IDBangGia != null)
            {
                LoadGrid(IDBangGia);
            }
        }