Esempio n. 1
0
        public IActionResult CreateLeaveInfo([FromBody] LeaveDTO leaveDTO)
        {
            var leave = LeaveAssembler.ToDO(leaveDTO);

            _leaveApplicationService.CreateLeaveInfo(leave);
            return(Ok());
        }
Esempio n. 2
0
        public async Task <IActionResult> Create(LeaveDTO leaveDTO)
        {
            var leaveDO = Mapper.Map <Leave>(leaveDTO);

            try
            {
                await _leaveApplicationService.CreateLeaveInfo(leaveDO);

                return(Ok(new { message = "Create Leave Info Success!" }));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Create Leave Info Error!");
                return(BadRequest(new { message = ErrorMessage }));
            }
        }