public async Task <bool> CreateCustomerCashPayment(GeneralLedgerView ledgerView) { try { GeneralLedger .CreateGeneralLedgerByView(ledgerView) .Apply(); CustomerLedger .Apply(); await CustomerLedger .CreateEntityByGeneralLedgerView(ledgerView); CustomerLedger.Apply(); AccountReceivable .UpdateAccountReceivableByGeneralLedgerView(ledgerView) .Apply(); GeneralLedger .UpdateAccountBalances(ledgerView); return(true); } catch (Exception ex) { throw new Exception("CreateCustomerCashPayment", ex); } }
public bool CreateAccountPayable(GeneralLedgerView ledgerView) { try { GeneralLedger.CreateGeneralLedgerByView(ledgerView).Apply(); Task <GeneralLedgerView> generalLedgerViewTask = Task.Run(async() => await GeneralLedger.Query().GetViewByDocNumber(ledgerView.DocNumber, ledgerView.DocType)); Task.WaitAll(generalLedgerViewTask); SupplierLedgerView supplierLedgerView = applicationViewFactory.MapSupplierLedgerView(generalLedgerViewTask.Result); supplierLedgerView.GeneralLedgerId = generalLedgerViewTask.Result.GeneralLedgerId; SupplierLedger.CreateEntityByView(supplierLedgerView); SupplierLedger.Apply(); SupplierLedger.CreateSupplierLedgerWithGeneralLedgerView(ledgerView).Apply(); AccountPayable.UpdatePayableByLedgerView(ledgerView).Apply(); GeneralLedger.UpdateAccountBalances(ledgerView); return(true); } catch (Exception ex) { throw new Exception("CreateAccountPayable", ex); } }