public ManagerAssignmentCollection FetchAll()
 {
     ManagerAssignmentCollection coll = new ManagerAssignmentCollection();
     Query qry = new Query(ManagerAssignment.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the users by manager.
        /// </summary>
        /// <param name="managerID">The manager ID.</param>
        /// <returns></returns>
        public Collection <User> GetByManager(int managerID)
        {
            ManagerAssignmentCollection assignmentCollection =
                new ManagerAssignmentCollection().Where(ManagerAssignment.Columns.ManagerID,
                                                        Comparison.Equals, managerID);
            //TODO: optimize UserService.GetByManager()
            Collection <User> userCollection = new Collection <User>();

            foreach (ManagerAssignment assignment in assignmentCollection)
            {
                userCollection.Add(CreateRecord(assignment.User));
            }

            return(userCollection);
        }
 public ManagerAssignmentCollection FetchByQuery(Query qry)
 {
     ManagerAssignmentCollection coll = new ManagerAssignmentCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
 public ManagerAssignmentCollection FetchByID(object ManagerID)
 {
     ManagerAssignmentCollection coll = new ManagerAssignmentCollection().Where("ManagerID", ManagerID).Load();
     return coll;
 }