private void PopulateFields(CardsEntity card, MatchesEntity match)
        {
            MatchesEntity currMatch = match;

            lblCardTitle.Text    = card.CardName;
            lblCardSubTitle.Text = card.SubTitle;

            lblMatchNum.Text   = currMatch.CardMatchNumber.ToString();
            lblMatchTitle.Text = currMatch.MatchTitle;
            lblMatchRules.Text = currMatch.MatchType + "/" + currMatch.MatchRules;
            lblChamp.Text      = currMatch.Title;

            lblPart1.Text = currMatch.Participant1;
            lblPart2.Text = currMatch.Participant2;
            lblPart3.Text = currMatch.Participant3;
            lblPart4.Text = currMatch.Participant4;
            lblPart5.Text = currMatch.Participant5;
            lblPart6.Text = currMatch.Participant6;
            lblPart7.Text = currMatch.Participant7;
            lblPart8.Text = currMatch.Participant8;


            lblMatchRating.Text = currMatch.MatchRating.ToString();

            lblMatchRating.Enabled = true;
        }
Beispiel #2
0
        private List <MatchesEntity> SortedMatchOutput()
        {
            List <MatchesEntity> sortedMatches = new List <MatchesEntity>();

            if (!isBrandSorted)
            {
                sortedMatches = storeHelper.MatchesList.OrderByDescending(c => c.MatchRating).ToList();
            }
            else
            {
                string selItem = cbxPromos.SelectedItem.ToString();

                PromotionsEntity promo = storeHelper.PromotionsList.FirstOrDefault(p => p.Name == selItem);

                List <CardsEntity> promoCards = storeHelper.CardsList.Where(c => c.ConnOrgName == promo.Name).ToList();

                List <MatchesEntity> matches = new List <MatchesEntity>();

                foreach (CardsEntity c in promoCards)
                {
                    MatchesEntity match = mHelper.PopulateMatchesList().FirstOrDefault(m => m.AttachedCardName == c.CardName);

                    matches.Add(match);
                }

                sortedMatches = matches.OrderByDescending(m => m.MatchRating).ToList();
            }

            return(sortedMatches);
        }
Beispiel #3
0
 public static void SaveMatch(MatchesEntity matches)
 {
     using (IDbConnection cnn = new MySqlConnection(loadConnectionString()))
     {
         cnn.Execute("insert into matches (diseases_id, symptoms_id, distrust_measure, confidence_measure) values (@Diseases_id," +
                     "@Symptoms_id, @Distrust_measure, @Confidence_measure)", matches);
     }
 }
Beispiel #4
0
        private void cbxPromos_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbxPromos.SelectedItem.ToString() == "All Promotions")
            {
                List <MatchesEntity> matches = new List <MatchesEntity>();

                foreach (CardsEntity c in storeHelper.CardsList)
                {
                    MatchesEntity match = mHelper.PopulateMatchesList().FirstOrDefault(m => m.AttachedCardName == c.CardName);
                    matches.Add(match);
                }

                List <MatchesEntity> sortedMatches = matches.OrderByDescending(m => m.MatchRating).ToList();

                isBrandSorted = false;

                List <MatchesEntity> Top10 = new List <MatchesEntity>();

                for (int i = 0; i < 10; i++)
                {
                    Top10.Add(sortedMatches[i]);
                }


                SetButonsOutput(Top10);
            }
            else
            {
                string selItem = cbxPromos.SelectedItem.ToString();

                PromotionsEntity promo = storeHelper.PromotionsList.FirstOrDefault(p => p.Name == selItem);

                List <CardsEntity> promoCards = storeHelper.CardsList.Where(c => c.ConnOrgName == promo.Name).ToList();

                List <MatchesEntity> matches = new List <MatchesEntity>();

                foreach (CardsEntity c in promoCards)
                {
                    MatchesEntity match = mHelper.PopulateMatchesList().FirstOrDefault(m => m.AttachedCardName == c.CardName);

                    matches.Add(match);
                }

                List <MatchesEntity> sortedMatches = matches.OrderByDescending(m => m.MatchRating).ToList();

                isBrandSorted = true;

                List <MatchesEntity> Top10 = new List <MatchesEntity>();

                for (int i = 0; i < 10; i++)
                {
                    Top10.Add(sortedMatches[i]);
                }


                SetButonsOutput(Top10);
            }
        }
Beispiel #5
0
        private void DELETEObsoleteMuleMatch(int index)
        {
            //0-based n-1 == actual Index
            MatchesEntity matchToBeDELETED = storeHelper.MatchesList[index];

            string file = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Matches\\" + matchToBeDELETED.MatchID + ".dat");

            if (File.Exists(file) == true)
            {
                File.Delete(file);
            }
        }
Beispiel #6
0
        public void SaveMatchesList(MatchesEntity match)
        {
            FileStream   stream = new FileStream(Directory.GetCurrentDirectory() + "\\Saves\\Main\\Matches\\" + match.MatchID + ".dat", FileMode.Create, FileAccess.Write);
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine(match.MatchID);

            writer.WriteLine(match.CardMatchNumber);
            writer.WriteLine(match.MatchTitle);

            writer.WriteLine(match.AttachedCardName);

            writer.WriteLine(match.MatchType);

            writer.WriteLine(match.MatchRules);

            writer.WriteLine(match.NumOfRounds);
            writer.WriteLine(match.MinsPerRound);

            writer.WriteLine(match.MatchMins);
            writer.WriteLine(match.NumOfFalls);

            writer.WriteLine(match.Title);

            writer.WriteLine(match.Participant1);
            writer.WriteLine(match.Participant2);
            writer.WriteLine(match.Participant3);
            writer.WriteLine(match.Participant4);
            writer.WriteLine(match.Participant5);
            writer.WriteLine(match.Participant6);
            writer.WriteLine(match.Participant7);
            writer.WriteLine(match.Participant8);

            writer.WriteLine(match.RedSideResult);
            writer.WriteLine(match.BlueSideResult);

            writer.WriteLine(match.MatchWinners);

            writer.WriteLine(match.FinalNumOfRounds);
            writer.WriteLine(match.FinalFallCount);

            writer.WriteLine(match.FinalMatchMins);
            writer.WriteLine(match.FinalMatchSecs);

            writer.WriteLine(match.MatchRating);

            writer.Close();
            stream.Close();
        }
Beispiel #7
0
        public MatchRankings()
        {
            InitializeComponent();

            storeHelper.PromotionsList = pHelper.PopulatePromotionsList();
            storeHelper.CardsList      = cHelper.PopulateCardsList();
            storeHelper.MatchesList    = mHelper.PopulateMatchesList();

            cbxPromos.Items.Add("All Promotions");

            foreach (PromotionsEntity p in storeHelper.PromotionsList)
            {
                if (IsPromoValid(p.Name))
                {
                    cbxPromos.Items.Add(p.Name);
                }
            }

            cbxPromos.SelectedIndex = 0;

            //Because the drop down is auto-set at "All Promotions", then we set the buttons until otherwise inputted
            List <MatchesEntity> matches = new List <MatchesEntity>();

            foreach (CardsEntity c in storeHelper.CardsList)
            {
                MatchesEntity match = mHelper.PopulateMatchesList().FirstOrDefault(m => m.AttachedCardName == c.CardName);
                matches.Add(match);
            }

            List <MatchesEntity> sortedMatches = matches.OrderByDescending(m => m.MatchRating).ToList();

            List <MatchesEntity> Top10 = new List <MatchesEntity>();

            for (int i = 0; i < 10; i++)
            {
                Top10.Add(sortedMatches[i]);
            }

            SetButonsOutput(Top10);
        }
Beispiel #8
0
        private void ResetAllMatches(List <MatchesEntity> matchList)
        {
            if (matchList.Count > 0)
            {
                for (int i = 0; i < matchList.Count(); i++)
                {
                    //Temp save the match @ index i
                    MatchesEntity newMatch = new MatchesEntity()
                    {
                        MatchID          = i,
                        CardMatchNumber  = matchList[i].CardMatchNumber,
                        MatchTitle       = matchList[i].MatchTitle,
                        AttachedCardName = matchList[i].AttachedCardName,
                        MatchType        = matchList[i].MatchType,
                        MatchRules       = matchList[i].MatchRules,

                        NumOfRounds  = matchList[i].NumOfRounds,
                        MinsPerRound = matchList[i].MinsPerRound,

                        MatchMins  = matchList[i].MatchMins,
                        NumOfFalls = matchList[i].NumOfFalls,

                        Title = matchList[i].Title,

                        Participant1 = matchList[i].Participant1,
                        Participant2 = matchList[i].Participant2,
                        Participant3 = matchList[i].Participant3,
                        Participant4 = matchList[i].Participant4,
                        Participant5 = matchList[i].Participant5,
                        Participant6 = matchList[i].Participant6,
                        Participant7 = matchList[i].Participant7,
                        Participant8 = matchList[i].Participant8
                    };

                    //Save it with new index
                    mHelper.SaveMatchesList(newMatch);
                }
            }
        }
Beispiel #9
0
        private string ButtonOutput(MatchesEntity match)
        {
            /*
             *  Singles Match
             *  Tag Team Match
             *  6-Man Tag Match
             *  8-Man Tag Match
             *  Battle Royal
             */
            string output = "";

            switch (match.MatchType)
            {
            case "Singles Match":
                output = match.Participant1 + " vs " + match.Participant2 + " : " + match.MatchRating;
                break;

            case "Tag Team Match":
                output = match.Participant1 + " & " + match.Participant3 + " vs " + match.Participant2 + " & " + match.Participant4 + " : " + match.MatchRating;
                break;

            case "6-Man Tag Match":
                output = match.Participant1 + " & " + match.Participant3 + " & " + match.Participant5 + " vs " + match.Participant2 + " & " + match.Participant4 + " & " + match.Participant6 + " : " + match.MatchRating;
                break;

            case "8-Man Tag Match":
                output = match.Participant1 + " & " + match.Participant3 + " & " + match.Participant5 + " & " + match.Participant7 + " vs " + match.Participant2 + " & " + match.Participant4 + " & " + match.Participant6 + " & " + match.Participant8 + " : " + match.MatchRating;
                break;

            default:
                output = "";
                break;
            }

            return(output);
        }
Beispiel #10
0
        public List <MatchesEntity> PopulateMatchesList()
        {
            List <MatchesEntity> matchList = new List <MatchesEntity>();

            string dir = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Matches");

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Matches"));
            }
            else
            {
                FileInfo[] files = (new DirectoryInfo(dir).GetFiles("*.dat"));

                if (files.Length > 0)
                {
                    for (int i = 0; i < files.Length; i++)
                    {
                        try
                        {
                            FileInfo info = files[i];

                            using (StreamReader reader = new StreamReader(info.FullName))
                            {
                                MatchesEntity match = new MatchesEntity();

                                string id = reader.ReadLine();
                                match.MatchID = Convert.ToInt32(id);

                                string matchNum = reader.ReadLine();
                                match.CardMatchNumber = Convert.ToInt32(matchNum);
                                match.MatchTitle      = reader.ReadLine();

                                match.AttachedCardName = reader.ReadLine();

                                match.MatchType = reader.ReadLine();

                                match.MatchRules = reader.ReadLine();

                                string roundNum = reader.ReadLine();
                                match.NumOfRounds = Convert.ToInt32(roundNum);
                                string roundTime = reader.ReadLine();
                                match.MinsPerRound = Convert.ToInt32(roundTime);

                                string matchTime = reader.ReadLine();
                                match.MatchMins = Convert.ToInt32(matchTime);
                                string fallsCount = reader.ReadLine();
                                match.NumOfFalls = Convert.ToInt32(fallsCount);

                                match.Title = reader.ReadLine();

                                match.Participant1 = reader.ReadLine();
                                match.Participant2 = reader.ReadLine();
                                match.Participant3 = reader.ReadLine();
                                match.Participant4 = reader.ReadLine();
                                match.Participant5 = reader.ReadLine();
                                match.Participant6 = reader.ReadLine();
                                match.Participant7 = reader.ReadLine();
                                match.Participant8 = reader.ReadLine();

                                match.RedSideResult  = reader.ReadLine();
                                match.BlueSideResult = reader.ReadLine();

                                match.MatchWinners = reader.ReadLine();

                                string finalRnds = reader.ReadLine();
                                match.FinalNumOfRounds = Convert.ToInt32(finalRnds);
                                string finalFall = reader.ReadLine();
                                match.FinalFallCount = Convert.ToInt32(finalFall);

                                string finalMins = reader.ReadLine();
                                match.FinalMatchMins = Convert.ToInt32(finalMins);
                                string finalSecs = reader.ReadLine();
                                match.FinalMatchSecs = Convert.ToInt32(finalSecs);

                                string rating = reader.ReadLine();
                                match.MatchRating = Convert.ToInt32(rating);

                                matchList.Add(match);

                                reader.Close();
                                //stream.Close();
                            }
                        }
                        catch (Exception e)
                        {
                            dir = string.Concat(Directory.GetCurrentDirectory(), "\\Logs");

                            if (!Directory.Exists(dir))
                            {
                                Directory.CreateDirectory(string.Concat(Directory.GetCurrentDirectory(), "\\Logs"));
                            }

                            string log = "Log - " + DateTime.Today.Ticks.ToString();

                            FileStream   stream = new FileStream(Directory.GetCurrentDirectory() + "\\Logs\\" + log + ".dat", FileMode.Create, FileAccess.Write);
                            StreamWriter writer = new StreamWriter(stream);

                            string err = e.ToString();
                            writer.WriteLine(err + "\n");

                            writer.Close();
                            stream.Close();
                        }
                    }
                }
            }

            return(matchList);
        }
        public PastMatchMain(MatchesEntity match)
        {
            InitializeComponent();

            MatchName = match.Title;
            CardName  = match.AttachedCardName;

            storeHelper.CardsList   = cHelper.PopulateCardsList();
            storeHelper.MatchesList = mHelper.PopulateMatchesList();

            MatchesEntity ma   = storeHelper.MatchesList.FirstOrDefault(m => m.Title == MatchName && m.AttachedCardName == CardName);
            CardsEntity   card = storeHelper.CardsList.FirstOrDefault(c => c.CardName == CardName && c.CardName == match.AttachedCardName);

            lblCardPromo.Text = card.ConnOrgName;
            lblCardLoc.Text   = card.Location;

            lblCardTitle.Text = card.CardName;
            lblSubTitle.Text  = card.SubTitle;

            lblMatchTitle.Text = match.Title;

            lblRedRes.Text = match.RedSideResult;
            lblPart1.Text  = match.Participant1;
            lblPart3.Text  = match.Participant3;
            lblPart5.Text  = match.Participant5;
            lblPart7.Text  = match.Participant7;

            switch (match.RedSideResult)
            {
            case "Won":
                lblRedRes.BackColor = Color.Green;
                lblRedRes.ForeColor = Color.PaleGreen;
                break;

            case "Draw":
                lblRedRes.BackColor = Color.DarkGoldenrod;
                lblRedRes.ForeColor = Color.NavajoWhite;
                break;

            case "Loss":
                lblRedRes.BackColor = Color.Crimson;
                lblRedRes.ForeColor = Color.MistyRose;
                break;
            }

            lblBlueRes.Text = match.BlueSideResult;
            lblPart2.Text   = match.Participant2;
            lblPart4.Text   = match.Participant4;
            lblPart6.Text   = match.Participant6;
            lblPart8.Text   = match.Participant8;

            switch (match.BlueSideResult)
            {
            case "Won":
                lblBlueRes.BackColor = Color.Green;
                lblBlueRes.ForeColor = Color.PaleGreen;
                break;

            case "Draw":
                lblBlueRes.BackColor = Color.DarkGoldenrod;
                lblBlueRes.ForeColor = Color.NavajoWhite;
                break;

            case "Loss":
                lblBlueRes.BackColor = Color.Crimson;
                lblBlueRes.ForeColor = Color.MistyRose;
                break;
            }

            if (match.FinalFallCount > 0)
            {
                lblRndOrFalls.Text      = "Fall #:";
                lblMatchRndFallNum.Text = match.FinalFallCount.ToString();
            }
            else if (match.FinalNumOfRounds > 0)
            {
                lblRndOrFalls.Text      = "Round #:";
                lblMatchRndFallNum.Text = match.FinalNumOfRounds.ToString();
            }

            lblMatchRndFallMins.Text = match.FinalMatchMins.ToString();
            lblMatchRndFallSecs.Text = match.FinalMatchSecs.ToString();

            lblMatchFinalRating.Text = match.MatchRating.ToString();
        }
Beispiel #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            IDSetterHelper idHelper = new IDSetterHelper();

            int rnds, rndsMins, mMins, mFalls;

            if (cbxRoundsCount.SelectedItem == null)
            {
                rnds = 0;
            }
            else
            {
                rnds = Convert.ToInt32(cbxRoundsCount.SelectedItem.ToString());
            }

            if (cbxRndsMinPerRnds.SelectedItem == null)
            {
                rndsMins = 0;
            }
            else
            {
                rndsMins = Convert.ToInt32(cbxRndsMinPerRnds.SelectedItem.ToString().ToString());
            }

            if (cbxFallsCount.SelectedItem == null)
            {
                mFalls = 0;
            }
            else
            {
                mFalls = Convert.ToInt32(cbxFallsCount.SelectedItem.ToString().ToString());
            }

            if (cbxMatchMins.SelectedItem == null)
            {
                mMins = 0;
            }
            else
            {
                mMins = Convert.ToInt32(cbxMatchMins.SelectedItem.ToString().ToString());
            }

            string title;

            if (cbxTitles.SelectedItem == null)
            {
                title = "";
            }
            else
            {
                title = cbxTitles.SelectedItem.ToString();
            }

            string part1 = "";
            string part2 = "";
            string part3 = "";
            string part4 = "";
            string part5 = "";
            string part6 = "";
            string part7 = "";
            string part8 = "";

            /*
             *  Singles Match
             *  Tag Team Match
             *  6-Man Tag Match
             *  8-Man Tag Match
             *  Battle Royal
             */

            if (cbxMatchType.SelectedItem.ToString() == "Singles Match")
            {
                if (cbxPart1.SelectedItem == null)
                {
                    cbxPart1.BackColor = Color.MistyRose;
                }
                else
                {
                    part1 = cbxPart1.SelectedItem.ToString();
                }

                if (cbxPart2.SelectedItem == null)
                {
                    cbxPart2.BackColor = Color.MistyRose;
                }
                else
                {
                    part2 = cbxPart2.SelectedItem.ToString();
                }

                part3 = "";
                part4 = "";
                part5 = "";
                part6 = "";
                part7 = "";
                part8 = "";
            }
            else if (cbxMatchType.SelectedItem.ToString() == "Tag Team Match")
            {
                if (cbxPart1.SelectedItem == null)
                {
                    cbxPart1.BackColor = Color.MistyRose;
                }
                else
                {
                    part1 = cbxPart1.SelectedItem.ToString();
                }

                if (cbxPart3.SelectedItem == null)
                {
                    cbxPart3.BackColor = Color.MistyRose;
                }
                else
                {
                    part3 = cbxPart3.SelectedItem.ToString();
                }

                if (cbxPart2.SelectedItem == null)
                {
                    cbxPart2.BackColor = Color.MistyRose;
                }
                else
                {
                    part2 = cbxPart2.SelectedItem.ToString();
                }

                if (cbxPart4.SelectedItem == null)
                {
                    cbxPart4.BackColor = Color.MistyRose;
                }
                else
                {
                    part4 = cbxPart4.SelectedItem.ToString();
                }

                part5 = "";
                part6 = "";
                part7 = "";
                part8 = "";
            }
            else if (cbxMatchType.SelectedItem.ToString() == "6-Man Tag Match")
            {
                if (cbxPart1.SelectedItem == null)
                {
                    cbxPart1.BackColor = Color.MistyRose;
                }
                else
                {
                    part1 = cbxPart1.SelectedItem.ToString();
                }

                if (cbxPart3.SelectedItem == null)
                {
                    cbxPart3.BackColor = Color.MistyRose;
                }
                else
                {
                    part3 = cbxPart3.SelectedItem.ToString();
                }

                if (cbxPart5.SelectedItem == null)
                {
                    cbxPart5.BackColor = Color.MistyRose;
                }
                else
                {
                    part5 = cbxPart5.SelectedItem.ToString();
                }

                if (cbxPart2.SelectedItem == null)
                {
                    cbxPart2.BackColor = Color.MistyRose;
                }
                else
                {
                    part2 = cbxPart2.SelectedItem.ToString();
                }

                if (cbxPart4.SelectedItem == null)
                {
                    cbxPart4.BackColor = Color.MistyRose;
                }
                else
                {
                    part4 = cbxPart4.SelectedItem.ToString();
                }

                if (cbxPart6.SelectedItem == null)
                {
                    cbxPart6.BackColor = Color.MistyRose;
                }
                else
                {
                    part6 = cbxPart6.SelectedItem.ToString();
                }

                part7 = "";
                part8 = "";
            }
            else if (cbxMatchType.SelectedItem.ToString() == "8-Man Tag Match" ||
                     cbxMatchType.SelectedItem.ToString() == "Battle Royal")
            {
                if (cbxPart1.SelectedItem == null)
                {
                    cbxPart1.BackColor = Color.MistyRose;
                }
                else
                {
                    part1 = cbxPart1.SelectedItem.ToString();
                }

                if (cbxPart3.SelectedItem == null)
                {
                    cbxPart3.BackColor = Color.MistyRose;
                }
                else
                {
                    part3 = cbxPart3.SelectedItem.ToString();
                }

                if (cbxPart5.SelectedItem == null)
                {
                    cbxPart5.BackColor = Color.MistyRose;
                }
                else
                {
                    part5 = cbxPart5.SelectedItem.ToString();
                }

                if (cbxPart7.SelectedItem == null)
                {
                    cbxPart7.BackColor = Color.MistyRose;
                }
                else
                {
                    part7 = cbxPart7.SelectedItem.ToString();
                }


                if (cbxPart2.SelectedItem == null)
                {
                    cbxPart2.BackColor = Color.MistyRose;
                }
                else
                {
                    part2 = cbxPart2.SelectedItem.ToString();
                }

                if (cbxPart4.SelectedItem == null)
                {
                    cbxPart4.BackColor = Color.MistyRose;
                }
                else
                {
                    part4 = cbxPart4.SelectedItem.ToString();
                }

                if (cbxPart6.SelectedItem == null)
                {
                    cbxPart6.BackColor = Color.MistyRose;
                }
                else
                {
                    part6 = cbxPart6.SelectedItem.ToString();
                }

                if (cbxPart8.SelectedItem == null)
                {
                    cbxPart8.BackColor = Color.MistyRose;
                }
                else
                {
                    part8 = cbxPart8.SelectedItem.ToString();
                }
            }

            MatchesEntity newMatch = new MatchesEntity()
            {
                MatchID          = idHelper.CurrentID(false, false, true, false, false, false, false),
                CardMatchNumber  = storeHelper.MatchesList.Count() + 1,
                MatchTitle       = tbMatchTitle.Text,
                AttachedCardName = CardName,
                MatchType        = cbxMatchType.SelectedItem.ToString(),
                MatchRules       = cbxMatchRules.SelectedItem.ToString(),

                NumOfRounds  = rnds,
                MinsPerRound = rndsMins,

                MatchMins  = mMins,
                NumOfFalls = mFalls,

                Title = title,

                Participant1 = part1,
                Participant2 = part2,
                Participant3 = part3,
                Participant4 = part4,
                Participant5 = part5,
                Participant6 = part6,
                Participant7 = part7,
                Participant8 = part8
            };

            mHelper.SaveMatchesList(newMatch);

            NewCard n = new NewCard(OrgName, false, thisCard.CardName);

            n.Show();
            this.Hide();
        }
Beispiel #13
0
        private void PopulateNextMatch(MatchesEntity match)
        {
            lblMatchNum.Text   = match.CardMatchNumber.ToString();
            lblMatchTitle.Text = match.MatchTitle;
            lblMatchRules.Text = match.MatchRules;
            lblChamp.Text      = match.Title;

            tbPart1.Text = match.Participant1;
            tbPart2.Text = match.Participant2;
            tbPart3.Text = match.Participant3;
            tbPart4.Text = match.Participant4;
            tbPart5.Text = match.Participant5;
            tbPart6.Text = match.Participant6;
            tbPart7.Text = match.Participant7;
            tbPart8.Text = match.Participant8;

            if (match.MatchRules != "SWA Match" ||
                match.MatchRules != "Gruesome Match")
            {
                udRndNum.Enabled  = false;
                udRndMins.Enabled = false;
                udRndSecs.Enabled = false;

                udFallNum.Enabled   = true;
                udMatchMins.Enabled = true;
                udMatchSecs.Enabled = true;

                udFallNum.Value     = match.FinalFallCount;
                udMatchMins.Value   = match.FinalMatchMins;
                udMatchSecs.Value   = match.FinalMatchSecs;
                udMatchRating.Value = match.MatchRating;

                if (match.MatchType == "Singles Match")
                {
                    cbBlue1.Enabled = true;
                    cbRed1.Enabled  = true;

                    cbBlue2.Enabled = false;
                    cbBlue3.Enabled = false;
                    cbBlue4.Enabled = false;
                    cbRed2.Enabled  = false;
                    cbRed3.Enabled  = false;
                    cbRed4.Enabled  = false;
                }
                else if (match.MatchType == "Tag Team Match")
                {
                    cbBlue1.Enabled = true;
                    cbRed1.Enabled  = true;

                    cbBlue2.Enabled = false;
                    cbBlue3.Enabled = false;
                    cbBlue4.Enabled = false;
                    cbRed2.Enabled  = false;
                    cbRed3.Enabled  = false;
                    cbRed4.Enabled  = false;
                }
                else if (match.MatchType == "6-Man Tag Match")
                {
                    cbBlue1.Enabled = true;
                    cbRed1.Enabled  = true;

                    cbBlue2.Enabled = false;
                    cbBlue3.Enabled = false;
                    cbBlue4.Enabled = false;
                    cbRed2.Enabled  = false;
                    cbRed3.Enabled  = false;
                    cbRed4.Enabled  = false;
                }
                else if (match.MatchType == "8-Man Tag Match")
                {
                    cbBlue1.Enabled = true;
                    cbRed1.Enabled  = true;

                    cbBlue2.Enabled = false;
                    cbBlue3.Enabled = false;
                    cbBlue4.Enabled = false;
                    cbRed2.Enabled  = false;
                    cbRed3.Enabled  = false;
                    cbRed4.Enabled  = false;
                }
                else if (match.MatchType == "Battle Royal")
                {
                    cbBlue1.Enabled = true;
                    cbBlue2.Enabled = true;
                    cbBlue3.Enabled = true;
                    cbBlue4.Enabled = true;

                    cbRed1.Enabled = true;
                    cbRed2.Enabled = true;
                    cbRed3.Enabled = true;
                    cbRed4.Enabled = true;
                }
            }
            else
            {
                udFallNum.Enabled   = false;
                udMatchMins.Enabled = false;
                udMatchSecs.Enabled = false;

                udRndNum.Enabled  = true;
                udRndMins.Enabled = true;
                udRndSecs.Enabled = true;

                udRndNum.Value      = match.FinalNumOfRounds;
                udMatchMins.Value   = match.FinalMatchMins;
                udMatchSecs.Value   = match.FinalMatchSecs;
                udMatchRating.Value = match.MatchRating;

                cbBlue1.Enabled = true;
                cbRed1.Enabled  = true;

                cbBlue2.Enabled = false;
                cbBlue3.Enabled = false;
                cbBlue4.Enabled = false;
                cbRed2.Enabled  = false;
                cbRed3.Enabled  = false;
                cbRed4.Enabled  = false;
            }
        }
Beispiel #14
0
        private void SaveCurrentMatch(MatchesEntity match)
        {
            if (match.MatchRules != "SWA Match" ||
                match.MatchRules != "Gruesome Match")
            {
                match.FinalFallCount = Convert.ToInt32(udFallNum.Value);
                match.FinalMatchMins = Convert.ToInt32(udMatchMins.Value);
                match.FinalMatchSecs = Convert.ToInt32(udMatchSecs.Value);
                match.MatchRating    = Convert.ToInt32(udMatchRating.Value);

                if (match.MatchType == "Singles Match" ||
                    match.MatchType == "Tag Team Match" ||
                    match.MatchType == "6-Man Tag Match" ||
                    match.MatchType == "8-Man Tag Match")
                {
                    if (cbRed1.Checked)
                    {
                        match.RedSideResult  = "Won";
                        match.BlueSideResult = "Loss";

                        if (match.MatchType == "Singles Match")
                        {
                            match.MatchWinners = tbPart1.Text;
                        }
                        else if (match.MatchType == "Tag Team Match")
                        {
                            match.MatchWinners = tbPart1.Text + " & " + tbPart3.Text;
                        }
                        else if (match.MatchType == "6-Man Tag Match")
                        {
                            match.MatchWinners = tbPart1.Text + " & " + tbPart3.Text + " & " + tbPart5.Text;
                        }
                        else if (match.MatchType == "8-Man Tag Match")
                        {
                            match.MatchWinners = tbPart1.Text + " & " + tbPart3.Text + " & " + tbPart5.Text + " & " + tbPart7.Text;
                        }
                    }
                    else if (cbBlue1.Checked)
                    {
                        match.RedSideResult  = "Loss";
                        match.BlueSideResult = "Won";

                        if (match.MatchType == "Singles Match")
                        {
                            match.MatchWinners = tbPart2.Text;
                        }
                        else if (match.MatchType == "Tag Team Match")
                        {
                            match.MatchWinners = tbPart2.Text + " & " + tbPart4.Text;
                        }
                        else if (match.MatchType == "6-Man Tag Match")
                        {
                            match.MatchWinners = tbPart2.Text + " & " + tbPart4.Text + " & " + tbPart6.Text;
                        }
                        else if (match.MatchType == "8-Man Tag Match")
                        {
                            match.MatchWinners = tbPart2.Text + " & " + tbPart4.Text + " & " + tbPart6.Text + " & " + tbPart8.Text;
                        }
                    }
                    else
                    {
                        match.RedSideResult  = "Draw";
                        match.BlueSideResult = "Draw";

                        match.MatchWinners = "Match Draw";
                    }
                }
                else if (match.MatchType == "Battle Royal")
                {
                    if (cbRed1.Checked)
                    {
                        match.RedSideResult  = "Won";
                        match.BlueSideResult = "Loss";

                        match.MatchWinners = tbPart1.Text;
                    }
                    else if (cbRed2.Checked)
                    {
                        match.RedSideResult  = "Won";
                        match.BlueSideResult = "Loss";

                        match.MatchWinners = tbPart3.Text;
                    }
                    else if (cbRed3.Checked)
                    {
                        match.RedSideResult  = "Won";
                        match.BlueSideResult = "Loss";

                        match.MatchWinners = tbPart5.Text;
                    }
                    else if (cbRed4.Checked)
                    {
                        match.RedSideResult  = "Won";
                        match.BlueSideResult = "Loss";

                        match.MatchWinners = tbPart7.Text;
                    }
                    else if (cbBlue1.Checked)
                    {
                        match.RedSideResult  = "Loss";
                        match.BlueSideResult = "Won";

                        match.MatchWinners = tbPart2.Text;
                    }
                    else if (cbBlue2.Checked)
                    {
                        match.RedSideResult  = "Loss";
                        match.BlueSideResult = "Won";

                        match.MatchWinners = tbPart4.Text;
                    }
                    else if (cbBlue3.Checked)
                    {
                        match.RedSideResult  = "Loss";
                        match.BlueSideResult = "Won";

                        match.MatchWinners = tbPart6.Text;
                    }
                    else if (cbBlue4.Checked)
                    {
                        match.RedSideResult  = "Loss";
                        match.BlueSideResult = "Won";

                        match.MatchWinners = tbPart8.Text;
                    }
                    else
                    {
                        match.RedSideResult  = "Draw";
                        match.BlueSideResult = "Draw";

                        match.MatchWinners = "Match Draw";
                    }
                }

                mHelper.SaveMatchesList(match);
            }
            else
            {
                match.FinalNumOfRounds = Convert.ToInt32(udRndNum.Value);
                match.FinalMatchMins   = Convert.ToInt32(udMatchMins.Value);
                match.FinalMatchSecs   = Convert.ToInt32(udMatchSecs.Value);
                match.MatchRating      = Convert.ToInt32(udMatchRating.Value);

                if (cbRed1.Checked)
                {
                    match.RedSideResult  = "Won";
                    match.BlueSideResult = "Loss";

                    match.MatchWinners = tbPart1.Text;
                }
                else if (cbBlue1.Checked)
                {
                    match.RedSideResult  = "Loss";
                    match.BlueSideResult = "Won";

                    match.MatchWinners = tbPart2.Text;
                }
                else
                {
                    match.RedSideResult  = "Draw";
                    match.BlueSideResult = "Draw";

                    match.MatchWinners = "Match Draw";
                }

                mHelper.SaveMatchesList(match);
            }
        }