Exemple #1
0
        private void button_searchBooking(object sender, RoutedEventArgs e)
        {
            if (search_booking.Text.Any(c => Char.IsLetterOrDigit(c) || Char.IsWhiteSpace(c)))
            {
                //stores what's in the Searchbox in a variable
                string id = search_booking.Text;
                //creates the SQL query
                string query = @"SELECT * FROM Bookings WHERE Booking_Id = '" + id + "';";

                DBConnection connection  = DBConnection.getDBConnectionInstance();
                DataSet      bookingData = connection.getDataSet(query);
                //checks that the query returned exactly one result
                int count = bookingData.Tables[0].Rows.Count;

                if (count == 1)
                {
                    booking_screen booking = new booking_screen(id, bookingData);
                    booking.Show();
                }
                else
                {
                    MessageBox.Show("No booking found.");
                }
            }
            else
            {
                MessageBox.Show("No booking found.");
            }
        }
Exemple #2
0
        private void bt_booking_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            booking_screen frm = new booking_screen();

            frm.Show();
            this.Close();
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.bookings_screen = ((WpfApp2.booking_screen)(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_new_booking = ((System.Windows.Controls.Button)(target));
                return;

            case 6:
                this.booking_search = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.booking_calendar = ((System.Windows.Controls.Calendar)(target));
                return;

            case 8:
                this.booking_list = ((System.Windows.Controls.ListView)(target));
                return;

            case 9:

            #line 23 "..\..\booking_screen.xaml"
                ((System.Windows.Controls.ListBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ListBoxItem_Selected);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.bookings_screen = ((WpfApp2.booking_screen)(target));
                return;

            case 2:
                this.bt_home = ((System.Windows.Controls.Button)(target));

            #line 11 "..\..\booking_screen.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 12 "..\..\booking_screen.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 13 "..\..\booking_screen.xaml"
                this.bt_staff.Click += new System.Windows.RoutedEventHandler(this.bt_staff_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.bt_new_booking = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\booking_screen.xaml"
                this.bt_new_booking.Click += new System.Windows.RoutedEventHandler(this.bt_new_booking_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.booking_search = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.bookingsGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 8:
                this.bTsearch = ((System.Windows.Controls.Button)(target));

            #line 17 "..\..\booking_screen.xaml"
                this.bTsearch.Click += new System.Windows.RoutedEventHandler(this.bTsearch_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.textBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 11:
                this.dp1 = ((System.Windows.Controls.DatePicker)(target));
                return;

            case 12:
                this.bTsearchDate = ((System.Windows.Controls.Button)(target));

            #line 27 "..\..\booking_screen.xaml"
                this.bTsearchDate.Click += new System.Windows.RoutedEventHandler(this.bTsearchDate_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.textBlock_Copy = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }