public ActionResult DeleteConfirmed(int id)
 {
     REVIEWRATING rEVIEWRATING = db.REVIEWRATINGs.Find(id);
     db.REVIEWRATINGs.Remove(rEVIEWRATING);
     db.SaveChanges();
     return RedirectToAction("Index");
 }
 public ActionResult Edit([Bind(Include = "ID,MASANPHAM,MATAIKHOAN,HOTEN,NOIDUNG,THOIGIANDANG,SOSAODANHGIA")] REVIEWRATING rEVIEWRATING)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rEVIEWRATING).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.MASANPHAM = new SelectList(db.SANPHAMs, "MASP", "TENSP", rEVIEWRATING.MASANPHAM);
     return View(rEVIEWRATING);
 }
 // GET: REVIEWRATINGs/Details/5
 public ActionResult Details(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     REVIEWRATING rEVIEWRATING = db.REVIEWRATINGs.Find(id);
     if (rEVIEWRATING == null)
     {
         return HttpNotFound();
     }
     return View(rEVIEWRATING);
 }
 // GET: REVIEWRATINGs/Edit/5
 public ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     REVIEWRATING rEVIEWRATING = db.REVIEWRATINGs.Find(id);
     if (rEVIEWRATING == null)
     {
         return HttpNotFound();
     }
     ViewBag.MASANPHAM = new SelectList(db.SANPHAMs, "MASP", "TENSP", rEVIEWRATING.MASANPHAM);
     return View(rEVIEWRATING);
 }
 public ActionResult C(string HOTEN, string NOIDUNG, int MaSP, string Rating)
 {
     if (ModelState.IsValid)
     {
         var db = new CsK24T25Entities();
         var rate = new REVIEWRATING();
         rate.HOTEN = HOTEN;
         rate.NOIDUNG = NOIDUNG;
         rate.MASANPHAM = MaSP;
         rate.SOSAODANHGIA = Double.Parse(Rating);
         rate.THOIGIANDANG = DateTime.Now;
         db.REVIEWRATINGs.Add(rate);
         db.SaveChanges();
         return RedirectToAction("Details", "SANPHAMs", new { id = MaSP });
     }
     return View();
 }