Пример #1
0
        public ExpenseEntryCollection FetchByQuery(Query qry)
        {
            ExpenseEntryCollection coll = new ExpenseEntryCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Пример #2
0
        public ExpenseEntryCollection FetchAll()
        {
            ExpenseEntryCollection coll = new ExpenseEntryCollection();
            Query qry = new Query(ExpenseEntry.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Пример #3
0
 public Double GetTotalByBillingPeriodAccountID(Int32 BillingPeriodAccountID)
 {
     Double total = 0;
     ExpenseEntryCollection col = this.FetchAll().Where(ExpenseEntry.Columns.IsDeleted, false);
     var allTimesheets = new TimesheetController().FetchAll();
     foreach (ExpenseEntry expenseentry in col)
     {
         var timesheet = allTimesheets.FirstOrDefault(x => x.Id == expenseentry.Timesheetid);
         if (timesheet != null && timesheet.Periodaccountid == BillingPeriodAccountID &&
             expenseentry.IsDeleted == false)
             total += expenseentry.Cost;
     }
     return total;
 }
Пример #4
0
 public ExpenseEntryCollection FetchByTimesheetID(int timesheetid)
 {
     ExpenseEntryCollection coll = new ExpenseEntryCollection().Where(ExpenseEntry.Columns.Timesheetid, timesheetid).OrderByAsc(ExpenseEntry.Columns.Expensedate).Load();
     return coll;
 }
Пример #5
0
        public ExpenseEntryCollection FetchByID(object Id)
        {
            ExpenseEntryCollection coll = new ExpenseEntryCollection().Where("id", Id).Load();

            return(coll);
        }