private void AdminReportsForm_Load(object sender, EventArgs e) { dataGridView1.DataSource = bindingSource1; List <string> users = DbAbstractionLayer.getAllUserNames(); users.ForEach(delegate(String user) { usersComboBox.Items.Add(user); }); usersComboBox.DropDownStyle = ComboBoxStyle.DropDownList; }
public static bool isUserNameFree(string userName) { List <string> users = DbAbstractionLayer.getAllUserNames(); return(!users.Contains(userName)); }