void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.individual_booking = ((WpfApp2.Individual_bookings)(target)); return; case 2: this.bt_home = ((System.Windows.Controls.Button)(target)); return; case 3: this.bt_patients = ((System.Windows.Controls.Button)(target)); return; case 4: this.bt_staff = ((System.Windows.Controls.Button)(target)); return; case 5: this.bt_cancel_booking = ((System.Windows.Controls.Button)(target)); return; case 6: this.bt_save_changes = ((System.Windows.Controls.Button)(target)); return; case 7: this.booking_details_view = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }
public static void viewBooking(string id) { //creates the SQL query string query = @"SELECT *, Patients.Patient_name, Patients.Patient_surname FROM Bookings INNER JOIN Patients ON Bookings.Patient_ID = Patients.Patient_ID WHERE Booking_Id = @ID;"; DBConnection connection = DBConnection.getDBConnectionInstance(); DataSet bookingData = connection.getDataById(query, id); //checks that the query returned exactly one result int count = bookingData.Tables[0].Rows.Count; if (count == 1) { Individual_bookings booking = new Individual_bookings(id, bookingData); booking.Show(); } else { MessageBox.Show("No booking found."); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.individual_booking = ((WpfApp2.Individual_bookings)(target)); return; case 2: this.bt_home = ((System.Windows.Controls.Button)(target)); #line 10 "..\..\Individual bookings.xaml" this.bt_home.Click += new System.Windows.RoutedEventHandler(this.bt_home_Click); #line default #line hidden return; case 3: this.bt_patients = ((System.Windows.Controls.Button)(target)); #line 11 "..\..\Individual bookings.xaml" this.bt_patients.Click += new System.Windows.RoutedEventHandler(this.bt_patients_Click); #line default #line hidden return; case 4: this.bt_staff = ((System.Windows.Controls.Button)(target)); #line 12 "..\..\Individual bookings.xaml" this.bt_staff.Click += new System.Windows.RoutedEventHandler(this.bt_staff_Click); #line default #line hidden return; case 5: this.bt_cancel_booking = ((System.Windows.Controls.Button)(target)); #line 14 "..\..\Individual bookings.xaml" this.bt_cancel_booking.Click += new System.Windows.RoutedEventHandler(this.bt_cancel_booking_Click); #line default #line hidden return; case 6: this.bt_save_changes = ((System.Windows.Controls.Button)(target)); #line 15 "..\..\Individual bookings.xaml" this.bt_save_changes.Click += new System.Windows.RoutedEventHandler(this.bt_save_changes_Click); #line default #line hidden return; case 7: this.booking_details_view = ((System.Windows.Controls.Label)(target)); return; case 8: this.edit_bookings = ((System.Windows.Controls.Image)(target)); return; case 9: this.lb_patient_id = ((System.Windows.Controls.Label)(target)); return; case 10: this.lb_patient_name = ((System.Windows.Controls.Label)(target)); return; case 11: this.lb_date = ((System.Windows.Controls.Label)(target)); return; case 12: this.lb_time = ((System.Windows.Controls.Label)(target)); return; case 13: this.lb_doctor = ((System.Windows.Controls.Label)(target)); return; case 14: this.lb_room = ((System.Windows.Controls.Label)(target)); return; case 15: this.lb_description = ((System.Windows.Controls.Label)(target)); return; case 16: this.ID = ((System.Windows.Controls.TextBox)(target)); #line 25 "..\..\Individual bookings.xaml" this.ID.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.tb_patient_id_TextChanged); #line default #line hidden return; case 17: this.tb_name = ((System.Windows.Controls.TextBox)(target)); #line 30 "..\..\Individual bookings.xaml" this.tb_name.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.tb_name_TextChanged); #line default #line hidden return; case 18: this.Date = ((System.Windows.Controls.TextBox)(target)); return; case 19: this.Time = ((System.Windows.Controls.TextBox)(target)); return; case 20: this.Doctor = ((System.Windows.Controls.TextBox)(target)); return; case 21: this.Room = ((System.Windows.Controls.TextBox)(target)); return; case 22: this.Description = ((System.Windows.Controls.TextBox)(target)); return; case 23: this.Booking_ID = ((System.Windows.Controls.TextBox)(target)); #line 40 "..\..\Individual bookings.xaml" this.Booking_ID.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.tb_patient_id_TextChanged); #line default #line hidden return; case 24: this.lb_patient_id_Copy = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }