예제 #1
0
 public ActionResult Edit([Bind(Include = "id,fullname,email,password,profil_picture,bio")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,username,password")] Admin admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(admin));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "id,kateqoriya_name")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "id,title,text,date,read_count,user_id,kateqoriya_id")] Source source)
 {
     if (ModelState.IsValid)
     {
         db.Entry(source).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.user_id = new SelectList(db.Users, "id", "fullname", source.user_id);
     return(View(source));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "id,comment1,user_id,topic_id")] Comment comment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.topic_id = new SelectList(db.Sources, "id", "title", comment.topic_id);
     ViewBag.user_id  = new SelectList(db.Users, "id", "fullname", comment.user_id);
     return(View(comment));
 }
예제 #6
0
 public ActionResult Edit([Bind(Include = "id,like_count,dislike_count,user_id,topic_id")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.topic_id = new SelectList(db.Sources, "id", "title", review.topic_id);
     ViewBag.user_id  = new SelectList(db.Users, "id", "fullname", review.user_id);
     return(View(review));
 }
예제 #7
0
 public ActionResult Edit([Bind(Include = "id,kateqoriya_id,topic_id")] RelCatAndSor relCatAndSor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(relCatAndSor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.kateqoriya_id = new SelectList(db.Categories, "id", "kateqoriya_name", relCatAndSor.kateqoriya_id);
     ViewBag.topic_id      = new SelectList(db.Sources, "id", "title", relCatAndSor.topic_id);
     return(View(relCatAndSor));
 }