Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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;
     }
 }