public SalesPersonCollection FetchByQuery(Query qry) { SalesPersonCollection coll = new SalesPersonCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public SalesPersonCollection FetchAll() { SalesPersonCollection coll = new SalesPersonCollection(); Query qry = new Query(SalesPerson.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static AVManager.DAL.SalesPersonCollection GetSalesPersonCollection(int varTerritoryID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand( "SELECT * FROM SalesPerson INNER JOIN SalesTerritoryHistory ON " + "SalesPerson.SalesPersonID=SalesTerritoryHistory.SalesPersonID WHERE SalesTerritoryHistory.TerritoryID=@TerritoryID", SalesTerritory.Schema.Provider.Name); cmd.AddParameter("@TerritoryID", varTerritoryID, DbType.Int32); IDataReader rdr = SubSonic.DataService.GetReader(cmd); SalesPersonCollection coll = new SalesPersonCollection(); coll.LoadAndCloseReader(rdr); return(coll); }