Example #1
0
 private void OnModifyBookClick(object sender, RoutedEventArgs e)
 {
     try {
         Librarian lib          = (Librarian)SDM.CurrentUser;
         int       price        = Convert.ToInt32(PriceTB.Text);
         int       quantity     = Convert.ToInt32(CopiesTB.Text);
         bool      isBestseller = IsBestsellerCB.SelectedIndex == 0;
         lib.ModifyBook
         (
             _docID,
             TitleTB.Text,
             AutorsTB.Text,
             PublisherTB.Text,
             Convert.ToInt32(PublishYearTB.Text),
             EditionTB.Text,
             DescriptionTB.Text,
             price,
             isBestseller,
             quantity,
             TagsTB.Text
         );
     } catch {
         MessageBox.Show("The row is empty", "Error");
     }
     prevPage.UpdateTable();
     Close();
 }
Example #2
0
        private void OnAddBookClick(object sender, RoutedEventArgs e)
        {
            Librarian currentUser = (Librarian)SDM.CurrentUser;
            int       price       = Convert.ToInt32(PriceTB.Text);
            int       quantity    = Convert.ToInt32(CopiesTB.Text);

            currentUser.AddAV
            (
                TitleTB.Text,
                AutorsTB.Text,
                price,
                quantity,
                TagsTB.Text
            );

            _previousPage.UpdateTable();
            Close();
        }
Example #3
0
 private void OnModifyAVClick(object sender, RoutedEventArgs e)
 {
     try {
         Librarian lib      = (Librarian)SDM.CurrentUser;
         int       price    = Convert.ToInt32(PriceTB.Text);
         int       quantity = Convert.ToInt32(CopiesTB.Text);
         lib.ModifyAV
         (
             _docID,
             TitleTB.Text,
             AutorsTB.Text,
             price,
             quantity,
             TagsTB.Text
         );
     } catch {
         MessageBox.Show("The row is empty", "Error");
     }
     prevPage.UpdateTable();
     Close();
 }
Example #4
0
        private void OnAddBookClick(object sender, RoutedEventArgs e)
        {
            Librarian currentUser  = (Librarian)SDM.CurrentUser;
            int       price        = Convert.ToInt32(PriceTB.Text);
            int       quantity     = Convert.ToInt32(CopiesTB.Text);
            bool      isBestseller = IsBestseller.SelectedIndex == 0;

            currentUser.AddBook
            (
                TitleTB.Text,
                AutorsTB.Text,
                PublisherTB.Text,
                Convert.ToInt32(PublishYearTB.Text),
                EditionTB.Text,
                DescriptionTB.Text,
                price,
                isBestseller,
                quantity,
                TagsTB.Text
            );

            _previousPage.UpdateTable();
            Close();
        }