public IList find(QueryObject qo) { try { ArrayList array = new ArrayList(); SqlDataReader reader = null; SqlConnection connection = UnitOfWork.Instance.Connection; connection.Open(); string sqlStmt = "SELECT * from Persons WHERE " + qo.ToString(); SqlCommand command = new SqlCommand(sqlStmt, connection); reader = command.ExecuteReader(); while(reader.Read()) { array.Add(loadFields(reader)); } if(reader != null) reader.Close(); connection.Close(); return array; } catch(SqlException sqle) { throw new ApplicationException(sqle.Message); } catch(Exception e) { throw new ApplicationException(e.Message); } }
public override IList findByName(String name) { QueryObject qo = new QueryObject(); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "LastName", name)); return Registry.Instance.getMapper(typeof(Employee)).find(qo); }
public IList find(QueryObject qo) { return Registry.Instance.getMapper(typeof(Employee)).find(qo); }
public override IList findByCategory(String category) { QueryObject qo = new QueryObject(); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "Category", category)); return Registry.Instance.getMapper(typeof(Product)).find(qo); }
public override IList findByPlz(String name) { QueryObject qo = new QueryObject(); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "PostalCode", name)); return Registry.Instance.getMapper(typeof(Address)).find(qo); }
public IList find(QueryObject qo) { return Registry.Instance.getMapper(typeof(OrderDetail)).find(qo); }
public override IList findByOrderDate(DateTime orderDate) { QueryObject qo = new QueryObject(); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "OrderDate", orderDate)); return Registry.Instance.getMapper(typeof(Order)).find(qo); }
public override IList findByNameAndPassword(String name, String password) { QueryObject qo = new QueryObject(); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "Password", password)); qo.addCriteria(new Criteria(Criteria.Operator.Equal, "Name", name)); return Registry.Instance.getMapper(typeof(Person)).find(qo); }