Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "ColorId,Color1")] Color color)
 {
     if (ModelState.IsValid)
     {
         db.Entry(color).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(color));
 }
Ejemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "CategoryId,Name")] Category category)
        {
            if (ModelState.IsValid)
            {
                db.Entry(category).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return(Redirect("Index"));
            }

            return(View(category));
        }
 public ActionResult Edit([Bind(Include = "NewsId,UserId,Title,ShortDescription,Content,CreatedDate,Status,Image")] News news)
 {
     if (ModelState.IsValid)
     {
         db.Entry(news).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Users, "UserId", "UserName", news.UserId);
     return(View(news));
 }