public CreateUserForm() { InitializeComponent(); users = new UserList(); usersList = users.GetUserNames(); numAdmins = 0; foreach (string ele in usersList) { string userName = ele; if (users.IsAdmin(userName)) { numAdmins = numAdmins + 1; } } }
/* * Method: FillTable * Parameters: N/A * Output: N/A * Created By: Riley Smith * Date: 4/13/2015 * Modified By: Riley Smith * * Description: Fills the Users Table with a list of users. */ private void FillTable() { userList = new UserList(); ArrayList users = userList.GetUserNames(); int line = 0; foreach (string ele in users) { usersGridView.Rows.Add(); usersGridView.Rows[line].Cells[0].Value = ele; DataGridViewRow row = usersGridView.Rows[line]; if (userList.IsLocked(ele)) { row.DefaultCellStyle.BackColor = Color.Red; } line++; } }