BranchInfo.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // BranchInfo.h : CBranchInfo 类的实现
  2. // CBranchInfo 实现
  3. // 代码生成在 2015年4月9日, 18:47
  4. #include "stdafx.h"
  5. #include "BranchInfo.h"
  6. IMPLEMENT_DYNAMIC(CBranchInfo, CRecordset)
  7. CBranchInfo::CBranchInfo(CDatabase* pdb): CRecordset(pdb)
  8. {
  9. m_id = 0;
  10. m_branch = _T("");
  11. m_domain = _T("");
  12. m_publicIP = _T("");
  13. m_nFields = 4;
  14. m_nDefaultType = dynaset;
  15. }
  16. // 此连接字符串中可能包含明文密码和/或其他重要
  17. // 信息。请在查看完此连接字符串并找到所有与安全
  18. // 有关的问题后移除 #error。可能需要将此密码存
  19. // 储为其他格式或使用其他的用户身份验证。
  20. CString CBranchInfo::GetDefaultConnect()
  21. {
  22. return _T("ODBC;DSN");
  23. }
  24. CString CBranchInfo::GetDefaultSQL()
  25. {
  26. return _T("[dbo].[BranchInfo]");
  27. }
  28. void CBranchInfo::DoFieldExchange(CFieldExchange* pFX)
  29. {
  30. pFX->SetFieldType(CFieldExchange::outputColumn);
  31. // RFX_Text() 和 RFX_Int() 这类宏依赖的是
  32. // 成员变量的类型,而不是数据库字段的类型。
  33. // ODBC 尝试自动将列值转换为所请求的类型
  34. RFX_Long(pFX, _T("[id]"), m_id);
  35. RFX_Text(pFX, _T("[branch]"), m_branch);
  36. RFX_Text(pFX, _T("[domain]"), m_domain);
  37. RFX_Text(pFX, _T("[publicIP]"), m_publicIP);
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CBranchInfo 诊断
  41. #ifdef _DEBUG
  42. void CBranchInfo::AssertValid() const
  43. {
  44. CRecordset::AssertValid();
  45. }
  46. void CBranchInfo::Dump(CDumpContext& dc) const
  47. {
  48. CRecordset::Dump(dc);
  49. }
  50. #endif //_DEBUG