home *** CD-ROM | disk | FTP | other *** search
- // EmployeePersonalSet.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "Employee.h"
- #include "EmployeePersonalSet.h"
-
- #include <io.h> // for _findfirst
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CEmployeePersonalSet
-
- IMPLEMENT_DYNAMIC(CEmployeePersonalSet, CDaoRecordset)
-
- CEmployeePersonalSet::CEmployeePersonalSet(CDaoDatabase* pdb)
- : CDaoRecordset(pdb)
- {
- //{{AFX_FIELD_INIT(CEmployeePersonalSet)
- m_Employee_Number = 0;
- m_Sex___Marital_Status = 0;
- m_Height = 0.0;
- m_Weight = 0.0;
- m_nFields = 5;
- //}}AFX_FIELD_INIT
- m_nDefaultType = dbOpenDynaset;
-
- //set up a parameterized query
- m_strFilter = "[Employee Number] = EmployeeNumberParam";
- m_nParams = 1;
- m_EmployeeNumberParam = 0;
- }
-
-
- CString CEmployeePersonalSet::GetDefaultDBName()
- {
- // Search for the database 2 levels up...
- struct _finddata_t c_file;
- long hFile;
- CString fname = "..\\..\\personnel.mdb";
-
- hFile = _findfirst(fname, &c_file);
-
- if( -1 != hFile )
- return _T(fname);
-
- // and then one level up.
- fname = "..\\personnel.mdb";
-
- hFile = _findfirst(fname, &c_file);
-
- if( -1 != hFile )
- return _T(fname);
-
- return _T("");
- }
-
- CString CEmployeePersonalSet::GetDefaultSQL()
- {
- return _T("[Employee Personal Info Table]");
- }
-
- void CEmployeePersonalSet::DoFieldExchange(CDaoFieldExchange* pFX)
- {
- //{{AFX_FIELD_MAP(CEmployeePersonalSet)
- pFX->SetFieldType(CDaoFieldExchange::outputColumn);
- DFX_Long(pFX, _T("[Employee Number]"), m_Employee_Number);
- DFX_DateTime(pFX, _T("[Birthdate]"), m_Birthdate);
- DFX_Byte(pFX, _T("[Sex & Marital Status]"), m_Sex___Marital_Status);
- DFX_Double(pFX, _T("[Height]"), m_Height);
- DFX_Double(pFX, _T("[Weight]"), m_Weight);
- //}}AFX_FIELD_MAP
-
- pFX->SetFieldType(CDaoFieldExchange::param);
- DFX_Long(pFX, _T("EmployeeNumberParam"), m_EmployeeNumberParam);
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CEmployeePersonalSet diagnostics
-
- #ifdef _DEBUG
- void CEmployeePersonalSet::AssertValid() const
- {
- CDaoRecordset::AssertValid();
- }
-
- void CEmployeePersonalSet::Dump(CDumpContext& dc) const
- {
- CDaoRecordset::Dump(dc);
- }
- #endif //_DEBUG
-