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

                    // db
                    induction.PhysicallyFit                = viewModel.PhysicallyFit;
                    induction.NotTakingMedication          = viewModel.NotTakingMedication;
                    induction.NoMedicalConditions          = viewModel.NoMedicalConditions;
                    induction.ComplyWithGuidelines         = viewModel.ComplyWithGuidelines;
                    induction.NoMentalOrPhysicalConditions = viewModel.NoMentalOrPhysicalConditions;
                    induction.InformSblChanges             = viewModel.InformSblChanges;
                    //
                    induction.Step6Signature  = viewModel.Step6Signature;
                    induction.Step6DateSigned = viewModel.Step6DateSigned;
                    db.SaveChanges();

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

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

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

        public ActionResult Step6(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 InductionStep6ViewModel
            {
                Id       = induction.Id,
                GuidId   = induction.GuidId,
                FullName = induction.FullName,
                //
                PhysicallyFit                = induction.PhysicallyFit,
                NotTakingMedication          = induction.NotTakingMedication,
                NoMedicalConditions          = induction.NoMedicalConditions,
                ComplyWithGuidelines         = induction.ComplyWithGuidelines,
                NoMentalOrPhysicalConditions = induction.NoMentalOrPhysicalConditions,
                InformSblChanges             = induction.InformSblChanges,
                //
                Step6Signature  = induction.Step6Signature,
                Step6DateSigned = induction.Step6DateSigned
            };

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

            return(View(viewModel));
        }