Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ToReviewEntity toreviewentity = db.ReviewEntity.Find(id);

            db.ReviewEntity.Remove(toreviewentity);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit(ToReviewEntity toreviewentity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(toreviewentity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(toreviewentity));
 }
Пример #3
0
        //
        // GET: /Review/Edit/5

        public ActionResult Edit(int id = 0)
        {
            ToReviewEntity toreviewentity = db.ReviewEntity.Find(id);

            if (toreviewentity == null)
            {
                return(HttpNotFound());
            }
            return(View(toreviewentity));
        }
Пример #4
0
        public ActionResult Create(ToReviewEntity toreviewentity)
        {
            if (ModelState.IsValid)
            {
                db.ReviewEntity.Add(toreviewentity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(toreviewentity));
        }
Пример #5
0
        //
        // GET: /Review/Details/5

        public ActionResult Details(int id = 0)
        {
            ToReviewEntity toreviewentity = db.ReviewEntity.Find(id);

            if (toreviewentity == null)
            {
                return(HttpNotFound());
            }
            ToReviewEntityVM _vm = new ToReviewEntityVM();

            _vm.Link             = toreviewentity.Link;
            _vm.Description      = toreviewentity.Description;
            _vm.Name             = toreviewentity.Name;
            _vm.ToReviewEntityID = toreviewentity.ToReviewEntityID;
            _vm.MsgToClient      = "Reviews ...";

            return(View(_vm));
        }