Exemplo n.º 1
0
        public ActionResult Step8(InductionStep8ViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var induction = db.Inductions.Where(x => x.Id == viewModel.Id).FirstOrDefault();

                    // db
                    induction.Step8Signature  = viewModel.Step8Signature;
                    induction.Step8DateSigned = viewModel.Step8DateSigned;
                    db.SaveChanges();

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

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

            return(View(viewModel));
        }
Exemplo n.º 2
0
        // step 8

        public ActionResult Step8(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 InductionStep8ViewModel
            {
                Id       = induction.Id,
                GuidId   = induction.GuidId,
                FullName = induction.FullName,
                //
                Step8Signature  = induction.Step8Signature,
                Step8DateSigned = induction.Step8DateSigned
            };

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

            return(View(viewModel));
        }