Ejemplo n.º 1
0
        public async Task <AppResponse <long> > CreateComplaintAsync(CreateComplaintInput input)
        {
            bool isSurgeryExist = await _systemtLookupsManager.IsComplaintExistAsync(input.Name);

            if (isSurgeryExist)
            {
                return new AppResponse <long>
                       {
                           IsSuccessful      = false,
                           StatusCode        = StatusCodes.ENTITY_ALREADY_EXIST,
                           StatusDescription = L("ComplaintExist")
                       }
            }
            ;

            long id = await _systemtLookupsManager.CreatComplaintAsync(input);

            return(new AppResponse <long>
            {
                Data = id,
                IsSuccessful = true,
                StatusCode = StatusCodes.SUCCESS,
                StatusDescription = L("Created")
            });
        }
Ejemplo n.º 2
0
        public async Task <long> CreatComplaintAsync(CreateComplaintInput input)
        {
            var record = _mapper.Map <SystemComplaint>(input);

            record.CreatorUserId = _abpSession.GetUserId();

            await _complaintRepository.InsertAsync(record);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(record.Id);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> CreateComplaintAsync([FromBody] CreateComplaintInput input)
        {
            AppResponse <long> response = await _systemLookupsService.CreateComplaintAsync(input);

            return(Ok(response));
        }