home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001032b < prev    next >
Text File  |  1991-11-18  |  1KB  |  52 lines

  1. //////////////////////////////////////////////////////
  2. // Source code for the "Payroll List" Class
  3. //
  4. //////////////////////////////////////////////////////
  5.  
  6. #include "paylist.h"
  7.  
  8. Boolean PayList::find(char *last)
  9. {
  10.     if (Pfm_List::find("Last","==",(void *) last))
  11.     {
  12.         get(empBuffer);
  13.         return(true);
  14.     }
  15.     return(false);
  16. }
  17.  
  18. Boolean PayList::find(char *last, char *first)
  19. {
  20.     if (DB_Find(table,"Last == %s && First == %s",
  21.     last, first))
  22.     {
  23.       get(empBuffer);
  24.       return(true);
  25.     }
  26.     return(false);
  27. }
  28.  
  29. void PayList::add(employee &emp)
  30. {
  31.     Pfm_List::add();
  32.     replace(emp);
  33. }
  34.  
  35. void PayList::replace(employee &emp)
  36. {
  37.     Pfm_List::replace("First",emp.first);
  38.     Pfm_List::replace("Last",emp.last);
  39.     Pfm_List::replace("Pay",emp.pay_rate);
  40.     Pfm_List::replace("Days",emp.days_worked);
  41.     empBuffer = emp;
  42.  
  43. }
  44.  
  45. void PayList::get(employee &emp)
  46. {
  47.     Pfm_List::get("First",emp.first);
  48.     Pfm_List::get("Last",emp.last);
  49.     Pfm_List::get("Pay",emp.pay_rate);
  50.     Pfm_List::get("Days",emp.days_worked);
  51. }
  52.