public DepartmentCollection FetchByQuery(Query qry) { DepartmentCollection coll = new DepartmentCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public DepartmentCollection FetchAll() { DepartmentCollection coll = new DepartmentCollection(); Query qry = new Query(Department.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static AVManager.DAL.DepartmentCollection GetDepartmentCollection(byte varShiftID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand( "SELECT * FROM Department INNER JOIN EmployeeDepartmentHistory ON " + "Department.DepartmentID=EmployeeDepartmentHistory.DepartmentID WHERE EmployeeDepartmentHistory.ShiftID=@ShiftID", Shift.Schema.Provider.Name); cmd.AddParameter("@ShiftID", varShiftID, DbType.Byte); IDataReader rdr = SubSonic.DataService.GetReader(cmd); DepartmentCollection coll = new DepartmentCollection(); coll.LoadAndCloseReader(rdr); return(coll); }