Update a Book

Update a Book

Interface Definitions:

Inputs to module:

Inputs by user:

Can be any/many of the below, to be edited:

Outputs:

Confirmation message

Data Abstractions:

Title ="string"

Author ="string"

Subject ="string"

Call # ="integer"

Publisher ="string"

Publishing Date ="date"

Location ="string"

Type ="char"

Cost ="currency"

Volume Number ="integer"

Copy Number ="integer"

Information ="string"

Design:

Environment: GUI (graphical user interface)

Interface: Pop-up window. (See picture files for a view.)

Completion of this module is performed by:

  1. Pressing Cancel - in which case no update is performed.
    • Update window is closed.
  2. Pressing Update - syntactical error checking is done.
    • Confirmation Window is popped up.

Sub-Modules:

Error-Handling:

Syntactical Errors:

IF Call number entered does not match any call number currently in system.

THEN give error window:

IF Location entered does not match any province currently in system.

THEN give error window:

IF Publishing Date entered does not match the format currently in

system or date is not in valid range.

THEN give error window:

Empty-Field Errors:

IF Call Number field is left empty

THEN give error window:

Imports:

Exports:

Pseudocode/Visual Basic Code

PSEUDO-CODE:Update Book

// Opening window.
//    User must enter call # in here.
   Switch on button presses:
      begin
         Case OK pushed:
           If call # textbox is blank 
              Bringup error message box.
           Else If call # does not exist 
              Bringup error message box.
           Else If call # is valid
              Exit this window and open up update window.
           Case CANCEL pushed:
              Exit this window and return to calling window.
      end


// Update window.
// On entry all relevant information will be displayed on the screen.
   Switch on button presses:
      begin
         Case UPDATE pushed:
            If Check_TextBoxes() is successful                  
               begin
                  popup Verify message box
                  If Verify is YES
                     update database.
               end
         Case CANCEL pushed:
            Exit this window and return to calling window.      
                        
                    
                     
// Check_TextBoxes function
Check_TextBoxes()
   begin
      If call # is already in use or call # is invalid
         begin
            popup error message box 
            return UNSUCCESSFUL
         end
      If subject is not one of the existing subjects
         begin
            popup Verify message box 
            If Verify is NO
               return UNSUCCESSFUL
         end
      If Type is not one of the possible types(reserved,circ,etc)
         begin
            popup error message box
            return UNSUCCESSFUL    
         end
      If Location is not one of the existing locations
         begin
            popup Verify message box 
            If Verify is NO
               return UNSUCCESSFUL
         end

     // If we've got to this point we're  OK
     return SUCCESSFUL
  end



Back to the Book Functions Index