SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace PricePortalLib
  6. {
  7.     // Interface for items fetched from sub-suppliers and cached locally
  8.     public interface IItem
  9.     {
  10.         // Sub-supplier code
  11.         uint SubSupplier
  12.         {
  13.             get;
  14.             set;
  15.         }
  16.  
  17.         // Part number for item
  18.         ulong PartNumber
  19.         {
  20.             get;
  21.             set;
  22.         }
  23.  
  24.         // Free text description of item
  25.         string Description
  26.         {
  27.             get;
  28.             set;
  29.         }
  30.  
  31.         // Time when item was retrieved from sub-supplier
  32.         DateTime Hit
  33.         {
  34.             get;
  35.             set;
  36.         }
  37.     }
  38.  
  39.     // Interface for object that knows which sub-suppliers have been defined
  40.     // and also knows how to search the sub-suppliers item data bases for items.
  41.     public interface ISearchSubSupplier
  42.     {
  43.         // Return (possibly empty) list of items that match search criteria
  44.         // partnumber = 0 (wild card) or specific part number
  45.         // description = "" (wild card) or string with free text
  46.         List<IItem> LookUpItem(ulong partnumber, string description);
  47.     }
  48.  
  49.     // Interface for object used to locally cache data retrieved from
  50.     // sub-suppliers
  51.     public interface IItemCache
  52.     {
  53.         // Return (possibly empty) list of items that match search criteria
  54.         // partnumber = 0 (wild card) or specific part number
  55.         // description = "" (wild card) or string with free text
  56.         List<IItem> LookUpItem(ulong partnumber, string description);
  57.         // Add items (found through sub-suppliers) to local cache of known items
  58.         void AddItems(List<IItem> items);
  59.         // Remove items from local cache of known items (because they are too old)
  60.         void RemoveItems(List<IItem> items);
  61.     }
  62.  
  63.     // Interface for object used by web-frontend to get a list of items that
  64.     // match search criteria entered by user.
  65.     public interface IFindItem
  66.     {
  67.         // Return (possibly empty) list of items that match search criteria
  68.         // partnumber = 0 (wild card) or specific part number
  69.         // description = "" (wild card) or string with free text
  70.         List<IItem> LookUpItem(ulong partnumber, string description);
  71.         // Configure how long items in cache should be used
  72.         void SetCacheExpireTime(uint hours);
  73.     }
  74.  
  75. }
RAW Paste Data
Top