Ejemplo n.º 1
0
        public PreviousEmploymentDetails InsertPreviousEmployment(PreviousEmploymentDetails previousEmploymentDetails, int candidateId)
        {
            if (!string.IsNullOrEmpty(previousEmploymentDetails.PreviousEmployment1?.OrganizationName))
            {
                CandidateRepository.InsertEmploymentDetails(ConvertToEmploymentDetailsEntity(previousEmploymentDetails.PreviousEmployment1, candidateId));
            }
            if (!string.IsNullOrEmpty(previousEmploymentDetails.PreviousEmployment2?.OrganizationName))
            {
                CandidateRepository.InsertEmploymentDetails(ConvertToEmploymentDetailsEntity(previousEmploymentDetails.PreviousEmployment2, candidateId));
            }

            return(previousEmploymentDetails);
        }
        public ActionResult Create(PreviousEmploymentDetails previousEmploymentDetails)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                var candidateId = Session["candidateId"];

                var result = CandidateService.InsertPreviousEmployment(previousEmploymentDetails, Convert.ToInt32(candidateId));

                return(RedirectToAction("Create", "References"));
            }
            catch (Exception exception)
            {
                return(View());
            }
        }