Пример #1
0
 private void viewTripsBtn_Click(object sender, EventArgs e)
 {
     if (viewTrips == null)
     {
         viewTrips             = new ViewTrips();
         viewTrips.FormClosed += delegate { viewTrips = null; };
     }
     viewTrips.currentUser = currentUser;
     viewTrips.Show();
 }
Пример #2
0
        private void AddTripBtn_Click(object sender, EventArgs e)
        {
            tripAddCounter++;
            if (viewTrips == null)
            {
                viewTrips             = new ViewTrips();
                viewTrips.FormClosed += delegate { viewTrips = null; };
            }
            if (tripAddCounter == 1)
            {
                viewTrips.trip1destLbl.Text = destTb.Text;
                viewTrips.DepDateLbl.Text   = "Departure date: " + depDateTb.Text;
                viewTrips.DepTimeLbl.Text   = "Departure time: " + DepTimeTb.Text;
                viewTrips.arrDateLbl.Text   = "Arrival date: " + arrDateTb.Text;
                viewTrips.arrTimeLbl.Text   = "Arrival time: " + arrTimeTb.Text;
            }


            currentUser.destination = destTb.Text;

            currentUser.DepartureDate = depDateTb.Text;
            currentUser.DepartureTime = DepTimeTb.Text;
            currentUser.ArrivalDate   = arrDateTb.Text;
            currentUser.ArrivalTime   = arrTimeTb.Text;

            if (eastOrWest(currentUser.destination).Equals("east"))
            {
                currentUser.setType("East");
            }
            else if (eastOrWest(currentUser.destination).Equals("west"))
            {
                currentUser.setType("West");
            }
            else
            {
                currentUser.setType("Regular");
            }



            MessageBox.Show("Trip Added!");
            destTb.Clear();
            depDateTb.Clear();
            DepTimeTb.Clear();
            arrDateTb.Clear();
            arrTimeTb.Clear();
        }