Example #1
0
        public async Task <IActionResult> AddClientType([FromBody] ClientTypeDTO clientType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid model"));
            }

            var result = await clientTypeService.AddClientTypeAsync(clientType);

            return(Json(result));
        }
Example #2
0
        public async Task <RequestResultDTO> UpdateClientTypeAsync(ClientTypeDTO clientTypeDTO)
        {
            try
            {
                var clientType = mapper.Map <ClientType>(clientTypeDTO);
                await unitOfWork.ClientTypeRepository.UpdateAsync(clientType);

                return(new RequestResultDTO());
            }
            catch (Exception ex)
            {
                return(ex.RequestResult());
            }
        }
Example #3
0
        public async Task <IActionResult> UpdateClientType([FromBody] ClientTypeDTO clientType)
        {
            var result = await clientTypeService.UpdateClientTypeAsync(clientType);

            return(Json(result));
        }