public PersonalInformationEntity InsertCandidate(PersonalInformationEntity personalInformation) { var candidate = ConvertToServiceEntity(personalInformation); var candidateId = CandidateRepository.InsertCandidate(candidate); InsertDependents(personalInformation, candidateId); //InsertEmploymentDetails(candidateDisplayEntity, candidateId); //InsertMonthlyEmoluments(candidateDisplayEntity, candidateId); personalInformation.CandidateId = candidateId; return(personalInformation); }
private CandidateDependents ConvertToDependentsEntity(PersonalInformationEntity personalInformation, int candidateId) { return(new CandidateDependents() { CandidateId = candidateId, FatherBirthDate = personalInformation.FatherBirthDate, FatherName = personalInformation.FatherName, MotherName = personalInformation.MotherName, MotherBirthDate = personalInformation.MotherBirthDate, SpouseName = personalInformation.SpouseName, SpouseBirthDate = personalInformation.SpouseBirthDate, FirstChildName = personalInformation.FirstChildName, FirstChildBirthDate = personalInformation.FirstChildBirthDate, SecondChildName = personalInformation.SecondChildName, SecondChildBirthDate = personalInformation.SecondChildBirthDate }); }
public ActionResult Create(PersonalInformationEntity personalInformation) { try { if (!ModelState.IsValid) { return(View()); } var result = CandidateService.InsertCandidate(personalInformation); Session["candidateId"] = result.CandidateId; return(RedirectToAction("Create", "ContactInfo", result.CandidateId)); } catch (Exception exception) { return(View()); } }
//public List<CandidateDisplayEntity> GetCandidateDetails(int candidateId) //{ // throw new NotImplementedException(); //} private Candidate ConvertToServiceEntity(PersonalInformationEntity candidate) { return(new Candidate() { Prefix = candidate.Prefix, FirstName = candidate.FirstName, MiddleName = candidate.MiddleName, LastName = candidate.LastName, BirthDate = candidate.BirthDate, Anniversary = candidate.AnniversaryDate, Gender = candidate.Gender, MaritalStatus = candidate.MaritalStatus, Qualification = candidate.Qualification, WorkExperience = candidate.WorkExperience, PanCardNumber = candidate.PanCardNumber, AadharCardNumber = candidate.AadharCardNumber, UanNumber = candidate.UanNumber, PassportNumber = candidate.PassportNumber, PassportExpiry = candidate.PassportExpiry, PassportIssuePlace = candidate.PassportIssuePlace, VisaExpiry = candidate.VisaExpiry, Visa = candidate.Visa }); }
public bool UpdateCandidate(PersonalInformationEntity personalInformation) { throw new NotImplementedException(); }
private void InsertDependents(PersonalInformationEntity personalInformation, int candidateId) { CandidateRepository.InsertDependents(ConvertToDependentsEntity(personalInformation, candidateId)); }