public string ValidateCreateNewAccount( ICustomerAccountHolder forHolder, string currencyCode, decimal openingBalance, DateTime asOf, string newAccountName) { var rb = new ReasonBuilder(); rb.AppendOnCondition(FindAccounts(forHolder, newAccountName).Count() > 0, "Holder already has Account matching this name"); return(rb.Reason); }
public ICustomerAccount CreateNewAccount( ICustomerAccountHolder forHolder, string currencyCode, [Mask("N")] decimal openingBalance, [Mask("d")] DateTime asOf, [Optionally, Named("Customer's own description")] string customersOwnDescription) { string name = "Customer A/c for " + forHolder.Name; //Code is null because it is set when the customer account is persisted CustomerAccount ca = AccountsService.CreateNewAccount <CustomerAccount>(null, name, AccountTypes.Asset, currencyCode, openingBalance, asOf); ca.AccountHolder = forHolder; ca.Description = customersOwnDescription; return(ca); }
private IQueryable <CustomerAccount> AllAccountsForHolder(ICustomerAccountHolder forHolder) { return(PolymorphicNavigator.FindOwners <CustomerAccountAccountHolderLink, ICustomerAccountHolder, CustomerAccount>(forHolder)); }
public IQueryable <ICustomerAccount> AllAccounts(ICustomerAccountHolder forHolder) { return(AllAccountsForHolder(forHolder)); }
public IQueryable <ICustomerAccount> FindAccounts(ICustomerAccountHolder forHolder, string matchingName) { int c = AllAccountsForHolder(forHolder).Count(); return(AllAccountsForHolder(forHolder).Where(x => x.Description.ToUpper().Contains(matchingName.ToUpper()))); }