예제 #1
0
        /// <summary>
        /// Gets all the users in the database by the role name
        /// </summary>
        /// <param name="roleName">Role to filter the users from</param>
        /// <returns>All users with the roleName</returns>
        public MembershipUserCollection GetUsersListByRole(RHP.Common.Enums.UserRoles roleName)
        {
            MembershipUserCollection UserCollection = null;
            string[] userList;
            userList = Roles.GetUsersInRole(roleName.ToString());

            foreach (string userName in userList)
            {
                MembershipUser user;
                user = Membership.GetUser(userName);
                UserCollection.Add(user);
            }

            return UserCollection;
        }
예제 #2
0
 public static BaseHouse Create(RHP.Common.Enums.HouseType houseType)
 {
     BaseHouse baseHouse;
     switch (houseType)
     {
         case RHP.Common.Enums.HouseType.Dorms:
             baseHouse = new Dorm();
             break;
         case RHP.Common.Enums.HouseType.Appartment:
             baseHouse = new Appartment();
             break;
         case RHP.Common.Enums.HouseType.Condo:
             baseHouse = new Condo();
             break;
         case RHP.Common.Enums.HouseType.FamilyHousing:
             baseHouse = new FamilyHousing();
             break;
         case RHP.Common.Enums.HouseType.House:
             baseHouse = new OnCampusHouse();
             break;
         case RHP.Common.Enums.HouseType.OffCampusAppartment:
             baseHouse = new OffCampusAppartment();
             break;
         case RHP.Common.Enums.HouseType.OffCampusCondo:
             baseHouse = new OffCampusCondo();
             break;
         case RHP.Common.Enums.HouseType.TownHome:
             baseHouse = new TownHome();
             break;
         case RHP.Common.Enums.HouseType.OffCampusHouse:
             baseHouse = new OffCampusHouse();
             break;
         default:
             baseHouse = new Dorm();
             break;
     }
     return baseHouse;
 }