Esempio n. 1
0
        private void InitalizeTable()
        {
            //Create new object of type BookingDBAccess. Update table to show all bookings
            BookingDBAccess bdba = new BookingDBAccess(db);

            createTable(bdba.getAllBook());
        }
Esempio n. 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     //Shows all the data for bookings when the 'View' button is clicked
     if (comboBox1.Text == "Show All")
     {
         BookingDBAccess bdba = new BookingDBAccess(db);
         createTable(bdba.getAllBook());
     }
     //Shows the data for the bookings which matches the searched for BookingId
     else if (comboBox1.Text == "Booking ID")
     {
         BookingDBAccess bdba   = new BookingDBAccess(db);
         int             BookNo = Convert.ToInt32(searchBox.Text);
         createTable(bdba.getBookWithID(BookNo));
     }
     //shows the data for the bookings which matches the searched for Childs name
     else if (comboBox1.Text == "Child Name")
     {
         ChildrenDBAccess cdba = new ChildrenDBAccess(db);
         string           name = searchBox.Text;
         createTableShowAllChild(cdba.GetChildByName(name));
         selectedTable = "Children";
     }
     //Shows the data for the bookings which matches the searched for childs age
     else if (comboBox1.Text == "Child Age")
     {
         ChildrenDBAccess cdba = new ChildrenDBAccess(db);
         int age = Convert.ToInt32(searchBox.Text);
         createTableShowAllChild(cdba.GetChildByAge("=", age.ToString()));
         selectedTable = "Children";
     }
 }