Example #1
0
        public static void getTextData(String filepath, Constraints constraints)
        {
            categories = new Categories();
            string[] lines   = System.IO.File.ReadAllLines(filepath);
            string   tmtName = "";

            foreach (string line in lines)
            {
                Char     delimiter  = ':';
                String[] substrings = line.Split(delimiter);

                if (line.Contains('*') || line.Contains('#') || line.Contains('@') || line.Contains('$') || line.Contains('%'))
                {
                    Form1.Message = "Invalid Input Format";
                    break;
                }
                else if (substrings.Length > 0)
                {
                    tmtName = substrings[0];
                    if (substrings[1].Contains("Adult"))
                    {
                        String[] longString   = substrings[2].Split(')');
                        String[] nameString   = longString[2].Split(null);
                        String[] weightString = substrings[2].Split('(');

                        string name         = nameString[1] + " " + nameString[2];
                        string resultString = Regex.Match(weightString[2], @"\d+").Value;
                        double weight       = Double.Parse(resultString);
                        Console.WriteLine(weight);
                        if (substrings[1].Contains("MEN"))
                        {
                            if (substrings[2].Contains("White"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.MenzFinWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFlyLow && weight <= constraints.MenzFlyHigh)
                                {
                                    categories.MenzFlyWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzBantamLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzBantamWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFeatherLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzFeatherWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzLightLow && weight <= constraints.MenzLightHigh)
                                {
                                    categories.MenzLightWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzWelterLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzWelterWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzMiddleLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzMiddleWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.MenzHeavyWhiteBelt.Add(name);
                                }
                                else
                                {
                                    categories.MenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Black"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.MenzFinBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFlyLow && weight <= constraints.MenzFlyHigh)
                                {
                                    categories.MenzFlyBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzBantamLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzBantamBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFeatherLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzFeatherBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzLightLow && weight <= constraints.MenzLightHigh)
                                {
                                    categories.MenzLightBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzWelterLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzWelterBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzMiddleLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzMiddleBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.MenzHeavyBlackBelt.Add(name);
                                }
                                else
                                {
                                    categories.MenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Blue"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.MenzFinBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFlyLow && weight <= constraints.MenzFlyHigh)
                                {
                                    categories.MenzFlyBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzBantamLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzBantamBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFeatherLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzFeatherBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzLightLow && weight <= constraints.MenzLightHigh)
                                {
                                    categories.MenzLightBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzWelterLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzWelterBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzMiddleLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzMiddleBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.MenzHeavyBlueBelt.Add(name);
                                }
                                else
                                {
                                    categories.MenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Purple"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.MenzFinPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFlyLow && weight <= constraints.MenzFlyHigh)
                                {
                                    categories.MenzFlyPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzBantamLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzBantamPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFeatherLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzFeatherPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzLightLow && weight <= constraints.MenzLightHigh)
                                {
                                    categories.MenzLightPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzWelterLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzWelterPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzMiddleLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzMiddlePurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.MenzHeavyPurpleBelt.Add(name);
                                }
                                else
                                {
                                    categories.MenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Brown"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.MenzFinBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFlyLow && weight <= constraints.MenzFlyHigh)
                                {
                                    categories.MenzFlyBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzBantamLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzBantamBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzFeatherLow && weight <= constraints.MenzFeatherHigh)
                                {
                                    categories.MenzFeatherBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzLightLow && weight <= constraints.MenzLightHigh)
                                {
                                    categories.MenzLightBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzWelterLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzWelterBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzMiddleLow && weight <= constraints.MenzWelterHigh)
                                {
                                    categories.MenzMiddleBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.MenzHeavyBrownBelt.Add(name);
                                }
                                else
                                {
                                    categories.MenzError.Add(name);
                                }
                            }
                            else
                            {
                                categories.MenzError.Add(name);
                            }
                        }
                        else if (substrings[1].Contains("FEMALE"))
                        {
                            if (substrings[2].Contains("White"))
                            {
                                if (weight <= constraints.WomenzFin)
                                {
                                    categories.WomenzFinWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFlyLow && weight <= constraints.WomenzFlyHigh)
                                {
                                    categories.WomenzFlyWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzBantamLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzBantamWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFeatherLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzFeatherWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzLightLow && weight <= constraints.WomenzLightHigh)
                                {
                                    categories.WomenzLightWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzWelterLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzWelterWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzMiddleLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzMiddleWhiteBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzHeavy)
                                {
                                    categories.WomenzHeavyWhiteBelt.Add(name);
                                }
                                else
                                {
                                    categories.WomenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Black"))
                            {
                                if (weight <= constraints.WomenzFin)
                                {
                                    categories.WomenzFinBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFlyLow && weight <= constraints.WomenzFlyHigh)
                                {
                                    categories.WomenzFlyBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzBantamLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzBantamBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFeatherLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzFeatherBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzLightLow && weight <= constraints.WomenzLightHigh)
                                {
                                    categories.WomenzLightBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzWelterLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzWelterBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzMiddleLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzMiddleBlackBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzHeavy)
                                {
                                    categories.WomenzHeavyBlackBelt.Add(name);
                                }
                                else
                                {
                                    categories.WomenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Blue"))
                            {
                                if (weight <= constraints.MenzFin)
                                {
                                    categories.WomenzFinBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFlyLow && weight <= constraints.WomenzFlyHigh)
                                {
                                    categories.WomenzFlyBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzBantamLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzBantamBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFeatherLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzFeatherBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzLightLow && weight <= constraints.WomenzLightHigh)
                                {
                                    categories.WomenzLightBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzWelterLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzWelterBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzMiddleLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzMiddleBlueBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzHeavy)
                                {
                                    categories.WomenzHeavyBlueBelt.Add(name);
                                }
                                else
                                {
                                    categories.WomenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Purple"))
                            {
                                if (weight <= constraints.WomenzFin)
                                {
                                    categories.WomenzFinPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFlyLow && weight <= constraints.WomenzFlyHigh)
                                {
                                    categories.WomenzFlyPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzBantamLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzBantamPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFeatherLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzFeatherPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzLightLow && weight <= constraints.WomenzLightHigh)
                                {
                                    categories.WomenzLightPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzWelterLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzWelterPurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzMiddleLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzMiddlePurpleBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.WomenzHeavyPurpleBelt.Add(name);
                                }
                                else
                                {
                                    categories.WomenzError.Add(name);
                                }
                            }
                            else if (substrings[2].Contains("Brown"))
                            {
                                if (weight <= constraints.WomenzFin)
                                {
                                    categories.WomenzFinBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFlyLow && weight <= constraints.WomenzFlyHigh)
                                {
                                    categories.WomenzFlyBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzBantamLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzBantamBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzFeatherLow && weight <= constraints.WomenzFeatherHigh)
                                {
                                    categories.WomenzFeatherBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzLightLow && weight <= constraints.WomenzLightHigh)
                                {
                                    categories.WomenzLightBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzWelterLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzWelterBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.WomenzMiddleLow && weight <= constraints.WomenzWelterHigh)
                                {
                                    categories.WomenzMiddleBrownBelt.Add(name);
                                }
                                else if (weight >= constraints.MenzHeavy)
                                {
                                    categories.WomenzHeavyBrownBelt.Add(name);
                                }
                                else
                                {
                                    categories.WomenzError.Add(name);
                                }
                            }
                            else
                            {
                                categories.WomenzError.Add(name);
                            }
                        }
                    }
                    else if (substrings[1].Contains("Kids"))
                    {
                        String[] longString = substrings[1].Split(')');
                        String[] nameString = longString[1].Split(null);
                        string   name       = nameString[2] + " " + nameString[3];
                        if (substrings[1].Contains("Novice"))
                        {
                            categories.KidsNovice.Add(name);
                        }
                        else if (substrings[1].Contains("Beginner"))
                        {
                            categories.KidsBeginner.Add(name);
                        }
                        else if (substrings[1].Contains("Intermediate"))
                        {
                            categories.KidsIntermediate.Add(name);
                        }
                        else if (substrings[1].Contains("Advanced"))
                        {
                            categories.KidsAdvanced.Add(name);
                        }
                        else
                        {
                            categories.KidzError.Add(name);
                        }
                    }
                }
            }
            Generate.generate(categories, tmtName);
        }
        public static void getExcelFile(String filepath, Constraints constraints)
        {
            Excel.Application xlApp       = new Excel.Application();
            Excel.Workbook    xlWorkbook  = xlApp.Workbooks.Open(filepath);
            Excel._Worksheet  xlWorksheet = xlWorkbook.Sheets[1];
            Excel.Range       xlRange     = xlWorksheet.UsedRange;

            int rowCount = xlRange.Rows.Count + 1;
            int colCount = xlRange.Columns.Count;

            for (int i = 2; i <= rowCount; i++)
            {
                if (xlRange.Cells[i, 6] != null && xlRange.Cells[i, 6].Value2 != null)
                {
                    if (Convert.ToInt16(xlRange.Cells[i, 5].Value2) <= Convert.ToInt16(constraints.KidsMaxAge))
                    {
                        Console.WriteLine("Kids Found !");
                        if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "NOVICE")
                        {
                            categories.KidsNovice.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                        }
                        else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BEGINNER")
                        {
                            categories.KidsBeginner.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                        }
                        else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "INTERMEDIATE")
                        {
                            categories.KidsIntermediate.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                        }
                        else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "ADVANCED")
                        {
                            categories.KidsAdvanced.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                        }
                        else
                        {
                            categories.KidzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                        }
                    }
                    else if (xlRange.Cells[i, 6].Value2.ToString() == "male")
                    {
                        if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzFin))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzFinBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzFinWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzFinPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzFinBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzFinBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzFlyLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzFlyHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzFlyBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzFlyWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzFlyPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzFlyBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzFlyBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzBantamLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzBantamHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzBantamBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzBantamWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzBantamPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzBantamBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzBantamBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzFeatherLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzFeatherHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzFeatherBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzFeatherWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzFeatherPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzFeatherBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzFeatherBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzLightLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzLightHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzLightBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzLightWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzLightPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzLightBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzLightBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzWelterLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzWelterHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzWelterBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzWelterWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzWelterPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzWelterBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzWelterBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzMiddleLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.MenzMiddleHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzMiddleBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzMiddleWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzMiddlePurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzMiddleBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzMiddleBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.MenzHeavy))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.MenzHeavyBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.MenzHeavyWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.MenzHeavyPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.MenzHeavyBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.MenzHeavyBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.MenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                    }
                    else if (xlRange.Cells[i, 6].Value2.ToString() == "female")
                    {
                        if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzFin))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzFinBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzFinWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzFinPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzFinBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzFinBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzFlyLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzFlyHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzFlyBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzFlyWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzFlyPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzFlyBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzFlyBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzBantamLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzBantamHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzBantamBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzBantamWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzBantamPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzBantamBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzBantamBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzFeatherLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzFeatherHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzFeatherBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzFeatherWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzFeatherPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzFeatherBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzFeatherBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzLightLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzLightHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzLightBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzLightWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzLightPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzLightBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzLightBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzWelterLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzWelterHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzWelterBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzWelterWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzWelterPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzWelterBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzWelterBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzMiddleLow) && Convert.ToDouble(xlRange.Cells[i, 4].Value2) <= Convert.ToDouble(constraints.WomenzMiddleHigh))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzMiddleBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzMiddleWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzMiddlePurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzMiddleBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzMiddleBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                        else if (Convert.ToDouble(xlRange.Cells[i, 4].Value2) >= Convert.ToDouble(constraints.WomenzHeavy))
                        {
                            if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLACK BELT")
                            {
                                categories.WomenzHeavyBlackBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "WHITE BELT")
                            {
                                categories.WomenzHeavyWhiteBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "PURPLE BELT")
                            {
                                categories.WomenzHeavyPurpleBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BLUE BELT")
                            {
                                categories.WomenzHeavyBlueBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else if (xlRange.Cells[i, 3].Value2.ToString().ToUpper() == "BROWN BELT")
                            {
                                categories.WomenzHeavyBrownBelt.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                            else
                            {
                                categories.WomenzError.Add(Convert.ToInt16(xlRange.Cells[i, 1].Value2));
                            }
                        }
                    }
                }
            }

            //categories.MenzHeavyBrownBelt.ForEach(Console.WriteLine);

            GC.Collect();
            GC.WaitForPendingFinalizers();


            Marshal.ReleaseComObject(xlRange);
            Marshal.ReleaseComObject(xlWorksheet);

            xlWorkbook.Close();
            Marshal.ReleaseComObject(xlWorkbook);

            xlApp.Quit();
            Marshal.ReleaseComObject(xlApp);
        }