Exemple #1
0
        public ActionResult Create(int?id)
        {
            var organisationId = UserOrganisationId;

            id = id ?? 0;
            var admission       = _nidanBusinessService.RetrieveAdmissionGrid(organisationId, id.Value, e => true);
            var companies       = _nidanBusinessService.RetrieveCompanies(organisationId, e => true);
            var companyBranches = _nidanBusinessService.RetrieveCompanyBranches(organisationId, e => true);
            var viewModel       = new CandidatePostPlacementViewModel
            {
                AdmissionId            = id.Value,
                BatchId                = admission.BatchId ?? 0,
                CandidateName          = admission.CandidateName,
                Mobile                 = admission.Mobile,
                EmailId                = admission.EmailId,
                Course                 = admission.CourseName,
                Companies              = new SelectList(companies, "CompanyId", "Name"),
                CompanyBranches        = new SelectList(companyBranches, "CompanyBranchId", "CompanyBranchName"),
                CandidatePostPlacement = new CandidatePostPlacement()
                {
                    AdmissionId = id.Value,
                    BatchId     = admission.BatchId ?? 0
                }
            };

            return(View(viewModel));
        }
Exemple #2
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));
        }