123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- // ProductInfo.h : CProductInfo 类的实现
- // CProductInfo 实现
- // 代码生成在 2016年9月30日, 14:30
- #include "stdafx.h"
- #include "ProductInfo.h"
- IMPLEMENT_DYNAMIC(CProductInfo, CRecordset)
- CProductInfo::CProductInfo(CDatabase* pdb): CRecordset(pdb)
- {
- m_AutoID = 0;
- m_StudioID = _T("");
- m_ProductSN = _T("");
- m_ProductName = _T("");
- m_ProductCost = 0.0;
- m_ProductPrice = 0.0;
- m_ProductTypes = _T("");
- m_ProductUnit = _T("");
- m_ProductShelves = FALSE;
- m_ProductNote = _T("");
- m_nFields = 10;
- m_nDefaultType = dynaset;
- }
- //#error 安全问题:连接字符串可能包含密码。
- // 此连接字符串中可能包含明文密码和/或其他重要
- // 信息。请在查看完此连接字符串并找到所有与安全
- // 有关的问题后移除 #error。可能需要将此密码存
- // 储为其他格式或使用其他的用户身份验证。
- CString CProductInfo::GetDefaultConnect()
- {
- return _T("DSN=EasySelection;Description=EasySelection;Trusted_Connection=Yes;APP=Microsoft\x00ae Visual Studio\x00ae 2010;WSID=IT-PC;DATABASE=EasySelection;");
- }
- CString CProductInfo::GetDefaultSQL()
- {
- return _T("[dbo].[ProductInfo]");
- }
- void CProductInfo::DoFieldExchange(CFieldExchange* pFX)
- {
- pFX->SetFieldType(CFieldExchange::outputColumn);
- // RFX_Text() 和 RFX_Int() 这类宏依赖的是
- // 成员变量的类型,而不是数据库字段的类型。
- // ODBC 尝试自动将列值转换为所请求的类型
- RFX_Long(pFX, _T("[AutoID]"), m_AutoID);
- RFX_Text(pFX, _T("[StudioID]"), m_StudioID);
- RFX_Text(pFX, _T("[ProductSN]"), m_ProductSN);
- RFX_Text(pFX, _T("[ProductName]"), m_ProductName);
- RFX_Double(pFX, _T("[ProductCost]"), m_ProductCost);
- RFX_Double(pFX, _T("[ProductPrice]"), m_ProductPrice);
- RFX_Text(pFX, _T("[ProductTypes]"), m_ProductTypes);
- RFX_Text(pFX, _T("[ProductUnit]"), m_ProductUnit);
- RFX_Bool(pFX, _T("[ProductShelves]"), m_ProductShelves);
- RFX_Text(pFX, _T("[ProductNote]"), m_ProductNote);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CProductInfo 诊断
- #ifdef _DEBUG
- void CProductInfo::AssertValid() const
- {
- CRecordset::AssertValid();
- }
- void CProductInfo::Dump(CDumpContext& dc) const
- {
- CRecordset::Dump(dc);
- }
- #endif //_DEBUG
- //////////////////////////////////////////////////////////////////////////
- IMPLEMENT_SERIAL(CProductInfoObj, CObject, 0)
- CProductInfoObj::CProductInfoObj()
- {
- m_AutoID = 0;
- m_StudioID = _T("");
- m_ProductSN = _T("");
- m_ProductName = _T("");
- m_ProductCost = 0.0;
- m_ProductPrice = 0.0;
- m_ProductTypes = _T("");
- m_ProductUnit = _T("");
- m_ProductShelves = TRUE;
- m_ProductNote = _T("");
- }
- CProductInfoObj& CProductInfoObj::operator=(const CProductInfoObj& member)
- {
- m_AutoID = member.m_AutoID;
- m_StudioID = member.m_StudioID;
- m_ProductSN = member.m_ProductSN;
- m_ProductName = member.m_ProductName;
- m_ProductCost = member.m_ProductCost;
- m_ProductPrice = member.m_ProductPrice;
- m_ProductTypes = member.m_ProductTypes;
- m_ProductUnit = member.m_ProductUnit;
- m_ProductShelves = member.m_ProductShelves;
- m_ProductNote = member.m_ProductNote;
- return *this;
- }
- void CProductInfoObj::Serialize(CArchive& ar)
- {
- try
- {
- CObject::Serialize(ar);
- if( ar.IsStoring() )
- {
- ar << m_AutoID;
- ar << m_StudioID;
- ar << m_ProductSN;
- ar << m_ProductName;
- ar << m_ProductCost;
- ar << m_ProductPrice;
- ar << m_ProductTypes;
- ar << m_ProductUnit;
- ar << m_ProductShelves;
- ar << m_ProductNote;
- }
- else
- {
- ar >> m_AutoID;
- ar >> m_StudioID;
- ar >> m_ProductSN;
- ar >> m_ProductName;
- ar >> m_ProductCost;
- ar >> m_ProductPrice;
- ar >> m_ProductTypes;
- ar >> m_ProductUnit;
- ar >> m_ProductShelves;
- ar >> m_ProductNote;
- }
- }
- catch (CMemoryException* e)
- {
- #if _DEBUG
- e->ReportError();
- #endif
- }
- }
|