home *** CD-ROM | disk | FTP | other *** search
- // EmployeePaySet.cpp : implementation of the CEmployeePaySet class
- //
-
- #include "stdafx.h"
- #include "Employee.h"
- #include "EmployeePaySet.h"
-
- #include <io.h> // for _findfirst
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CEmployeePaySet implementation
-
- IMPLEMENT_DYNAMIC(CEmployeePaySet, CDaoRecordset)
-
- CEmployeePaySet::CEmployeePaySet(CDaoDatabase* pdb)
- : CDaoRecordset(pdb)
- {
- //{{AFX_FIELD_INIT(CEmployeePaySet)
- m_Employee_Number = 0;
- m_Last_Name = _T("");
- m_First_Name = _T("");
- m_Department__ = 0;
- m_Employee_Pay_Type = 0;
- m_Hours = 0.0;
- m_Hourly_Rate = 0.0;
- m_Weekly_Salary = 0.0;
- m_Sales_Bonus_Rate = 0.0;
- m_Weekly_Sales = 0.0;
- m_nFields = 10;
- //}}AFX_FIELD_INIT
- m_nDefaultType = dbOpenDynaset;
-
- m_strSort = "[Last Name],[First Name]";
- }
-
- CString CEmployeePaySet::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 CEmployeePaySet::GetDefaultSQL()
- {
- return _T("[Employee Pay Table]");
- }
-
- void CEmployeePaySet::DoFieldExchange(CDaoFieldExchange* pFX)
- {
- //{{AFX_FIELD_MAP(CEmployeePaySet)
- pFX->SetFieldType(CDaoFieldExchange::outputColumn);
- DFX_Long(pFX, _T("[Employee Number]"), m_Employee_Number);
- DFX_Text(pFX, _T("[Last Name]"), m_Last_Name);
- DFX_Text(pFX, _T("[First Name]"), m_First_Name);
- DFX_Short(pFX, _T("[Department #]"), m_Department__);
- DFX_Short(pFX, _T("[Employee Pay Type]"), m_Employee_Pay_Type);
- DFX_Double(pFX, _T("[Hours]"), m_Hours);
- DFX_Double(pFX, _T("[Hourly Rate]"), m_Hourly_Rate);
- DFX_Double(pFX, _T("[Weekly Salary]"), m_Weekly_Salary);
- DFX_Double(pFX, _T("[Sales Bonus Rate]"), m_Sales_Bonus_Rate);
- DFX_Double(pFX, _T("[Weekly Sales]"), m_Weekly_Sales);
- //}}AFX_FIELD_MAP
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CEmployeePaySet diagnostics
-
- #ifdef _DEBUG
- void CEmployeePaySet::AssertValid() const
- {
- CDaoRecordset::AssertValid();
- }
-
- void CEmployeePaySet::Dump(CDumpContext& dc) const
- {
- CDaoRecordset::Dump(dc);
- }
- #endif //_DEBUG
-