Exemplo n.º 1
0
        public ActionResult Detail(Guid id, string resumeGUID)
        {
            try
            {
                if (resumeGUID == null || string.IsNullOrWhiteSpace(resumeGUID))
                {
                    resumeGUID = "6257B7B5-C4D0-4D00-ACB4-350A95861B7F";
                }

                var                 viewModel       = new EducationDetailsViewModel();
                Repository          _repositoryMain = new Repository(_connectionString);
                EducationRepository _repository     = new EducationRepository(_connectionString);

                Applicant        applicant = _repositoryMain.GetApplicant(resumeGUID);
                EducationItem    education = _repository.GetEducationDetails(resumeGUID, id);
                List <MinorItem> minorList = _repository.GetMinorList(id);

                if (education.IsGraduated == true)
                {
                    viewModel.Graduated = "Graduated";
                }
                else
                {
                    viewModel.Graduated = "Did not Graduate";
                }

                viewModel.Title     = "Richard M. Cano Resume";
                viewModel.Applicant = applicant;
                viewModel.Education = education;
                viewModel.MinorList = minorList;
                viewModel.Applicant = applicant;

                return(View(viewModel));
            }
            catch (InvalidCastException e)
            {
                throw (e);
                //return View("Error");
            }
        }