Example #1
0
        public ActionResult Step9(InductionStep9ViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var induction = db.Inductions.Where(x => x.Id == viewModel.Id).FirstOrDefault();

                    // db
                    induction.Step9Signature  = viewModel.Step9Signature;
                    induction.Step9DateSigned = viewModel.Step9DateSigned;
                    //
                    induction.Status = "Pending";
                    induction.Active = true;
                    //
                    db.SaveChanges();

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

                    return(RedirectToAction("thankyou"));
                }
                catch (Exception ex)
                {
                    // log
                    Helpers.Logging.LogEntry("Induction: Step9 - InductionId: " + viewModel.Id, ex.Message, true);
                }
            }

            return(View(viewModel));
        }
Example #2
0
        // step 9

        public ActionResult Step9(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 InductionStep9ViewModel
            {
                Id       = induction.Id,
                GuidId   = induction.GuidId,
                FullName = induction.FullName,
                //
                Step9Signature  = induction.Step9Signature,
                Step9DateSigned = induction.Step9DateSigned
            };

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

            return(View(viewModel));
        }