public List <EntryClassesCount> GetEntryClassCount() { List <EntryClassesCount> retVal = new List <EntryClassesCount>(); try { EntryClassCountBL entryClasses = new EntryClassCountBL(_connString); tblEntryClassCount = entryClasses.GetEntryClassCount(); if (tblEntryClassCount != null && tblEntryClassCount.Rows.Count > 0) { foreach (DataRow row in tblEntryClassCount.Rows) { EntryClassesCount entryClass = new EntryClassesCount(_connString); entryClass.Show_Entry_Class_ID = Utils.DBNullToGuid(row["Show_Entry_Class_ID"]); entryClass.Class_Name_Description = Utils.DBNullToString(row["Class_Name_Description"]); entryClass.Class_No = Utils.DBNullToShort(row["Class_No"]); entryClass.Entries = Utils.DBNullToShort(row["Entries"]); retVal.Add(entryClass); } } } catch (Exception ex) { throw ex; } return(retVal); }
public static bool UnAllocateDogsFromFinalClasses(string connString, Guid user_ID) { bool retVal = false; try { List <EntryClassesCount> entryClassesList = new List <EntryClassesCount>(); EntryClassesCount entryClasses = new EntryClassesCount(connString); entryClassesList = entryClasses.GetEntryClassCount(); foreach (EntryClassesCount entryClass in entryClassesList) { List <DogClasses> dogClassList = new List <DogClasses>(); DogClasses dogClasses = new DogClasses(connString); dogClassList = dogClasses.GetDog_ClassesByShow_Entry_Class_ID(entryClass.Show_Entry_Class_ID); foreach (DogClasses row in dogClassList) { row.Show_Final_Class_ID = null; Guid dog_Class_ID = new Guid(row.Dog_Class_ID.ToString()); retVal = row.Update_Dog_Class(dog_Class_ID, user_ID); } } } catch (Exception ex) { throw ex; } return(retVal); }
private static void AddFinalClass(string connString, EntryClassesCount row, int part, int partCount, short order_By) { try { int newPart = part += 1; string newClassDescription = string.Format("{0} Part {1}", row.Class_Name_Description, newPart); FinalClassNames finalClassName = new FinalClassNames(connString); finalClassName.Show_Entry_Class_ID = row.Show_Entry_Class_ID; finalClassName.Class_Name_Description = row.Class_Name_Description; finalClassName.Class_No = row.Class_No; finalClassName.Show_Final_Class_Description = newClassDescription; finalClassName.Entries = (short)partCount; finalClassName.OrderBy = order_By; finalClassName.InsertFinalClassNames(); } catch (Exception ex) { throw ex; } }
public List<EntryClassesCount> GetEntryClassCount() { List<EntryClassesCount> entryClassList = new List<EntryClassesCount>(); EntryClassCountBL entryClasses = new EntryClassCountBL(); tblEntryClassCount = entryClasses.GetEntryClassCount(); if (tblEntryClassCount != null && tblEntryClassCount.Count > 0) { foreach (sss.tblEntryClassCountRow row in tblEntryClassCount) { EntryClassesCount entryClass = new EntryClassesCount(); entryClass.Show_Entry_Class_ID = row.Show_Entry_Class_ID; entryClass.Class_Name_Description = row.Class_Name_Description; entryClass.Class_No = row.Class_No; entryClass.Entries = row.Entries; entryClassList.Add(entryClass); } } return entryClassList; }
private static void AddFinalClass(EntryClassesCount row, int part, int partCount, short order_By) { int newPart = part += 1; string newClassDescription = string.Format("{0} Part {1}", row.Class_Name_Description, newPart); FinalClassNames finalClassName = new FinalClassNames(); finalClassName.Show_Entry_Class_ID = row.Show_Entry_Class_ID; finalClassName.Class_Name_Description = row.Class_Name_Description; finalClassName.Class_No = row.Class_No; finalClassName.Show_Final_Class_Description = newClassDescription; finalClassName.Entries = (short)partCount; finalClassName.OrderBy = order_By; finalClassName.InsertFinalClassNames(); }
public static bool UnAllocateDogsFromFinalClasses(Guid user_ID) { bool success = false; List<EntryClassesCount> entryClassesList = new List<EntryClassesCount>(); EntryClassesCount entryClasses = new EntryClassesCount(); entryClassesList = entryClasses.GetEntryClassCount(); foreach (EntryClassesCount entryClass in entryClassesList) { List<DogClasses> dogClassList = new List<DogClasses>(); DogClasses dogClasses = new DogClasses(); dogClassList = dogClasses.GetDog_ClassesByShow_Entry_Class_ID(entryClass.Show_Entry_Class_ID); foreach (DogClasses row in dogClassList) { row.Show_Final_Class_ID = null; Guid dog_Class_ID = new Guid(row.Dog_Class_ID.ToString()); success = row.Update_Dog_Class(dog_Class_ID, user_ID); } } return success; }
public static bool PopulateFinalClassNames() { short order_By = 0; bool success = false; EntryClassesCount entryClasses = new EntryClassesCount(); EntryClassList = entryClasses.GetEntryClassCount(); if (EntryClassList != null && EntryClassList.Count > 0) { FinalClassNames clearFinalClassNames = new FinalClassNames(); bool clearSuccess = clearFinalClassNames.ClearFinalClassNames(); if (clearSuccess) { foreach (EntryClassesCount row in EntryClassList) { if (row.Entries > Constants.MAX_CLASS_SIZE) { int classQty = ClassQty(row.Entries); int partMod = row.Entries % classQty; for (int i = 0; i < classQty; i++) { int partCount = row.Entries / classQty; if (partMod > 0) partCount += 1; order_By += 1; AddFinalClass(row, i, partCount, order_By); partMod -= 1; } } else { order_By += 1; FinalClassNames finalClassName = new FinalClassNames(); finalClassName.Show_Entry_Class_ID = row.Show_Entry_Class_ID; finalClassName.Class_Name_Description = row.Class_Name_Description; finalClassName.Class_No = row.Class_No; finalClassName.Show_Final_Class_Description = row.Class_Name_Description; finalClassName.Entries = row.Entries; finalClassName.OrderBy = order_By; finalClassName.InsertFinalClassNames(); } } success = true; } else { success = false; } } return success; }
public static bool PopulateFinalClassNames(string connString, int maxClassSize) { bool success = false; try { short order_By = 0; EntryClassesCount entryClasses = new EntryClassesCount(connString); EntryClassList = entryClasses.GetEntryClassCount(); if (EntryClassList != null && EntryClassList.Count > 0) { FinalClassNames clearFinalClassNames = new FinalClassNames(connString); bool clearSuccess = clearFinalClassNames.ClearFinalClassNames(); if (clearSuccess) { foreach (EntryClassesCount row in EntryClassList) { if (row.Entries > maxClassSize) { int classQty = ClassQty(row.Entries, maxClassSize); int partMod = row.Entries % classQty; for (int i = 0; i < classQty; i++) { int partCount = row.Entries / classQty; if (partMod > 0) { partCount += 1; } order_By += 1; AddFinalClass(connString, row, i, partCount, order_By); partMod -= 1; } } else { order_By += 1; FinalClassNames finalClassName = new FinalClassNames(connString); finalClassName.Show_Entry_Class_ID = row.Show_Entry_Class_ID; finalClassName.Class_Name_Description = row.Class_Name_Description; finalClassName.Class_No = row.Class_No; finalClassName.Show_Final_Class_Description = row.Class_Name_Description; finalClassName.Entries = row.Entries; finalClassName.OrderBy = order_By; finalClassName.InsertFinalClassNames(); } } success = true; } else { success = false; } } } catch (Exception ex) { throw ex; } return(success); }
protected void PopulateEntryClassGridView() { EntryClassesCount entryClasses = new EntryClassesCount(); EntryClassList = entryClasses.GetEntryClassCount(); if (EntryClassList != null && EntryClassList.Count > 0) { Common.EntryClassList = EntryClassList; EntryClassGridView.DataSource = EntryClassList; EntryClassGridView.DataBind(); divEntryClassList.Visible = true; divGetFinalClasses.Visible = true; } else { MessageLabel.Text = "No Data for this Show."; divEntryClassList.Visible = false; divGetFinalClasses.Visible = false; divFinalClassList.Visible = false; } }
protected void PopulateEntryClassesCountTable() { if (!string.IsNullOrEmpty(Show_ID)) { bool success = false; Guid show_ID = new Guid(Show_ID); EntryClassesCount entryClasses = new EntryClassesCount(); success = entryClasses.PopulateEntryClassCount(show_ID); if (success) { PopulateEntryClassGridView(); } else { MessageLabel.Text = "Failed to populate the Entry Class Count table!"; divEntryClassList.Visible = false; } } }