public ActionResult Edit([Bind(Include = "Id,Photo,Title")] PhotoArea photoArea)
 {
     if (ModelState.IsValid)
     {
         db.Entry(photoArea).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(photoArea));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Photo,NavItem")] HeaderContent headerContent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(headerContent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(headerContent));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,Title,Content,Date,BigContent")] MainContent mainContent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mainContent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mainContent));
 }
 public ActionResult Edit([Bind(Include = "Id,MainTitle,Title,Content,Icon")] CardBody cardBody)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cardBody).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cardBody));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "Id,Icon,Name")] AmazingFeatures amazingFeatures)
 {
     if (ModelState.IsValid)
     {
         db.Entry(amazingFeatures).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(amazingFeatures));
 }
示例#6
0
        public ActionResult Edit(Page page)
        {
            page.BackgroundImageId = db.Images.FirstOrDefault(p => p.Path == page.BackgroundImage.Path).Id;
            page.BackgroundImage   = null;



            db.Entry(page).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Pages"));
        }