예제 #1
0
        public ActionResult Create(AssessmentViewModel assessmentViewModel)
        {
            var organisationId = UserOrganisationId;
            var personnelId    = UserPersonnelId;

            if (ModelState.IsValid)
            {
                assessmentViewModel.Assessment.OrganisationId = organisationId;
                assessmentViewModel.Assessment.CreatedBy      = personnelId;
                assessmentViewModel.Assessment = NidanBusinessService.CreateAssessment(organisationId, assessmentViewModel.Assessment);
                return(RedirectToAction("Index"));
            }
            assessmentViewModel.AssessmentTypes = new SelectList(NidanBusinessService.RetrieveAssessmentTypes(organisationId, e => true).ToList());
            assessmentViewModel.Centres         = new SelectList(NidanBusinessService.RetrieveCentres(organisationId, e => true).ToList());
            assessmentViewModel.Courses         = new SelectList(NidanBusinessService.RetrieveCourses(organisationId, e => true).ToList());
            assessmentViewModel.Batches         = new SelectList(NidanBusinessService.RetrieveBatches(organisationId, e => true).ToList());
            return(View(assessmentViewModel));
        }