예제 #1
0
        private void LoadAdmin()
        {
            panModifyUser.Visibility = Visibility.Hidden;           //Hide the modification panels as they are not needed yet
            panModifyFarm.Visibility = Visibility.Hidden;           //

            lstFarms.Items.Clear();                                 //Clean the list views
            lstUsers.Items.Clear();                                 //

            cboModuserRoles.Items.Clear();                          //Clean the combo boxes associated with modifying the users/farms
            cboModuserfarmlist.Items.Clear();                       //

            foreach (User u in DownloadData.GetAllUsers())          //get all users currently on server
            {
                lstUsers.Items.Add(u);                              //add them into the list view
            }
            cboModuserfarmlist.Items.Add("NONE");                   //Make the default/first option be nil
            foreach (FullFarm ff in DownloadData.GetAllFullFarms()) //get all farms currently on server
            {
                lstFarms.Items.Add(ff);                             //add the farms into the list view
                cboModuserfarmlist.Items.Add(ff.name);              //add the farm names into the combo box on modifying farms panel
            }

            for (PermissionLevel p = PermissionLevel.Admin; p < PermissionLevel.Guest + 1; p++) //increment through all the roles possible
            {
                cboModuserRoles.Items.Add(p);                                                   //add the roles to the combo box for the user to select on modify user
            }
        }