home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c13 / lab02 / ex01 / employeepayset.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  2.1 KB  |  80 lines

  1. // EmployeePaySet.cpp : implementation of the CEmployeePaySet class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Employee.h"
  6. #include "EmployeePaySet.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CEmployeePaySet implementation
  16.  
  17. IMPLEMENT_DYNAMIC(CEmployeePaySet, CRecordset)
  18.  
  19. CEmployeePaySet::CEmployeePaySet(CDatabase* pdb)
  20.     : CRecordset(pdb)
  21. {
  22.     //{{AFX_FIELD_INIT(CEmployeePaySet)
  23.     m_Employee_Number = 0;
  24.     m_Last_Name = _T("");
  25.     m_First_Name = _T("");
  26.     m_Department__ = 0;
  27.     m_Employee_Pay_Type = 0;
  28.     m_Hours = 0.0;
  29.     m_Hourly_Rate = 0.0;
  30.     m_Weekly_Salary = 0.0;
  31.     m_Sales_Bonus_Rate = 0.0;
  32.     m_Weekly_Sales = 0.0;
  33.     m_nFields = 10;
  34.     //}}AFX_FIELD_INIT
  35.     m_nDefaultType = dynaset;
  36.     m_strSort = "[Last Name], [First Name]";
  37. }
  38.  
  39. CString CEmployeePaySet::GetDefaultConnect()
  40. {
  41.     return _T("ODBC;DSN=Personal");
  42. }
  43.  
  44. CString CEmployeePaySet::GetDefaultSQL()
  45. {
  46.     return _T("[Employee Pay Table]");
  47. }
  48.  
  49. void CEmployeePaySet::DoFieldExchange(CFieldExchange* pFX)
  50. {
  51.     //{{AFX_FIELD_MAP(CEmployeePaySet)
  52.     pFX->SetFieldType(CFieldExchange::outputColumn);
  53.     RFX_Long(pFX, _T("[Employee Number]"), m_Employee_Number);
  54.     RFX_Text(pFX, _T("[Last Name]"), m_Last_Name);
  55.     RFX_Text(pFX, _T("[First Name]"), m_First_Name);
  56.     RFX_Int(pFX, _T("[Department #]"), m_Department__);
  57.     RFX_Int(pFX, _T("[Employee Pay Type]"), m_Employee_Pay_Type);
  58.     RFX_Double(pFX, _T("[Hours]"), m_Hours);
  59.     RFX_Double(pFX, _T("[Hourly Rate]"), m_Hourly_Rate);
  60.     RFX_Double(pFX, _T("[Weekly Salary]"), m_Weekly_Salary);
  61.     RFX_Double(pFX, _T("[Sales Bonus Rate]"), m_Sales_Bonus_Rate);
  62.     RFX_Double(pFX, _T("[Weekly Sales]"), m_Weekly_Sales);
  63.     //}}AFX_FIELD_MAP
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CEmployeePaySet diagnostics
  68.  
  69. #ifdef _DEBUG
  70. void CEmployeePaySet::AssertValid() const
  71. {
  72.     CRecordset::AssertValid();
  73. }
  74.  
  75. void CEmployeePaySet::Dump(CDumpContext& dc) const
  76. {
  77.     CRecordset::Dump(dc);
  78. }
  79. #endif //_DEBUG
  80.