Beispiel #1
0
 public ActionResult Edit([Bind(Include = "id,file_name,file_type,file_size,file_path")] Models.File file)
 {
     if (ModelState.IsValid)
     {
         db.Entry(file).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(file));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "id,name")] category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "id,name,surname,age,email,phone")] User_reg user_reg)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user_reg).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user_reg));
 }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "id,category_name,photo,title,author,dates,text,pages,type_id,categoryID")] C_News_category c_News_category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(c_News_category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.categoryID = new SelectList(db.categories, "id", "name", c_News_category.categoryID);
     ViewBag.type_id    = new SelectList(db.types, "id", "name", c_News_category.type_id);
     return(View(c_News_category));
 }