public static IEnumerable <Payment> GetSundryPaymentsFromDate(DateTime fromDate) { var db = new LA_Entities(); var payments = (from p in db.Payments where p.IsSundry && p.Timestamp >= fromDate orderby p.Timestamp descending, p.Account.Customer.Surname select p).ToList(); return(payments); }
public List <Account> GetAccountsForCollection(DateTime collectionDay) { var db = new LA_Entities(); var accounts = (from a in db.Accounts where a.Customer.Collector_Id == Id && ( (int)collectionDay.DayOfWeek == a.Customer.PreferredDay || collectionDay == a.NextPaymentDate ) select a).ToList(); return(accounts); }