public ActionResult Edit([Bind(Include = "CategoryId,CategoryName")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "LabelId,LabelName")] Labels labels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(labels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(labels));
 }
 public ActionResult Edit([Bind(Include = "AuthorityId,Authority1")] Authority authority)
 {
     if (ModelState.IsValid)
     {
         db.Entry(authority).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(authority));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "UserId,AuthorityId,UserName,Password,Email,Name,Images")] Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AuthorityId = new SelectList(db.Authority, "AuthorityId", "Authority1", users.AuthorityId);
     return(View(users));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "ArticleId,CategoryId,Baslik,ImageUrl,ImageUrlt,Description,Date,Reads,UserId")] Article article)
 {
     if (ModelState.IsValid)
     {
         db.Entry(article).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Category, "CategoryId", "CategoryName", article.CategoryId);
     return(View(article));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "ComentId,ArticleId,UserId,Description,Date")] Comments comments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArticleId = new SelectList(db.Article, "ArticleId", "Baslik", comments.ArticleId);
     ViewBag.UserId    = new SelectList(db.Users, "UserId", "UserName", comments.UserId);
     return(View(comments));
 }