public ActionResult Edit([Bind(Include = "Id,Email,Address,Phone")] Contact contact)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contact).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(contact));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] UserType userType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userType));
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "Id,Title,Image,About")] Blog blog, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         blog.Image           = Comman.WorkWithFile.Upload("~/Uploads/", file);
         db.Entry(blog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(blog));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,UserTypeId,Email,Password")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserTypeId = new SelectList(db.UserTypes, "Id", "Name", user.UserTypeId);
     return(View(user));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,About,Image")] Fermer fermer, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         fermer.Image           = Comman.WorkWithFile.Upload("~/Uploads/", file);
         db.Entry(fermer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fermer));
 }
Esempio n. 6
0
 public ActionResult Edit([Bind(Include = "Id,Name,CategoryId,About,Price,Description,BoxOrNot")] Product product, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         product.Image           = Comman.WorkWithFile.Upload("~/Uploads/", file);
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", product.CategoryId);
     return(View(product));
 }
 public ActionResult Edit([Bind(Include = "id,Name,Image,Size,ProductID")] BoxContain boxContain, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         boxContain.Image           = Comman.WorkWithFile.Upload("~/Uploads", file);
         db.Entry(boxContain).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductID = new SelectList(db.Products, "Id", "Name", boxContain.ProductID);
     return(View(boxContain));
 }