home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / database / stockcpp / store.hpp < prev   
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.4 KB  |  69 lines

  1. //******************************************************************************
  2. //                                                                             *
  3. //COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1994.   *
  4. //                                                                             *
  5. //DISCLAIMER OF WARRANTIES:                                                    *
  6. //  The following [enclosed] code is sample code created by IBM                *
  7. //  Corporation.  This sample code is not part of any standard IBM product     *
  8. //  and is provided to you solely for the purpose of assisting you in the      *
  9. //  development of your applications.  The code is provided "AS IS",           *
  10. //  without warranty of any kind.  IBM shall not be liable for any damages     *
  11. //  arising out of your use of the sample code, even if they have been         *
  12. //  advised of the possibility of such damages.                                *
  13. //                                                                             *
  14. //******************************************************************************
  15. //******************************************************************************
  16. // File Name: store.hpp                                                        *
  17. //                                                                             *
  18. // Note: This file keeps the definiton of the store class.                     *
  19. //                                                                             *
  20. //******************************************************************************
  21. #include <iostream.h>
  22. #include <idsmcon.hpp>          // If using Embedded Datastore
  23. #include <idsmcod.hpp>          // If using ODBC Datastore
  24. #include <idsmcdb.hpp>          // If using CLI  Datastore
  25. #include "invento.hpp"          // For the generated Inventory object classes
  26. #include "receive.hpp"          // For the generated Receivedorder object classes
  27. #include "prclist.hpp"          // For the generated PriceList object classes
  28.  
  29. enum postflag {NOT_POSTED, POSTED};    // enum flag for posted or not yet posted
  30. enum commitflag {ROLLBACK, COMMIT};    // enum flag for commit or rollback
  31.  
  32. class Store {
  33. public:
  34.    Store(IString usrid, IString pwd);              // Constructor expects userid and password
  35.    Store();                                        // Constructor expects no userid and no password
  36.    ~Store();                                       // Destructor
  37.    void generatePriceList();                       // Generate a price list
  38.    void postingInventory();                        // update the inventory data with received order
  39.    void displayItem();                             // display a price list item
  40.    void transaction(commitflag commitflagArg);     // commit or rollback
  41.  
  42.    void addReceivedOrder(              // Add a received order to the database
  43.           short  receivedNumberArg,    // received order number
  44.           IString prodNumberArg,       // product number
  45.           long    receivedQuantityArg, // recieved quantity
  46.           double  totalCostArg);        // total cost of the order
  47.  
  48.    void addNewItem(                    // add a new item to the inventory table
  49.           IString prodNumberArg,       // product number
  50.           IString prodDescriptionArg,  // product description
  51.           long    onHandQuantityArg,   // on hand quantity
  52.           double  avarageCostArg,      // average cost per unit
  53.           double  listingPriceArg);    // listing price per unit
  54. private:
  55.    ReceiveDatastore        dsm;                 // datastore manager
  56.    InventoDatastore        dsm1;                // datastore manager
  57.    PrclistDatastore        dsm2;                // datastore manager
  58.    IDatastore              dsm3;                // IDatastore for Embedded SQL
  59.    Invento                 inventoryObj;        // inventory class object
  60.    Receive                 receivedOrderObj;    // received order class object
  61.    ReceiveManager          receivedOrderMgr;    // received order manager
  62.    Prclist                 priceList;
  63.    PrclistManager          priceListMgr;        // price list object manager
  64.    IString                 userid;              // userid used to logon to the database
  65.    IString                 password;            // password used to logon to the database
  66.    IString                 ISESQL;              // ISESQL environment variable for Embedded SQL
  67. };
  68.  
  69.