Ejemplo n.º 1
0
        public Opportunity GetOpportunity(Guid workDoneItemId)
        {
            var inv = GetInvoice(workDoneItemId);
            var opp = Context.Opportunities.Single(o => o.Id == inv.OpportunityId);

            return(OpportunityConverter.ToDomainObject(opp));
        }
Ejemplo n.º 2
0
 private IEnumerable <Opportunity> GetNewOpportunities(Guid accountId, DateTime createdAfter)
 {
     return((from o in Context.Opportunities
             where o.Created > createdAfter &&
             o.AccountId == accountId
             orderby o.Name ascending
             select OpportunityConverter.ToDomainObject(o)).AsEnumerable());
 }
Ejemplo n.º 3
0
        public Opportunity GetItem(Guid id)
        {
            var entity = Context.Opportunities.Single(o => o.Id == id);
            var opp    = OpportunityConverter.ToDomainObject(entity);

            opp.Invoices = GetInvoices(id);

            return(opp);
        }
Ejemplo n.º 4
0
 private IEnumerable <Opportunity> GetActiveOpportunities(Guid accountId, DateTime invoicesFrom)
 {
     return((from o in Context.Opportunities
             join i in Context.Invoices
             on o.Id equals i.OpportunityId
             where i.InvoiceDate > invoicesFrom &&
             o.AccountId == accountId
             orderby o.Name ascending
             select OpportunityConverter.ToDomainObject(o)).Distinct().AsEnumerable());
 }