//DELETE THE RETURN BOOK =>PL
 private void BtnAccept_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ReturnedBook returned = dgReturn.SelectedItem as ReturnedBook;
         if (returned != null)
         {
             UserReturnBL userReturnBL = new UserReturnBL();
             bool         isDone1      = userReturnBL.DeleteReturnBL(returned.BookId, returned.UserId);
             BookBL       bookBL       = new BookBL();
             bool         isDone2      = bookBL.IncBookCopyBL(returned.BookId);
             if (isDone1 == true && isDone2 == true)
             {
                 MessageBox.Show("Book taken back successfully...");
                 InitializeAdminReturn();
             }
             else
             {
                 MessageBox.Show("Try again...");
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Some unknown exception is occured!!!, Try again..");
     }
 }
Ejemplo n.º 2
0
 //REJECT THE REQUESTED BOOK =>PL
 private void BtnReject_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         RequestedBook request = dgRequests.SelectedItem as RequestedBook;
         if (request != null)
         {
             BookBL        bookBL      = new BookBL();
             bool          isDone1     = bookBL.IncBookCopyBL(request.BookId);
             UserRequestBL userRequest = new UserRequestBL();
             bool          isDone2     = userRequest.DeleteRequestBL(request.BookId, request.UserId);
             if (isDone1 == true && isDone2 == true)
             {
                 MessageBox.Show("Rejected request successfully...");
                 InitializeRequests();
             }
             else
             {
                 MessageBox.Show("Try again latter...");
             }
         }
         else
         {
             MessageBox.Show("Select book properly...");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Some unknown exception is occured!!!, Try again..");
     }
 }
 //DELETE RECIEVED BOOK FROM RECIEVED BOOK TABLE
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (BookId > 0)
     {
         UserRecieveBL userRecieveBL = new UserRecieveBL();
         bool          isDone1       = userRecieveBL.DeleteRecieveBL(BookId, UserId);
         BookBL        bookBL        = new BookBL();
         bool          isDone2       = bookBL.IncBookCopyBL(BookId);
         if (isDone1 == true && isDone2 == true)
         {
             MessageBox.Show("Book deleted successfully...");
         }
         else
         {
             MessageBox.Show("Try again...");
         }
     }
     else
     {
         MessageBox.Show("Select a book properly...");
     }
 }
 //REJECT THE REQUESTED BOOK =>PL
 private void btnReject_Click(object sender, EventArgs e)
 {
     if (BookId > 0)
     {
         BookBL        bookBL      = new BookBL();
         bool          isDone1     = bookBL.IncBookCopyBL(BookId);
         UserRequestBL userRequest = new UserRequestBL();
         bool          isDone2     = userRequest.DeleteRequestBL(BookId, UserId);
         if (isDone1 == true && isDone2 == true)
         {
             MessageBox.Show("Deleted request successfully...");
         }
         else
         {
             MessageBox.Show("Try again latter...");
         }
     }
     else
     {
         MessageBox.Show("Select book properly...");
     }
 }