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

  1. // EmployeePersonalSet.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Employee.h"
  6. #include "EmployeePersonalSet.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. // CEmployeePersonalSet
  16.  
  17. IMPLEMENT_DYNAMIC(CEmployeePersonalSet, CRecordset)
  18.  
  19. CEmployeePersonalSet::CEmployeePersonalSet(CDatabase* pdb)
  20.     : CRecordset(pdb)
  21. {
  22.     //{{AFX_FIELD_INIT(CEmployeePersonalSet)
  23.     m_Employee_Number = 0;
  24.     m_Sex___Marital_Status = 0;
  25.     m_Height = 0.0;
  26.     m_Weight = 0.0;
  27.     m_nFields = 5;
  28.     //}}AFX_FIELD_INIT
  29.  
  30.     m_Birthdate.year        = 0;
  31.     m_Birthdate.month        = 0;
  32.     m_Birthdate.day            = 0;
  33.     m_Birthdate.hour        = 0;
  34.     m_Birthdate.minute        = 0;
  35.     m_Birthdate.second        = 0;
  36.     m_Birthdate.fraction    = 0;
  37.  
  38.     m_nDefaultType = dynaset;
  39.  
  40.     m_strFilter = "[Employee Number] = ?";    //? == parameter placeholder
  41.     m_nParams = 1;
  42.     m_EmployeeNumberParam = 0;
  43. }
  44.  
  45.  
  46. CString CEmployeePersonalSet::GetDefaultConnect()
  47. {
  48.     return _T("ODBC;DSN=Personal");
  49. }
  50.  
  51. CString CEmployeePersonalSet::GetDefaultSQL()
  52. {
  53.     return _T("[Employee Personal Info Table]");
  54. }
  55.  
  56. void CEmployeePersonalSet::DoFieldExchange(CFieldExchange* pFX)
  57. {
  58.     pFX->SetFieldType(CFieldExchange::param);
  59.     RFX_Long(pFX, _T("[EmployeeNumberParam]"), m_EmployeeNumberParam);
  60.     //{{AFX_FIELD_MAP(CEmployeePersonalSet)
  61.     pFX->SetFieldType(CFieldExchange::outputColumn);
  62.     RFX_Long(pFX, _T("[Employee Number]"), m_Employee_Number);
  63.     RFX_Byte(pFX, _T("[Sex & Marital Status]"), m_Sex___Marital_Status);
  64.     RFX_Double(pFX, _T("[Height]"), m_Height);
  65.     RFX_Double(pFX, _T("[Weight]"), m_Weight);
  66.     //}}AFX_FIELD_MAP
  67.     RFX_Date(pFX, _T("[Birthdate]"), m_Birthdate);
  68. }
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CEmployeePersonalSet diagnostics
  72.  
  73. #ifdef _DEBUG
  74. void CEmployeePersonalSet::AssertValid() const
  75. {
  76.     CRecordset::AssertValid();
  77. }
  78.  
  79. void CEmployeePersonalSet::Dump(CDumpContext& dc) const
  80. {
  81.     CRecordset::Dump(dc);
  82. }
  83. #endif //_DEBUG
  84.