private void EasyCRMForm_Load(object sender, System.EventArgs e) { List <User> users = (List <User>)_userRepository.ListAll(); this.usersBindingSource.DataSource = users; this.accountsBindingSource.DataSource = _accountRepository.ListAll(); this.sectorsBindingSource.DataSource = _sectorRepository.ListAll(); this.tasksBindingSource.DataSource = _taskRepository.ListAll(); this.contactsBindingSource.DataSource = _contactRepository.ListAll(); this.userComboBoxItems = new List <User>(users); this.userComboBoxItems.Insert(0, new User() { UserName = "", Email = "All" }); //setting combo boxes for choosing the user whose information is desired this.accountBindingNavigatorSelectUserItem.ComboBox.DisplayMember = "Email"; this.accountBindingNavigatorSelectUserItem.ComboBox.ValueMember = "UserName"; this.taskBindingNavigatorSelectUserItem.ComboBox.DisplayMember = "Email"; this.taskBindingNavigatorSelectUserItem.ComboBox.ValueMember = "UserName"; this.contactBindingNavigatorSelectUserItem.ComboBox.DisplayMember = "Email"; this.contactBindingNavigatorSelectUserItem.ComboBox.ValueMember = "UserName"; this.accountBindingNavigatorSelectUserItem.ComboBox.Items.AddRange(userComboBoxItems.ToArray()); this.taskBindingNavigatorSelectUserItem.ComboBox.Items.AddRange(userComboBoxItems.ToArray()); this.contactBindingNavigatorSelectUserItem.ComboBox.Items.AddRange(userComboBoxItems.ToArray()); this.accountBindingNavigatorSelectUserItem.ComboBox.SelectedIndex = 0; this.taskBindingNavigatorSelectUserItem.ComboBox.SelectedIndex = 0; this.contactBindingNavigatorSelectUserItem.ComboBox.SelectedIndex = 0; }
public IEnumerable <IndustrialSector> ListIndustrialSectors() { return(_repository.ListAll()); }