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); } }
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); } }
public async Task <IActionResult> OnGet() { Input = new InputModel() { Gender = (await _genderService.GetGenders()).Select(p => SelectListFactory.Create(p)) }; return(Page()); }
public async Task <IActionResult> OnGet() { Input = new InputModel() { Courses = (await _courseService.GetCourses()).Select(p => SelectListFactory.Create(p)) }; return(Page()); }