예제 #1
0
        public ActionResult Create(CandidatePostPlacementViewModel candidatePostPlacementViewModel)
        {
            var organisationId = UserOrganisationId;
            var personnelId    = UserPersonnelId;
            var centreId       = UserCentreId;

            if (ModelState.IsValid)
            {
                candidatePostPlacementViewModel.CandidatePostPlacement.OrganisationId = organisationId;
                candidatePostPlacementViewModel.CandidatePostPlacement.CreatedBy      = personnelId;
                candidatePostPlacementViewModel.CandidatePostPlacement.CentreId       = centreId;
                candidatePostPlacementViewModel.CandidatePostPlacement = _nidanBusinessService.CreateCandidatePostPlacement(organisationId, candidatePostPlacementViewModel.CandidatePostPlacement);
                return(RedirectToAction("Index"));
            }
            candidatePostPlacementViewModel.Companies       = new SelectList(_nidanBusinessService.RetrieveCompanies(organisationId, e => true).ToList(), "CompanyId", "Name");
            candidatePostPlacementViewModel.CompanyBranches = new SelectList(_nidanBusinessService.RetrieveCompanyBranches(organisationId, e => true).ToList(), "CompanyBranchId", "CompanyBranchName");
            return(View(candidatePostPlacementViewModel));
        }