public ActionResult Edit(ProjectType ptype) { if (ModelState.IsValid) { context.Entry(ptype).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } return(View(ptype)); }
public ActionResult Edit(Label label) { if (ModelState.IsValid) { context.Entry(label).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } return(View(label)); }
public ActionResult Edit(Client client) { if (ModelState.IsValid) { var image = WebImage.GetImageFromRequest("UploadedImage"); if (image != null) { client.MainImage = Server.MapPath("/Images/Clients/").SaveImage(image); } context.Entry(client).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } return(View(client)); }