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 } }
public Uploader() { InitializeComponent(); DisableEnableWindows(ActiveWindow.Home); /*DateTime date = new DateTime(2016, 06, 6); * for (int i = 1; i <= 52; i++) * { * cboColsonidatedReportDate.Items.Add(date.ToString("yyyy-MM-dd")); * date = date.AddDays(7); * }*/ List <User> userList = DownloadData.GetAllUsers(); List <DateTime> dateList = new List <DateTime>(); foreach (User u in userList) { List <tmpdate> tmp; tmp = DownloadData.GetWeeklyDataDates(u.id); try { tmp = DownloadData.GetWeeklyDataDates(u.id); } catch { continue; } if (tmp == null) { continue; } foreach (tmpdate dt in tmp) { //MessageBox.Show(dt + ""); if (dateList.Contains(dt.sdate)) { continue; } else { dateList.Add(dt.sdate); cboColsonidatedReportDate.Items.Add(dt.sdate.ToString("yyyy-MM-dd")); } } } txtbxSaveDir.Text = Utilities.SAVE_FOLDER; }