Beispiel #1
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            string searchString = txtSearch.Text;

            ControllerBook C_ControllerBook = new ControllerBook();

            var filteredBooks = C_ControllerBook.getBooks(searchString);

            dtagrdBooks.ItemsSource = filteredBooks;
        }
Beispiel #2
0
        public MainUserUI(string t_username_loggedinuser)
        {
            InitializeComponent();

            loggedinuser = t_username_loggedinuser;

            ControllerBook C_ControllerBook = new ControllerBook();

            var books = C_ControllerBook.getBooks("All");

            dtagrdBooks.ItemsSource = books;
        }
Beispiel #3
0
        private void btnReserve_Click(object sender, RoutedEventArgs e)
        {
            ModelObjBook selectedRow = (ModelObjBook)dtagrdBooks.SelectedItem;

            int selectedPKey = selectedRow.pkey;

            ControllerBook C_ControllerBook = new ControllerBook();

            bool bookAvaiable = C_ControllerBook.bookAvaiable(selectedPKey);

            if (bookAvaiable == true)
            {
            }
            else
            {
                MessageBox.Show("Book already reserved", "Book reservation", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }