Ejemplo n.º 1
0
        public EditPassenger(passenger o)
        {
            InitializeComponent();

            p = o;

            FirstNameTextBox.Text = p.first_name;
            LastNameTextBox.Text  = p.last_name;
            PhoneTextBox.Text     = p.phone;
            AddressTextBox.Text   = p.address;
        }
Ejemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            transportation transportation = (transportation)TransportationComboBox.SelectedItem;
            passenger      passenger      = (passenger)PassengerComboBox.SelectedItem;

            t.transportation_id = transportation.Id;
            t.passenger_id      = passenger.Id;

            db.transportation_passangers.AddOrUpdate(t);

            db.SaveChanges();

            this.Close();
        }
Ejemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string fName   = FirstNameTextBox.Text;
            string lName   = LastNameTextBox.Text;
            string phone   = PhoneTextBox.Text;
            string address = AddressTextBox.Text;


            passenger o = new passenger(); //יצירת אובייקט עובד חדש

            o.first_name = fName;
            o.last_name  = lName;
            o.phone      = phone;
            o.address    = address;


            db.passenger.Add(o);

            db.SaveChanges();

            this.Close();
        }