public static void SetClassesAndDrawQty(Guid show_ID) { bool lowestClassSet = false; List<ClassesAndDrawQty> classesAndDrawQtyList = new List<ClassesAndDrawQty>(); ShowFinalClasses showFinalClasses = new ShowFinalClasses(); List<ShowFinalClasses> showFinalClassList = showFinalClasses.GetShow_Final_ClassesByShow_ID(show_ID); foreach (ShowFinalClasses row in showFinalClassList) { if (row.Show_Final_Class_Description != "NFC" && !row.Show_Final_Class_Description.Contains("YKC") && !row.Show_Final_Class_Description.Contains("Champ")) { int drawQty = 10; DogClasses dogClass = new DogClasses(); int entryCount = dogClass.GetEntryCountByShow_Final_Class_ID(row.Show_Final_Class_ID); if (entryCount <= Constants.DRAW_QTY_LESS_THAN) { drawQty = 6; } ClassesAndDrawQty classAndDrawQty = new ClassesAndDrawQty(); classAndDrawQty.Show_Final_Class_ID = row.Show_Final_Class_ID; classAndDrawQty.DrawQty = drawQty; if (!lowestClassSet) { classAndDrawQty.LowestClass = true; lowestClassSet = true; } classesAndDrawQtyList.Add(classAndDrawQty); } } ClassesAndDrawQtyList = classesAndDrawQtyList; }
private void PopulateClassList(string Show_ID) { if (!string.IsNullOrEmpty(Show_ID)) { Guid show_ID = new Guid(Show_ID); ShowFinalClasses showFinalClasses = new ShowFinalClasses(); List<ShowFinalClasses> tblShowFinalClasses = showFinalClasses.GetShow_Final_ClassesByShow_ID(show_ID); List<ShowFinalClasses> classList = new List<ShowFinalClasses>(); ShowFinalClasses allClasses = new ShowFinalClasses(); 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(); } }