public async Task <IActionResult> OnPostAsync() { var dto = ObjectMapper.Map <EmployeeCreateViewModel, EmployeeCreateDto>(Employee); dto.IsGregorianCalendar = Employee.Calendar == Calendar.GregorianCalendar ? true : false; await _employeeAppService.CreateAsync(dto); return(NoContent()); }
private async Task CreateOrModifyEmployee(EmployeeRequestDto employeeRequestDto) { if (employeeRequestDto.OperationStatus == OperationModel.Create) { employeeRequestDto.Salt = Utils.Number(8); employeeRequestDto.Password = AESCryption.EncryptText(employeeRequestDto.Password, employeeRequestDto.Salt); await _employeeAppService.CreateAsync(employeeRequestDto); } else if (employeeRequestDto.OperationStatus == OperationModel.Modify) { await _employeeAppService.ModifyAsync(employeeRequestDto); } }
public virtual async Task <EmployeeListDto> CreateAsync(EmployeeCreateDto input) { return(await _employeeAppService.CreateAsync(input)); }