예제 #1
0
 public IEnumerable <ReportProfitItem> GetProfitData()
 {
     return(from a in accounts
            join p in allocations on a.Id equals p.AccountId
            select new ReportProfitItem
     {
         Account = AccountConverter.ConvertToDomain(a),
         Allocation = AllocationConverter.ConvertToDomain(p),
         WorkDoneMargin = GetWorkDoneMargin(a.Id, GetMonthStart(p.Month))
     });
 }
예제 #2
0
 public IEnumerable <ReportWorkDoneItem> GetWorkDoneItems()
 {
     return(from a in accounts
            join i in invoices on a.Id equals i.AccountId
            join w in workDoneItems on i.Id equals w.InvoiceId
            where (bool)w.Active && (bool)i.Active
            select new ReportWorkDoneItem
     {
         Account = AccountConverter.ConvertToDomain(a),
         Invoice = InvoiceConverter.ConvertToDomain(i),
         WorkDoneItem = WorkDoneItemConverter.ConvertToDomain(w)
     });
 }