home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / daoenrol / sectset.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.1 KB  |  82 lines

  1. // sectset.cpp : implementation of the CsectionSet class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "DaoEnrol.h"
  15. #include "sectset.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CsectionSet implementation
  25.  
  26. IMPLEMENT_DYNAMIC(CsectionSet, CDaoRecordset)
  27.  
  28. CsectionSet::CsectionSet(CDaoDatabase* pdb)
  29.     : CDaoRecordset(pdb)
  30. {
  31.     //{{AFX_FIELD_INIT(CsectionSet)
  32.     m_CourseID = _T("");
  33.     m_SectionNo = _T("");
  34.     m_InstructorID = _T("");
  35.     m_RoomNo = _T("");
  36.     m_Schedule = _T("");
  37.     m_Capacity = 0;
  38.     m_nFields = 6;
  39.     //}}AFX_FIELD_INIT
  40.     m_nDefaultType = dbOpenDynaset;
  41.     m_nParams = 1;
  42.     m_strCourseIDParam = _T("");
  43.  
  44. }
  45.  
  46.  
  47. CString CsectionSet::GetDefaultSQL()
  48. {
  49.     return _T("[Section]");
  50. }
  51.  
  52. void CsectionSet::DoFieldExchange(CDaoFieldExchange* pFX)
  53. {
  54.     //{{AFX_FIELD_MAP(CsectionSet)
  55.     pFX->SetFieldType(CDaoFieldExchange::outputColumn);
  56.     DFX_Text(pFX, _T("[CourseID]"), m_CourseID);
  57.     DFX_Text(pFX, _T("[SectionNo]"), m_SectionNo);
  58.     DFX_Text(pFX, _T("[InstructorID]"), m_InstructorID);
  59.     DFX_Text(pFX, _T("[RoomNo]"), m_RoomNo);
  60.     DFX_Text(pFX, _T("[Schedule]"), m_Schedule);
  61.     DFX_Short(pFX, _T("[Capacity]"), m_Capacity);
  62.     //}}AFX_FIELD_MAP
  63.     pFX->SetFieldType(CDaoFieldExchange::param);
  64.     DFX_Text(pFX, _T("CourseIDParam"), m_strCourseIDParam);
  65.  
  66. }
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69. // CsectionSet diagnostics
  70.  
  71. #ifdef _DEBUG
  72. void CsectionSet::AssertValid() const
  73. {
  74.     CDaoRecordset::AssertValid();
  75. }
  76.  
  77. void CsectionSet::Dump(CDumpContext& dc) const
  78. {
  79.     CDaoRecordset::Dump(dc);
  80. }
  81. #endif //_DEBUG
  82.