//GET: Admin/Pages/EditSlidebar
        public ActionResult EditSlidebar()
        {
            SlidebarVM model;

            using (Db db = new Db())
            {
                SlidebarDTO dto = db.Slidebar.Find(1);

                model = new SlidebarVM(dto);
            }

            return(View(model));
        }
        public ActionResult EditSlidebar(SlidebarVM model)
        {
            using (Db db = new Db())
            {
                SlidebarDTO dto = db.Slidebar.Find(1);

                dto.Body = model.Body;

                db.SaveChanges();
            }
            TempData["SM"] = "You have edited the slidebar";
            return(RedirectToAction("EditSlidebar"));
        }
示例#3
0
 public SlidebarVM(SlidebarDTO row)
 {
     Id   = row.Id;
     Body = row.Body;
 }