public List<OwnersDogsClassesDrawn> GetOwnerDogsClassesDrawnList(Guid show_ID, Guid? show_Final_Class_ID, bool display) { RunningOrdersBL rOBL = new RunningOrdersBL(); tblOwnersDogsClassesDrawnList = rOBL.GetOwnersDogsClassesDrawn(display); List<OwnersDogsClassesDrawn> displayList = new List<OwnersDogsClassesDrawn>(); OwnersDogsClassesDrawn displayItem = new OwnersDogsClassesDrawn(); if (tblOwnersDogsClassesDrawnList != null && tblOwnersDogsClassesDrawnList.Count > 0) { short ring_No = 0; Shows show = new Shows(show_ID); string show_Final_Class_Description = string.Empty; ClearDrawnFlags(); int rowCount = 0; int rowCountRO = 0; int rowCountInScope = 0; foreach (sss.tblOwnersDogsClassesDrawnListRow oDCDLRow in tblOwnersDogsClassesDrawnList) { rowCount += 1; if (!oDCDLRow.IsRunning_OrderNull()) { rowCountRO += 1; displayItem.Running_Order = oDCDLRow.Running_Order; if (oDCDLRow.Running_Order > 0 && oDCDLRow.Running_Order < 21) { rowCountInScope += 1; //if (display) SetDrawnFlags(oDCDLRow, show_ID); displayItem.DogDrawnInClass = true; } } } foreach (sss.tblOwnersDogsClassesDrawnListRow row in tblOwnersDogsClassesDrawnList) { ShowFinalClasses sfc = new ShowFinalClasses(row.Show_Final_Class_ID); if ((ring_No != row.Ring_No && ring_No != 0) || (ring_No == row.Ring_No && show_Final_Class_Description != row.Show_Final_Class_Description)) { //new ring number OwnersDogsClassesDrawn completeRow = BuildCompleteRow(displayItem); displayList.Add(completeRow); displayItem = new OwnersDogsClassesDrawn(); } if (!row.IsRunning_OrderNull()) { displayItem.Running_Order = row.Running_Order; if (row.Running_Order > 0 && row.Running_Order < 21) { //if (display) SetDrawnFlags(row, show_ID); displayItem.DogDrawnInClass = true; } } displayItem.Ring_No = row.Ring_No; displayItem.Owners.Add(row.Owner); if (RunningOrders.OwnersDrawn.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawn = true; if ((Guid)sfc.Show_ID == RunningOrders.Day1_Show_ID) { if (RunningOrders.OwnersDrawnOnDay1.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawnOnDay = true; } else { if (RunningOrders.OwnersDrawnOnDay2.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawnOnDay = true; } displayItem.Dog_KC_Name = row.Dog_KC_Name; if (!row.IsOffer_Of_HelpNull()) { displayItem.Offer_Of_Help = row.Offer_Of_Help; displayItem.Helper = row.Offer_Of_Help; } else displayItem.Helper = false; displayItem.HighestClass = IsHighestClass(row); displayItem.OldestDog = IsOldestDog(row); displayItem.Entrant_ID = row.Entrant_ID; if (!row.IsEntry_DateNull()) displayItem.Entry_Date = row.Entry_Date; displayItem.Owner_ID = row.Owner_ID; displayItem.Dog_ID = row.Dog_ID; if (RunningOrders.DogsDrawn.IndexOf(row.Dog_ID) != -1) displayItem.DogDrawn = true; displayItem.Dog_Class_ID = row.Dog_Class_ID; displayItem.Show_Final_Class_ID = row.Show_Final_Class_ID; SetOwnerDogCounts(row, show_ID); displayItem.OwnerDogCount = RunningOrders.OwnerDogCount; displayItem.OwnerDogsInClassCount = RunningOrders.OwnerDogsInClassCount; displayItem.ClassesPerOwnerEnteredCount = RunningOrders.ClassesPerOwnerEnteredCount; displayItem.ClassesPerDogEnteredCount = RunningOrders.ClassesPerDogEnteredCount; displayItem.Show_Final_Class_Description = row.Show_Final_Class_Description; show_Final_Class_Description = row.Show_Final_Class_Description; //displayList.Add(displayItem); ring_No = row.Ring_No; } OwnersDogsClassesDrawn completeRowFinal = BuildCompleteRow(displayItem); displayList.Add(completeRowFinal); } return displayList; }
public bool PopulateOwnersDogsClassesDrawnList(Guid show_ID, Guid? show_Final_Class_ID, bool display) { bool success = false; if (show_Final_Class_ID == new Guid()) show_Final_Class_ID = null; RunningOrdersBL runningOrders = new RunningOrdersBL(); if (display) success = runningOrders.PopulateOwnersDogsClassesList(show_ID, show_Final_Class_ID); else success = runningOrders.PopulateOwnersDogsClassesListOrderByEntry_Date(show_ID, null); return success; }
public static bool DeleteOwnersDogsClassesDrawnList() { bool success = false; RunningOrdersBL runningOrders = new RunningOrdersBL(); success = runningOrders.DeleteOwnersDogsClassesList(); return success; }