Exemplo n.º 1
0
        public Homepage(RiderManager rm)
        {
            this.rm = rm;
            InitializeComponent();



            //Retrives all the riders results/summary
            //rtbIndScoreboard.AppendText(rm.GetIndividualScore());

            //ListView Scoreboard Properties
            listvScoreBoard.View = View.Details;
            listvScoreBoard.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            //Add Columns
            listvScoreBoard.Columns.Add("Position");
            listvScoreBoard.Columns.Add("ID");
            listvScoreBoard.Columns.Add("Name", 70);
            listvScoreBoard.Columns.Add("Surname", 75);
            listvScoreBoard.Columns.Add("Total Time", 95);

            //Initialise Datatable and add Columns
            dts = new DataTable();
            dts.Columns.Add("Position");
            dts.Columns.Add("ID");
            dts.Columns.Add("Name");
            dts.Columns.Add("Surname");
            dts.Columns.Add("Total Time");

            //Getting DataList from Rider Manager
            List <Rider> riders = this.rm.GetRiders();

            //Listview Rider Search Properties
            listvRiderSearch.View = View.Details;
            listvRiderSearch.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            //Add Columns
            listvRiderSearch.Columns.Add("ID");
            listvRiderSearch.Columns.Add("Name", 64);

            //Initialise Datatable and add Columns
            dt = new DataTable();
            dt.Columns.Add("ID");
            dt.Columns.Add("Name");



            foreach (var rider in riders)
            {
                dt.Rows.Add(rider.GetRiderID(), rider.GetName());
            }

            //Fill Datatable
            dv = new DataView(dt);
            PopulateListView(dv);

            //Fill Datatable
            dvs = new DataView(dts);
            PopulateListViewScoreboard(dvs);
        }
        public AllCompetitorResults(RiderManager rm)
        {
            this.rm = rm;
            InitializeComponent();

            richTextBox1.ReadOnly      = true;
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); //Set the font to bold
            richTextBox1.AppendText("Summary for all riders");
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular);
            //Retrives all the riders results/summary
            richTextBox1.AppendText(rm.GetRidersSummary());
        }
        public RiderSummary(RiderManager rm)
        {
            this.rm = rm;
            InitializeComponent();

            richTextBox1.ReadOnly      = true;
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); //Set the font to bold
            //richTextBox1.AppendText("Rider Summary");
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular);
            //Retrives a rider's summary
            richTextBox1.AppendText(rm.LastRiderSummary());
        }
        public ResultsSummary(RiderManager rm, string summary)
        {
            this.rm      = rm;
            this.summary = summary;
            InitializeComponent();

            richTextBox1.ReadOnly      = true;
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); //Set the font to bold
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular);
            //Retrives a rider's result summary
            richTextBox1.AppendText(summary);
        }
        public TimesSummary(RiderManager rm, string message)
        {
            this.rm      = rm;
            this.message = message;
            InitializeComponent();

            richTextBox1.ReadOnly      = true;
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); //Set the font to bold
            richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular);
            //Retrives a rider's start / end times summary
            richTextBox1.AppendText(message);
        }
        public RiderTimes(RiderManager rm)
        {
            this.rm = rm;
            InitializeComponent();

            if (txbSearch.Text == "") //If the Search textbox is blank then do the following
            {
                txbSearch.Focus();
            }

            //Disable all the radiobuttons, datetimepickers and update button
            //to prevent user from clicking it when they have not selected a rider
            rbttn1.Enabled       = false;
            rbttn2.Enabled       = false;
            rbttn3.Enabled       = false;
            rbttn4.Enabled       = false;
            bttnUpdate.Enabled   = false;
            dtpStartTime.Enabled = false;
            dtpEndTime.Enabled   = false;

            //Formatting the datetimepickers
            dtpStartTime.Format       = DateTimePickerFormat.Custom;
            dtpStartTime.CustomFormat = "HH:mm:ss";
            dtpStartTime.Text         = "00:00:00";

            dtpEndTime.Format       = DateTimePickerFormat.Custom;
            dtpEndTime.CustomFormat = "HH:mm:ss";
            dtpEndTime.Text         = "00:00:00";

            //Listview Properties
            listvSearch.View = View.Details;
            listvSearch.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            //Add Columns
            listvSearch.Columns.Add("ID");
            listvSearch.Columns.Add("Name");
            listvSearch.Columns.Add("Surname", 75);
            listvSearch.Columns.Add("Age", 50);
            listvSearch.Columns.Add("School", 75);
            listvSearch.Columns.Add("Leg 1", 80);
            listvSearch.Columns.Add("Leg 2", 80);
            listvSearch.Columns.Add("Leg 3", 80);
            listvSearch.Columns.Add("Leg 4", 80);

            //Initialise Datatable and add Columns
            dt = new DataTable();
            dt.Columns.Add("ID");
            dt.Columns.Add("Name");
            dt.Columns.Add("Surname");
            dt.Columns.Add("Age");
            dt.Columns.Add("School");
            dt.Columns.Add("Leg 1");
            dt.Columns.Add("Leg 2");
            dt.Columns.Add("Leg 3");
            dt.Columns.Add("Leg 4");

            //Getting DataList from Rider Manager
            List <Rider> riders = this.rm.GetRiders();

            foreach (var rider in riders)   //Code from Microsoft Teams
            {
                string[] entryData = rider.GetLegStatus().Split('#');

                string[] entryStatus = new string[4];

                int innerLoop = 0;
                for (int entryDataIndex = 0; entryDataIndex < entryData.Length; entryDataIndex++)
                {
                    for (int entryStatusIndex = innerLoop; entryStatusIndex < 4; entryStatusIndex++)
                    {
                        if (entryData[entryDataIndex] == "" + entryStatusIndex)
                        {
                            entryStatus[entryStatusIndex] = "Entered";
                            //When the leg is entered, add 1 to the leg entered index which makes the innerLoop
                            //This is so that the for loop starts at the next index
                            innerLoop        = entryStatusIndex + 1;
                            entryStatusIndex = 4;
                        }
                        else
                        {
                            entryStatus[entryStatusIndex] = "Not Entered";
                        }
                    }
                }
                //if (entryData[entryData.Length - 1] != "1")
                //{
                //    entryStatus[1] = "Not Entered";
                //}

                //if (entryData[entryData.Length - 1] != "2")
                //{
                //    entryStatus[2] = "Not Entered";
                //}

                if (entryData[entryData.Length - 1] != "3")
                {
                    entryStatus[3] = "Not Entered";
                }

                dt.Rows.Add(rider.GetRiderID(), rider.GetName(), rider.GetSurname(), rider.GetAge(), rider.GetSchool(), entryStatus[0], entryStatus[1], entryStatus[2], entryStatus[3]);
            }

            //Fill Datatable
            dv = new DataView(dt);

            PopulateListView(dv);
        }
 public Export(RiderManager rm)
 {
     this.rm = rm;
     InitializeComponent();
 }
Exemplo n.º 8
0
 public AddRider(RiderManager rm)
 {
     this.rm = rm;
     InitializeComponent();
 }