public ActionResult Create(InterviewStatus interviewstatus) { if (ModelState.IsValid) { db.InterviewStatus.Add(interviewstatus); try { db.SaveChanges(); } catch (Exception e) { Session["FlashMessage"] = "Failed to create status." + e.Message; return View(interviewstatus); } return RedirectToAction("Index"); } return View(interviewstatus); }
public ActionResult Edit(InterviewStatus interviewstatus) { if (ModelState.IsValid) { db.Entry(interviewstatus).State = EntityState.Modified; try { db.SaveChanges(); } catch (Exception e) { Session["FlashMessage"] = "Failed to edit status." + e.Message; return View(interviewstatus); } return RedirectToAction("Index"); } return View(interviewstatus); }