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

  1. // SectSet.cpp : implementation of the CSectionSet class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Enroll.h"
  6. #include "SectSet.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. // CSectionSet implementation
  16.  
  17. IMPLEMENT_DYNAMIC(CSectionSet, CRecordset)
  18.  
  19. CSectionSet::CSectionSet(CDatabase* pdb)
  20.     : CRecordset(pdb)
  21. {
  22.     //{{AFX_FIELD_INIT(CSectionSet)
  23.     m_CourseID = _T("");
  24.     m_SectionNo = _T("");
  25.     m_InstructorID = _T("");
  26.     m_RoomNo = _T("");
  27.     m_Schedule = _T("");
  28.     m_Capacity = 0;
  29.     m_nFields = 6;
  30.     //}}AFX_FIELD_INIT
  31.     m_nDefaultType = snapshot;
  32.     m_nParams = 1;
  33.     m_strCourseIDParam = "";
  34.  
  35. }
  36.  
  37. CString CSectionSet::GetDefaultConnect()
  38. {
  39.     return _T("ODBC;DSN=Student Registration");
  40. }
  41.  
  42. CString CSectionSet::GetDefaultSQL()
  43. {
  44.     return _T("[Section]");
  45. }
  46.  
  47. void CSectionSet::DoFieldExchange(CFieldExchange* pFX)
  48. {
  49.     //{{AFX_FIELD_MAP(CSectionSet)
  50.     pFX->SetFieldType(CFieldExchange::outputColumn);
  51.     RFX_Text(pFX, _T("[CourseID]"), m_CourseID);
  52.     RFX_Text(pFX, _T("[SectionNo]"), m_SectionNo);
  53.     RFX_Text(pFX, _T("[InstructorID]"), m_InstructorID);
  54.     RFX_Text(pFX, _T("[RoomNo]"), m_RoomNo);
  55.     RFX_Text(pFX, _T("[Schedule]"), m_Schedule);
  56.     RFX_Int(pFX, _T("[Capacity]"), m_Capacity);
  57.     //}}AFX_FIELD_MAP
  58.     pFX->SetFieldType(CFieldExchange::param);
  59.     RFX_Text(pFX, "CourseIDParam", m_strCourseIDParam);
  60.  
  61. }
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CSectionSet diagnostics
  65.  
  66. #ifdef _DEBUG
  67. void CSectionSet::AssertValid() const
  68. {
  69.     CRecordset::AssertValid();
  70. }
  71.  
  72. void CSectionSet::Dump(CDumpContext& dc) const
  73. {
  74.     CRecordset::Dump(dc);
  75. }
  76. #endif //_DEBUG
  77.