示例#1
0
        public ActionResult Step5(InductionStep5ViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var induction = db.Inductions.Where(x => x.Id == viewModel.Id).FirstOrDefault();

                    // db
                    induction.Step5Signature  = viewModel.Step5Signature;
                    induction.Step5DateSigned = viewModel.Step5DateSigned;
                    db.SaveChanges();

                    // log
                    Helpers.Logging.LogEntry("Induction: Step5 - InductionId: " + viewModel.Id, "", false);

                    return(RedirectToAction("step6", new { guidid = viewModel.GuidId }));
                }
                catch (Exception ex)
                {
                    // log
                    Helpers.Logging.LogEntry("Induction: Step5 - InductionId: " + viewModel.Id, ex.Message, true);
                }
            }

            return(View(viewModel));
        }
示例#2
0
        // step 5

        public ActionResult Step5(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 InductionStep5ViewModel
            {
                Id       = induction.Id,
                GuidId   = induction.GuidId,
                FullName = induction.FullName,
                //
                Step5Signature  = induction.Step5Signature,
                Step5DateSigned = induction.Step5DateSigned
            };

            if (viewModel == null)
            {
                return(HttpNotFound());
            }

            return(View(viewModel));
        }