private void PopulateClasses() { cboShowClasses.Items.Clear(); ShowFinalClasses showFinalClasses = new ShowFinalClasses(Utils.ConnectionString()); List <ShowFinalClasses> showFinalClassList = showFinalClasses.GetShow_Final_ClassesByShow_ID(_showID); ComboBoxItem item = null; foreach (ShowFinalClasses sfc in showFinalClassList) { item = new ComboBoxItem(); item.Text = sfc.Show_Final_Class_Description; item.Value = sfc.Show_Final_Class_ID; cboShowClasses.Items.Add(item); } }
private void PopulateClassList(string Show_ID) { if (!string.IsNullOrEmpty(Show_ID)) { Guid show_ID = new Guid(Show_ID); ShowFinalClasses showFinalClasses = new ShowFinalClasses(_connString); List <ShowFinalClasses> tblShowFinalClasses = showFinalClasses.GetShow_Final_ClassesByShow_ID(show_ID); List <ShowFinalClasses> classList = new List <ShowFinalClasses>(); ShowFinalClasses allClasses = new ShowFinalClasses(_connString); allClasses.Show_Final_Class_Description = "All Classes"; allClasses.Show_Final_Class_ID = new Guid(); classList.Add(allClasses); foreach (ShowFinalClasses row in tblShowFinalClasses) { classList.Add(row); } lstClasses.DataSource = classList; lstClasses.DataBind(); } }