Example #1
0
        public async Task <IActionResult> GeneralInfo(UpdateEmployeeGeneralInfoQuery query)
        {
            var employeeEntity = await _employeeService.HandleAsync(query);

            var vm = BuildGeneralInfoForm(employeeEntity.Result);

            return(View("FormView", vm));
        }
Example #2
0
        public async Task <QueryExecutionResult <EmployeeEntity> > HandleAsync(UpdateEmployeeGeneralInfoQuery query)
        {
            var employeeEntity = await _repository.FirstAsync(new EmployeeWithIdSpecification(query.EmployeeId));

            var queryExecutionResult = new QueryExecutionResult <EmployeeEntity>(employeeEntity);

            return(queryExecutionResult);
        }
Example #3
0
        public async Task <IActionResult> GeneralInfo(UpdateEmployeeGeneralInfoQuery query, UpdateEmployeeGeneralInfoCommand command)
        {
            if (ModelState.IsValid == false)
            {
                var employeeEntity = command.Adapt <EmployeeEntity>();
                var vm             = BuildGeneralInfoForm(employeeEntity);

                return(PartialView(vm));
            }

            await _employeeService.HandleAsync(command);

            return(RedirectToAction(nameof(Index), new SearchEmployeeQuery(command.EmployeeNo)));
        }
Example #4
0
 private string GeneralInfoUri(UpdateEmployeeGeneralInfoQuery query) => Url.AppUri(nameof(GeneralInfo), nameof(EmployeeController), query);