Esempio n. 1
0
        private void btnFindJourney_Click(object sender, EventArgs e)
        {
            Journey findJourney = JourneysManager.FindJourney(textBoxIdOfJourneyToFind.Text);

            textBoxRewFromCity.Text    = findJourney.FromCity;
            textBoxRewToCity.Text      = findJourney.ToCity;
            dateTimePickerRewDate.Text = findJourney.Date;
        }
Esempio n. 2
0
 public void AddJourney(string fromCity, string toCity, string date)
 {
     if (JourneysManager.FindJourney(fromCity, toCity, date))
     {
         string   timeAndPrice    = JourneysManager.FindJourneyTimeAndPrice(fromCity, toCity, date);
         string[] ArrTimeAndPrice = timeAndPrice.Split(' ');
         string   time            = ArrTimeAndPrice[0];
         string   price           = ArrTimeAndPrice[1];
         Journey  journeyAdd      = new Journey(fromCity, toCity, date, time, price);
         journeysInPannier.Add(journeyAdd);
         MessageBox.Show("You have added journey to your list in pannier");
     }
     else
     {
         MessageBox.Show("Such journey is not available");
     }
 }
Esempio n. 3
0
        private void btnReWrite_Click(object sender, EventArgs e)
        {
            Journey findJourney = JourneysManager.FindJourney(textBoxIdOfJourneyToFind.Text);

            comboBoxFromCity.Items.Remove(findJourney.FromCity);
            comboBoxToCity.Items.Remove(findJourney.ToCity);
            comboBoxDateTime.Items.Remove(findJourney.Date);

            findJourney.ToCity   = textBoxRewToCity.Text;
            findJourney.FromCity = textBoxRewFromCity.Text;
            findJourney.Date     = dateTimePickerRewDate.Text;

            comboBoxFromCity.Items.Add(findJourney.FromCity);
            comboBoxToCity.Items.Add(findJourney.ToCity);
            comboBoxDateTime.Items.Add(findJourney.Date);

            textBoxRewFromCity.Text    = "";
            textBoxRewToCity.Text      = "";
            dateTimePickerRewDate.Text = "";

            textBoxIdOfJourneyToFind.Text = "";
        }