Exemple #1
0
 public ActionResult AddEducation(EducationalDetails rowData)
 {
     return(Content("Save"));
 }
Exemple #2
0
        public async Task <ActionResult> Register([FromBody] ApplicantVM model)
        {
            Biodata biodata = new Biodata();

            biodata.IdCard        = model.IdCard;
            biodata.FirstName     = model.FirstName;
            biodata.LastName      = model.LastName;
            biodata.PlaceOfDate   = model.PlaceOfDate;
            biodata.BirthDate     = model.BirthDate;
            biodata.Religion      = model.Religion;
            biodata.Gender        = model.Gender;
            biodata.PhoneNumber   = model.PhoneNumber;
            biodata.Address       = model.Address;
            biodata.MaritalStatus = model.MaritalStatus;
            var result1 = await _biodataRepository.PostAsync(biodata);

            EducationalDetails education = new EducationalDetails();

            education.Level          = model.Level;
            education.Name           = model.Name;
            education.Majors         = model.Majors;
            education.YearOfEntry    = model.YearOfEntry;
            education.GraduationYear = model.GraduationYear;
            education.Place          = model.Place;
            education.FinalValue     = model.FinalValue;
            var result2 = await _educationalDetailsRepository.PostAsync(education);

            WorkExperience workexp = new WorkExperience();

            workexp.CompanyName        = model.CompanyName;
            workexp.LastPosition       = model.LastPosition;
            workexp.TypeOfBussiness    = model.TypeOfBussiness;
            workexp.YearStartedWorking = model.YearStartedWorking;
            workexp.YearOfResign       = model.YearOfResign;
            workexp.LastSalary         = model.LastSalary;
            var result3 = await _workExperienceRepository.PostAsync(workexp);

            Document document = new Document();

            document.fIdCard      = model.fIdCard;
            document.fResume      = model.fResume;
            document.fCV          = model.fCV;
            document.fFamilyCard  = model.fFamilyCard;
            document.fTranscripts = model.fTranscripts;
            document.fDiploma     = model.fDiploma;
            document.fCertificate = model.fCertificate;
            var result4 = await _documentRepository.PostAsync(document);

            if (result1 != null && result2 != null && result3 != null && result4 != null)
            {
                Applicant applicant = new Applicant();
                applicant.Biodata_Id            = biodata.Id;
                applicant.EducationalDetails_Id = education.Id;
                applicant.Document_Id           = document.Id;
                applicant.WorkExperience_Id     = workexp.Id;
                applicant.User_Id = model.User_Id;
                await _applicantRepository.PostAsync(applicant);

                return(Ok("Registered Applicant Success!"));
            }
            else
            {
                return(BadRequest("Failed to register!"));
            }
        }