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); }
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); }
public void UpdateAddressee(Request request, RequestDetailDto requestDetailDto) { var customer = GetCustomer(request.AddresseeId); if (customer == null) { return; } customer.Address = requestDetailDto.AddresseeAddress; customer.ShortAddress = requestDetailDto.AddresseeShortAddress; }
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)); } }
public async Task <IActionResult> Post([FromBody] RequestDetailDto detailDto) { var result = await _mediator.Send(new Create.Command(detailDto, User.Identity.GetUserId())); return(Ok(result)); }
public async Task <IActionResult> Put(int id, [FromBody] RequestDetailDto detailDto) { var result = await _mediator.Send(new Update.Command(id, detailDto)); return(Ok(result)); }