Document Navigator For The Design Index (Testing Document)
Previous Section
(Customer Administration)
This Section
(Transactions)
Next Section
(Entity Relationship Diagram)
Previous (Renewing A Book) Putting A Book On Hold Next (Canceling A Book On Hold)

 


PseudoCode                                   
/*        Main functionality
   Procedure Hold_a_Book processes the request ( of the patron with
   the given User Id) to hold a book with a specified Call Number.
*/

Procedure HOLD_A_BOOK
{
   while (1)
     {
   
       switch (kind_of_button_pressed) :
         {
         case CLEAR:
              clear the contents in the entry field;
          case HELP:
              open a new pop-up window displaying help;
          case CANCEL:
              close the Hold a Book window and return control to the Book Administration Window;
          case SEARCH1:    /* search the User Id */
              search for the patron ID by poping up the Searching Customer window;
          case SEARCH2:    /* search the User Id */
              search for the call number of the book by poping up the View Book Copy window;
          case PRINT:
              print a report on the held books;    
          case OK button:
              if (syntax for User ID is not correct)
                   display error message about the User ID;
              else if (syntax for Call Number is not correct)
                        display error message about the Call Number;
              else if (User ID does not exist in database)
                  display non-existent input error message;
              else if (Call_Number does not exist in database)
                  display non-existent input error message;
               else 
               {
                retrieve the book's info from the database
                if (Circulation_Status is On_Hold)
                    display message( "Hold is unsuccessful: book is currently on hold.");
                else 
                  {
                  retrieve the customer's record from the database
                  if (outstanding books >= MAX_OUTSTANDING)
                    display message "Hold was unsuccessful: The patron's outstanding books have reached maximum limit.";
                  else
                     update the customer's record;
                     change the Circulation_status to 'on hold';
                     display message "Hold was successful.";
                  }
                }
         }
     }
}

 


Document Navigator For The Design Index (Testing Document)
Previous Section
(Customer Administration)
This Section
(Transactions)
Next Section
(Entity Relationship Diagram)
Previous (Renewing A Book) Putting A Book On Hold Next (Canceling A Book On Hold)

Copyright ©1997 VoidWorks Software Inc.

Send mail to the Group Leader or the Webmaster
Pages created and maintained with Mortar