Ejemplo n.º 1
0
        public void UnClickEveryButton()
        {
            if (CapEstate == true)
            {
                CapEstateBtn.PerformClick(); CapBlank.Visible = false;
            }

            if (Castries == true)
            {
                CastriesBtn.PerformClick(); CasBlank.Visible = false;
            }

            if (Bosquet == true)
            {
                BosquetBtn.PerformClick(); BosquetBlank.Visible = false;
            }

            if (Soufriere == true)
            {
                SoufriereBtn.PerformClick(); SouBlank.Visible = false;
            }

            if (Vieuxfort == true)
            {
                VieuxfortBtn.PerformClick(); VieuxBlank.Visible = false;
            }

            if (Anbre == true)
            {
                AnbreBtn.PerformClick(); AnbreBlank.Visible = false;
            }
        }
Ejemplo n.º 2
0
        public void Connections()
        {
            displayStationBtn.PerformClick();

            if (OriginLst.SelectedIndex == DestLst.SelectedIndex)
            {
                MessageBox.Show("You are already at this destination");
                CasBlank.Image     = Properties.Resources.Home;
                CapBlank.Image     = Properties.Resources.Home;
                BosquetBlank.Image = Properties.Resources.Home;
                SouBlank.Image     = Properties.Resources.Home;
                VieuxBlank.Image   = Properties.Resources.Home;
                AnbreBlank.Image   = Properties.Resources.Home;
            }

            //Cap Estate
            if (OriginLst.SelectedIndex == 0)
            {
                UnClickEveryButton();
                CapEstateBtn.PerformClick();
                CapBlank.Image   = Properties.Resources.Home;
                CapBlank.Visible = true;



                if (DestLst.SelectedIndex == 1)
                {
                    Route = 1;

                    CastriesBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 2)
                {
                    Route = 2;
                    CastriesBtn.PerformClick();
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 3)
                {
                    Route = 3;
                    CastriesBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 4)
                {
                    Route = 4;
                    CastriesBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                    VieuxfortBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 5)
                {
                    Route = 5;
                    CastriesBtn.PerformClick();
                    BosquetBtn.PerformClick();
                    AnbreBtn.PerformClick();
                }
            }
            //Castries
            if (OriginLst.SelectedIndex == 1)
            {
                UnClickEveryButton();
                CastriesBtn.PerformClick();
                CasBlank.Image   = Properties.Resources.Home;
                CasBlank.Visible = true;
                if (DestLst.SelectedIndex == 0)
                {
                    Route = 6;
                    CapEstateBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 2)
                {
                    Route = 7;
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 3)
                {
                    Route = 8;
                    SoufriereBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 4)
                {
                    Route = 9;
                    SoufriereBtn.PerformClick();
                    VieuxfortBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 5)
                {
                    Route = 10;
                    BosquetBtn.PerformClick();
                    AnbreBtn.PerformClick();
                }
            }
            //Bosquet
            if (OriginLst.SelectedIndex == 2)
            {
                UnClickEveryButton();
                BosquetBtn.PerformClick();
                BosquetBlank.Image   = Properties.Resources.Home;
                BosquetBlank.Visible = true;
                if (DestLst.SelectedIndex == 0)
                {
                    CapEstateBtn.PerformClick();
                    CastriesBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 1)
                {
                    CastriesBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 3)
                {
                    CastriesBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 4)
                {
                    AnbreBtn.PerformClick();
                    VieuxfortBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 5)
                {
                    AnbreBtn.PerformClick();
                }
            }
            //Soufriere
            if (OriginLst.SelectedIndex == 3)
            {
                UnClickEveryButton();
                SoufriereBtn.PerformClick();
                SouBlank.Image   = Properties.Resources.Home;
                SouBlank.Visible = true;
                if (DestLst.SelectedIndex == 0)
                {
                    CapEstateBtn.PerformClick();
                    CastriesBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 1)
                {
                    CastriesBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 2)
                {
                    CastriesBtn.PerformClick();
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 4)
                {
                    VieuxfortBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 5)
                {
                    AnbreBtn.PerformClick();
                    VieuxfortBtn.PerformClick();
                }
            }
            //Vieuxfort
            if (OriginLst.SelectedIndex == 4)
            {
                UnClickEveryButton();
                VieuxfortBtn.PerformClick();
                VieuxBlank.Image   = Properties.Resources.Home;
                VieuxBlank.Visible = true;
                if (DestLst.SelectedIndex == 0)
                {
                    CapEstateBtn.PerformClick();
                    CastriesBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 1)
                {
                    CastriesBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 2)
                {
                    AnbreBtn.PerformClick();
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 3)
                {
                    SoufriereBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 5)
                {
                    AnbreBtn.PerformClick();
                }
            }
            //Anbre
            if (OriginLst.SelectedIndex == 5)
            {
                UnClickEveryButton();
                AnbreBtn.PerformClick();
                AnbreBlank.Image   = Properties.Resources.Home;
                AnbreBlank.Visible = true;
                if (DestLst.SelectedIndex == 0)
                {
                    CapEstateBtn.PerformClick();
                    CastriesBtn.PerformClick();
                    BosquetBtn.PerformClick();
                }
                else if (DestLst.SelectedIndex == 1)
                {
                    CastriesBtn.PerformClick();
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 2)
                {
                    BosquetBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 3)
                {
                    VieuxfortBtn.PerformClick();
                    SoufriereBtn.PerformClick();
                }

                else if (DestLst.SelectedIndex == 4)
                {
                    VieuxfortBtn.PerformClick();
                }
            }

            //Destination
            if (DestLst.SelectedIndex == 0)
            {
                CapBlank.Image   = Properties.Resources.Location;
                CapBlank.Visible = true;
            }
            else if (DestLst.SelectedIndex == 1)
            {
                CasBlank.Image   = Properties.Resources.Location;
                CasBlank.Visible = true;
            }
            else if (DestLst.SelectedIndex == 2)
            {
                BosquetBlank.Image   = Properties.Resources.Location;
                BosquetBlank.Visible = true;
            }
            else if (DestLst.SelectedIndex == 3)
            {
                SouBlank.Image   = Properties.Resources.Location;
                SouBlank.Visible = true;
            }
            else if (DestLst.SelectedIndex == 4)
            {
                VieuxBlank.Image   = Properties.Resources.Location;
                VieuxBlank.Visible = true;
            }
            else if (DestLst.SelectedIndex == 5)
            {
                AnbreBlank.Image   = Properties.Resources.Location;
                AnbreBlank.Visible = true;
            }

            if (OriginLst.SelectedIndex == DestLst.SelectedIndex)
            {
                CasBlank.Image     = Properties.Resources.Home;
                CapBlank.Image     = Properties.Resources.Home;
                BosquetBlank.Image = Properties.Resources.Home;
                SouBlank.Image     = Properties.Resources.Home;
                VieuxBlank.Image   = Properties.Resources.Home;
                AnbreBlank.Image   = Properties.Resources.Home;
            }

            OriginConnection();
            DestinationConnection();
        }