public ActionResult DeleteConfirmed(int id) { ProcessPerspectiveViewModel processPerspectiveViewModel = db.ProcessPerspectiveViewModels.Find(id); db.ProcessPerspectiveViewModels.Remove(processPerspectiveViewModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Description")] ProcessPerspectiveViewModel processPerspectiveViewModel) { if (ModelState.IsValid) { db.Entry(processPerspectiveViewModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(processPerspectiveViewModel)); }
public ActionResult Create(ProcessPerspectiveViewModel processPerspective) { if (ModelState.IsValid) { var procModel = AutoMapper.Mapper.Map <ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective); this.processPerspectiveService.Add(procModel); } return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,Name,Description")] ProcessPerspectiveViewModel processPerspectiveViewModel) { if (ModelState.IsValid) { db.ProcessPerspectiveViewModels.Add(processPerspectiveViewModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(processPerspectiveViewModel)); }
// GET: ProcessPerspectiveViewModels/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProcessPerspectiveViewModel processPerspectiveViewModel = db.ProcessPerspectiveViewModels.Find(id); if (processPerspectiveViewModel == null) { return(HttpNotFound()); } return(View(processPerspectiveViewModel)); }
public ActionResult Edit(int id, ProcessPerspectiveViewModel processPerspective) { try { if (ModelState.IsValid) { var procModel = AutoMapper.Mapper.Map <ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective); this.processPerspectiveService.Update(procModel); } return(RedirectToAction("Index")); } catch { return(View()); } }