예제 #1
0
        public async Task <IActionResult> OnGet(int id)
        {
            try
            {
                var trainee = await _traineeService.GetTraineeById(id);

                if (trainee == null)
                {
                    return(NotFound());
                }

                Input = new InputModel()
                {
                    TraineeId   = trainee.TraineeId,
                    Address     = trainee.Address,
                    DoB         = trainee.DoB,
                    Email       = trainee.Email,
                    PhoneHome   = trainee.PhoneHome,
                    PhoneMobile = trainee.PhoneMobile,
                    FullName    = trainee.FullName,
                    GenderId    = trainee.GenderId,
                    Gender      = (await _genderService.GetGenders()).Select(p => SelectListFactory.Create(p))
                };

                return(Page());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
        public async Task <IActionResult> OnGet(int id)
        {
            try
            {
                var training = await _trainingService.GetTrainingById(id);

                if (training == null)
                {
                    return(NotFound());
                }

                Input = new InputModel()
                {
                    TrainingId = training.TrainingId,
                    Courses    = (await _courseService.GetCourses()).Select(p => SelectListFactory.Create(p)),
                    CourseId   = training.CourseId,
                    StartDate  = training.StartDate,
                    EndDate    = training.EndDate
                };
                return(Page());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #3
0
        public async Task <IActionResult> OnGet()
        {
            Input = new InputModel()
            {
                Gender = (await _genderService.GetGenders()).Select(p => SelectListFactory.Create(p))
            };

            return(Page());
        }
예제 #4
0
        public async Task <IActionResult> OnGet()
        {
            Input = new InputModel()
            {
                Courses = (await _courseService.GetCourses()).Select(p => SelectListFactory.Create(p))
            };

            return(Page());
        }