Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 public virtual async Task <EmployeeListDto> CreateAsync(EmployeeCreateDto input)
 {
     return(await _employeeAppService.CreateAsync(input));
 }