private void ReOpenAllTrans() { CWConfirmationBox dialog = new CWConfirmationBox(Uniconta.ClientTools.Localization.lookup("AreYouSureToContinue"), Uniconta.ClientTools.Localization.lookup("Confirmation"), false); dialog.Closing += async delegate { if (dialog.ConfirmationResult == CWConfirmationBox.ConfirmationResultEnum.Yes) { TransactionAPI transApi = new TransactionAPI(this.api); var masterAccount = dgCreditorTranOpenGrid.masterRecord as DCAccount; if (masterAccount != null) { busyIndicator.IsBusy = true; var errorCodes = await transApi.ReOpenAll(masterAccount, true); busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(errorCodes); if (errorCodes == ErrorCodes.Succes) { InitQuery(); } } } }; dialog.Show(); }
async void Settle() { if (transOpenMaster != null && settles != null && settles.Count > 0) { TransactionAPI transApi = new TransactionAPI(api); var err = await transApi.Settle(transOpenMaster, settles); transOpenMaster = null; settles = null; UtilDisplay.ShowErrorCode(err); InitQuery(); } }
async void Settle(CreditorTransClient trans) { TransactionAPI tranApi = new TransactionAPI(api); ErrorCodes err; if (trans.IsSettled) { err = await tranApi.ReOpen(master, trans); } else { err = await tranApi.ReOpen(trans, master); } if (err != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(err); } else { InitQuery(); } }