string testAccount(string ac, int AccLen) { if (ac == null || ac.Length == 0) { return(null); } if (ac.Length <= AccLen) { var rec = GLAccCache.Get(ac); if (rec != null) { return(rec.KeyStr); } if (ac.Length < AccLen) { rec = GLAccCache.Get(ac.PadLeft(AccLen, '0')); if (rec != null) { return(rec.KeyStr); } } } else { var rec = DebtorCache.Get(ac); if (rec != null) { return(rec.KeyStr); } rec = CreditorCache.Get(ac); if (rec != null) { return(rec.KeyStr); } } faultyAccounts.Add(ac); return(ac); }
private void OKButton_Click(object sender, RoutedEventArgs e) { if (leAccount.Visibility == Visibility.Visible) { if (string.IsNullOrWhiteSpace(leAccount.Text)) { UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("MandatoryField"), (Uniconta.ClientTools.Localization.lookup("Account"))), Uniconta.ClientTools.Localization.lookup("Warning")); return; } DCAccount = cmbDCtype.SelectedIndex == 0 ? (DCAccount)DebtorCache?.Get(Account) : (DCAccount)CreditorCache?.Get(Account); } if (txtVat.Visibility == Visibility.Visible && string.IsNullOrWhiteSpace(leVat.Text)) { UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("MandatoryField"), (Uniconta.ClientTools.Localization.lookup("Vat"))), Uniconta.ClientTools.Localization.lookup("Warning")); return; } this.DialogResult = true; }