public ActionResult Step7(InductionStep7ViewModel viewModel) { if (ModelState.IsValid) { try { var induction = db.Inductions.Where(x => x.Id == viewModel.Id).FirstOrDefault(); // db induction.Step7Signature = viewModel.Step7Signature; induction.Step7DateSigned = viewModel.Step7DateSigned; db.SaveChanges(); // log Helpers.Logging.LogEntry("Induction: Step7 - InductionId: " + viewModel.Id, "", false); return(RedirectToAction("step8", new { guidid = viewModel.GuidId })); } catch (Exception ex) { // log Helpers.Logging.LogEntry("Induction: Step7 - InductionId: " + viewModel.Id, ex.Message, true); } } return(View(viewModel)); }
// step 7 public ActionResult Step7(string guidid) { if (!db.Inductions.Where(x => x.GuidId == guidid).Any()) { return(RedirectToAction("index")); } var induction = db.Inductions.Where(x => x.GuidId == guidid).FirstOrDefault(); var viewModel = new InductionStep7ViewModel { Id = induction.Id, GuidId = induction.GuidId, FullName = induction.FullName, // Step7Signature = induction.Step7Signature, Step7DateSigned = induction.Step7DateSigned }; if (viewModel == null) { return(HttpNotFound()); } return(View(viewModel)); }