public void Add(PointsUserControl usercontrol, int tab)
        {
            switch (tab)
            {
            case 0:
                overallFlowLayoutPanel.Controls.Add(usercontrol);
                break;

            case 1:
                weekFlowLayoutPanel.Controls.Add(usercontrol);
                break;
            }
        }
        public void Add(PointsUserControl usercontrol, int tab)
        {
            overallFlowLayoutPanel.Controls.Add(usercontrol);

            //switch (tab)
            //{
            //    case 0:
            //        overallFlowLayoutPanel.Controls.Add(usercontrol);
            //        break;
            //    case 1:
            //        weekFlowLayoutPanel.Controls.Add(usercontrol);
            //        break;
            //}
        }
Esempio n. 3
0
        private void statsButton_Click(object sender, EventArgs e)
        {
            var fb = new FixtureBuilder();
            //var weekStats = fb.getWeekStats();
            var totalStats = fb.getTotalStats();

            //if (weekStats.Count < 1 || totalStats.Count < 1)
            if (totalStats.Count < 1)
            {
                MessageBox.Show("There are no stats to display.");
            }
            else
            {
                tablePanel.Visible   = false;
                submitButton.Visible = false;
                backButton.Enabled   = false;

                try
                {
                    fixtureBoxList[fix].Visible = false;
                }
                catch (Exception) { }

                nextButton.Visible = false;
                backButton.Visible = false;
                menuButton.Visible = true;

                mainPanel.Controls.Add(tableUsercontrol);

                //foreach (KeyValuePair<string, int> user in weekStats)
                //{
                //    var pointsUserControl = new PointsUserControl();
                //    pointsUserControl.setUserPoints(user.Key + "    " + user.Value, user.Value.ToString());
                //    tableUsercontrol.Add(pointsUserControl, 1);
                //}

                tableUsercontrol.RemoveAll();

                foreach (KeyValuePair <string, int> user in totalStats)
                {
                    var pointsUserControl = new PointsUserControl();
                    pointsUserControl.setUserPoints(user.Key + "    " + user.Value, user.Value.ToString());
                    tableUsercontrol.Add(pointsUserControl, 0);
                }

                tableUsercontrol.Visible = true;
            }
        }