public static ChiTietGioHang FindCTGioHang(int id)
        {
            ChiTietGioHang b = null;

            using (var db = new Context())
            {
                b = db.ChiTietGioHang.Find(id);
                db.Dispose();
            }
            return(b);
        }
        public static ChiTietGioHang Xoa(int id)
        {
            ChiTietGioHang b = null;

            using (var db = new Context())
            {
                b                 = db.ChiTietGioHang.Find(id);
                b.isdeleted       = true;
                db.Entry(b).State = EntityState.Modified;
                db.SaveChanges();
                db.Dispose();
            }
            return(b);
        }
        public static ChiTietGioHang DaTonTai(int id, int soluong, double thanhtien)
        {
            ChiTietGioHang b = null;

            using (var db = new Context())
            {
                b                 = db.ChiTietGioHang.Find(id);
                b.soluong         = b.soluong + soluong;
                b.thanhtien       = b.thanhtien + thanhtien;
                db.Entry(b).State = EntityState.Modified;
                db.SaveChanges();
                db.Dispose();
            }
            return(b);
        }