示例#1
0
        public async Task <int> ExecuteAsync(RequestDetailDto requestDetailDto)
        {
            var request = _mapper.Map <RequestDetailDto, Request>(requestDetailDto);

            var requestRepository = Uow.GetRepository <Request>();
            await requestRepository.CreateAsync(request);

            await Uow.SaveChangesAsync();

            return(request.Id);
        }
示例#2
0
 public async Task Handle(Request request, RequestDetailDto requestDto)
 {
     await ApplyIcgsRequest(request, requestDto.IcgsRequestDtos);
     await ApplyIcisIds(request, requestDto.IcisRequestIds.ToList());
     await ApplyColorIds(request, requestDto.ColorTzIds.ToList());
     await ApplyRequestInfo(requestDto, request);
     await ApplyRequestEarlyRegDtos(request, requestDto.RequestEarlyRegDtos);
     await ApplyIcfemIds(request, requestDto.IcfemIds.ToList());
     await ApplyIpcIds(request, requestDto.IpcIds.ToList(), requestDto.MainIpcId);
     await ApplyRequestConventionInfo(request, requestDto.RequestConventionInfoDtos);
 }
示例#3
0
        public void UpdateAddressee(Request request, RequestDetailDto requestDetailDto)
        {
            var customer = GetCustomer(request.AddresseeId);

            if (customer == null)
            {
                return;
            }

            customer.Address      = requestDetailDto.AddresseeAddress;
            customer.ShortAddress = requestDetailDto.AddresseeShortAddress;
        }
示例#4
0
        private async Task ApplyRequestInfo(RequestDetailDto requestDto, Request request)
        {
            var requestInfo = _mapper.Map <RequestDetailDto, RequestInfo>(requestDto);

            if (requestInfo == null)
            {
                return;
            }
            if (request.RequestInfo == null)
            {
                await Executor.GetCommand <CreateRequestInfoCommand>().Process(c => c.ExecuteAsync(requestInfo));
            }
            else
            {
                await Executor.GetCommand <UpdateRequestInfoCommand>().Process(c => c.ExecuteAsync(requestInfo));
            }
        }
示例#5
0
        public async Task <IActionResult> Post([FromBody] RequestDetailDto detailDto)
        {
            var result = await _mediator.Send(new Create.Command(detailDto, User.Identity.GetUserId()));

            return(Ok(result));
        }
示例#6
0
        public async Task <IActionResult> Put(int id, [FromBody] RequestDetailDto detailDto)
        {
            var result = await _mediator.Send(new Update.Command(id, detailDto));

            return(Ok(result));
        }