void LoadOrgs() { try { CashMode mode = FilterSuppliers.IsChecked == true ? CashMode.Expense : CashMode.Neutral; switch (mode) { case CashMode.Expense: textAccountCode.ItemsSource = tcBitcoin.NodeCash.vwOrgLists .Where(tb => tb.CashModeCode == (short)mode && (tb.OrganisationStatusCode == 1 || tb.OrganisationStatusCode == 2)) .OrderBy(tb => tb.AccountCode) .Select(account => TCBitcoin.EmbedKey(account.AccountCode, $"{account.AccountName} ({account.OrganisationType})")) .ToList(); break; default: textAccountCode.ItemsSource = tcBitcoin.NodeCash.vwOrgLists .OrderBy(tb => tb.AccountCode) .Select(account => TCBitcoin.EmbedKey(account.AccountCode, $"{account.AccountName} ({account.OrganisationType})")) .ToList(); break; } } catch (Exception err) { MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error); } }
public InvoicesControl(TreeView treeView, TCBitcoin bitcoin, CashMode cashMode) { tvWallet = treeView; tcBitcoin = bitcoin; Polarity = cashMode; InitializeComponent(); }
public InvoiceType GetInvoiceType(CashMode invoicePolarity, CashMode paymentPolarity) { switch (invoicePolarity) { case CashMode.Expense: return(paymentPolarity == CashMode.Expense ? InvoiceType.PurchaseInvoice : InvoiceType.DebitNote); case CashMode.Income: return(paymentPolarity == CashMode.Income ? InvoiceType.SalesInvoice : InvoiceType.CreditNote); default: return(InvoiceType.SalesInvoice); } }