Пример #1
0
        private void cbStageSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            int    id         = 0;
            string startCity  = "";
            string finishCity = "";
            double distance   = 0;

            int       stageID   = cbStageSelector.SelectedIndex;
            DataTable stageInfo = service.getStage(stageID + 1);

            foreach (DataRow row in stageInfo.Rows)
            {
                id         = (int)row["id"];
                startCity  = row["start"].ToString();
                finishCity = row["finish"].ToString();
                distance   = (double)row["distance"];
            }

            lblStageInfo.Text    = startCity + " / " + finishCity + " (" + distance + "km)";
            pbStageMap.Image     = Image.FromFile("C:/Users/robin/Documents/GitHub/TourPouleApp/TourPouleApp/TourPouleApp/stageImages/stage" + id + "map.jpg");
            pbStageProfile.Image = Image.FromFile("C:/Users/robin/Documents/GitHub/TourPouleApp/TourPouleApp/TourPouleApp/stageImages/stage" + id + "profile.png");
        }