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

  1. // EmployeeDoc.cpp : implementation of the CEmployeeDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "EmployeePersonalSet.h"
  6. #include "EmployeePaySet.h"
  7. #include "Employee.h"
  8. #include "EmployeeDoc.h"
  9.  
  10.  
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CEmployeeDoc
  20.  
  21. IMPLEMENT_DYNCREATE(CEmployeeDoc, CDocument)
  22.  
  23. BEGIN_MESSAGE_MAP(CEmployeeDoc, CDocument)
  24.     //{{AFX_MSG_MAP(CEmployeeDoc)
  25.         // NOTE - the ClassWizard will add and remove mapping macros here.
  26.         //    DO NOT EDIT what you see in these blocks of generated code!
  27.     //}}AFX_MSG_MAP
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CEmployeeDoc construction/destruction
  32.  
  33. CEmployeeDoc::CEmployeeDoc()
  34.     : m_employeePaySet( & m_DB ), 
  35.         m_employeePersonalInfoSet( & m_DB )
  36. {
  37.     // TODO: add one-time construction code here
  38.  
  39. }
  40.  
  41. CEmployeeDoc::~CEmployeeDoc()
  42. {
  43. }
  44.  
  45. BOOL CEmployeeDoc::OnNewDocument()
  46. {
  47.     if (!CDocument::OnNewDocument())
  48.         return FALSE;
  49.  
  50.     // TODO: add reinitialization code here
  51.     // (SDI documents will reuse this document)
  52.  
  53.     return TRUE;
  54. }
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CEmployeeDoc diagnostics
  58.  
  59. #ifdef _DEBUG
  60. void CEmployeeDoc::AssertValid() const
  61. {
  62.     CDocument::AssertValid();
  63. }
  64.  
  65. void CEmployeeDoc::Dump(CDumpContext& dc) const
  66. {
  67.     CDocument::Dump(dc);
  68. }
  69. #endif //_DEBUG
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CEmployeeDoc commands
  73.  
  74. CEmployeePersonalSet * CEmployeeDoc::GetEmployeeInfoSet( )
  75. {
  76.     return & m_employeePersonalInfoSet;
  77. }
  78.  
  79. CEmployeePaySet * CEmployeeDoc::GetEmployeePaySet()
  80. {
  81.     return & m_employeePaySet;
  82. }
  83.