Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "CategoryId,Name,Description")] Categories categories)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categories));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "UserId,Name,Email,Bio")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(users));
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "PortfolioId,Title,Description,UserId,CategoryId,Image,Imagedescription,pContent")] Portfolio portfolio)
 {
     if (ModelState.IsValid)
     {
         db.Entry(portfolio).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "Name", portfolio.CategoryId);
     ViewBag.UserId     = new SelectList(db.Users, "UserId", "Name", portfolio.UserId);
     return(View(portfolio));
 }