public override async Task <InvoiceView> MapToView(Invoice inputObject) { InvoiceView outObject = mapper.Map <InvoiceView>(inputObject); Task <Supplier> supplierTask = _unitOfWork.supplierRepository.GetEntityById(inputObject?.SupplierId); Task <Customer> customerTask = _unitOfWork.customerRepository.GetEntityById(inputObject?.CustomerId); Task <TaxRatesByCode> taxRatesByCodeTask = _unitOfWork.taxRateByCodeRepository.GetEntityById(inputObject.TaxRatesByCodeId); Task.WaitAll(supplierTask, customerTask, taxRatesByCodeTask); Task <AddressBook> addressBookSupplierTask = _unitOfWork.addressBookRepository.GetEntityById(supplierTask.Result?.AddressId); Task <AddressBook> addressBookCustomerTask = _unitOfWork.addressBookRepository.GetEntityById(customerTask.Result?.AddressId); Task.WaitAll(addressBookSupplierTask, addressBookCustomerTask); outObject.SupplierName = addressBookSupplierTask.Result?.Name; outObject.CustomerName = addressBookCustomerTask.Result?.Name; outObject.TaxCode = taxRatesByCodeTask.Result.TaxCode; List <InvoiceDetailView> viewsList = new List <InvoiceDetailView>(); FluentInvoiceDetail fluentInvoiceDetail = new FluentInvoiceDetail(_unitOfWork); IList <InvoiceDetail> list = await fluentInvoiceDetail.Query().GetEntitiesByInvoiceId(inputObject?.InvoiceId); foreach (var item in list) { viewsList.Add(await fluentInvoiceDetail.Query().MapToView(item)); } outObject.InvoiceDetailViews = viewsList; await Task.Yield(); return(outObject); }
public SupplierInvoiceDetailModule() { unitOfWork = new UnitOfWork(); SupplierInvoiceDetail = new FluentSupplierInvoiceDetail(unitOfWork); Invoice = new FluentInvoice(unitOfWork); InvoiceDetail = new FluentInvoiceDetail(unitOfWork); SupplierInvoice = new FluentSupplierInvoice(unitOfWork); ItemMaster = new FluentItemMaster(unitOfWork); }
public AccountPayableDetailModule() { unitOfWork = new UnitOfWork(); AccountPayableDetail = new FluentAccountPayableDetail(unitOfWork); Invoice = new FluentInvoice(unitOfWork); InvoiceDetail = new FluentInvoiceDetail(unitOfWork); PurchaseOrderDetail = new FluentPurchaseOrderDetail(unitOfWork); PurchaseOrder = new FluentPurchaseOrder(unitOfWork); AccountPayable = new FluentAccountPayable(unitOfWork); }
public InvoiceModule() { unitOfWork = new UnitOfWork(); Invoice = new FluentInvoice(unitOfWork); InvoiceDetail = new FluentInvoiceDetail(unitOfWork); AccountReceivable = new FluentAccountReceivable(unitOfWork); GeneralLedger = new FluentGeneralLedger(unitOfWork); Customer = new FluentCustomer(unitOfWork); Supplier = new FluentSupplier(unitOfWork); AddressBook = new FluentAddressBook(unitOfWork); ContractInvoice = new FluentContractInvoice(unitOfWork); TaxRatesByCode = new FluentTaxRatesByCode(unitOfWork); CustomerLedger = new FluentCustomerLedger(unitOfWork); }
public AccountReceivableDetailModule() { unitOfWork = new UnitOfWork(); AccountReceivableDetail = new FluentAccountReceivableDetail(unitOfWork); AccountReceivable = new FluentAccountReceivable(unitOfWork); Udc = new FluentUdc(unitOfWork); ChartOfAccount = new FluentChartOfAccount(unitOfWork); Invoice = new FluentInvoice(unitOfWork); Customer = new FluentCustomer(unitOfWork); AddressBook = new FluentAddressBook(unitOfWork); PurchaseOrder = new FluentPurchaseOrder(unitOfWork); InvoiceDetail = new FluentInvoiceDetail(unitOfWork); PurchaseOrderDetail = new FluentPurchaseOrderDetail(unitOfWork); ItemMaster = new FluentItemMaster(unitOfWork); }