Exemplo n.º 1
0
        public async Task <SupplierDocumentRespObj> Handle(GetSupplierDocumentQuery request, CancellationToken cancellationToken)
        {
            var supplier = await _supRepo.GetSupplierDocumentAsync(request.SupplierDocumentId);

            var docs = await _serverRequest.GetAllDocumentsAsync();

            var itemList = new List <cor_supplierdocument>();

            itemList.Add(supplier);
            var resp = _mapper.Map <List <SupplierDocumentObj> >(itemList);

            foreach (var item in resp)
            {
                item.Name = docs.commonLookups.FirstOrDefault(a => a.LookupId == item.DocumentId)?.LookupName;
            }
            return(new SupplierDocumentRespObj
            {
                SupplierDocument = resp,
                Status = new APIResponseStatus
                {
                    IsSuccessful = true,
                    Message = new APIResponseMessage
                    {
                        FriendlyMessage = supplier == null ? "Search Complete!! No Record Found" : null
                    }
                }
            });
        }
Exemplo n.º 2
0
 public async Task <CommonLookupRespObj> Handle(GetAllDocumenttypesQuery request, CancellationToken cancellationToken)
 {
     return(await _serverRequest.GetAllDocumentsAsync());
 }