public MinBuyCalcForm() { InitializeComponent(); var abSearches = new List <DropDownOption> { new DropDownOption { Id = -1, DisplayValue = "-- Select Search --" } }; abSearches.AddRange(SearchDAL.GetSearches <PlayerSearchCriteria>().Select(a => new DropDownOption { Id = a.PkId, DisplayValue = a.Name })); cmb_abSearches.DataSource = abSearches; var abAccounts = new List <DropDownOption> { new DropDownOption { Id = -1, DisplayValue = "-- Select a account --" } }; abAccounts.AddRange(UserDAL.GetUsers().Select(a => new DropDownOption { Id = a.Id, DisplayValue = a.Email })); cmb_accounts.DataSource = abAccounts; }
public AccountList(Action <bool> longOperationCB) { InitializeComponent(); HideEditForm(); List <DropDownCheckOption> options = new List <DropDownCheckOption>(); options.AddRange(SearchDAL.GetSearches <PlayerSearchCriteria>().Select(a => new DropDownCheckOption { Id = a.PkId, DisplayValue = a.Name })); this.cmb_searches.Items.AddRange(options.ToArray()); _longOperationCB = longOperationCB; }
private void SearchList_Load(object sender, EventArgs e) { List <PlayerSearchCriteria> playerSearchCriterias = SearchDAL.GetSearches <PlayerSearchCriteria>(); grd_searchList.DataSource = playerSearchCriterias.ToDataTable(); if (playerSearchCriterias.Any()) { lbl_noSearches.Visible = false; grd_searchList.Visible = true; } else { lbl_noSearches.Visible = true; grd_searchList.Visible = false; } }