public List <Transaction> getTransactions(int Account_id, DateTime date, TransacFilter filter) { if (filter == TransacFilter.ALL) { return(bdd.Transaction.Where(t => t.account_id == Account_id && t.date >= date).ToList()); } bool bool_filter = (filter == TransacFilter.VALIDATED) ? true : false; return(bdd.Transaction.Where(t => t.account_id == Account_id && t.date >= date && t.validated == bool_filter).ToList()); }
public List <Transaction> getTransactions(int Account_id, string name, TransacFilter filter) { if (filter == TransacFilter.ALL) { return(bdd.Transaction.Where(t => t.account_id == Account_id && t.name.Contains(name)).ToList()); } bool bool_filter = (filter == TransacFilter.VALIDATED) ? true : false; return(bdd.Transaction.Where(t => t.account_id == Account_id && t.name.Contains(name) && t.validated == bool_filter).ToList()); }
public List <Transaction> getTransactions(TransacFilter filter) { if (filter == TransacFilter.ALL) { return(bdd.Transaction.ToList()); } bool bool_filter = (filter == TransacFilter.VALIDATED) ? true : false; return(bdd.Transaction.Where(t => t.validated == bool_filter).ToList()); }