public Account GetAccount(Guid WorkDoneItemId) { var inv = GetOpportunity(WorkDoneItemId); var acc = Context.Accounts.Single(a => a.Id == inv.AccountId); return(AccountConverter.ToDomain(acc)); }
public IEnumerable <Account> GetNewAccounts() { return((from a in Context.Accounts where a.Created > Context.NewDate orderby a.Name ascending select AccountConverter.ToDomain(a)).AsEnumerable()); }
public IEnumerable <Account> GetActiveAccounts() { return((from a in Context.Accounts join i in Context.Invoices on a.Id equals i.AccountId where i.InvoiceDate > Context.ActiveDate orderby a.Name ascending select AccountConverter.ToDomain(a)).Distinct().AsEnumerable()); }
public Account GetItem(Guid id) { var account = (from a in Context.Accounts where a.Id == id select AccountConverter.ToDomain(a)).Single(); account.Invoices = GetInvoices(id, Context.ActiveDate); account.Opportunities = GetNewAndActiveOpportunities(id, Context.NewDate, Context.ActiveDate); return(account); }
public Account GetParent(Guid id) { var parentId = Context.Opportunities.Single(o => o.Id == id).AccountId; return(AccountConverter.ToDomain(Context.Accounts.Single(a => a.Id == parentId))); }