Sfoglia il codice sorgente

转移存储路径。

Jeff 5 anni fa
parent
commit
7485a9b638
97 ha cambiato i file con 18668 aggiunte e 0 eliminazioni
  1. 172 0
      .gitignore
  2. 43 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum.sln
  3. 269 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Base64.cpp
  4. 79 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Base64.h
  5. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOrders.cpp
  6. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOrders.h
  7. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOther.cpp
  8. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOther.h
  9. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgSelectPackageType.cpp
  10. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgSelectPackageType.h
  11. 29 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Classichead.h
  12. 743 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/EncodingConversion.cpp
  13. 95 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/EncodingConversion.h
  14. 131 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/ErpCompanyInfo.cpp
  15. 77 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/ErpCompanyInfo.h
  16. 546 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Global.cpp
  17. 89 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Global.h
  18. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Resource.h
  19. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblCustomerSource.cpp
  20. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblCustomerSource.h
  21. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblDept.cpp
  22. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblDept.h
  23. 101 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblEmployee.cpp
  24. 62 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblEmployee.h
  25. 85 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpense.cpp
  26. 54 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpense.h
  27. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpenseType.cpp
  28. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpenseType.h
  29. 79 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoods.cpp
  30. 51 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoods.h
  31. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoodsType.cpp
  32. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoodsType.h
  33. 121 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblHospitalCustomer.cpp
  34. 72 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblHospitalCustomer.h
  35. 85 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblIntentionalCustomer.cpp
  36. 54 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblIntentionalCustomer.h
  37. 95 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblMembershipCard.cpp
  38. 59 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblMembershipCard.h
  39. 345 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrder.cpp
  40. 184 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrder.h
  41. 101 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderCustomer.cpp
  42. 62 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderCustomer.h
  43. 137 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderGoods.cpp
  44. 80 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderGoods.h
  45. 85 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient.cpp
  46. 54 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient.h
  47. 73 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient2.cpp
  48. 48 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient2.h
  49. 87 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderScenicSpot.cpp
  50. 55 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderScenicSpot.h
  51. 69 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackage.cpp
  52. 46 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackage.h
  53. 65 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods.cpp
  54. 44 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods.h
  55. 65 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods2.cpp
  56. 44 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods2.h
  57. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType.cpp
  58. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType.h
  59. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType2.cpp
  60. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType2.h
  61. 103 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblRegularCustomer.cpp
  62. 63 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblRegularCustomer.h
  63. 61 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblScenicSpot.cpp
  64. 42 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblScenicSpot.h
  65. 71 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblSupplier.cpp
  66. 47 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblSupplier.h
  67. 375 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblVersion.cpp
  68. 199 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblVersion.h
  69. 7785 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.cpp
  70. 255 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.h
  71. 46 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.ini
  72. 924 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/des.cpp
  73. 59 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/des.h
  74. 610 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv.c
  75. 345 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv_impl.cpp
  76. 15 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv_impl.h
  77. 613 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/localcharset.c
  78. 53 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/localcharset.h
  79. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.cpp
  80. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.h
  81. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.rc
  82. 488 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.vcxproj
  83. 172 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.vcxproj.filters
  84. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2PlatinumDlg.cpp
  85. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2PlatinumDlg.h
  86. 577 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/relocatable.c
  87. 81 0
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/relocatable.h
  88. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/res/lyfzClassic2Platinum.ico
  89. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/res/lyfzClassic2Platinum.rc2
  90. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/stdafx.cpp
  91. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/stdafx.h
  92. BIN
      bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/targetver.h
  93. 30 0
      bygone/lyfzClassic2Platinum/将dindan表客户资料更新到client表.sql
  94. 3 0
      bygone/lyfzClassic2Platinum/注意.txt
  95. BIN
      bygone/lyfzClassic2Platinum/说明.doc
  96. 198 0
      数据库/db.sql
  97. BIN
      数据库/数据库设计.xls

+ 172 - 0
.gitignore

@@ -62,3 +62,175 @@
 *.out
 *.app
 
+# ---> C Sharp
+# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
+[Bb]in/
+[Oo]bj/
+
+# mstest test results
+TestResults
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.log
+*.vspscc
+*.vssscc
+.builds
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Publish Web Output
+*.Publish.xml
+
+# NuGet Packages Directory
+packages
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+[Tt]est[Rr]esult*
+*.Cache
+ClientBin
+[Ss]tyle[Cc]op.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+# ---> Python
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+*.db
+*.opendb

+ 43 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum.sln

@@ -0,0 +1,43 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27428.2037
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lyfzClassic2Platinum", "lyfzClassic2Platinum\lyfzClassic2Platinum.vcxproj", "{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+		Win7Debug|x64 = Win7Debug|x64
+		Win7Debug|x86 = Win7Debug|x86
+		Win7Release|x64 = Win7Release|x64
+		Win7Release|x86 = Win7Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Debug|x64.ActiveCfg = Debug|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Debug|x64.Build.0 = Debug|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Debug|x86.ActiveCfg = Debug|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Debug|x86.Build.0 = Debug|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Release|x64.ActiveCfg = Release|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Release|x64.Build.0 = Release|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Release|x86.ActiveCfg = Release|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Release|x86.Build.0 = Release|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Debug|x64.ActiveCfg = Win7Debug|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Debug|x64.Build.0 = Win7Debug|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Debug|x86.ActiveCfg = Win7Debug|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Debug|x86.Build.0 = Win7Debug|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Release|x64.ActiveCfg = Win7Release|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Release|x64.Build.0 = Win7Release|x64
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Release|x86.ActiveCfg = Win7Release|Win32
+		{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}.Win7Release|x86.Build.0 = Win7Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {73587B36-4FC3-4950-BE5D-48D28AB36D2A}
+	EndGlobalSection
+EndGlobal

+ 269 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Base64.cpp

@@ -0,0 +1,269 @@
+#include "StdAfx.h"
+#include "Base64.h"
+
+CBase64::CBase64(void)
+{
+}
+
+CBase64::~CBase64(void)
+{
+}
+
+const char CBase64::sm_base64digits[65] =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+const char CBase64::sm_base64val[128] = {
+	BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
+	BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
+	BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63,
+	52, 53, 54, 55,  56, 57, 58, 59,  60, 61,BAD,BAD, BAD,BAD,BAD,BAD,
+	BAD,  0,  1,  2,   3,  4,  5,  6,   7,  8,  9, 10,  11, 12, 13, 14,
+	15, 16, 17, 18,  19, 20, 21, 22,  23, 24, 25,BAD, BAD,BAD,BAD,BAD,
+	BAD, 26, 27, 28,  29, 30, 31, 32,  33, 34, 35, 36,  37, 38, 39, 40,
+	41, 42, 43, 44,  45, 46, 47, 48,  49, 50, 51,BAD, BAD,BAD,BAD,BAD
+};
+
+/************************************************************************/
+/*  函数:[6/2/2016 IT];
+/*  描述:将字节转换为Base64字符;
+/*  参数:;
+/*  	[IN] pbinary:			要转换成Base64字符的二进制字节数组;
+/*  	[IN] nbinaryLen:		pbinary所指向的缓存大小;
+/*  	[OUT] pOutBase64:		返回转换后的Base64字符,以'\0'结束;
+/*  返回:返回转换成功后的Base64字符数;
+/*  注意:注意参数1是字节BYTE,返回的pOutBase64是人为加上'\0'结束符;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+void CBase64::binToBase64(IN const unsigned char *pbinary, IN size_t nbinaryLen, OUT char *pOutBase64)
+{
+	for ( ; nbinaryLen >= 3; nbinaryLen -= 3, pbinary += 3) 
+	{
+		*pOutBase64++ = sm_base64digits[pbinary[0] >> 2];
+		*pOutBase64++ = sm_base64digits[((pbinary[0] << 4) & 0x30) | (pbinary[1] >> 4)];
+		*pOutBase64++ = sm_base64digits[((pbinary[1] << 2) & 0x3c) | (pbinary[2] >> 6)];
+		*pOutBase64++ = sm_base64digits[pbinary[2] & 0x3f];
+	}
+
+	if (nbinaryLen > 0) 
+	{
+		unsigned char fragment;
+		*pOutBase64++ = sm_base64digits[pbinary[0] >> 2];
+		fragment = (pbinary[0] << 4) & 0x30;
+
+		if (nbinaryLen > 1)
+			fragment |= pbinary[1] >> 4;
+
+		*pOutBase64++ = sm_base64digits[fragment];
+		*pOutBase64++ = (nbinaryLen < 2) ? '=' : sm_base64digits[(pbinary[1] << 2) & 0x3c];
+		*pOutBase64++ = '=';
+	}
+	*pOutBase64 = '\0';
+}
+
+/************************************************************************/
+/*  函数:[6/2/2016 IT];
+/*  描述:将Base64字符串转为化二进制字节字符串;
+/*  参数:;
+/*  	[IN] pBase64:		要转化成二进制字节字符串的Base64字符;
+/*  	[OUT] pbinary:		返回转化成二进制字节的字符串;
+/*  	[IN] maxLen:		pbinary指向的缓存大小;
+/*  返回:返回转化成二进制字节字符数;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+int CBase64::base64ToBin(IN const char *pBase64, OUT unsigned char *pbinary, IN size_t maxLen)
+{
+	size_t len = 0;
+	unsigned char digit1, digit2, digit3, digit4;
+
+	if (pBase64[0] == '+' && pBase64[1] == ' ')
+		pBase64 += 2;
+	if (pBase64[0] == '\r')
+		return 0;
+
+	while (*pBase64 && *pBase64 != '\r' /*&& digit4 != '='*/) 
+	{
+		digit1 = pBase64[0];
+		if (decode64(digit1) == BAD)
+			return -1;
+		digit2 = pBase64[1];
+		if (decode64(digit2) == BAD)
+			return -1;
+		digit3 = pBase64[2];
+		if (digit3 != '=' && decode64(digit3) == BAD)
+			return -1; 
+		digit4 = pBase64[3];
+		if (digit4 != '=' && decode64(digit4) == BAD)
+			return -1;
+		pBase64 += 4;
+
+		++len;
+		if (maxLen && len > maxLen)
+			return -1;
+
+		*(pbinary++) = (decode64(digit1) << 2) | (decode64(digit2) >> 4);
+		if (digit3 != '=') 
+		{
+			++len;
+			if (maxLen && len > maxLen)
+				return -1;
+			*(pbinary++) = ((decode64(digit2) << 4) & 0xf0) | (decode64(digit3) >> 2);
+			if (digit4 != '=') 
+			{
+				++len;
+				if (maxLen && len > maxLen)
+					return -1;
+				*(pbinary++) = ((decode64(digit3) << 6) & 0xc0) | decode64(digit4);
+			} // if
+		} // if
+	} // while
+
+	return len;
+}
+
+#ifndef VC60
+/************************************************************************/
+/*  函数:StringToBase64[1/14/2017 IT];
+/*  描述:将指定字符串转成Base64字符串;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+CStringA CBase64::StringToBase64A(IN CStringA strSource)
+{
+	CStringA strBase64 = "";
+	// 计算出Base64字符长度;
+	INT nBase64Len = CalcBase64Len(strSource.GetLength());
+	CHAR* pBase64 = new CHAR[nBase64Len+1];
+	memset(pBase64, 0, nBase64Len+1);
+	binToBase64((const unsigned char*)strSource.GetString(), strSource.GetLength(), pBase64);
+
+	strBase64 = pBase64;
+	if (pBase64) delete []pBase64;
+
+	return strBase64;
+}
+
+CStringW CBase64::StringToBase64W(IN CStringW strSource)
+{
+	CStringW strBase64 = L"";
+	// 获取多字节字符字节数;
+	int cbMultiByte = WideCharToMultiByte(CP_OEMCP, 0, strSource, -1, NULL, 0, NULL, NULL);
+	if ( cbMultiByte == 0 )
+		return L"";
+
+	// 转换成多字节字符;
+	CHAR *pMultiByteStr = new CHAR[cbMultiByte+1];
+	memset(pMultiByteStr, 0, cbMultiByte + 1);
+	int nWriteNum = WideCharToMultiByte(CP_OEMCP, 0, strSource, -1, pMultiByteStr, cbMultiByte, NULL, NULL);
+	if (nWriteNum != cbMultiByte)
+	{
+		if (pMultiByteStr) 
+			delete []pMultiByteStr;
+		return L"";
+	}
+
+	// 计算出Base64字符长度;
+	INT nBase64Len = CalcBase64Len(cbMultiByte);
+	CHAR *pBase64 = new CHAR[nBase64Len+1];
+	memset(pBase64, 0, nBase64Len+1);
+	binToBase64((const unsigned char*)pMultiByteStr, cbMultiByte, pBase64);
+
+	strBase64 = pBase64;
+	if (pBase64) delete []pBase64;
+	if (pMultiByteStr) delete []pMultiByteStr;
+
+	return strBase64;
+}
+
+/************************************************************************/
+/*  函数:[1/14/2017 IT];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+CStringA CBase64::Base64ToStringA(IN CStringA strBase64)
+{
+	CStringA strResult = "";
+	// 计算出结果长度;
+	INT nStrlen = CalcBinLen(strBase64.GetLength());
+	BYTE *pString = new BYTE[nStrlen+1];
+	memset(pString, 0, nStrlen+1);
+	base64ToBin(strBase64, pString, nStrlen);
+
+	strResult = (char*)pString;
+	if ( pString) delete []pString;
+
+	return strResult;
+}
+
+CStringW CBase64::Base64ToStringW(IN CStringW strBase64)
+{
+	CStringW strResult = L"";
+	// 获取多字节字符字节数;
+	int cbMultiByte = WideCharToMultiByte(CP_OEMCP, 0, strBase64, -1, NULL, 0, NULL, NULL);
+	if ( cbMultiByte == 0 )
+		return L"";
+
+	// 转换成多字节字符;
+	CHAR *pMultiByteStr = new CHAR[cbMultiByte+1];
+	memset(pMultiByteStr, 0, cbMultiByte + 1);
+	int nWriteNum = WideCharToMultiByte(CP_OEMCP, 0, strBase64, -1, pMultiByteStr, cbMultiByte, NULL, NULL);
+	if (nWriteNum != cbMultiByte)
+	{
+		if (pMultiByteStr) 
+			delete []pMultiByteStr;
+		return L"";
+	}
+
+	// 计算出Bin字符长度;
+	INT nStrlen = CalcBinLen(cbMultiByte);
+	CHAR *pString = new CHAR[nStrlen+1];
+	memset(pString, 0, nStrlen+1);
+	base64ToBin(pMultiByteStr, (unsigned char*)pString, nStrlen );
+
+	// 获取宽字符字节数;
+	int cchWideChar  = MultiByteToWideChar(CP_ACP, 0, pString, -1, NULL, 0);
+	if ( cchWideChar == 0 )
+		return L"";
+
+	// 转换成宽字符串;
+	WCHAR *pResult = new WCHAR[cchWideChar];
+	memset(pResult, 0 , sizeof(WCHAR)*cchWideChar);
+	nWriteNum = MultiByteToWideChar(CP_ACP, 0, pString, -1, pResult, cchWideChar );
+	if ( nWriteNum != cchWideChar)
+		return L"";
+
+	strResult = pResult;
+	if ( pResult ) delete[] pResult;
+	if (pString) delete []pString;
+	if (pMultiByteStr) delete []pMultiByteStr;
+
+	return strResult;
+}
+#endif

+ 79 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Base64.h

@@ -0,0 +1,79 @@
+/************************************************************************/
+/*  Copyright (C), 2016-2020, [IT], 保留所有权利;
+/*  模 块 名:;
+/*  描    述:;
+/*
+/*  版    本:[V];	
+/*  作    者:[IT];
+/*  日    期:[5/24/2016];
+/*
+/*
+/*  注    意:;
+/*
+/*  修改记录:[IT];
+/*  修改日期:;
+/*  修改版本:;
+/*  修改内容:;
+/************************************************************************/
+#ifndef __BASE64_CODE__
+#define __BASE64_CODE__
+
+#pragma once
+
+class CBase64
+{
+public:
+	CBase64(void);
+	~CBase64(void);
+
+	/************************************************************************/
+	/*  函数:[5/24/2016 IT];
+	/*  描述:获取指定字符串长度对应的Base64字符长度;
+	/*  参数:;
+	/*  	[IN] len:要计算的字符长度;
+	/*  返回:返回指定长度len的字符串转换为编码Base64对应的长度,并多加一个'\0'结束符;
+	/*  注意:;
+	/************************************************************************/
+	static int CalcBase64Len(IN const size_t& len) {
+		return (len / 3 + (len % 3 ? 1 : 0)) * 4 + 1; // one more byte for '\0'
+	}
+
+	static void binToBase64(IN const unsigned char *pbinary, IN size_t nbinaryLen, OUT char *pOutBase64);
+
+	/************************************************************************/
+	/*  函数:[5/24/2016 IT];
+	/*  描述:获取指定Base64字符串长度对应的字节长度;
+	/*  参数:;
+	/*  	[IN] len:要计算的Base64字符长度;
+	/*  返回:返回指定长度len的Base64字符串转换为字节对应的长度;
+	/*  注意:;
+	/************************************************************************/
+	static int CalcBinLen(size_t len) {
+		return len / 4 * 3; 
+	}
+
+	static int base64ToBin(IN const char *pBase64, OUT unsigned char *pbinary, IN size_t maxLen);
+
+private:
+	static char decode64(unsigned char ch) {
+		return ch < 128 ? sm_base64val[ch] : BAD;
+	}
+
+private:
+	enum {BAD = -1};
+	// 必须是ASCII字符;
+	static const char sm_base64digits[65];
+	// 必须是ASCII字符;
+	static const char sm_base64val[128];
+
+	// mfc版本;
+public:
+#ifndef VC60
+	static CStringA StringToBase64A(IN CStringA strSource);
+	static CStringW StringToBase64W(IN CStringW strSource);
+	static CStringA Base64ToStringA(IN CStringA strBase64);
+	static CStringW Base64ToStringW(IN CStringW strBase64);
+#endif
+};
+
+#endif // __BASE64_CODE__

BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOrders.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOrders.h


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOther.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgOther.h


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgSelectPackageType.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/CDlgSelectPackageType.h


+ 29 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Classichead.h

@@ -0,0 +1,29 @@
+#pragma once
+
+#include "TblCustomerSource.h"
+#include "TblDept.h"
+#include "TblEmployee.h"
+#include "TblExpense.h"
+#include "TblExpenseType.h"
+#include "TblGoods.h"
+#include "TblGoodsType.h"
+#include "TblHospitalCustomer.h"
+#include "TblIntentionalCustomer.h"
+#include "TblMembershipCard.h"
+#include "TblOrder.h"
+#include "TblOrderCustomer.h"
+#include "TblOrderGoods.h"
+#include "TblOrderRecipient.h"
+#include "TblOrderRecipient2.h"
+#include "TblOrderScenicSpot.h"
+#include "TblPackage.h"
+#include "TblPackageGoods.h"
+#include "TblPackageGoods2.h"
+#include "TblPackageType.h"
+#include "TblPackageType2.h"
+#include "TblRegularCustomer.h"
+#include "TblScenicSpot.h"
+#include "TblSupplier.h"
+#include "TblVersion.h"
+
+#include "ErpCompanyInfo.h"

+ 743 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/EncodingConversion.cpp

@@ -0,0 +1,743 @@
+#include "StdAfx.h"
+#include "EncodingConversion.h"
+
+namespace EncodingConverion
+{
+
+	WCHAR* ASCII2UNICODE(IN LPCCH lpASCIIStr)
+	{
+		if ( lpASCIIStr == NULL )
+			return NULL;
+
+		// 获取宽字符字节数;
+		int cchWideChar  = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, NULL, 0);
+		if ( cchWideChar == 0)
+			return NULL;
+
+		// 转换成宽字符串;
+		WCHAR *pWideChar = new WCHAR[cchWideChar + 1];
+		memset(pWideChar, 0 , sizeof(WCHAR)*(cchWideChar + 1));
+		int nWriteNum = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, pWideChar, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+		{ 
+			if (pWideChar) 
+				delete []pWideChar;
+			return NULL;
+		}
+
+		return pWideChar;
+	}
+
+	BOOL ASCII2UNICODE(IN LPCCH lpASCIIStr, OUT PWCH pUNICODEStr, IN CONST INT& nUNICODEStrLen)
+	{
+		if ( lpASCIIStr == NULL )
+			return FALSE;
+
+		// 获取宽字符字节数;
+		int cchWideChar  = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, NULL, 0);
+		if ( cchWideChar == 0 || cchWideChar >= nUNICODEStrLen)
+			return FALSE;
+
+		// 转换成宽字符串;
+		memset(pUNICODEStr, 0 , sizeof(WCHAR)*nUNICODEStrLen);
+		int nWriteNum = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, pUNICODEStr, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+			return FALSE;
+
+		return TRUE;
+	}
+
+	BOOL ASCII2UNICODE(IN LPCCH lpASCIIStr, OUT wstring &strResult)
+	{
+		if ( lpASCIIStr == NULL )
+			return FALSE;
+
+		// 获取宽字符字节数;
+		int cchWideChar  = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, NULL, 0);
+		if ( cchWideChar == 0 )
+			return FALSE;
+
+		// 转换成宽字符串;
+		WCHAR *pResult = new WCHAR[cchWideChar];
+		memset(pResult, 0 , sizeof(WCHAR)*cchWideChar);
+		int nWriteNum = MultiByteToWideChar(CP_ACP, 0, lpASCIIStr, -1, pResult, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+			return FALSE;
+
+		strResult = pResult;
+		if ( pResult )
+			delete[] pResult;
+
+		return TRUE;
+	}
+
+	CHAR* UNICODE2ASCII(IN LPWCH lpUNICODEStr)
+	{
+		if ( lpUNICODEStr == NULL )
+			return NULL;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 )
+			return NULL;
+
+		// 转换成多字节字符;
+		CHAR *pMultiByteStr = new CHAR[cbMultiByte+1];
+		memset(pMultiByteStr, 0, cbMultiByte + 1);
+		int nWriteNum = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, pMultiByteStr, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+		{
+			if (pMultiByteStr) 
+				delete []pMultiByteStr;
+			return NULL;
+		}
+
+		return pMultiByteStr;
+	}
+
+	BOOL UNICODE2ASCII(IN LPWCH lpUNICODEStr, OUT LPCH pASCIIStr, IN CONST INT& nASCIIStrLen)
+	{
+		if ( lpUNICODEStr == NULL )
+			return FALSE;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 || cbMultiByte >= nASCIIStrLen )
+			return FALSE;
+
+		// 转换成多字节字符;
+		memset((void*)pASCIIStr, 0, nASCIIStrLen);
+		int nWriteNum = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, pASCIIStr, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+		{
+			return FALSE;
+		}
+
+		return TRUE;
+	}
+
+	BOOL UNICODE2ASCII(IN LPWCH lpUNICODEStr, OUT string &strResult)
+	{
+		if ( lpUNICODEStr == NULL )
+			return FALSE;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 )
+			return FALSE;
+
+		// 转换成多字节字符;
+		CHAR* pResult = new CHAR[cbMultiByte];
+		memset(pResult, 0, cbMultiByte);
+		int nWriteNum = WideCharToMultiByte(CP_OEMCP, 0, lpUNICODEStr, -1, pResult, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+			return FALSE;
+
+		strResult = pResult;
+		if ( pResult )
+			delete[] pResult;
+
+		return TRUE;
+	}
+
+	CHAR* UNICODE2UTF8(IN LPWCH lpUNICODEStr)
+	{
+		if ( lpUNICODEStr == NULL )
+			return NULL;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 )
+			return NULL;
+
+		// 转换成多字节字符;
+		CHAR* pMultiByteStr = new CHAR[cbMultiByte+1];
+		memset(pMultiByteStr, 0, cbMultiByte + 1);
+		int nWriteNum = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, pMultiByteStr, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+		{
+			if (pMultiByteStr) 
+				delete []pMultiByteStr;
+			return NULL;
+		}
+
+		return pMultiByteStr;
+	}
+
+	BOOL UNICODE2UTF8(IN LPWCH lpUNICODEStr, OUT LPCH pUTF8Str, IN CONST INT& nUTF8StrLen)
+	{
+		if ( lpUNICODEStr == NULL )
+			return FALSE;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 || cbMultiByte >= nUTF8StrLen )
+			return FALSE;
+
+		// 转换成多字节字符;
+		memset(pUTF8Str, 0, nUTF8StrLen);
+		int nWriteNum = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, pUTF8Str, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+		{
+			return FALSE;
+		}
+
+		return TRUE;
+	}
+
+	BOOL UNICODE2UTF8(IN LPWCH lpUNICODEStr, OUT string &strResult)
+	{
+		if ( lpUNICODEStr == NULL )
+			return FALSE;
+
+		// 获取多字节字符字节数;
+		int cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, NULL, 0, NULL, NULL);
+		if ( cbMultiByte == 0 )
+			return FALSE;
+
+		// 转换成多字节字符;
+		CHAR *pResult = new CHAR[cbMultiByte];
+		memset(pResult, 0, cbMultiByte);
+		int nWriteNum = WideCharToMultiByte(CP_UTF8, 0, lpUNICODEStr, -1, pResult, cbMultiByte, NULL, NULL);
+		if (nWriteNum != cbMultiByte)
+			return FALSE;
+
+		strResult = pResult;
+		if ( pResult )
+			delete[] pResult;
+
+		return TRUE;
+	}
+
+	CHAR* ASCII2UTF8(IN LPCCH lpASCIIStr)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = ASCII2UNICODE(lpASCIIStr);
+		if ( pWideChar == NULL )
+			return NULL;
+
+		// 再将UICODE转成UTF8;
+		CHAR* pUTF8 = UNICODE2UTF8(pWideChar);
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return pUTF8;
+	}
+
+	BOOL ASCII2UTF8(IN LPCCH lpASCIIStr, OUT LPCH pUTF8Str, IN CONST INT& nUTF8StrLen)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = ASCII2UNICODE(lpASCIIStr);
+		if ( pWideChar == NULL )
+			return FALSE;
+
+		// 再将UICODE转成UTF8;
+		BOOL bResult = UNICODE2UTF8(pWideChar, pUTF8Str, nUTF8StrLen);
+
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return bResult;
+	}
+
+	BOOL ASCII2UTF8(IN LPCCH lpASCIIStr, OUT string &strResult)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = ASCII2UNICODE(lpASCIIStr);
+		if ( pWideChar == NULL )
+			return FALSE;
+
+		// 再将UICODE转成UTF8;
+		BOOL bResult = UNICODE2UTF8(pWideChar, strResult);
+
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return bResult;
+	}
+
+	WCHAR* UTF82UNICODE(IN LPCCH lpUTF8)
+	{
+		if ( lpUTF8 == NULL )
+			return NULL;
+
+		// 获取unicode字符数;
+		int cchWideChar = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, NULL, 0);
+		if ( cchWideChar == 0)
+			return NULL;
+
+		// 转换成宽字符串;
+		WCHAR *pWideChar = new WCHAR[cchWideChar + 1];
+		memset(pWideChar, 0 , sizeof(WCHAR)*(cchWideChar + 1));
+		int nWriteNum = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, pWideChar, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+		{ 
+			if (pWideChar) 
+				delete []pWideChar;
+			return NULL;
+		}
+
+		return pWideChar;
+	}
+
+	BOOL UTF82UNICODE(IN LPCCH lpUTF8, OUT PWCH pUNICODEStr, IN CONST INT& nUNICODEStrLen)
+	{
+		if ( lpUTF8 == NULL )
+			return FALSE;
+
+		// 获取宽字符字节数;
+		int cchWideChar  = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, NULL, 0);
+		if ( cchWideChar == 0 || cchWideChar >= nUNICODEStrLen)
+			return FALSE;
+
+		// 转换成宽字符串;
+		memset(pUNICODEStr, 0 , sizeof(WCHAR)*nUNICODEStrLen);
+		int nWriteNum = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, pUNICODEStr, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+			return FALSE;
+
+		return TRUE;
+	}
+
+	BOOL UTF82UNICODE(IN LPCCH lpUTF8, OUT wstring &strResult)
+	{
+		if ( lpUTF8 == NULL )
+			return FALSE;
+
+		// 获取宽字符字节数;
+		int cchWideChar  = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, NULL, 0);
+		if ( cchWideChar == 0 )
+			return FALSE;
+
+		// 转换成宽字符串;
+		WCHAR* pResult = new WCHAR[cchWideChar];
+		memset(pResult, 0 , sizeof(WCHAR)*cchWideChar);
+		int nWriteNum = MultiByteToWideChar(CP_UTF8, 0, lpUTF8, -1, pResult, cchWideChar );
+		if ( nWriteNum != cchWideChar)
+			return FALSE;
+
+		strResult = pResult;
+		if ( pResult )
+			delete[] pResult;
+
+		return TRUE;
+	}
+
+	CHAR* UTF82ASCII(IN LPCCH lpUTF8)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = UTF82UNICODE(lpUTF8);
+		if ( pWideChar == NULL )
+			return NULL;
+
+		// 再将UICODE转成UTF8;
+		CHAR* pUTF8 = UNICODE2ASCII(pWideChar);
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return pUTF8;
+	}
+
+	BOOL UTF82ASCII(IN LPCCH lpUTF8, OUT LPCH pASCIIStr, IN CONST INT& nASCIIStrLen)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = UTF82UNICODE(lpUTF8);
+		if ( pWideChar == NULL )
+			return FALSE;
+
+		// 再将UICODE转成UTF8;
+		BOOL bResult = UNICODE2ASCII(pWideChar, pASCIIStr, nASCIIStrLen);
+
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return bResult;
+	}
+
+	BOOL UTF82ASCII(IN LPCCH lpUTF8, OUT string &strResult)
+	{
+		// 将ASCII字符串转成UNICODE字符串;
+		WCHAR* pWideChar = UTF82UNICODE(lpUTF8);
+		if ( pWideChar == NULL )
+			return FALSE;
+
+		// 再将UICODE转成UTF8;
+		BOOL bResult = UNICODE2ASCII(pWideChar, strResult);
+
+		if ( pWideChar )
+			delete []pWideChar;
+
+		return bResult;
+	}
+
+	//做为解Url使用
+	char CharToInt(char ch)
+	{
+		if (ch >= '0' && ch <= '9')return (char)(ch - '0');
+		if (ch >= 'a' && ch <= 'f')return (char)(ch - 'a' + 10);
+		if (ch >= 'A' && ch <= 'F')return (char)(ch - 'A' + 10);
+		return -1;
+	}
+
+	char StrToBin(IN char (&str)[2])
+	{
+		char tempWord[2];
+		char chn;
+
+		tempWord[0] = CharToInt(str[0]);                         //make the B to 11 -- 00001011
+		tempWord[1] = CharToInt(str[1]);                         //make the 0 to 0  -- 00000000
+
+		chn = (tempWord[0] << 4) | tempWord[1];                //to change the BO to 10110000
+
+		return chn;
+	}
+
+	//GB2312 转为 UTF-8
+	void GB2312ToUTF_8(string& pOut, const char *pText, int pLen)
+	{
+		char buf[4];
+		memset(buf, 0, 4);
+
+		pOut.clear();
+
+		int i = 0;
+		while (i < pLen)
+		{
+			//如果是英文直接复制就可以;
+			if (pText[i] >= 0)
+			{
+				char asciistr[2] = { 0 };
+				asciistr[0] = (pText[i++]);
+				pOut.append(asciistr);
+			}
+			else
+			{
+				WCHAR pbuffer[2] = {0};
+				MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pText + i, 2, pbuffer, 1);
+				UNICODE2UTF8(pbuffer, buf, 4);
+				pOut.append(buf);
+				i += 2;
+			}
+		}
+
+		return;
+	}
+
+	/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:将字符串编码成为GB2312格式的URL;;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string EnCode_GB2312URL(IN CHAR* pText)
+	{
+		string dd;
+		size_t len = strlen(pText);
+		for (size_t i = 0; i < len; i++)
+		{
+			if (isalnum((BYTE)pText[i]))
+			{
+				char tempbuff[2];
+				sprintf_s(tempbuff, "%c", pText[i]);
+				dd.append(tempbuff);
+			}
+			else if (isspace((BYTE)pText[i]))
+			{
+				dd.append("+");
+			}
+			else
+			{
+				char tempbuff[4];
+				sprintf_s(tempbuff, "%%%X%X", ((BYTE*)pText)[i] >> 4, ((BYTE*)pText)[i] % 16);
+				dd.append(tempbuff);
+			}
+		}
+		return dd;
+	}
+
+	void EnCode_GB2312URL(IN CHAR* pText, OUT string& strResult)
+	{
+		size_t len = strlen(pText);
+		for (size_t i = 0; i < len; i++)
+		{
+			if (isalnum((BYTE)pText[i]))
+			{
+				char tempbuff[2];
+				sprintf_s(tempbuff, "%c", pText[i]);
+				strResult.append(tempbuff);
+			}
+			else if (isspace((BYTE)pText[i]))
+			{
+				strResult.append("+");
+			}
+			else
+			{
+				char tempbuff[4];
+				sprintf_s(tempbuff, "%%%X%X", ((BYTE*)pText)[i] >> 4, ((BYTE*)pText)[i] % 16);
+				strResult.append(tempbuff);
+			}
+		}
+	}
+
+	/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string EnCode_UTF8URL(IN const CHAR* pText)
+	{
+		string tt = "";
+		string dd = "";
+		ASCII2UTF8(pText,tt);
+
+		size_t len = tt.length();
+		for (size_t i = 0; i < len; i++)
+		{
+			if (isalnum((BYTE)tt.at(i)))
+			{
+				char tempbuff[2] = { 0 };
+				sprintf_s(tempbuff, "%c", (BYTE)tt.at(i));
+				dd.append(tempbuff);
+			}
+			else if (isspace((BYTE)tt.at(i)))
+			{
+				dd.append("+");
+			}
+			else
+			{
+				char tempbuff[4];
+				sprintf_s(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16);
+				dd.append(tempbuff);
+			}
+		}
+		return dd;
+	}
+
+	void EnCode_UTF8URL(IN const CHAR* pText, OUT string& strResult)
+	{
+		string tt = "";
+		ASCII2UTF8(pText,tt);
+
+		size_t len = tt.length();
+		for (size_t i = 0; i < len; i++)
+		{
+			if (isalnum((BYTE)tt.at(i)))
+			{
+				char tempbuff[2] = { 0 };
+				sprintf_s(tempbuff, "%c", (BYTE)tt.at(i));
+				strResult.append(tempbuff);
+			}
+			else if (isspace((BYTE)tt.at(i)))
+			{
+				strResult.append("+");
+			}
+			else
+			{
+				char tempbuff[4];
+				sprintf_s(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16);
+				strResult.append(tempbuff);
+			}
+		}
+	}
+
+	string EnCode_UNICODEURL(IN const CHAR* pText)
+	{
+		return "";
+	}
+
+	/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string DeCode_URLGB2312(IN const CHAR* pURLText)
+	{
+		string output = "";
+		char tmp[2];
+		int i = 0, idx = 0, ndx, len = strlen(pURLText);
+
+		while (i < len){
+			if (pURLText[i] == '%')
+			{
+				tmp[0] = pURLText[i + 1];
+				tmp[1] = pURLText[i + 2];
+				output += StrToBin(tmp);
+				i = i + 3;
+			}
+			else if (pURLText[i] == '+')
+			{
+				output += ' ';
+				i++;
+			}
+			else{
+				output += pURLText[i];
+				i++;
+			}
+		}
+
+		return output;
+	}
+
+	void DeCode_URLGB2312(IN const CHAR* pURLText, OUT string& strResult)
+	{
+		char tmp[2];
+		int i = 0, idx = 0, ndx, len = strlen(pURLText);
+
+		while (i < len){
+			if (pURLText[i] == '%')
+			{
+				tmp[0] = pURLText[i + 1];
+				tmp[1] = pURLText[i + 2];
+				strResult += StrToBin(tmp);
+				i = i + 3;
+			}
+			else if (pURLText[i] == '+')
+			{
+				strResult += ' ';
+				i++;
+			}
+			else{
+				strResult += pURLText[i];
+				i++;
+			}
+		}
+	}
+
+	/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string DeCode_URLUTF8(IN const CHAR* pURLText)
+	{
+		string output = "";
+		string temp = DeCode_URLGB2312(pURLText);
+		UTF82ASCII(temp.c_str(), output);
+		return output;
+	}
+
+	void DeCode_URLUTF8(IN const CHAR* pURLText, OUT string& strResult)
+	{
+		string temp = DeCode_URLGB2312(pURLText);
+		UTF82ASCII(temp.c_str(), strResult);
+	}
+
+	/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string DeCode_URLUNICODE(IN const CHAR* pURLText)
+	{
+		string str = pURLText;
+		string strResult = "";
+
+		INT nIndex = 0;
+		string strTemp = "";
+
+		while ( str.find_first_of("\\u") != string::npos )
+		{
+			nIndex = str.find_first_of("\\u");
+			strResult.append(str.substr(0, nIndex));
+			strTemp = str.substr(nIndex + 2, 4);
+			str = str.substr(nIndex + 2 +4);
+			CHAR szReturn[10] = {0};
+
+			union  __UNION_VAR_INT{
+				BYTE   ch[2];   
+				int	   value;   
+			}unionVarInt;
+
+			unionVarInt.ch[0] =  (CharToInt(strTemp.at(2)) << 4) | (CharToInt(strTemp.at(3))  & 0x00FF);
+			unionVarInt.ch[1] =  (CharToInt(strTemp.at(0)) << 4) | (CharToInt(strTemp.at(1))  & 0x00FF);
+
+			WCHAR szWide[2] = {0};
+			szWide[0] = unionVarInt.value;
+			UNICODE2ASCII(szWide,szReturn,10);
+			strResult.append(szReturn);
+		}
+		strResult.append(str);
+
+		return strResult;
+	}
+
+	void DeCode_URLUNICODE(IN const CHAR* pURLText, OUT string& strResult)
+	{
+		string str = pURLText;
+
+		INT nIndex = 0;
+		string strTemp = "";
+
+		while ( str.find_first_of("\\u") != string::npos )
+		{
+			nIndex = str.find_first_of("\\u");
+			strResult.append(str.substr(0, nIndex));
+			strTemp = str.substr(nIndex + 2, 4);
+			str = str.substr(nIndex + 2 +4);
+			CHAR szReturn[10] = {0};
+
+			union  __UNION_VAR_INT{
+				BYTE   ch[2];   
+				int	   value;   
+			}unionVarInt;
+
+			unionVarInt.ch[0] =  (CharToInt(strTemp.at(2)) << 4) | (CharToInt(strTemp.at(3))  & 0x00FF);
+			unionVarInt.ch[1] =  (CharToInt(strTemp.at(0)) << 4) | (CharToInt(strTemp.at(1))  & 0x00FF);
+
+			WCHAR szWide[2] = {0};
+			szWide[0] = unionVarInt.value;
+			UNICODE2ASCII(szWide,szReturn,10);
+			strResult.append(szReturn);
+		}
+		strResult.append(str);
+	}
+};

+ 95 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/EncodingConversion.h

@@ -0,0 +1,95 @@
+/************************************************************************/
+/*  Copyright (C), 2016-2020, [IT], 保留所有权利;
+/*  模 块 名:;
+/*  描    述:;
+/*
+/*  版    本:[V];	
+/*  作    者:[IT];
+/*  日    期:[12/19/2016];
+/*
+/*
+/*  注    意:;
+/*
+/*  修改记录:[IT];
+/*  修改日期:;
+/*  修改版本:;
+/*  修改内容:;
+/************************************************************************/
+#ifndef __ENCODING_CONVERSION__
+#define __ENCODING_CONVERSION__
+
+#include <string>
+#include <vector>
+using namespace std;
+
+#ifndef _UNICODE
+typedef string TString;
+#else
+typedef wstring TString;
+#endif
+
+#pragma once
+
+namespace EncodingConverion
+{
+	// 将字符转化为对应的ASCII十进制值;
+	extern char CharToInt(char ch);
+	// 将两个字符串转化成十六进制值;
+	extern char StrToBin(IN char (&str)[2]);
+	extern void GB2312ToUTF_8(string& pOut, const char *pText, int pLen);
+	// 将ASCII字符串转成UNICODE字符串;
+	extern WCHAR* ASCII2UNICODE(IN LPCCH lpASCIIStr);
+	extern BOOL   ASCII2UNICODE(IN LPCCH lpASCIIStr, OUT PWCH pUNICODEStr, IN CONST INT& nUNICODEStrLen);
+	extern BOOL   ASCII2UNICODE(IN LPCCH lpASCIIStr, OUT wstring &strResult);
+
+	// 将UNICODE字符串转成ASCII字符串;
+	extern CHAR* UNICODE2ASCII(IN LPWCH lpUNICODEStr);
+	extern BOOL  UNICODE2ASCII(IN LPWCH lpUNICODEStr, OUT LPCH pASCIIStr, IN CONST INT& nASCIIStrLen);
+	extern BOOL  UNICODE2ASCII(IN LPWCH lpUNICODEStr, OUT string &strResult);
+
+	// 将UNICODE字符串转成UFT8字符串;
+	extern CHAR* UNICODE2UTF8(IN LPWCH lpUNICODEStr);
+	extern BOOL  UNICODE2UTF8(IN LPWCH lpUNICODEStr, OUT LPCH pUTF8Str, IN CONST INT& nUTF8StrLen);
+	extern BOOL  UNICODE2UTF8(IN LPWCH lpUNICODEStr, OUT string &strResult);
+
+	// 将ASCII字符串转成UTF8字符串;
+	extern CHAR* ASCII2UTF8(IN LPCCH lpASCIIStr);
+	extern BOOL  ASCII2UTF8(IN LPCCH lpASCIIStr, OUT LPCH pUTF8Str, IN CONST INT& nUTF8StrLen);
+	extern BOOL  ASCII2UTF8(IN LPCCH lpASCIIStr, OUT string &strResult);
+
+	// 将UTF-8字符串转成UNICODE字符串;
+	extern WCHAR* UTF82UNICODE(IN LPCCH lpUTF8);
+	extern BOOL   UTF82UNICODE(IN LPCCH lpUTF8, OUT PWCH pUNICODEStr, IN CONST INT& nUNICODEStrLen);
+	extern BOOL   UTF82UNICODE(IN LPCCH lpUTF8, OUT wstring &strResult);
+
+	// 将UTF-8字符串转成ASCII字符串;
+	extern CHAR*  UTF82ASCII(IN LPCCH lpUTF8);
+	extern BOOL   UTF82ASCII(IN LPCCH lpUTF8, OUT LPCH pASCIIStr, IN CONST INT& nASCIIStrLen);
+	extern BOOL   UTF82ASCII(IN LPCCH lpUTF8, OUT string &strResult);
+
+	// 将UTF-8编码成GB2312;
+	extern string UTF8IntoGB2313(IN CHAR* pUTF8Text, IN const INT& nUTF8TextLen);
+	// 将GB2312编码成UTF-8;
+	extern string GB2312IntoUTF8(IN CHAR* pGB2312Text, IN const INT& nGB2312TextLen);
+
+	// 将字符串编码成为GB2312编码格式的URL;
+	extern string EnCode_GB2312URL(IN CHAR* pText);
+	extern void EnCode_GB2312URL(IN CHAR* pText, OUT string& strResult);
+	// 将字符串编码成为UTF-8编码格式的URL;
+	extern string EnCode_UTF8URL(IN const CHAR* pText);
+	extern void EnCode_UTF8URL(IN const CHAR* pText, OUT string& strResult);
+	// 将字符串编码成为UNICODE编码格式的URL;
+	extern string EnCode_UNICODEURL(IN const CHAR* pText);	// 未完成该函数;
+
+	// 解码UTF-8编码格式的URL;
+	extern string DeCode_URLUTF8(IN const CHAR* pURLText);
+	extern void DeCode_URLUTF8(IN const CHAR* pURLText, OUT string& strResult);
+	// 解码GB2312编码格式的URL;
+	extern string DeCode_URLGB2312(IN const CHAR* pURLText);
+	extern void DeCode_URLGB2312(IN const CHAR* pURLText, OUT string& strResult);
+	// 解码UNICODE编码格式的URL;
+	extern string DeCode_URLUNICODE(IN const CHAR* pURLText);
+	extern void DeCode_URLUNICODE(IN const CHAR* pURLText, OUT string& strResult);
+};
+
+#endif

+ 131 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/ErpCompanyInfo.cpp

@@ -0,0 +1,131 @@
+// ErpCompanyInfo.h : CErpCompanyInfo 类的实现
+
+
+
+// CErpCompanyInfo 实现
+
+// 代码生成在 2018年04月24日, 17:12
+
+#include "stdafx.h"
+#include "ErpCompanyInfo.h"
+IMPLEMENT_DYNAMIC(CErpCompanyInfo, CRecordset)
+
+CErpCompanyInfo::CErpCompanyInfo(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_ID = 0;
+	m_Company_DividedShop = _T("");
+	m_Company_Name = _T("");
+	m_Company_Manager = _T("");
+	m_Company_Telephone = _T("");
+	m_Company_Fax = _T("");
+	m_Company_URL = _T("");
+	m_Company_Address = _T("");
+	m_Company_SingleTitle = _T("");
+	m_Company_SingleExplanation = _T("");
+	m_Company_ReservationExplanation = _T("");
+	m_Company_ChildReserveExplain = _T("");
+	m_Company_PortraitReserveExplain = _T("");
+	m_Company_ProductionNotes = _T("");
+	m_Company_DressDescription = _T("");
+	m_Company_DimensionalCode = _T("");
+	m_Company_WeddingSingleLOG = _T("");
+	m_Company_ChildSingleLOG = _T("");
+	m_Company_PortraitLOG = _T("");
+	m_Company_ServiceLOG = _T("");
+	m_Company_About = _T("");
+	m_Company_PhotoThumbnail = _T("");
+	m_Company_PhotoAlbum = _T("");
+	m_Company_Detail = _T("");
+	m_Company_DianQingDate;
+	m_Company_MicroShareAccount = _T("");
+	m_Company_MicroSharePassword = _T("");
+	m_Company_CreateDatetime;
+	m_Company_CreateName = _T("");
+	m_Company_UpdateDatetime;
+	m_Company_UpdateName = _T("");
+	m_Company_OrderPrefix = _T("");
+	m_Company_IsHeadStore = 0;
+	m_Company_JMGDomain = _T("");
+	m_Company_ServerAddress = _T("");
+	m_Company_Port = 0;
+	m_Company_AllowingStatisticsOURPerformance = 0;
+	m_nFields = 37;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 #error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CErpCompanyInfo::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CErpCompanyInfo::GetDefaultSQL()
+{
+	return _T("[dbo].[tb_ErpCompanyInfo]");
+}
+
+void CErpCompanyInfo::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[ID]"), m_ID);
+	RFX_Text(pFX, _T("[Company_DividedShop]"), m_Company_DividedShop, 20);
+	RFX_Text(pFX, _T("[Company_Name]"), m_Company_Name, 100);
+	RFX_Text(pFX, _T("[Company_Manager]"), m_Company_Manager, 20);
+	RFX_Text(pFX, _T("[Company_Telephone]"), m_Company_Telephone, 100);
+	RFX_Text(pFX, _T("[Company_Fax]"), m_Company_Fax, 20);
+	RFX_Text(pFX, _T("[Company_URL]"), m_Company_URL, 200);
+	RFX_Text(pFX, _T("[Company_Address]"), m_Company_Address);
+	RFX_Text(pFX, _T("[Company_SingleTitle]"), m_Company_SingleTitle, 500);
+	RFX_Text(pFX, _T("[Company_SingleExplanation]"), m_Company_SingleExplanation, 2000);
+	RFX_Text(pFX, _T("[Company_ReservationExplanation]"), m_Company_ReservationExplanation, 2000);
+	RFX_Text(pFX, _T("[Company_ChildReserveExplain]"), m_Company_ChildReserveExplain, 2000);
+	RFX_Text(pFX, _T("[Company_PortraitReserveExplain]"), m_Company_PortraitReserveExplain, 2000);
+	RFX_Text(pFX, _T("[Company_ProductionNotes]"), m_Company_ProductionNotes, 2000);
+	RFX_Text(pFX, _T("[Company_DressDescription]"), m_Company_DressDescription, 2000);
+	RFX_Text(pFX, _T("[Company_DimensionalCode]"), m_Company_DimensionalCode, MAX_SQL_LEN);
+	RFX_Text(pFX, _T("[Company_WeddingSingleLOG]"), m_Company_WeddingSingleLOG, MAX_SQL_LEN);
+	RFX_Text(pFX, _T("[Company_ChildSingleLOG]"), m_Company_ChildSingleLOG, MAX_SQL_LEN);
+	RFX_Text(pFX, _T("[Company_PortraitLOG]"), m_Company_PortraitLOG, MAX_SQL_LEN);
+	RFX_Text(pFX, _T("[Company_ServiceLOG]"), m_Company_ServiceLOG, MAX_SQL_LEN);
+	RFX_Text(pFX, _T("[Company_About]"), m_Company_About, 2000);
+	RFX_Text(pFX, _T("[Company_PhotoThumbnail]"), m_Company_PhotoThumbnail, 2000);
+	RFX_Text(pFX, _T("[Company_PhotoAlbum]"), m_Company_PhotoAlbum, 2000);
+	RFX_Text(pFX, _T("[Company_Detail]"), m_Company_Detail, MAX_SQL_LEN);
+	RFX_Date(pFX, _T("[Company_DianQingDate]"), m_Company_DianQingDate);
+	RFX_Text(pFX, _T("[Company_MicroShareAccount]"), m_Company_MicroShareAccount);
+	RFX_Text(pFX, _T("[Company_MicroSharePassword]"), m_Company_MicroSharePassword);
+	RFX_Date(pFX, _T("[Company_CreateDatetime]"), m_Company_CreateDatetime);
+	RFX_Text(pFX, _T("[Company_CreateName]"), m_Company_CreateName);
+	RFX_Date(pFX, _T("[Company_UpdateDatetime]"), m_Company_UpdateDatetime);
+	RFX_Text(pFX, _T("[Company_UpdateName]"), m_Company_UpdateName);
+	RFX_Text(pFX, _T("[Company_OrderPrefix]"), m_Company_OrderPrefix);
+	RFX_Long(pFX, _T("[Company_IsHeadStore]"), m_Company_IsHeadStore);
+	RFX_Text(pFX, _T("[Company_JMGDomain]"), m_Company_JMGDomain);
+	RFX_Text(pFX, _T("[Company_ServerAddress]"), m_Company_ServerAddress);
+	RFX_Long(pFX, _T("[Company_Port]"), m_Company_Port);
+	RFX_Long(pFX, _T("[Company_AllowingStatisticsOURPerformance]"), m_Company_AllowingStatisticsOURPerformance);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CErpCompanyInfo 诊断
+
+#ifdef _DEBUG
+void CErpCompanyInfo::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CErpCompanyInfo::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 77 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/ErpCompanyInfo.h

@@ -0,0 +1,77 @@
+// ErpCompanyInfo.h : CErpCompanyInfo 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 17:12
+
+class CErpCompanyInfo : public CRecordset
+{
+public:
+	CErpCompanyInfo(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CErpCompanyInfo)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_ID;
+	CString	m_Company_DividedShop;
+	CString	m_Company_Name;
+	CString	m_Company_Manager;
+	CString	m_Company_Telephone;
+	CString	m_Company_Fax;
+	CString	m_Company_URL;
+	CString	m_Company_Address;
+	CString	m_Company_SingleTitle;
+	CString	m_Company_SingleExplanation;
+	CString	m_Company_ReservationExplanation;
+	CString	m_Company_ChildReserveExplain;
+	CString	m_Company_PortraitReserveExplain;
+	CString	m_Company_ProductionNotes;
+	CString	m_Company_DressDescription;
+	CString	m_Company_DimensionalCode;
+	CString	m_Company_WeddingSingleLOG;
+	CString	m_Company_ChildSingleLOG;
+	CString	m_Company_PortraitLOG;
+	CString	m_Company_ServiceLOG;
+	CString	m_Company_About;
+	CString	m_Company_PhotoThumbnail;
+	CString	m_Company_PhotoAlbum;
+	CString	m_Company_Detail;
+	CTime	m_Company_DianQingDate;
+	CString	m_Company_MicroShareAccount;
+	CString	m_Company_MicroSharePassword;
+	CTime	m_Company_CreateDatetime;
+	CString	m_Company_CreateName;
+	CTime	m_Company_UpdateDatetime;
+	CString	m_Company_UpdateName;
+	CString	m_Company_OrderPrefix;
+	long	m_Company_IsHeadStore;
+	CString	m_Company_JMGDomain;
+	CString	m_Company_ServerAddress;
+	long	m_Company_Port;
+	long	m_Company_AllowingStatisticsOURPerformance;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 546 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Global.cpp

@@ -0,0 +1,546 @@
+#include "stdafx.h"
+#include "Global.h"
+#include <locale.h>
+
+namespace Global {
+	BOOL g_bOurBranch = TRUE;
+	BOOL g_bChildVersion = FALSE;
+	TCHAR g_szIniName[MAX_PATH] = { 0 };
+	TCHAR g_szClassicBranchId[MAX_PATH] = _T("");
+	TCHAR g_szPlatinumBranchId[MAX_PATH] = _T("");
+	TCHAR g_szModulePath[MAX_PATH] = _T("");			// 软件目录;
+	TCHAR g_szModuleFileName[MAX_PATH] = _T("");		// 软件名称;
+	TCHAR g_szClassicConnectString[MAX_PATH] = _T("");	// DB连接串;
+	TCHAR g_szPlatinumConnectString[MAX_PATH] = _T("");	// DB连接串;
+	TCHAR g_szAdoClassicConnectString[MAX_PATH] = _T("");	// DB连接串;
+	TCHAR g_szAdoPlatinumConnectString[MAX_PATH] = _T("");	// DB连接串;
+	TCHAR g_szOrders[1024 * 10] = {0};
+
+	// 服务器信息;
+	TCHAR g_szClassicDBSource[MAX_PATH] = _T("");		// 数据库源(服务所在IP或计算机名);
+	DWORD g_dwClassicDBServerPort = 0;					// 数据库源端口;
+	TCHAR g_szClassicDBAccount[MAX_PATH] = _T("");		// 数据库登录用户;
+	TCHAR g_szClassicDBPassWord[MAX_PATH] = _T("");		// 数据库登录密码;
+	TCHAR g_szClassicDBName[MAX_PATH] = _T("");			// 数据库名称;	
+
+	TCHAR g_szPlatinumDBSource[MAX_PATH] = _T("");		// 数据库源(服务所在IP或计算机名);
+	DWORD g_dwPlatinumDBServerPort = 0;					// 数据库源端口;
+	TCHAR g_szPlatinumDBAccount[MAX_PATH] = _T("");		// 数据库登录用户;
+	TCHAR g_szPlatinumDBPassWord[MAX_PATH] = _T("");	// 数据库登录密码;
+	TCHAR g_szPlatinumDBName[MAX_PATH] = _T("");		// 数据库名称;	
+
+	TCHAR g_szPath1[MAX_PATH] = _T("");
+	TCHAR g_szPath2[MAX_PATH] = _T("");
+	TCHAR g_szPath3[MAX_PATH] = _T("");
+	TCHAR g_szPath4[MAX_PATH] = _T("");
+
+	TCHAR g_szComputerName[MAX_PATH] = {0};
+	TCHAR g_szShareImgHost[MAX_PATH] = {0};
+	BOOL g_IsConvMemberShip = FALSE;
+
+	/************************************************************************/
+	/*  函数:[5/20/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	int GetIniInfo(const TCHAR *szPath, const TCHAR *szIniName)
+	{
+		TCHAR szDrive[_MAX_DRIVE] = { 0 }, szDir[_MAX_DIR] = { 0 }, szFName[_MAX_FNAME] = { 0 }, szExt[_MAX_EXT] = { 0 };
+		::GetModuleFileName(NULL, g_szModulePath, sizeof(g_szModulePath) / sizeof(TCHAR));
+		_stprintf_s(g_szModuleFileName, _T("%s"), g_szModulePath);
+
+		_tsplitpath_s(g_szModulePath, szDrive, szDir, szFName, szExt);
+		_tcscpy_s(g_szModulePath, szDrive), _tcscat_s(g_szModulePath, szDir);
+
+		if (szPath != NULL && szIniName != NULL)
+			_stprintf_s(g_szIniName, _T("%s\\%s"), szPath, szIniName);
+		else
+			_stprintf_s(g_szIniName, _T("%sc2p.ini"), g_szModulePath);
+
+		// 获取本机计算机名;
+		DWORD dwLength = MAX_PATH;
+		if (!::GetComputerName(g_szComputerName, &dwLength))
+		{
+			WriteTextLog(_T("获取计算机名称失败!"));
+		}
+
+		// 获取指定计算机名的IP地址//获取共享主机名的IP地址;
+
+
+		HANDLE hFile = CreateFile(g_szIniName, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
+		if (ERROR_FILE_NOT_FOUND == GetLastError())
+			return -1;
+
+		CloseHandle(hFile), hFile = NULL;
+
+		g_bChildVersion = GetPrivateProfileInt(_T("ClassicInfo"), _T("IsChildVersion"), 0, g_szIniName);
+		// 获取经典版服务器端信息;g_bChildVersion
+		{
+			GetPrivateProfileString(_T("ClassicInfo"), _T("BranchId"), _T(""), g_szClassicBranchId, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("dbSource"), _T(""), g_szClassicDBSource, MAX_PATH, g_szIniName);
+			g_dwClassicDBServerPort = GetPrivateProfileInt(_T("ClassicInfo"), _T("dbServerPort"), 0, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("dbAccount"), _T(""), g_szClassicDBAccount, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("dbPassWord"), _T(""), g_szClassicDBPassWord, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("dbName"), _T(""), g_szClassicDBName, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("ShareImgHost"), _T(""), g_szShareImgHost, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("ClassicInfo"), _T("Orders"), _T(""), g_szOrders, 1024*10, g_szIniName);
+			g_bOurBranch = GetPrivateProfileInt(_T("ClassicInfo"), _T("IsOurBranch"), 1, g_szIniName);
+			g_IsConvMemberShip = GetPrivateProfileInt(_T("ClassicInfo"), _T("IsConvMemberShip"), 1, g_szIniName);
+			if (g_dwClassicDBServerPort != 0)
+			{
+				if (_tcscmp(g_szClassicDBAccount, _T("")) == 0)
+					_stprintf_s(g_szClassicConnectString, DB_SW_CONN_WITH_PORT, g_szClassicDBSource, g_dwClassicDBServerPort, g_szClassicDBName);
+				else
+					_stprintf_s(g_szClassicConnectString, DB_SS_CONN_WITH_PORT, g_szClassicDBSource, g_dwClassicDBServerPort, g_szClassicDBName, g_szClassicDBAccount, g_szClassicDBPassWord);
+
+				_stprintf_s(g_szAdoClassicConnectString,
+					_T("Provider=sqloledb;Data Source=%s,%ld;Initial Catalog=%s;User Id=%s;Password=%s; "),
+					g_szClassicDBSource,			// IP地址或服务名称;
+					g_dwClassicDBServerPort,
+					g_szClassicDBName,
+					g_szClassicDBAccount,
+					g_szClassicDBPassWord);
+			}
+			else
+			{
+				if (_tcscmp(g_szClassicDBAccount, _T("")) == 0)
+					_stprintf_s(g_szClassicConnectString, DB_SW_CONN_WITHOUT_PORT, g_szClassicDBSource, g_szClassicDBName);
+				else
+					_stprintf_s(g_szClassicConnectString, DB_SS_CONN_WITHOUT_PORT, g_szClassicDBSource, g_szClassicDBName, g_szClassicDBAccount, g_szClassicDBPassWord);
+
+				_stprintf_s(g_szAdoClassicConnectString,
+					_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; "),
+					g_szClassicDBSource,			// IP地址或服务名称;
+					g_szClassicDBName,
+					g_szClassicDBAccount,
+					g_szClassicDBPassWord);
+			}
+		}
+
+		// 获取铂金版服务器端信息;
+		{
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("BranchId"), _T(""), g_szPlatinumBranchId, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("dbSource"), _T(""), g_szPlatinumDBSource, MAX_PATH, g_szIniName);
+			g_dwPlatinumDBServerPort = GetPrivateProfileInt(_T("PlatinumInfo"), _T("dbServerPort"), 0, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("dbAccount"), _T(""), g_szPlatinumDBAccount, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("dbPassWord"), _T(""), g_szPlatinumDBPassWord, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("dbName"), _T(""), g_szPlatinumDBName, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("Path1"), _T(""), g_szPath1, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("Path2"), _T(""), g_szPath2, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("Path3"), _T(""), g_szPath3, MAX_PATH, g_szIniName);
+			GetPrivateProfileString(_T("PlatinumInfo"), _T("Path4"), _T(""), g_szPath4, MAX_PATH, g_szIniName);
+
+			if (g_dwPlatinumDBServerPort != 0)
+			{
+				if (_tcscmp(g_szPlatinumDBAccount, _T("")) == 0)
+					_stprintf_s(g_szPlatinumConnectString, DB_SW_CONN_WITH_PORT, g_szPlatinumDBSource, g_dwPlatinumDBServerPort, g_szPlatinumDBName);
+				else
+					_stprintf_s(g_szPlatinumConnectString, DB_SS_CONN_WITH_PORT, g_szPlatinumDBSource, g_dwPlatinumDBServerPort, g_szPlatinumDBName, g_szPlatinumDBAccount, g_szPlatinumDBPassWord);
+
+				_stprintf_s(g_szAdoPlatinumConnectString,
+					_T("Provider=sqloledb;Data Source=%s,%ld;Initial Catalog=%s;User Id=%s;Password=%s; "),
+					g_szPlatinumDBSource,			// IP地址或服务名称;
+					g_dwPlatinumDBServerPort,
+					g_szPlatinumDBName,
+					g_szPlatinumDBAccount,
+					g_szPlatinumDBPassWord);
+			}
+			else
+			{
+				if (_tcscmp(g_szPlatinumDBAccount, _T("")) == 0)
+					_stprintf_s(g_szPlatinumConnectString, DB_SW_CONN_WITHOUT_PORT, g_szPlatinumDBSource, g_szPlatinumDBName);
+				else
+					_stprintf_s(g_szPlatinumConnectString, DB_SS_CONN_WITHOUT_PORT, g_szPlatinumDBSource, g_szPlatinumDBName, g_szPlatinumDBAccount, g_szPlatinumDBPassWord);
+
+				_stprintf_s(g_szAdoPlatinumConnectString,
+					_T("Provider=sqloledb;Data Source=%s;Initial Catalog=%s;User Id=%s;Password=%s; "),
+					g_szPlatinumDBSource,			// IP地址或服务名称;
+					g_szPlatinumDBName,
+					g_szPlatinumDBAccount,
+					g_szPlatinumDBPassWord);
+			}
+		}
+
+		return 0;
+	}
+
+	/************************************************************************/
+	/*  函数:WriteTextLog[7/28/2016 IT];
+	/*  描述:写文本日志;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	void WriteTextLog(const TCHAR *format, ...)
+	{
+		try
+		{
+			static std::mutex _mutex;
+			std::unique_lock <std::mutex> lock{ _mutex };
+			// 解析出日志路径;
+			TCHAR szlogpath[MAX_PATH] = { 0 };
+			_stprintf_s(szlogpath, _T("%s%s.txt"), g_szModulePath, CTime::GetCurrentTime().Format("log-%m-%d").GetString());
+
+			// 打开或创建文件;
+			CStdioFile fp;
+			if (PathFileExists(szlogpath))
+			{
+				if (fp.Open(szlogpath, CFile::modeWrite) == FALSE)
+				{
+					return;
+				}
+				fp.SeekToEnd();
+			}
+			else
+			{
+				if (!fp.Open(szlogpath, CFile::modeCreate | CFile::modeWrite))
+					return;
+			}
+
+			// 格式化前设置语言区域;
+			TCHAR* old_locale = _tcsdup(_tsetlocale(LC_CTYPE, NULL));
+			_tsetlocale(LC_CTYPE, _T("chs"));//设定中文;
+
+			// 格式化日志内容;
+			va_list		args = NULL;
+			int			len = 0;
+			TCHAR		*buffer = NULL;
+			va_start(args, format);
+			// _vscprintf doesn't count. terminating '\0'
+			len = _vsctprintf_p(format, args);
+			if (len == -1)
+			{
+				goto clear;
+			}
+
+			len++;
+			buffer = (TCHAR*)malloc(len * sizeof(TCHAR));
+			_vstprintf_s(buffer, len, format, args); // C4996
+			// Note: vsprintf is deprecated; consider using vsprintf_s instead
+
+			// 将日志内容输入到文件中;
+			fp.WriteString(CTime::GetCurrentTime().Format(_T("%Y-%m-%d %H:%M:%S ")));
+			fp.WriteString(buffer);
+			fp.WriteString(_T("\n"));
+
+			// 关闭文件,释放资源并设置回原语言区域;
+			free(buffer);
+		clear:
+			_tsetlocale(LC_CTYPE, old_locale);
+			free(old_locale);//还原区域设定;
+			fp.Close();
+		}
+		catch (CException *e)
+		{
+			e->ReportError();
+			e->Delete();
+		}
+	}
+
+	/************************************************************************/
+	/*  函数:将字符串转成DATE对象[4/27/2018 Jeff];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:字符串必须是 2018/01/01 10:10:10 或 2018-01-01 10:10:10 格式;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	DATE String2Date(CString strDate)
+	{
+		COleDateTime oletime;
+		if (strDate.GetLength() <= 10)
+			oletime.SetDate(_ttoi(strDate.Left(4)), _ttoi(strDate.Mid(5, 2)), _ttoi(strDate.Mid(8, 2)));
+		else
+			oletime.SetDateTime(_ttoi(strDate.Left(4)), _ttoi(strDate.Mid(5, 2)), _ttoi(strDate.Mid(8, 2)), _ttoi(strDate.Mid(11, 2)), _ttoi(strDate.Mid(14, 2)), _ttoi(strDate.Mid(17, 2)));
+
+		return oletime.m_dt;
+	}
+
+	_variant_t GetFieldBSTRValue(_variant_t &field, CString strDefault)
+	{
+		_variant_t result(strDefault);
+		result.vt = VT_BSTR;
+		if (field.vt == VT_NULL)
+		{
+
+		}
+
+		return _variant_t();
+	}
+
+	CString ShowFolder()
+	{
+		TCHAR           szFolderPath[MAX_PATH] = { 0 };
+		CString         strFolderPath = TEXT("");
+
+		BROWSEINFO      sInfo;
+		::ZeroMemory(&sInfo, sizeof(BROWSEINFO));
+		sInfo.pidlRoot = 0;
+		sInfo.lpszTitle = _T("请选择一个文件夹:");
+		sInfo.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_EDITBOX;
+		sInfo.lpfn = NULL;
+
+		// 显示文件夹选择对话框  
+		LPITEMIDLIST lpidlBrowse = ::SHBrowseForFolder(&sInfo);
+		if (lpidlBrowse != NULL)
+		{
+			// 取得文件夹名  
+			if (::SHGetPathFromIDList(lpidlBrowse, szFolderPath))
+			{
+				strFolderPath = szFolderPath;
+			}
+		}
+		if (lpidlBrowse != NULL)
+		{
+			::CoTaskMemFree(lpidlBrowse);
+		}
+
+		return strFolderPath;
+	}
+
+	CString EncodeHex16String(CString str)
+	{
+#ifdef _UNICODE
+		string result;
+		string strgbk = convert("UCS-2LE", "GBK", (const char*)str.GetBuffer(0), str.GetLength() * sizeof(TCHAR));
+		// 转成utf-8格式;
+		string strutf8 = convert("GBK", "UTF-8", strgbk.c_str(), strgbk.size());
+
+		char szHex[5] = { 0 };
+		for ( int i = 0; i < strutf8.size(); i++ )
+		{
+			szHex[4] = '\0';
+			if (strutf8[i] > 0)
+				sprintf_s(szHex, "%04X", strutf8[i]);
+			else
+				sprintf_s(szHex, "%04X", 256 + strutf8[i]);
+			result.append(szHex);
+		}
+
+		TString strResponse;
+		strResponse.append((TCHAR*)((convert("GBK", "UCS-2LE", result.c_str(), result.size())).c_str()), result.size());
+		return strResponse.c_str();
+#else
+		char szHex[5] = {0};
+		CString result;
+		// 转成utf-8格式;
+		string strutf8 = convert("GBK", "UTF-8", (const char*)str.GetBuffer(0), str.GetLength());
+		for ( int i = 0; i < strutf8.size(); i++)
+		{
+			szHex[4] = '\0';
+			if ( strutf8[i] > 0 )
+				sprintf_s(szHex, "%04X", strutf8[i]);
+			else
+				sprintf_s(szHex, "%04X", 256 + strutf8[i]);
+			result += szHex;
+		}
+
+		return result.c_str();
+#endif
+	}
+
+	CString GetHostByName(CString strHostName)
+	{
+		WSADATA wsaData;
+		int iResult;
+
+		DWORD dwError;
+		int i = 0;
+
+		struct hostent *remoteHost;
+		struct in_addr addr;
+
+		char **pAlias;
+
+		// Initialize Winsock;
+		iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
+		if (iResult != 0) {
+			WriteTextLog(_T("WSAStartup failed: %d\n"), iResult);
+			return _T("");
+		}
+
+#ifdef _UNICODE
+		std::string strhostname = convert("UCS-2LE", "GBK", (const char*)strHostName.GetBuffer(0), strHostName.GetLength() * sizeof(TCHAR));
+#else
+		std::string strhostname = strHostName;
+#endif
+
+		std::string strAddr;
+		remoteHost = gethostbyname(strhostname.c_str());
+
+		if (remoteHost == NULL) {
+			dwError = WSAGetLastError();
+			if (dwError != 0) {
+				if (dwError == WSAHOST_NOT_FOUND) {
+					printf("Host not found\n");
+					return _T("");
+				}
+				else if (dwError == WSANO_DATA) {
+					printf("No data record found\n");
+					return _T("");
+				}
+				else {
+					printf("Function failed with error: %ld\n", dwError);
+					return _T("");
+				}
+			}
+		}
+		else {
+			printf("Function returned:\n");
+			printf("\tOfficial name: %s\n", remoteHost->h_name);
+			for (pAlias = remoteHost->h_aliases; *pAlias != 0; pAlias++) {
+				printf("\tAlternate name #%d: %s\n", ++i, *pAlias);
+			}
+			printf("\tAddress type: ");
+			switch (remoteHost->h_addrtype) {
+			case AF_INET:
+				printf("AF_INET\n");
+				break;
+			case AF_NETBIOS:
+				printf("AF_NETBIOS\n");
+				break;
+			default:
+				printf(" %d\n", remoteHost->h_addrtype);
+				break;
+			}
+			printf("\tAddress length: %d\n", remoteHost->h_length);
+
+			i = 0;
+			if (remoteHost->h_addrtype == AF_INET)
+			{
+				/*while (remoteHost->h_addr_list[i] != 0) {
+					addr.s_addr = *(u_long *)remoteHost->h_addr_list[i++];
+					printf("\tIP Address #%d: %s\n", i, inet_ntoa(addr));
+				}*/
+				// 只获取第一个,多网卡情况不考虑;
+				if (remoteHost->h_addr_list[0] != 0)
+				{
+					addr.s_addr = *(u_long *)remoteHost->h_addr_list[i++];
+					strAddr = inet_ntoa(addr);
+				}
+			}
+			else if (remoteHost->h_addrtype == AF_NETBIOS)
+			{
+				printf("NETBIOS address was returned\n");
+			}
+		}
+
+#ifdef _UNICODE
+		string result = convert("GBK", "UCS-2LE", strAddr.c_str(), strAddr.size());
+		TString strResponse;
+		strResponse.append((TCHAR*)(result.c_str()), result.size() / 2);
+		return strResponse.c_str();
+#else
+		return strAddr.c_str();
+#endif
+	}
+
+	CString DecodeHex16String(CString str)
+	{
+#ifdef _UNICODE
+		string strutf8;
+		// 转成gbk; 
+		string strgbk = convert("UCS-2LE", "GBK", (const char*)str.GetBuffer(0), str.GetLength() * sizeof(TCHAR));
+		for ( int i = 0; i < strgbk.size(); i += 4)
+		{
+			strutf8.append(1, strtoul(strgbk.substr(i,4).c_str(), NULL, 16));
+		}
+		// 将utf8转成gbk; 
+		string result = convert("utf-8", "GBK", strutf8.c_str(), strutf8.size());		
+		result = convert("GBK", "UCS-2LE", result.c_str(), result.size());
+		TString strResponse;
+		strResponse.append((TCHAR*)(result.c_str()), result.size()/2);
+		return strResponse.c_str();
+#else
+		string strutf8;
+		for ( int i = 0; i < strgbk.size(); i += 4 )
+		{
+			strutf8.append(1, strtoul(strgbk.substr(i, 4).c_str(), NULL, 16));
+		}
+		// 将utf8转成gbk; 
+		string result = convert("utf-8", "GBK", strutf8.c_str(), strutf8.size());
+		return result.c_str();
+#endif
+	}
+
+	/************************************************************************/
+	/*  函数:GetErrorInfo[9/13/2016 IT];
+	/*  描述:获取指定错误码的具体描述;
+	/*  参数:;
+	/*  	[IN] dwError:错误码;
+	/*  返回:返回CString;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	CString GetErrorInfo(const DWORD &dwError)
+	{
+		LPVOID lpMsgBuf;
+		CString strErrorInfo;
+		BOOL fOk = FormatMessage(
+			FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+			NULL,
+			dwError,
+			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+			(LPTSTR)&lpMsgBuf,
+			0, NULL
+		);
+
+		if (!fOk)
+		{
+			// Is it a network-related error?
+			HMODULE hDll = LoadLibraryEx(TEXT("netmsg.dll"), NULL, DONT_RESOLVE_DLL_REFERENCES);
+
+			if (hDll != NULL)
+			{
+				FormatMessage(
+					FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+					hDll, dwError,
+					MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
+					(LPTSTR)&lpMsgBuf,
+					0, NULL
+				);
+
+				FreeLibrary(hDll);
+			}
+		}
+
+		if (lpMsgBuf != NULL)
+		{
+			strErrorInfo.Format(_T("错误码=%d,系统描述:%s"), dwError, (PCTSTR)LocalLock(lpMsgBuf));
+			LocalFree(lpMsgBuf);
+		}
+		else
+		{
+			strErrorInfo.Format(_T("错误码=%d,系统描述:未知错误内容!"), dwError);
+		}
+
+		return strErrorInfo;
+	}
+}

+ 89 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Global.h

@@ -0,0 +1,89 @@
+#ifndef __GLOABL__
+#define __GLOABL__
+
+#pragma once
+
+#define DB_SS_CONN_WITH_PORT		_T("driver={SQL Server};Server=%s,%d;database=%s;uid=%s;pwd=%s")
+#define DB_SS_CONN_WITHOUT_PORT		_T("driver={SQL Server};Server=%s;database=%s;uid=%s;pwd=%s")
+#define DB_SS_CONN_WITHOUT_PORT2	_T("driver={SQL Server};Server=%s;database=%d;uid=%s;pwd=%s")
+#define DB_SW_CONN_WITH_PORT		_T("Driver={SQL Server};Server=%s,%d;Database=%s;Trusted_Connection=yes;")
+#define DB_SW_CONN_WITHOUT_PORT		_T("Driver={SQL Server};Server=%s;Database=%s;Trusted_Connection=yes;")
+#define DB_SW_CONN_WITHOUT_PORT2	_T("Driver={SQL Server};Server=%s;Database=%d;Trusted_Connection=yes;")
+
+#define OImgpath	_T("客户原片(管理软件)$")
+#define EImgpath	_T("修好的片(管理软件)$")
+#define FImgpath	_T("精修好的片(管理软件)$")
+#define DImgpath	_T("设计好的片(管理软件)$")
+
+#define OBImgpath	_T("客户原片备份(管理软件)$")
+#define EBImgpath	_T("修好的片备份(管理软件)$")
+#define FBImgpath	_T("精修好的片备份(管理软件)$")
+#define DBImgpath	_T("设计好的片备份(管理软件)$")
+
+#define COBImgpath	_T("客户原片备份(儿童管理软件)$")
+#define CEBImgpath	_T("修好的片备份(儿童管理软件)$")
+#define CFBImgpath	_T("精修好的片备份(儿童管理软件)$")
+#define CDBImgpath	_T("设计好的片备份(儿童管理软件)$")
+
+enum
+{
+	OImgtype = 1,		// 原片;
+	EImgtype = 2,		// 初修;
+	FImgtype = 3,		// 精修;
+	DImgtype = 4,		// 设计;
+	OBImgtype = 5,		// 原片备份;
+	EBImgtype = 6,		// 初修备份;
+	FBImgtype = 7,		// 精修备份;
+	DBImgtype = 8		// 设计备份;
+};
+
+namespace Global
+{
+	extern BOOL g_bOurBranch;//是否本店;
+	extern BOOL g_bChildVersion; // 是否是儿童店;
+	extern TCHAR g_szIniName[MAX_PATH];
+	extern TCHAR g_szClassicBranchId[MAX_PATH];
+	extern TCHAR g_szPlatinumBranchId[MAX_PATH];
+	extern TCHAR g_szModulePath[MAX_PATH];				// 软件目录;
+	extern TCHAR g_szModuleFileName[MAX_PATH];			// 软件名称;
+	extern TCHAR g_szClassicConnectString[MAX_PATH];	// DB连接串;
+	extern TCHAR g_szPlatinumConnectString[MAX_PATH];	// DB连接串;
+	extern TCHAR g_szAdoClassicConnectString[MAX_PATH];	// DB连接串;
+	extern TCHAR g_szAdoPlatinumConnectString[MAX_PATH];	// DB连接串;
+	extern TCHAR g_szOrders[1024*10];	// DB连接串;
+
+	// 服务器信息;
+	extern TCHAR g_szClassicDBSource[MAX_PATH];			// 数据库源(服务所在IP或计算机名);
+	extern DWORD g_dwClassicDBServerPort;				// 数据库源端口;
+	extern TCHAR g_szClassicDBAccount[MAX_PATH];		// 数据库登录用户;
+	extern TCHAR g_szClassicDBPassWord[MAX_PATH];		// 数据库登录密码;
+	extern TCHAR g_szClassicDBName[MAX_PATH];			// 数据库名称;	
+
+	extern TCHAR g_szPlatinumDBSource[MAX_PATH];		// 数据库源(服务所在IP或计算机名);
+	extern DWORD g_dwPlatinumDBServerPort;				// 数据库源端口;
+	extern TCHAR g_szPlatinumDBAccount[MAX_PATH];		// 数据库登录用户;
+	extern TCHAR g_szPlatinumDBPassWord[MAX_PATH];		// 数据库登录密码;
+	extern TCHAR g_szPlatinumDBName[MAX_PATH];			// 数据库名称;	
+
+	extern TCHAR g_szPath1[MAX_PATH];
+	extern TCHAR g_szPath2[MAX_PATH];
+	extern TCHAR g_szPath3[MAX_PATH];
+	extern TCHAR g_szPath4[MAX_PATH];
+
+	extern TCHAR g_szComputerName[MAX_PATH];
+	extern TCHAR g_szShareImgHost[MAX_PATH];
+	extern BOOL g_IsConvMemberShip;
+
+	extern int GetIniInfo(const TCHAR *szPath = NULL, const TCHAR *szIniName = NULL);
+	extern void WriteTextLog(const TCHAR *format, ...);
+	extern DATE String2Date(CString strDate);
+	extern _variant_t GetFieldBSTRValue(_variant_t &field, CString strDefault = _T(""));
+	extern CString ShowFolder();
+
+	extern CString DecodeHex16String(CString str);
+	extern CString EncodeHex16String(CString str);
+	extern CString GetHostByName(CString strHostName);
+	extern CString GetErrorInfo(const DWORD &dwError);
+};
+
+#endif

BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/Resource.h


+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblCustomerSource.cpp

@@ -0,0 +1,61 @@
+// TblCustomerSource.h : CTblCustomerSource 类的实现
+
+
+
+// CTblCustomerSource 实现
+
+// 代码生成在 2018年04月24日, 15:00
+
+#include "stdafx.h"
+#include "TblCustomerSource.h"
+IMPLEMENT_DYNAMIC(CTblCustomerSource, CRecordset)
+
+CTblCustomerSource::CTblCustomerSource(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_id = 0;
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblCustomerSource::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblCustomerSource::GetDefaultSQL()
+{
+	return _T("[dbo].[clientfrom]");
+}
+
+void CTblCustomerSource::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Long(pFX, _T("[id]"), m_id);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblCustomerSource 诊断
+
+#ifdef _DEBUG
+void CTblCustomerSource::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblCustomerSource::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblCustomerSource.h

@@ -0,0 +1,42 @@
+// TblCustomerSource.h : CTblCustomerSource 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:00
+
+class CTblCustomerSource : public CRecordset
+{
+public:
+	CTblCustomerSource(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblCustomerSource)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	long	m_id;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblDept.cpp

@@ -0,0 +1,61 @@
+// TblDept.h : CTblDept 类的实现
+
+
+
+// CTblDept 实现
+
+// 代码生成在 2018年04月24日, 14:54
+
+#include "stdafx.h"
+#include "TblDept.h"
+IMPLEMENT_DYNAMIC(CTblDept, CRecordset)
+
+CTblDept::CTblDept(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_name = _T("");
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblDept::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblDept::GetDefaultSQL()
+{
+	return _T("[dbo].[bumen]");
+}
+
+void CTblDept::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name]"), m_name);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblDept 诊断
+
+#ifdef _DEBUG
+void CTblDept::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblDept::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblDept.h

@@ -0,0 +1,42 @@
+// TblDept.h : CTblDept 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 14:54
+
+class CTblDept : public CRecordset
+{
+public:
+	CTblDept(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblDept)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CString	m_name;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 101 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblEmployee.cpp

@@ -0,0 +1,101 @@
+// TblEmployee.h : CTblEmployee 类的实现
+
+
+
+// CTblEmployee 实现
+
+// 代码生成在 2018年04月24日, 15:35
+
+#include "stdafx.h"
+#include "TblEmployee.h"
+IMPLEMENT_DYNAMIC(CTblEmployee, CRecordset)
+
+CTblEmployee::CTblEmployee(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_bm = _T("");
+	m_id = "";
+	m_name = "";
+	m_sex = _T("");
+	m_phone = _T("");
+	m_address = _T("");
+	m_bz = _T("");
+	m_base = _T("");
+	m_rate1 = _T("");
+	m_rate2 = _T("");
+	m_bz2 = _T("");
+	m_address2 = _T("");
+	m_idno = _T("");
+	m_marry = _T("");
+	m_dimission = _T("");
+	m_rate3 = _T("");
+	m_rate4 = _T("");
+	m_rate5 = _T("");
+	m_loginno1 = _T("");
+	m_loginno2 = _T("");
+	m_photo;
+	m_level = _T("");
+	m_nFields = 22;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblEmployee::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblEmployee::GetDefaultSQL()
+{
+	return _T("[dbo].[renyuan]");
+}
+
+void CTblEmployee::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[bm]"), m_bm);
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Text(pFX, _T("[phone]"), m_phone);
+	RFX_Text(pFX, _T("[address]"), m_address);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[base]"), m_base);
+	RFX_Text(pFX, _T("[rate1]"), m_rate1);
+	RFX_Text(pFX, _T("[rate2]"), m_rate2);
+	RFX_Text(pFX, _T("[bz2]"), m_bz2);
+	RFX_Text(pFX, _T("[address2]"), m_address2);
+	RFX_Text(pFX, _T("[idno]"), m_idno);
+	RFX_Text(pFX, _T("[marry]"), m_marry);
+	RFX_Text(pFX, _T("[dimission]"), m_dimission);
+	RFX_Text(pFX, _T("[rate3]"), m_rate3);
+	RFX_Text(pFX, _T("[rate4]"), m_rate4);
+	RFX_Text(pFX, _T("[rate5]"), m_rate5);
+	RFX_Text(pFX, _T("[loginno1]"), m_loginno1);
+	RFX_Text(pFX, _T("[loginno2]"), m_loginno2);
+	RFX_LongBinary(pFX, _T("[photo]"), m_photo);
+	RFX_Text(pFX, _T("[level]"), m_level);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblEmployee 诊断
+
+#ifdef _DEBUG
+void CTblEmployee::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblEmployee::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 62 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblEmployee.h

@@ -0,0 +1,62 @@
+// TblEmployee.h : CTblEmployee 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:35
+
+class CTblEmployee : public CRecordset
+{
+public:
+	CTblEmployee(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblEmployee)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_bm;
+	CStringA	m_id;
+	CStringA	m_name;
+	CString	m_sex;
+	CString	m_phone;
+	CString	m_address;
+	CString	m_bz;
+	CString	m_base;
+	CString	m_rate1;
+	CString	m_rate2;
+	CString	m_bz2;
+	CString	m_address2;
+	CString	m_idno;
+	CString	m_marry;
+	CString	m_dimission;
+	CString	m_rate3;
+	CString	m_rate4;
+	CString	m_rate5;
+	CString	m_loginno1;
+	CString	m_loginno2;
+	CLongBinary	m_photo;
+	CString	m_level;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 85 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpense.cpp

@@ -0,0 +1,85 @@
+// TblExpense.h : CTblExpense 类的实现
+
+
+
+// CTblExpense 实现
+
+// 代码生成在 2018年04月24日, 15:31
+
+#include "stdafx.h"
+#include "TblExpense.h"
+IMPLEMENT_DYNAMIC(CTblExpense, CRecordset)
+
+CTblExpense::CTblExpense(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_name = _T("");
+	m_money = _T("");
+	m_dat = _T("");
+	m_bz = _T("");
+	m_renyuan1 = _T("");
+	m_renyuan2 = _T("");
+	m_financecheck = _T("");
+	m_time = _T("");
+	m_photo;
+	m_financecheck2 = _T("");
+	m_financecheck3 = _T("");
+	m_hasphoto = _T("");
+	m_jdd = _T("");
+	m_nFields = 14;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblExpense::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblExpense::GetDefaultSQL()
+{
+	return _T("[dbo].[gudingfeiyong]");
+}
+
+void CTblExpense::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[money]"), m_money);
+	RFX_Text(pFX, _T("[dat]"), m_dat);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[renyuan1]"), m_renyuan1);
+	RFX_Text(pFX, _T("[renyuan2]"), m_renyuan2);
+	RFX_Text(pFX, _T("[financecheck]"), m_financecheck);
+	RFX_Text(pFX, _T("[time]"), m_time);
+	RFX_LongBinary(pFX, _T("[photo]"), m_photo);
+	RFX_Text(pFX, _T("[financecheck2]"), m_financecheck2);
+	RFX_Text(pFX, _T("[financecheck3]"), m_financecheck3);
+	RFX_Text(pFX, _T("[hasphoto]"), m_hasphoto);
+	RFX_Text(pFX, _T("[jdd]"), m_jdd);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblExpense 诊断
+
+#ifdef _DEBUG
+void CTblExpense::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblExpense::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 54 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpense.h

@@ -0,0 +1,54 @@
+// TblExpense.h : CTblExpense 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:31
+
+class CTblExpense : public CRecordset
+{
+public:
+	CTblExpense(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblExpense)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CString	m_name;
+	CString	m_money;
+	CString	m_dat;
+	CString	m_bz;
+	CString	m_renyuan1;
+	CString	m_renyuan2;
+	CString	m_financecheck;
+	CString	m_time;
+	CLongBinary	m_photo;
+	CString	m_financecheck2;
+	CString	m_financecheck3;
+	CString	m_hasphoto;
+	CString	m_jdd;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpenseType.cpp

@@ -0,0 +1,61 @@
+// TblExpenseType.h : CTblExpenseType 类的实现
+
+
+
+// CTblExpenseType 实现
+
+// 代码生成在 2018年04月24日, 15:32
+
+#include "stdafx.h"
+#include "TblExpenseType.h"
+IMPLEMENT_DYNAMIC(CTblExpenseType, CRecordset)
+
+CTblExpenseType::CTblExpenseType(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_xiangmu = _T("");
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblExpenseType::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblExpenseType::GetDefaultSQL()
+{
+	return _T("[dbo].[gudingfeiyongxiangmu]");
+}
+
+void CTblExpenseType::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[xiangmu]"), m_xiangmu);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblExpenseType 诊断
+
+#ifdef _DEBUG
+void CTblExpenseType::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblExpenseType::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblExpenseType.h

@@ -0,0 +1,42 @@
+// TblExpenseType.h : CTblExpenseType 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:32
+
+class CTblExpenseType : public CRecordset
+{
+public:
+	CTblExpenseType(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblExpenseType)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CString	m_xiangmu;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 79 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoods.cpp

@@ -0,0 +1,79 @@
+// TblGoods.h : CTblGoods 类的实现
+
+
+
+// CTblGoods 实现
+
+// 代码生成在 2018年04月24日, 15:36
+
+#include "stdafx.h"
+#include "TblGoods.h"
+IMPLEMENT_DYNAMIC(CTblGoods, CRecordset)
+
+CTblGoods::CTblGoods(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_spid = _T("");
+	m_spname = _T("");
+	m_spdanwei = _T("");
+	m_spjiaga1 = _T("");
+	m_spjiage2 = _T("");
+	m_splb = _T("");
+	m_spbz = _T("");
+	m_spjiage3 = _T("");
+	m_hide = _T("");
+	m_width = _T("");
+	m_height = _T("");
+	m_nFields = 11;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblGoods::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblGoods::GetDefaultSQL()
+{
+	return _T("[dbo].[shangpin]");
+}
+
+void CTblGoods::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[spid]"), m_spid);
+	RFX_Text(pFX, _T("[spname]"), m_spname);
+	RFX_Text(pFX, _T("[spdanwei]"), m_spdanwei);
+	RFX_Text(pFX, _T("[spjiaga1]"), m_spjiaga1);
+	RFX_Text(pFX, _T("[spjiage2]"), m_spjiage2);
+	RFX_Text(pFX, _T("[splb]"), m_splb);
+	RFX_Text(pFX, _T("[spbz]"), m_spbz);
+	RFX_Text(pFX, _T("[spjiage3]"), m_spjiage3);
+	RFX_Text(pFX, _T("[hide]"), m_hide);
+	RFX_Text(pFX, _T("[width]"), m_width);
+	RFX_Text(pFX, _T("[height]"), m_height);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblGoods 诊断
+
+#ifdef _DEBUG
+void CTblGoods::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblGoods::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 51 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoods.h

@@ -0,0 +1,51 @@
+// TblGoods.h : CTblGoods 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:36
+
+class CTblGoods : public CRecordset
+{
+public:
+	CTblGoods(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblGoods)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_spid;
+	CString	m_spname;
+	CString	m_spdanwei;
+	CString	m_spjiaga1;
+	CString	m_spjiage2;
+	CString	m_splb;
+	CString	m_spbz;
+	CString	m_spjiage3;
+	CString	m_hide;
+	CString	m_width;
+	CString	m_height;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoodsType.cpp

@@ -0,0 +1,61 @@
+// TblGoodsType.h : CTblGoodsType 类的实现
+
+
+
+// CTblGoodsType 实现
+
+// 代码生成在 2018年04月24日, 15:37
+
+#include "stdafx.h"
+#include "TblGoodsType.h"
+IMPLEMENT_DYNAMIC(CTblGoodsType, CRecordset)
+
+CTblGoodsType::CTblGoodsType(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_name = "";
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblGoodsType::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblGoodsType::GetDefaultSQL()
+{
+	return _T("[dbo].[shangpinlb]");
+}
+
+void CTblGoodsType::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name]"), m_name);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblGoodsType 诊断
+
+#ifdef _DEBUG
+void CTblGoodsType::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblGoodsType::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblGoodsType.h

@@ -0,0 +1,42 @@
+// TblGoodsType.h : CTblGoodsType 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:37
+
+class CTblGoodsType : public CRecordset
+{
+public:
+	CTblGoodsType(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblGoodsType)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CStringA	m_name;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 121 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblHospitalCustomer.cpp

@@ -0,0 +1,121 @@
+// TblHospitalCustomer.h : CTblHospitalCustomer 类的实现
+
+
+
+// CTblHospitalCustomer 实现
+
+// 代码生成在 2018年04月24日, 15:33
+
+#include "stdafx.h"
+#include "TblHospitalCustomer.h"
+IMPLEMENT_DYNAMIC(CTblHospitalCustomer, CRecordset)
+
+CTblHospitalCustomer::CTblHospitalCustomer(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = _T("");
+	m_checkmsg = _T("");
+	m_name1 = _T("");
+	m_name2 = _T("");
+	m_food = _T("");
+	m_sex = _T("");
+	m_check1 = _T("");
+	m_birthdaytype = _T("");
+	m_birthday = _T("");
+	m_pregnancydays = _T("");
+	m_qq = _T("");
+	m_date1 = _T("");
+	m_from = _T("");
+	m_clerk = _T("");
+	m_type = _T("");
+	m_hospital = _T("");
+	m_remark = _T("");
+	m_phone1 = _T("");
+	m_phone2 = _T("");
+	m_phone3 = _T("");
+	m_phone4 = _T("");
+	m_phone5 = _T("");
+	m_addr1 = _T("");
+	m_addr2 = _T("");
+	m_addr3 = _T("");
+	m_post1 = _T("");
+	m_post2 = _T("");
+	m_post3 = _T("");
+	m_pinyin1 = _T("");
+	m_pinyin2 = _T("");
+	m_inputdate = _T("");
+	m_inputer = _T("");
+	m_nFields = 32;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblHospitalCustomer::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblHospitalCustomer::GetDefaultSQL()
+{
+	return _T("[dbo].[hospitalclient]");
+}
+
+void CTblHospitalCustomer::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[checkmsg]"), m_checkmsg);
+	RFX_Text(pFX, _T("[name1]"), m_name1);
+	RFX_Text(pFX, _T("[name2]"), m_name2);
+	RFX_Text(pFX, _T("[food]"), m_food);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+	RFX_Text(pFX, _T("[birthdaytype]"), m_birthdaytype);
+	RFX_Text(pFX, _T("[birthday]"), m_birthday);
+	RFX_Text(pFX, _T("[pregnancydays]"), m_pregnancydays);
+	RFX_Text(pFX, _T("[qq]"), m_qq);
+	RFX_Text(pFX, _T("[date1]"), m_date1);
+	RFX_Text(pFX, _T("[from]"), m_from);
+	RFX_Text(pFX, _T("[clerk]"), m_clerk);
+	RFX_Text(pFX, _T("[type]"), m_type);
+	RFX_Text(pFX, _T("[hospital]"), m_hospital);
+	RFX_Text(pFX, _T("[remark]"), m_remark);
+	RFX_Text(pFX, _T("[phone1]"), m_phone1);
+	RFX_Text(pFX, _T("[phone2]"), m_phone2);
+	RFX_Text(pFX, _T("[phone3]"), m_phone3);
+	RFX_Text(pFX, _T("[phone4]"), m_phone4);
+	RFX_Text(pFX, _T("[phone5]"), m_phone5);
+	RFX_Text(pFX, _T("[addr1]"), m_addr1);
+	RFX_Text(pFX, _T("[addr2]"), m_addr2);
+	RFX_Text(pFX, _T("[addr3]"), m_addr3);
+	RFX_Text(pFX, _T("[post1]"), m_post1);
+	RFX_Text(pFX, _T("[post2]"), m_post2);
+	RFX_Text(pFX, _T("[post3]"), m_post3);
+	RFX_Text(pFX, _T("[pinyin1]"), m_pinyin1);
+	RFX_Text(pFX, _T("[pinyin2]"), m_pinyin2);
+	RFX_Text(pFX, _T("[inputdate]"), m_inputdate);
+	RFX_Text(pFX, _T("[inputer]"), m_inputer);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblHospitalCustomer 诊断
+
+#ifdef _DEBUG
+void CTblHospitalCustomer::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblHospitalCustomer::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 72 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblHospitalCustomer.h

@@ -0,0 +1,72 @@
+// TblHospitalCustomer.h : CTblHospitalCustomer 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:33
+
+class CTblHospitalCustomer : public CRecordset
+{
+public:
+	CTblHospitalCustomer(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblHospitalCustomer)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_id;
+	CString	m_checkmsg;
+	CString	m_name1;
+	CString	m_name2;
+	CString	m_food;
+	CString	m_sex;
+	CString	m_check1;
+	CString	m_birthdaytype;
+	CString	m_birthday;
+	CString	m_pregnancydays;
+	CString	m_qq;
+	CString	m_date1;
+	CString	m_from;
+	CString	m_clerk;
+	CString	m_type;
+	CString	m_hospital;
+	CString	m_remark;
+	CString	m_phone1;
+	CString	m_phone2;
+	CString	m_phone3;
+	CString	m_phone4;
+	CString	m_phone5;
+	CString	m_addr1;
+	CString	m_addr2;
+	CString	m_addr3;
+	CString	m_post1;
+	CString	m_post2;
+	CString	m_post3;
+	CString	m_pinyin1;
+	CString	m_pinyin2;
+	CString	m_inputdate;
+	CString	m_inputer;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 85 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblIntentionalCustomer.cpp

@@ -0,0 +1,85 @@
+// TblIntentionalCustomer.h : CTblIntentionalCustomer 类的实现
+
+
+
+// CTblIntentionalCustomer 实现
+
+// 代码生成在 2018年04月24日, 14:58
+
+#include "stdafx.h"
+#include "TblIntentionalCustomer.h"
+IMPLEMENT_DYNAMIC(CTblIntentionalCustomer, CRecordset)
+
+CTblIntentionalCustomer::CTblIntentionalCustomer(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_phone = _T("");
+	m_qq = _T("");
+	m_addr = _T("");
+	m_from = _T("");
+	m_reason = _T("");
+	m_bz = _T("");
+	m_pinyin = _T("");
+	m_date = _T("");
+	m_sex = _T("");
+	m_id = 0;
+	m_ren = _T("");
+	m_birthday = _T("");
+	m_check1 = _T("");
+	m_nFields = 14;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblIntentionalCustomer::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblIntentionalCustomer::GetDefaultSQL()
+{
+	return _T("[dbo].[client2]");
+}
+
+void CTblIntentionalCustomer::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[phone]"), m_phone);
+	RFX_Text(pFX, _T("[qq]"), m_qq);
+	RFX_Text(pFX, _T("[addr]"), m_addr);
+	RFX_Text(pFX, _T("[from]"), m_from);
+	RFX_Text(pFX, _T("[reason]"), m_reason);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[pinyin]"), m_pinyin);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[ren]"), m_ren);
+	RFX_Text(pFX, _T("[birthday]"), m_birthday);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblIntentionalCustomer 诊断
+
+#ifdef _DEBUG
+void CTblIntentionalCustomer::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblIntentionalCustomer::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 54 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblIntentionalCustomer.h

@@ -0,0 +1,54 @@
+// TblIntentionalCustomer.h : CTblIntentionalCustomer 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 14:58
+
+class CTblIntentionalCustomer : public CRecordset
+{
+public:
+	CTblIntentionalCustomer(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblIntentionalCustomer)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	CString	m_phone;
+	CString	m_qq;
+	CString	m_addr;
+	CString	m_from;
+	CString	m_reason;
+	CString	m_bz;
+	CString	m_pinyin;
+	CString	m_date;
+	CString	m_sex;
+	long	m_id;
+	CString	m_ren;
+	CString	m_birthday;
+	CString	m_check1;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 95 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblMembershipCard.cpp

@@ -0,0 +1,95 @@
+// TblMembershipCard.h : CTblMembershipCard 类的实现
+
+
+
+// CTblMembershipCard 实现
+
+// 代码生成在 2018年04月24日, 15:54
+
+#include "stdafx.h"
+#include "TblMembershipCard.h"
+IMPLEMENT_DYNAMIC(CTblMembershipCard, CRecordset)
+
+CTblMembershipCard::CTblMembershipCard(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_memberno = _T("");
+	m_name = _T("");
+	m_date = _T("");
+	m_money = _T("");
+	m_autoid = 0;
+	m_sex = _T("");
+	m_phone = _T("");
+	m_qq = _T("");
+	m_addr = _T("");
+	m_occupation = _T("");
+	m_birthday = _T("");
+	m_pinyin = _T("");
+	m_balance = _T("");
+	m_sendmark1 = _T("");
+	m_sendmark2 = _T("");
+	m_psw = _T("");
+	m_cardtype = _T("");
+	m_check1 = _T("");
+	m_discount = _T("");
+	m_nFields = 19;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblMembershipCard::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblMembershipCard::GetDefaultSQL()
+{
+	return _T("[dbo].[membermanage]");
+}
+
+void CTblMembershipCard::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[memberno]"), m_memberno);
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[money]"), m_money);
+	RFX_Long(pFX, _T("[autoid]"), m_autoid);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Text(pFX, _T("[phone]"), m_phone);
+	RFX_Text(pFX, _T("[qq]"), m_qq);
+	RFX_Text(pFX, _T("[addr]"), m_addr);
+	RFX_Text(pFX, _T("[occupation]"), m_occupation);
+	RFX_Text(pFX, _T("[birthday]"), m_birthday);
+	RFX_Text(pFX, _T("[pinyin]"), m_pinyin);
+	RFX_Text(pFX, _T("[balance]"), m_balance);
+	RFX_Text(pFX, _T("[sendmark1]"), m_sendmark1);
+	RFX_Text(pFX, _T("[sendmark2]"), m_sendmark2);
+	RFX_Text(pFX, _T("[psw]"), m_psw);
+	RFX_Text(pFX, _T("[cardtype]"), m_cardtype);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+	RFX_Text(pFX, _T("[discount]"), m_discount);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblMembershipCard 诊断
+
+#ifdef _DEBUG
+void CTblMembershipCard::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblMembershipCard::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 59 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblMembershipCard.h

@@ -0,0 +1,59 @@
+// TblMembershipCard.h : CTblMembershipCard 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:54
+
+class CTblMembershipCard : public CRecordset
+{
+public:
+	CTblMembershipCard(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblMembershipCard)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_memberno;
+	CString	m_name;
+	CString	m_date;
+	CString	m_money;
+	long	m_autoid;
+	CString	m_sex;
+	CString	m_phone;
+	CString	m_qq;
+	CString	m_addr;
+	CString	m_occupation;
+	CString	m_birthday;
+	CString	m_pinyin;
+	CString	m_balance;
+	CString	m_sendmark1;
+	CString	m_sendmark2;
+	CString	m_psw;
+	CString	m_cardtype;
+	CString	m_check1;
+	CString	m_discount;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 345 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrder.cpp

@@ -0,0 +1,345 @@
+// TblOrder.h : CTblOrder 类的实现
+
+
+
+// CTblOrder 实现
+
+// 代码生成在 2018年04月24日, 15:02
+
+#include "stdafx.h"
+#include "TblOrder.h"
+IMPLEMENT_DYNAMIC(CTblOrder, CRecordset)
+
+CTblOrder::CTblOrder(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = "";
+	m_money1 = _T("");
+	m_money2 = _T("");
+	m_money3 = _T("");
+	m_name1 = _T("");
+	m_name2 = _T("");
+	m_taoxiid = "";
+	m_taoxiname = _T("");
+	m_taoxijiage = _T("");
+	m_taoxizs = _T("");
+	m_time1 = _T("");
+	m_time2 = _T("");
+	m_time3 = _T("");
+	m_bm = _T("");
+	m_ren = _T("");
+	m_discount = _T("");
+	m_payed1 = _T("");
+	m_payed2 = _T("");
+	m_payed3 = _T("");
+	m_payed4 = _T("");
+	m_payed5 = _T("");
+	m_time4 = _T("");
+	m_time5 = _T("");
+	m_takezs = _T("");
+	m_choosezs = _T("");
+	m_status = _T("");
+	m_clothescount2 = _T("");
+	m_outside2 = _T("");
+	m_style = _T("");
+	m_payed3time = _T("");
+	m_payed4ren = _T("");
+	m_payed4time = _T("");
+	m_status2 = _T("");
+	m_status3 = _T("");
+	m_waiter1 = _T("");
+	m_waiter2 = _T("");
+	m_waiter3 = _T("");
+	m_waiter4 = _T("");
+	m_bz = _T("");
+	m_taketime = _T("");
+	m_clothescount = _T("");
+	m_outside = _T("");
+	m_bz2 = _T("");
+	m_bz3 = _T("");
+	m_urgent = _T("");
+	m_status4 = _T("");
+	m_status5 = _T("");
+	m_waiter5 = _T("");
+	m_waiter6 = _T("");
+	m_pinyin1 = _T("");
+	m_pinyin2 = _T("");
+	m_waiter7 = _T("");
+	m_status6 = _T("");
+	m_phone1 = _T("");
+	m_phone2 = _T("");
+	m_status7 = _T("");
+	m_memberno = _T("");
+	m_waiter8 = _T("");
+	m_time6 = _T("");
+	m_status8 = _T("");
+	m_bruncount = _T("");
+	m_tichenren1 = _T("");
+	m_tichenren2 = _T("");
+	m_tichenren3 = _T("");
+	m_tichenren4 = _T("");
+	m_tichenren5 = _T("");
+	m_send1 = _T("");
+	m_send2 = _T("");
+	m_send3 = _T("");
+	m_datetime4 = _T("");
+	m_datetime5 = _T("");
+	m_datetime6 = _T("");
+	m_waiter12 = _T("");
+	m_waiter22 = _T("");
+	m_waiter1rate = _T("");
+	m_waiter2rate = _T("");
+	m_waiter13 = _T("");
+	m_waiter14 = _T("");
+	m_waiter23 = _T("");
+	m_waiter24 = _T("");
+	m_waiter12rate = _T("");
+	m_waiter13rate = _T("");
+	m_waiter14rate = _T("");
+	m_waiter22rate = _T("");
+	m_waiter23rate = _T("");
+	m_waiter24rate = _T("");
+	m_ren2 = _T("");
+	m_renrate = _T("");
+	m_ren2rate = _T("");
+	m_txtype = _T("");
+	m_delphotos = _T("");
+	m_growthtxselname = _T("");
+	m_delphotos2 = _T("");
+	m_designno = _T("");
+	m_designreplaceno = _T("");
+	m_size = _T("");
+	m_dindantype = _T("");
+	m_contractno1 = _T("");
+	m_contractno2 = _T("");
+	m_cfno = _T("");
+	m_calldate = _T("");
+	m_from = _T("");
+	m_reason = _T("");
+	m_time7 = _T("");
+	m_time8 = _T("");
+	m_time9 = _T("");
+	m_time10 = _T("");
+	m_authorize = _T("");
+	m_discount2 = _T("");
+	m_authorize2 = _T("");
+	m_bz4 = _T("");
+	m_satisfaction1 = 0;
+	m_satisfaction2 = 0;
+	m_satisfaction3 = 0;
+	m_satisfaction4 = 0;
+	m_satisfaction5 = 0;
+	m_satisfaction6 = 0;
+	m_satisfaction7 = 0;
+	m_bz5 = _T("");
+	m_send4 = 0;
+	m_send5 = 0;
+	m_waiter9 = _T("");
+	m_curno = _T("");
+	m_xplrr = _T("");
+	m_xplrtime = _T("");
+	m_satisfaction8 = 0;
+	m_VisitPeople1 = _T("");
+	m_VisitPeople2 = _T("");
+	m_VisitPeople3 = _T("");
+	m_VisitPeople4 = _T("");
+	m_VisitPeople5 = _T("");
+	m_VisitPeople6 = _T("");
+	m_VisitPeople7 = _T("");
+	m_VisitPeople8 = _T("");
+	m_VisitTime1 = _T("");
+	m_VisitTime2 = _T("");
+	m_VisitTime3 = _T("");
+	m_VisitTime4 = _T("");
+	m_VisitTime5 = _T("");
+	m_VisitTime6 = _T("");
+	m_VisitTime7 = _T("");
+	m_VisitTime8 = _T("");
+	m_XPCloundSite = _T("");
+	m_XYCloundSite = _T("");
+	m_nFields = 144;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrder::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrder::GetDefaultSQL()
+{
+	return _T("[dbo].[dindan]");
+}
+
+void CTblOrder::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[money1]"), m_money1);
+	RFX_Text(pFX, _T("[money2]"), m_money2);
+	RFX_Text(pFX, _T("[money3]"), m_money3);
+	RFX_Text(pFX, _T("[name1]"), m_name1);
+	RFX_Text(pFX, _T("[name2]"), m_name2);
+	RFX_Text(pFX, _T("[taoxiid]"), m_taoxiid);
+	RFX_Text(pFX, _T("[taoxiname]"), m_taoxiname);
+	RFX_Text(pFX, _T("[taoxijiage]"), m_taoxijiage);
+	RFX_Text(pFX, _T("[taoxizs]"), m_taoxizs);
+	RFX_Text(pFX, _T("[time1]"), m_time1);
+	RFX_Text(pFX, _T("[time2]"), m_time2);
+	RFX_Text(pFX, _T("[time3]"), m_time3);
+	RFX_Text(pFX, _T("[bm]"), m_bm);
+	RFX_Text(pFX, _T("[ren]"), m_ren);
+	RFX_Text(pFX, _T("[discount]"), m_discount);
+	RFX_Text(pFX, _T("[payed1]"), m_payed1);
+	RFX_Text(pFX, _T("[payed2]"), m_payed2);
+	RFX_Text(pFX, _T("[payed3]"), m_payed3);
+	RFX_Text(pFX, _T("[payed4]"), m_payed4);
+	RFX_Text(pFX, _T("[payed5]"), m_payed5);
+	RFX_Text(pFX, _T("[time4]"), m_time4);
+	RFX_Text(pFX, _T("[time5]"), m_time5);
+	RFX_Text(pFX, _T("[takezs]"), m_takezs);
+	RFX_Text(pFX, _T("[choosezs]"), m_choosezs);
+	RFX_Text(pFX, _T("[status]"), m_status);
+	RFX_Text(pFX, _T("[clothescount2]"), m_clothescount2);
+	RFX_Text(pFX, _T("[outside2]"), m_outside2);
+	RFX_Text(pFX, _T("[style]"), m_style);
+	RFX_Text(pFX, _T("[payed3time]"), m_payed3time);
+	RFX_Text(pFX, _T("[payed4ren]"), m_payed4ren);
+	RFX_Text(pFX, _T("[payed4time]"), m_payed4time);
+	RFX_Text(pFX, _T("[status2]"), m_status2);
+	RFX_Text(pFX, _T("[status3]"), m_status3);
+	RFX_Text(pFX, _T("[waiter1]"), m_waiter1);
+	RFX_Text(pFX, _T("[waiter2]"), m_waiter2);
+	RFX_Text(pFX, _T("[waiter3]"), m_waiter3);
+	RFX_Text(pFX, _T("[waiter4]"), m_waiter4);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[taketime]"), m_taketime);
+	RFX_Text(pFX, _T("[clothescount]"), m_clothescount);
+	RFX_Text(pFX, _T("[outside]"), m_outside);
+	RFX_Text(pFX, _T("[bz2]"), m_bz2);
+	RFX_Text(pFX, _T("[bz3]"), m_bz3);
+	RFX_Text(pFX, _T("[urgent]"), m_urgent);
+	RFX_Text(pFX, _T("[status4]"), m_status4);
+	RFX_Text(pFX, _T("[status5]"), m_status5);
+	RFX_Text(pFX, _T("[waiter5]"), m_waiter5);
+	RFX_Text(pFX, _T("[waiter6]"), m_waiter6);
+	RFX_Text(pFX, _T("[pinyin1]"), m_pinyin1);
+	RFX_Text(pFX, _T("[pinyin2]"), m_pinyin2);
+	RFX_Text(pFX, _T("[waiter7]"), m_waiter7);
+	RFX_Text(pFX, _T("[status6]"), m_status6);
+	RFX_Text(pFX, _T("[phone1]"), m_phone1);
+	RFX_Text(pFX, _T("[phone2]"), m_phone2);
+	RFX_Text(pFX, _T("[status7]"), m_status7);
+	RFX_Text(pFX, _T("[memberno]"), m_memberno);
+	RFX_Text(pFX, _T("[waiter8]"), m_waiter8);
+	RFX_Text(pFX, _T("[time6]"), m_time6);
+	RFX_Text(pFX, _T("[status8]"), m_status8);
+	RFX_Text(pFX, _T("[bruncount]"), m_bruncount);
+	RFX_Text(pFX, _T("[tichenren1]"), m_tichenren1);
+	RFX_Text(pFX, _T("[tichenren2]"), m_tichenren2);
+	RFX_Text(pFX, _T("[tichenren3]"), m_tichenren3);
+	RFX_Text(pFX, _T("[tichenren4]"), m_tichenren4);
+	RFX_Text(pFX, _T("[tichenren5]"), m_tichenren5);
+	RFX_Text(pFX, _T("[send1]"), m_send1);
+	RFX_Text(pFX, _T("[send2]"), m_send2);
+	RFX_Text(pFX, _T("[send3]"), m_send3);
+	RFX_Text(pFX, _T("[datetime4]"), m_datetime4);
+	RFX_Text(pFX, _T("[datetime5]"), m_datetime5);
+	RFX_Text(pFX, _T("[datetime6]"), m_datetime6);
+	RFX_Text(pFX, _T("[waiter12]"), m_waiter12);
+	RFX_Text(pFX, _T("[waiter22]"), m_waiter22);
+	RFX_Text(pFX, _T("[waiter1rate]"), m_waiter1rate);
+	RFX_Text(pFX, _T("[waiter2rate]"), m_waiter2rate);
+	RFX_Text(pFX, _T("[waiter13]"), m_waiter13);
+	RFX_Text(pFX, _T("[waiter14]"), m_waiter14);
+	RFX_Text(pFX, _T("[waiter23]"), m_waiter23);
+	RFX_Text(pFX, _T("[waiter24]"), m_waiter24);
+	RFX_Text(pFX, _T("[waiter12rate]"), m_waiter12rate);
+	RFX_Text(pFX, _T("[waiter13rate]"), m_waiter13rate);
+	RFX_Text(pFX, _T("[waiter14rate]"), m_waiter14rate);
+	RFX_Text(pFX, _T("[waiter22rate]"), m_waiter22rate);
+	RFX_Text(pFX, _T("[waiter23rate]"), m_waiter23rate);
+	RFX_Text(pFX, _T("[waiter24rate]"), m_waiter24rate);
+	RFX_Text(pFX, _T("[ren2]"), m_ren2);
+	RFX_Text(pFX, _T("[renrate]"), m_renrate);
+	RFX_Text(pFX, _T("[ren2rate]"), m_ren2rate);
+	RFX_Text(pFX, _T("[txtype]"), m_txtype);
+	RFX_Text(pFX, _T("[delphotos]"), m_delphotos);
+	RFX_Text(pFX, _T("[growthtxselname]"), m_growthtxselname);
+	RFX_Text(pFX, _T("[delphotos2]"), m_delphotos2);
+	RFX_Text(pFX, _T("[designno]"), m_designno);
+	RFX_Text(pFX, _T("[designreplaceno]"), m_designreplaceno);
+	RFX_Text(pFX, _T("[size]"), m_size);
+	RFX_Text(pFX, _T("[dindantype]"), m_dindantype);
+	RFX_Text(pFX, _T("[contractno1]"), m_contractno1);
+	RFX_Text(pFX, _T("[contractno2]"), m_contractno2);
+	RFX_Text(pFX, _T("[cfno]"), m_cfno);
+	RFX_Text(pFX, _T("[calldate]"), m_calldate);
+	RFX_Text(pFX, _T("[from]"), m_from);
+	RFX_Text(pFX, _T("[reason]"), m_reason);
+	RFX_Text(pFX, _T("[time7]"), m_time7);
+	RFX_Text(pFX, _T("[time8]"), m_time8);
+	RFX_Text(pFX, _T("[time9]"), m_time9);
+	RFX_Text(pFX, _T("[time10]"), m_time10);
+	RFX_Text(pFX, _T("[authorize]"), m_authorize);
+	RFX_Text(pFX, _T("[discount2]"), m_discount2);
+	RFX_Text(pFX, _T("[authorize2]"), m_authorize2);
+	RFX_Text(pFX, _T("[bz4]"), m_bz4);
+	RFX_Long(pFX, _T("[satisfaction1]"), m_satisfaction1);
+	RFX_Long(pFX, _T("[satisfaction2]"), m_satisfaction2);
+	RFX_Long(pFX, _T("[satisfaction3]"), m_satisfaction3);
+	RFX_Long(pFX, _T("[satisfaction4]"), m_satisfaction4);
+	RFX_Long(pFX, _T("[satisfaction5]"), m_satisfaction5);
+	RFX_Long(pFX, _T("[satisfaction6]"), m_satisfaction6);
+	RFX_Long(pFX, _T("[satisfaction7]"), m_satisfaction7);
+	RFX_Text(pFX, _T("[bz5]"), m_bz5);
+	RFX_Long(pFX, _T("[send4]"), m_send4);
+	RFX_Long(pFX, _T("[send5]"), m_send5);
+	RFX_Text(pFX, _T("[waiter9]"), m_waiter9);
+	RFX_Text(pFX, _T("[curno]"), m_curno);
+	RFX_Text(pFX, _T("[xplrr]"), m_xplrr);
+	RFX_Text(pFX, _T("[xplrtime]"), m_xplrtime);
+	RFX_Long(pFX, _T("[satisfaction8]"), m_satisfaction8);
+	RFX_Text(pFX, _T("[VisitPeople1]"), m_VisitPeople1);
+	RFX_Text(pFX, _T("[VisitPeople2]"), m_VisitPeople2);
+	RFX_Text(pFX, _T("[VisitPeople3]"), m_VisitPeople3);
+	RFX_Text(pFX, _T("[VisitPeople4]"), m_VisitPeople4);
+	RFX_Text(pFX, _T("[VisitPeople5]"), m_VisitPeople5);
+	RFX_Text(pFX, _T("[VisitPeople6]"), m_VisitPeople6);
+	RFX_Text(pFX, _T("[VisitPeople7]"), m_VisitPeople7);
+	RFX_Text(pFX, _T("[VisitPeople8]"), m_VisitPeople8);
+	RFX_Text(pFX, _T("[VisitTime1]"), m_VisitTime1);
+	RFX_Text(pFX, _T("[VisitTime2]"), m_VisitTime2);
+	RFX_Text(pFX, _T("[VisitTime3]"), m_VisitTime3);
+	RFX_Text(pFX, _T("[VisitTime4]"), m_VisitTime4);
+	RFX_Text(pFX, _T("[VisitTime5]"), m_VisitTime5);
+	RFX_Text(pFX, _T("[VisitTime6]"), m_VisitTime6);
+	RFX_Text(pFX, _T("[VisitTime7]"), m_VisitTime7);
+	RFX_Text(pFX, _T("[VisitTime8]"), m_VisitTime8);
+	RFX_Text(pFX, _T("[XPCloundSite]"), m_XPCloundSite);
+	RFX_Text(pFX, _T("[XYCloundSite]"), m_XYCloundSite);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrder 诊断
+
+#ifdef _DEBUG
+void CTblOrder::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrder::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 184 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrder.h

@@ -0,0 +1,184 @@
+// TblOrder.h : CTblOrder 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:02
+
+class CTblOrder : public CRecordset
+{
+public:
+	CTblOrder(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrder)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CStringA	m_id;
+	CString	m_money1;
+	CString	m_money2;
+	CString	m_money3;
+	CString	m_name1;
+	CString	m_name2;
+	CStringA	m_taoxiid;
+	CString	m_taoxiname;
+	CString	m_taoxijiage;
+	CString	m_taoxizs;
+	CString	m_time1;
+	CString	m_time2;
+	CString	m_time3;
+	CString	m_bm;
+	CString	m_ren;
+	CString	m_discount;
+	CString	m_payed1;
+	CString	m_payed2;
+	CString	m_payed3;
+	CString	m_payed4;
+	CString	m_payed5;
+	CString	m_time4;
+	CString	m_time5;
+	CString	m_takezs;
+	CString	m_choosezs;
+	CString	m_status;
+	CString	m_clothescount2;
+	CString	m_outside2;
+	CString	m_style;
+	CString	m_payed3time;
+	CString	m_payed4ren;
+	CString	m_payed4time;
+	CString	m_status2;
+	CString	m_status3;
+	CString	m_waiter1;
+	CString	m_waiter2;
+	CString	m_waiter3;
+	CString	m_waiter4;
+	CString	m_bz;
+	CString	m_taketime;
+	CString	m_clothescount;
+	CString	m_outside;
+	CString	m_bz2;
+	CString	m_bz3;
+	CString	m_urgent;
+	CString	m_status4;
+	CString	m_status5;
+	CString	m_waiter5;
+	CString	m_waiter6;
+	CString	m_pinyin1;
+	CString	m_pinyin2;
+	CString	m_waiter7;
+	CString	m_status6;
+	CString	m_phone1;
+	CString	m_phone2;
+	CString	m_status7;
+	CString	m_memberno;
+	CString	m_waiter8;
+	CString	m_time6;
+	CString	m_status8;
+	CString	m_bruncount;
+	CString	m_tichenren1;
+	CString	m_tichenren2;
+	CString	m_tichenren3;
+	CString	m_tichenren4;
+	CString	m_tichenren5;
+	CString	m_send1;
+	CString	m_send2;
+	CString	m_send3;
+	CString	m_datetime4;
+	CString	m_datetime5;
+	CString	m_datetime6;
+	CString	m_waiter12;
+	CString	m_waiter22;
+	CString	m_waiter1rate;
+	CString	m_waiter2rate;
+	CString	m_waiter13;
+	CString	m_waiter14;
+	CString	m_waiter23;
+	CString	m_waiter24;
+	CString	m_waiter12rate;
+	CString	m_waiter13rate;
+	CString	m_waiter14rate;
+	CString	m_waiter22rate;
+	CString	m_waiter23rate;
+	CString	m_waiter24rate;
+	CString	m_ren2;
+	CString	m_renrate;
+	CString	m_ren2rate;
+	CString	m_txtype;
+	CString	m_delphotos;
+	CString	m_growthtxselname;
+	CString	m_delphotos2;
+	CString	m_designno;
+	CString	m_designreplaceno;
+	CString	m_size;
+	CString	m_dindantype;
+	CString	m_contractno1;
+	CString	m_contractno2;
+	CString	m_cfno;
+	CString	m_calldate;
+	CString	m_from;
+	CString	m_reason;
+	CString	m_time7;
+	CString	m_time8;
+	CString	m_time9;
+	CString	m_time10;
+	CString	m_authorize;
+	CString	m_discount2;
+	CString	m_authorize2;
+	CString	m_bz4;
+	long	m_satisfaction1;
+	long	m_satisfaction2;
+	long	m_satisfaction3;
+	long	m_satisfaction4;
+	long	m_satisfaction5;
+	long	m_satisfaction6;
+	long	m_satisfaction7;
+	CString	m_bz5;
+	long	m_send4;
+	long	m_send5;
+	CString	m_waiter9;
+	CString	m_curno;
+	CString	m_xplrr;
+	CString	m_xplrtime;
+	long	m_satisfaction8;
+	CString	m_VisitPeople1;
+	CString	m_VisitPeople2;
+	CString	m_VisitPeople3;
+	CString	m_VisitPeople4;
+	CString	m_VisitPeople5;
+	CString	m_VisitPeople6;
+	CString	m_VisitPeople7;
+	CString	m_VisitPeople8;
+	CString	m_VisitTime1;
+	CString	m_VisitTime2;
+	CString	m_VisitTime3;
+	CString	m_VisitTime4;
+	CString	m_VisitTime5;
+	CString	m_VisitTime6;
+	CString	m_VisitTime7;
+	CString	m_VisitTime8;
+	CString	m_XPCloundSite;
+	CString	m_XYCloundSite;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 101 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderCustomer.cpp

@@ -0,0 +1,101 @@
+// TblOrderCustomer.h : CTblOrderCustomer 类的实现
+
+
+
+// CTblOrderCustomer 实现
+
+// 代码生成在 2018年04月24日, 14:56
+
+#include "stdafx.h"
+#include "TblOrderCustomer.h"
+IMPLEMENT_DYNAMIC(CTblOrderCustomer, CRecordset)
+
+CTblOrderCustomer::CTblOrderCustomer(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = _T("");
+	m_name1 = _T("");
+	m_name2 = _T("");
+	m_phone1 = _T("");
+	m_phone2 = _T("");
+	m_qq1 = _T("");
+	m_qq2 = _T("");
+	m_addr1 = _T("");
+	m_addr2 = _T("");
+	m_occupation1 = _T("");
+	m_occupation2 = _T("");
+	m_birthday1 = _T("");
+	m_birthday2 = _T("");
+	m_time3 = _T("");
+	m_area = _T("");
+	m_area2 = _T("");
+	m_check1 = _T("");
+	m_check2 = _T("");
+	m_check3 = _T("");
+	m_sex = _T("");
+	m_zodiac = _T("");
+	m_photo;
+	m_nFields = 22;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrderCustomer::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrderCustomer::GetDefaultSQL()
+{
+	return _T("[dbo].[client]");
+}
+
+void CTblOrderCustomer::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name1]"), m_name1);
+	RFX_Text(pFX, _T("[name2]"), m_name2);
+	RFX_Text(pFX, _T("[phone1]"), m_phone1);
+	RFX_Text(pFX, _T("[phone2]"), m_phone2);
+	RFX_Text(pFX, _T("[qq1]"), m_qq1);
+	RFX_Text(pFX, _T("[qq2]"), m_qq2);
+	RFX_Text(pFX, _T("[addr1]"), m_addr1);
+	RFX_Text(pFX, _T("[addr2]"), m_addr2);
+	RFX_Text(pFX, _T("[occupation1]"), m_occupation1);
+	RFX_Text(pFX, _T("[occupation2]"), m_occupation2);
+	RFX_Text(pFX, _T("[birthday1]"), m_birthday1);
+	RFX_Text(pFX, _T("[birthday2]"), m_birthday2);
+	RFX_Text(pFX, _T("[time3]"), m_time3);
+	RFX_Text(pFX, _T("[area]"), m_area);
+	RFX_Text(pFX, _T("[area2]"), m_area2);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+	RFX_Text(pFX, _T("[check2]"), m_check2);
+	RFX_Text(pFX, _T("[check3]"), m_check3);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Text(pFX, _T("[zodiac]"), m_zodiac);
+	RFX_LongBinary(pFX, _T("[photo]"), m_photo);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrderCustomer 诊断
+
+#ifdef _DEBUG
+void CTblOrderCustomer::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrderCustomer::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 62 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderCustomer.h

@@ -0,0 +1,62 @@
+// TblOrderCustomer.h : CTblOrderCustomer 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 14:56
+
+class CTblOrderCustomer : public CRecordset
+{
+public:
+	CTblOrderCustomer(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrderCustomer)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_id;
+	CString	m_name1;
+	CString	m_name2;
+	CString	m_phone1;
+	CString	m_phone2;
+	CString	m_qq1;
+	CString	m_qq2;
+	CString	m_addr1;
+	CString	m_addr2;
+	CString	m_occupation1;
+	CString	m_occupation2;
+	CString	m_birthday1;
+	CString	m_birthday2;
+	CString	m_time3;
+	CString	m_area;
+	CString	m_area2;
+	CString	m_check1;
+	CString	m_check2;
+	CString	m_check3;
+	CString	m_sex;
+	CString	m_zodiac;
+	CLongBinary	m_photo;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 137 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderGoods.cpp

@@ -0,0 +1,137 @@
+// TblOrderGoods.h : CTblOrderGoods 类的实现
+
+
+
+// CTblOrderGoods 实现
+
+// 代码生成在 2018年04月24日, 15:08
+
+#include "stdafx.h"
+#include "TblOrderGoods.h"
+IMPLEMENT_DYNAMIC(CTblOrderGoods, CRecordset)
+
+CTblOrderGoods::CTblOrderGoods(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = "";
+	m_spid = "";
+	m_shuliang = _T("");
+	m_kind = _T("");
+	m_price = _T("");
+	m_name = _T("");
+	m_no = _T("");
+	m_status1 = _T("");
+	m_status2 = _T("");
+	m_status3 = _T("");
+	m_status4 = _T("");
+	m_autoid = 0;
+	m_date1 = _T("");
+	m_date2 = _T("");
+	m_date3 = _T("");
+	m_date4 = _T("");
+	m_name1 = _T("");
+	m_name2 = _T("");
+	m_name3 = _T("");
+	m_name4 = _T("");
+	m_hqdate = _T("");
+	m_hqtime = _T("");
+	m_urgent = _T("");
+	m_taketime = _T("");
+	m_no2 = _T("");
+	m_growthtxname = _T("");
+	m_status5 = _T("");
+	m_status6 = _T("");
+	m_date5 = _T("");
+	m_date6 = _T("");
+	m_name5 = _T("");
+	m_name6 = _T("");
+	m_ps = _T("");
+	m_zs = _T("");
+	m_ren1 = _T("");
+	m_ren2 = _T("");
+	m_hqstatus = _T("");
+	m_bz = _T("");
+	m_BackItemsCot = _T("");
+	m_PickupItemsCot = _T("");
+	m_nFields = 40;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrderGoods::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrderGoods::GetDefaultSQL()
+{
+	return _T("[dbo].[dindansp]");
+}
+
+void CTblOrderGoods::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[spid]"), m_spid);
+	RFX_Text(pFX, _T("[shuliang]"), m_shuliang);
+	RFX_Text(pFX, _T("[kind]"), m_kind);
+	RFX_Text(pFX, _T("[price]"), m_price);
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[no]"), m_no);
+	RFX_Text(pFX, _T("[status1]"), m_status1);
+	RFX_Text(pFX, _T("[status2]"), m_status2);
+	RFX_Text(pFX, _T("[status3]"), m_status3);
+	RFX_Text(pFX, _T("[status4]"), m_status4);
+	RFX_Long(pFX, _T("[autoid]"), m_autoid);
+	RFX_Text(pFX, _T("[date1]"), m_date1);
+	RFX_Text(pFX, _T("[date2]"), m_date2);
+	RFX_Text(pFX, _T("[date3]"), m_date3);
+	RFX_Text(pFX, _T("[date4]"), m_date4);
+	RFX_Text(pFX, _T("[name1]"), m_name1);
+	RFX_Text(pFX, _T("[name2]"), m_name2);
+	RFX_Text(pFX, _T("[name3]"), m_name3);
+	RFX_Text(pFX, _T("[name4]"), m_name4);
+	RFX_Text(pFX, _T("[hqdate]"), m_hqdate);
+	RFX_Text(pFX, _T("[hqtime]"), m_hqtime);
+	RFX_Text(pFX, _T("[urgent]"), m_urgent);
+	RFX_Text(pFX, _T("[taketime]"), m_taketime);
+	RFX_Text(pFX, _T("[no2]"), m_no2);
+	RFX_Text(pFX, _T("[growthtxname]"), m_growthtxname);
+	RFX_Text(pFX, _T("[status5]"), m_status5);
+	RFX_Text(pFX, _T("[status6]"), m_status6);
+	RFX_Text(pFX, _T("[date5]"), m_date5);
+	RFX_Text(pFX, _T("[date6]"), m_date6);
+	RFX_Text(pFX, _T("[name5]"), m_name5);
+	RFX_Text(pFX, _T("[name6]"), m_name6);
+	RFX_Text(pFX, _T("[ps]"), m_ps);
+	RFX_Text(pFX, _T("[zs]"), m_zs);
+	RFX_Text(pFX, _T("[ren1]"), m_ren1);
+	RFX_Text(pFX, _T("[ren2]"), m_ren2);
+	RFX_Text(pFX, _T("[hqstatus]"), m_hqstatus);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[BackItemsCot]"), m_BackItemsCot);
+	RFX_Text(pFX, _T("[PickupItemsCot]"), m_PickupItemsCot);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrderGoods 诊断
+
+#ifdef _DEBUG
+void CTblOrderGoods::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrderGoods::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 80 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderGoods.h

@@ -0,0 +1,80 @@
+// TblOrderGoods.h : CTblOrderGoods 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:08
+
+class CTblOrderGoods : public CRecordset
+{
+public:
+	CTblOrderGoods(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrderGoods)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CStringA	m_id;
+	CStringA	m_spid;
+	CString	m_shuliang;
+	CString	m_kind;
+	CString	m_price;
+	CString	m_name;
+	CString	m_no;
+	CString	m_status1;
+	CString	m_status2;
+	CString	m_status3;
+	CString	m_status4;
+	long	m_autoid;
+	CString	m_date1;
+	CString	m_date2;
+	CString	m_date3;
+	CString	m_date4;
+	CString	m_name1;
+	CString	m_name2;
+	CString	m_name3;
+	CString	m_name4;
+	CString	m_hqdate;
+	CString	m_hqtime;
+	CString	m_urgent;
+	CString	m_taketime;
+	CString	m_no2;
+	CString	m_growthtxname;
+	CString	m_status5;
+	CString	m_status6;
+	CString	m_date5;
+	CString	m_date6;
+	CString	m_name5;
+	CString	m_name6;
+	CString	m_ps;
+	CString	m_zs;
+	CString	m_ren1;
+	CString	m_ren2;
+	CString	m_hqstatus;
+	CString	m_bz;
+	CString	m_BackItemsCot;
+	CString	m_PickupItemsCot;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 85 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient.cpp

@@ -0,0 +1,85 @@
+// TblOrderRecipient.h : CTblOrderRecipient 类的实现
+
+
+
+// CTblOrderRecipient 实现
+
+// 代码生成在 2018年04月24日, 15:05
+
+#include "stdafx.h"
+#include "TblOrderRecipient.h"
+IMPLEMENT_DYNAMIC(CTblOrderRecipient, CRecordset)
+
+CTblOrderRecipient::CTblOrderRecipient(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_autoid = 0;
+	m_id = "";
+	m_money = _T("");
+	m_ren = _T("");
+	m_date = _T("");
+	m_bz = _T("");
+	m_kind = _T("");
+	m_ren2 = _T("");
+	m_item = _T("");
+	m_paytype = _T("");
+	m_jdd = _T("");
+	m_financecheck = _T("");
+	m_discount = _T("");
+	m_time = _T("");
+	m_nFields = 14;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrderRecipient::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrderRecipient::GetDefaultSQL()
+{
+	return _T("[dbo].[dindanbukuan]");
+}
+
+void CTblOrderRecipient::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[autoid]"), m_autoid);
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[money]"), m_money);
+	RFX_Text(pFX, _T("[ren]"), m_ren);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[kind]"), m_kind);
+	RFX_Text(pFX, _T("[ren2]"), m_ren2);
+	RFX_Text(pFX, _T("[item]"), m_item);
+	RFX_Text(pFX, _T("[paytype]"), m_paytype);
+	RFX_Text(pFX, _T("[jdd]"), m_jdd);
+	RFX_Text(pFX, _T("[financecheck]"), m_financecheck);
+	RFX_Text(pFX, _T("[discount]"), m_discount);
+	RFX_Text(pFX, _T("[time]"), m_time);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrderRecipient 诊断
+
+#ifdef _DEBUG
+void CTblOrderRecipient::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrderRecipient::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 54 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient.h

@@ -0,0 +1,54 @@
+// TblOrderRecipient.h : CTblOrderRecipient 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:05
+
+class CTblOrderRecipient : public CRecordset
+{
+public:
+	CTblOrderRecipient(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrderRecipient)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_autoid;
+	CStringA	m_id;
+	CString	m_money;
+	CString	m_ren;
+	CString	m_date;
+	CString	m_bz;
+	CString	m_kind;
+	CString	m_ren2;
+	CString	m_item;
+	CString	m_paytype;
+	CString	m_jdd;
+	CString	m_financecheck;
+	CString	m_discount;
+	CString	m_time;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 73 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient2.cpp

@@ -0,0 +1,73 @@
+// TblOrderRecipient2.h : CTblOrderRecipient2 类的实现
+
+
+
+// CTblOrderRecipient2 实现
+
+// 代码生成在 2018年04月24日, 15:06
+
+#include "stdafx.h"
+#include "TblOrderRecipient2.h"
+IMPLEMENT_DYNAMIC(CTblOrderRecipient2, CRecordset)
+
+CTblOrderRecipient2::CTblOrderRecipient2(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_autoid = 0;
+	m_id = "";
+	m_money = _T("");
+	m_ren = _T("");
+	m_date = _T("");
+	m_bz = _T("");
+	m_kind = _T("");
+	m_ren2 = _T("");
+	m_nFields = 8;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrderRecipient2::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrderRecipient2::GetDefaultSQL()
+{
+	return _T("[dbo].[dindanbukuan2]");
+}
+
+void CTblOrderRecipient2::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[autoid]"), m_autoid);
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[money]"), m_money);
+	RFX_Text(pFX, _T("[ren]"), m_ren);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[kind]"), m_kind);
+	RFX_Text(pFX, _T("[ren2]"), m_ren2);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrderRecipient2 诊断
+
+#ifdef _DEBUG
+void CTblOrderRecipient2::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrderRecipient2::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 48 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderRecipient2.h

@@ -0,0 +1,48 @@
+// TblOrderRecipient2.h : CTblOrderRecipient2 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:06
+
+class CTblOrderRecipient2 : public CRecordset
+{
+public:
+	CTblOrderRecipient2(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrderRecipient2)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_autoid;
+	CStringA	m_id;
+	CString	m_money;
+	CString	m_ren;
+	CString	m_date;
+	CString	m_bz;
+	CString	m_kind;
+	CString	m_ren2;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 87 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderScenicSpot.cpp

@@ -0,0 +1,87 @@
+// TblOrderScenicSpot.h : CTblOrderScenicSpot 类的实现
+
+
+
+// CTblOrderScenicSpot 实现
+
+// 代码生成在 2018年04月24日, 15:08
+
+#include "stdafx.h"
+#include "TblOrderScenicSpot.h"
+IMPLEMENT_DYNAMIC(CTblOrderScenicSpot, CRecordset)
+
+CTblOrderScenicSpot::CTblOrderScenicSpot(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = _T("");
+	m_name = _T("");
+	m_date = _T("");
+	m_time = _T("");
+	m_waiter1 = _T("");
+	m_waiter2 = _T("");
+	m_status = _T("");
+	m_waiter12 = _T("");
+	m_waiter22 = _T("");
+	m_bookingdate = _T("");
+	m_dress = _T("");
+	m_bz = _T("");
+	m_clerk = _T("");
+	m_inputtime = _T("");
+	m_branch = _T("");
+	m_nFields = 15;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblOrderScenicSpot::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblOrderScenicSpot::GetDefaultSQL()
+{
+	return _T("[dbo].[dindanjd]");
+}
+
+void CTblOrderScenicSpot::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[time]"), m_time);
+	RFX_Text(pFX, _T("[waiter1]"), m_waiter1);
+	RFX_Text(pFX, _T("[waiter2]"), m_waiter2);
+	RFX_Text(pFX, _T("[status]"), m_status);
+	RFX_Text(pFX, _T("[waiter12]"), m_waiter12);
+	RFX_Text(pFX, _T("[waiter22]"), m_waiter22);
+	RFX_Text(pFX, _T("[bookingdate]"), m_bookingdate);
+	RFX_Text(pFX, _T("[dress]"), m_dress);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[clerk]"), m_clerk);
+	RFX_Text(pFX, _T("[inputtime]"), m_inputtime);
+	RFX_Text(pFX, _T("[branch]"), m_branch);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblOrderScenicSpot 诊断
+
+#ifdef _DEBUG
+void CTblOrderScenicSpot::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblOrderScenicSpot::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 55 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblOrderScenicSpot.h

@@ -0,0 +1,55 @@
+// TblOrderScenicSpot.h : CTblOrderScenicSpot 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:08
+
+class CTblOrderScenicSpot : public CRecordset
+{
+public:
+	CTblOrderScenicSpot(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblOrderScenicSpot)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_id;
+	CString	m_name;
+	CString	m_date;
+	CString	m_time;
+	CString	m_waiter1;
+	CString	m_waiter2;
+	CString	m_status;
+	CString	m_waiter12;
+	CString	m_waiter22;
+	CString	m_bookingdate;
+	CString	m_dress;
+	CString	m_bz;
+	CString	m_clerk;
+	CString	m_inputtime;
+	CString	m_branch;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 69 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackage.cpp

@@ -0,0 +1,69 @@
+// TblPackage.h : CTblPackage 类的实现
+
+
+
+// CTblPackage 实现
+
+// 代码生成在 2018年04月24日, 15:44
+
+#include "stdafx.h"
+#include "TblPackage.h"
+IMPLEMENT_DYNAMIC(CTblPackage, CRecordset)
+
+CTblPackage::CTblPackage(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_taoxiid = _T("");
+	m_taoxiname = "";
+	m_taoxijiage = _T("");
+	m_zs = _T("");
+	m_type = _T("");
+	m_show = _T("");
+	m_nFields = 6;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblPackage::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblPackage::GetDefaultSQL()
+{
+	return _T("[dbo].[taoxi]");
+}
+
+void CTblPackage::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[taoxiid]"), m_taoxiid);
+	RFX_Text(pFX, _T("[taoxiname]"), m_taoxiname);
+	RFX_Text(pFX, _T("[taoxijiage]"), m_taoxijiage);
+	RFX_Text(pFX, _T("[zs]"), m_zs);
+	RFX_Text(pFX, _T("[type]"), m_type);
+	RFX_Text(pFX, _T("[show]"), m_show);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblPackage 诊断
+
+#ifdef _DEBUG
+void CTblPackage::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblPackage::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 46 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackage.h

@@ -0,0 +1,46 @@
+// TblPackage.h : CTblPackage 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:44
+
+class CTblPackage : public CRecordset
+{
+public:
+	CTblPackage(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblPackage)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_taoxiid;
+	CStringA	m_taoxiname;
+	CString	m_taoxijiage;
+	CString	m_zs;
+	CString	m_type;
+	CString	m_show;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 65 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods.cpp

@@ -0,0 +1,65 @@
+// TblPackageGoods.h : CTblPackageGoods 类的实现
+
+
+
+// CTblPackageGoods 实现
+
+// 代码生成在 2018年04月24日, 15:45
+
+#include "stdafx.h"
+#include "TblPackageGoods.h"
+IMPLEMENT_DYNAMIC(CTblPackageGoods, CRecordset)
+
+CTblPackageGoods::CTblPackageGoods(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_taoxiid = "";
+	m_spid1 = "";
+	m_shuliang = _T("");
+	m_nFields = 4;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblPackageGoods::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblPackageGoods::GetDefaultSQL()
+{
+	return _T("[dbo].[taoxishangpin1]");
+}
+
+void CTblPackageGoods::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[taoxiid]"), m_taoxiid);
+	RFX_Text(pFX, _T("[spid1]"), m_spid1);
+	RFX_Text(pFX, _T("[shuliang]"), m_shuliang);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblPackageGoods 诊断
+
+#ifdef _DEBUG
+void CTblPackageGoods::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblPackageGoods::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 44 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods.h

@@ -0,0 +1,44 @@
+// TblPackageGoods.h : CTblPackageGoods 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:45
+
+class CTblPackageGoods : public CRecordset
+{
+public:
+	CTblPackageGoods(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblPackageGoods)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CStringA	m_taoxiid;
+	CStringA	m_spid1;
+	CString	m_shuliang;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 65 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods2.cpp

@@ -0,0 +1,65 @@
+// TblPackageGoods2.h : CTblPackageGoods2 类的实现
+
+
+
+// CTblPackageGoods2 实现
+
+// 代码生成在 2018年04月24日, 15:45
+
+#include "stdafx.h"
+#include "TblPackageGoods2.h"
+IMPLEMENT_DYNAMIC(CTblPackageGoods2, CRecordset)
+
+CTblPackageGoods2::CTblPackageGoods2(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_id = 0;
+	m_taoxiid = "";
+	m_spid2 = "";
+	m_shuliang = _T("");
+	m_nFields = 4;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblPackageGoods2::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblPackageGoods2::GetDefaultSQL()
+{
+	return _T("[dbo].[taoxishangpin2]");
+}
+
+void CTblPackageGoods2::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[taoxiid]"), m_taoxiid);
+	RFX_Text(pFX, _T("[spid2]"), m_spid2);
+	RFX_Text(pFX, _T("[shuliang]"), m_shuliang);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblPackageGoods2 诊断
+
+#ifdef _DEBUG
+void CTblPackageGoods2::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblPackageGoods2::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 44 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageGoods2.h

@@ -0,0 +1,44 @@
+// TblPackageGoods2.h : CTblPackageGoods2 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:45
+
+class CTblPackageGoods2 : public CRecordset
+{
+public:
+	CTblPackageGoods2(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblPackageGoods2)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	long	m_id;
+	CStringA	m_taoxiid;
+	CStringA	m_spid2;
+	CString	m_shuliang;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType.cpp

@@ -0,0 +1,61 @@
+// TblPackageType.h : CTblPackageType 类的实现
+
+
+
+// CTblPackageType 实现
+
+// 代码生成在 2018年04月24日, 15:47
+
+#include "stdafx.h"
+#include "TblPackageType.h"
+IMPLEMENT_DYNAMIC(CTblPackageType, CRecordset)
+
+CTblPackageType::CTblPackageType(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_id = 0;
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblPackageType::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblPackageType::GetDefaultSQL()
+{
+	return _T("[dbo].[txlb]");
+}
+
+void CTblPackageType::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Long(pFX, _T("[id]"), m_id);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblPackageType 诊断
+
+#ifdef _DEBUG
+void CTblPackageType::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblPackageType::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType.h

@@ -0,0 +1,42 @@
+// TblPackageType.h : CTblPackageType 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:47
+
+class CTblPackageType : public CRecordset
+{
+public:
+	CTblPackageType(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblPackageType)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	long	m_id;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType2.cpp

@@ -0,0 +1,61 @@
+// TblPackageType2.h : CTblPackageType2 类的实现
+
+
+
+// CTblPackageType2 实现
+
+// 代码生成在 2018年04月24日, 15:47
+
+#include "stdafx.h"
+#include "TblPackageType2.h"
+IMPLEMENT_DYNAMIC(CTblPackageType2, CRecordset)
+
+CTblPackageType2::CTblPackageType2(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_id = 0;
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblPackageType2::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblPackageType2::GetDefaultSQL()
+{
+	return _T("[dbo].[txlb2]");
+}
+
+void CTblPackageType2::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Long(pFX, _T("[id]"), m_id);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblPackageType2 诊断
+
+#ifdef _DEBUG
+void CTblPackageType2::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblPackageType2::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblPackageType2.h

@@ -0,0 +1,42 @@
+// TblPackageType2.h : CTblPackageType2 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:47
+
+class CTblPackageType2 : public CRecordset
+{
+public:
+	CTblPackageType2(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblPackageType2)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	long	m_id;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 103 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblRegularCustomer.cpp

@@ -0,0 +1,103 @@
+// TblRegularCustomer.h : CTblRegularCustomer 类的实现
+
+
+
+// CTblRegularCustomer 实现
+
+// 代码生成在 2018年04月24日, 14:59
+
+#include "stdafx.h"
+#include "TblRegularCustomer.h"
+IMPLEMENT_DYNAMIC(CTblRegularCustomer, CRecordset)
+
+CTblRegularCustomer::CTblRegularCustomer(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_phone = _T("");
+	m_qq = _T("");
+	m_addr = _T("");
+	m_bz = _T("");
+	m_pinyin = _T("");
+	m_date = _T("");
+	m_sex = _T("");
+	m_ren = _T("");
+	m_id = 0;
+	m_dandate = _T("");
+	m_name2 = _T("");
+	m_phone2 = _T("");
+	m_qq2 = _T("");
+	m_birthday = _T("");
+	m_birthday2 = _T("");
+	m_time3 = _T("");
+	m_taoxiname = _T("");
+	m_taoxijiage = _T("");
+	m_check1 = _T("");
+	m_check2 = _T("");
+	m_check3 = _T("");
+	m_pinyin2 = _T("");
+	m_nFields = 23;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblRegularCustomer::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblRegularCustomer::GetDefaultSQL()
+{
+	return _T("[dbo].[client3]");
+}
+
+void CTblRegularCustomer::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Text(pFX, _T("[phone]"), m_phone);
+	RFX_Text(pFX, _T("[qq]"), m_qq);
+	RFX_Text(pFX, _T("[addr]"), m_addr);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+	RFX_Text(pFX, _T("[pinyin]"), m_pinyin);
+	RFX_Text(pFX, _T("[date]"), m_date);
+	RFX_Text(pFX, _T("[sex]"), m_sex);
+	RFX_Text(pFX, _T("[ren]"), m_ren);
+	RFX_Long(pFX, _T("[id]"), m_id);
+	RFX_Text(pFX, _T("[dandate]"), m_dandate);
+	RFX_Text(pFX, _T("[name2]"), m_name2);
+	RFX_Text(pFX, _T("[phone2]"), m_phone2);
+	RFX_Text(pFX, _T("[qq2]"), m_qq2);
+	RFX_Text(pFX, _T("[birthday]"), m_birthday);
+	RFX_Text(pFX, _T("[birthday2]"), m_birthday2);
+	RFX_Text(pFX, _T("[time3]"), m_time3);
+	RFX_Text(pFX, _T("[taoxiname]"), m_taoxiname);
+	RFX_Text(pFX, _T("[taoxijiage]"), m_taoxijiage);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+	RFX_Text(pFX, _T("[check2]"), m_check2);
+	RFX_Text(pFX, _T("[check3]"), m_check3);
+	RFX_Text(pFX, _T("[pinyin2]"), m_pinyin2);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblRegularCustomer 诊断
+
+#ifdef _DEBUG
+void CTblRegularCustomer::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblRegularCustomer::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 63 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblRegularCustomer.h

@@ -0,0 +1,63 @@
+// TblRegularCustomer.h : CTblRegularCustomer 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 14:59
+
+class CTblRegularCustomer : public CRecordset
+{
+public:
+	CTblRegularCustomer(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblRegularCustomer)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	CString	m_phone;
+	CString	m_qq;
+	CString	m_addr;
+	CString	m_bz;
+	CString	m_pinyin;
+	CString	m_date;
+	CString	m_sex;
+	CString	m_ren;
+	long	m_id;
+	CString	m_dandate;
+	CString	m_name2;
+	CString	m_phone2;
+	CString	m_qq2;
+	CString	m_birthday;
+	CString	m_birthday2;
+	CString	m_time3;
+	CString	m_taoxiname;
+	CString	m_taoxijiage;
+	CString	m_check1;
+	CString	m_check2;
+	CString	m_check3;
+	CString	m_pinyin2;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 61 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblScenicSpot.cpp

@@ -0,0 +1,61 @@
+// TblScenicSpot.h : CTblScenicSpot 类的实现
+
+
+
+// CTblScenicSpot 实现
+
+// 代码生成在 2018年04月24日, 15:34
+
+#include "stdafx.h"
+#include "TblScenicSpot.h"
+IMPLEMENT_DYNAMIC(CTblScenicSpot, CRecordset)
+
+CTblScenicSpot::CTblScenicSpot(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_name = _T("");
+	m_id = 0;
+	m_nFields = 2;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblScenicSpot::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblScenicSpot::GetDefaultSQL()
+{
+	return _T("[dbo].[jd]");
+}
+
+void CTblScenicSpot::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[name]"), m_name);
+	RFX_Long(pFX, _T("[id]"), m_id);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblScenicSpot 诊断
+
+#ifdef _DEBUG
+void CTblScenicSpot::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblScenicSpot::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 42 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblScenicSpot.h

@@ -0,0 +1,42 @@
+// TblScenicSpot.h : CTblScenicSpot 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:34
+
+class CTblScenicSpot : public CRecordset
+{
+public:
+	CTblScenicSpot(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblScenicSpot)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_name;
+	long	m_id;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 71 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblSupplier.cpp

@@ -0,0 +1,71 @@
+// TblSupplier.h : CTblSupplier 类的实现
+
+
+
+// CTblSupplier 实现
+
+// 代码生成在 2018年04月24日, 15:09
+
+#include "stdafx.h"
+#include "TblSupplier.h"
+IMPLEMENT_DYNAMIC(CTblSupplier, CRecordset)
+
+CTblSupplier::CTblSupplier(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_gyid = "";
+	m_gyname = "";
+	m_addr = _T("");
+	m_tel = _T("");
+	m_fax = _T("");
+	m_netaddress = _T("");
+	m_bz = _T("");
+	m_nFields = 7;
+	m_nDefaultType = dynaset;
+}
+//#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblSupplier::GetDefaultConnect()
+{
+	return _T("ODBC;DSN=");
+}
+
+CString CTblSupplier::GetDefaultSQL()
+{
+	return _T("[dbo].[gongyingshang]");
+}
+
+void CTblSupplier::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[gyid]"), m_gyid);
+	RFX_Text(pFX, _T("[gyname]"), m_gyname);
+	RFX_Text(pFX, _T("[addr]"), m_addr);
+	RFX_Text(pFX, _T("[tel]"), m_tel);
+	RFX_Text(pFX, _T("[fax]"), m_fax);
+	RFX_Text(pFX, _T("[netaddress]"), m_netaddress);
+	RFX_Text(pFX, _T("[bz]"), m_bz);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblSupplier 诊断
+
+#ifdef _DEBUG
+void CTblSupplier::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblSupplier::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 47 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblSupplier.h

@@ -0,0 +1,47 @@
+// TblSupplier.h : CTblSupplier 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 15:09
+
+class CTblSupplier : public CRecordset
+{
+public:
+	CTblSupplier(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblSupplier)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CStringA	m_gyid;
+	CStringA	m_gyname;
+	CString	m_addr;
+	CString	m_tel;
+	CString	m_fax;
+	CString	m_netaddress;
+	CString	m_bz;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 375 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblVersion.cpp

@@ -0,0 +1,375 @@
+// TblVersion.h : CTblVersion 类的实现
+
+
+
+// CTblVersion 实现
+
+// 代码生成在 2018年04月24日, 14:50
+
+#include "stdafx.h"
+#include "TblVersion.h"
+IMPLEMENT_DYNAMIC(CTblVersion, CRecordset)
+
+CTblVersion::CTblVersion(CDatabase* pdb)
+	: CRecordset(pdb)
+{
+	m_version = _T("");
+	m_curdate = "";
+	m_check1 = _T("");
+	m_check2 = _T("");
+	m_check3 = _T("");
+	m_check4 = _T("");
+	m_edit1 = _T("");
+	m_edit2 = _T("");
+	m_edit3 = _T("");
+	m_edit4 = _T("");
+	m_info1 = _T("");
+	m_info2 = _T("");
+	m_info3 = _T("");
+	m_info4 = _T("");
+	m_info5 = _T("");
+	m_bak1 = _T("");
+	m_bak2 = _T("");
+	m_bak3 = _T("");
+	m_bak4 = _T("");
+	m_bak5 = _T("");
+	m_bak6 = _T("");
+	m_baktime = _T("");
+	m_bakserver1 = _T("");
+	m_bakserver2 = _T("");
+	m_bakserver3 = _T("");
+	m_bakserver4 = _T("");
+	m_bakserver5 = _T("");
+	m_msgaccount = _T("");
+	m_msgpsw = _T("");
+	m_msgused = _T("");
+	m_msgbalance = _T("");
+	m_msgcheck1 = _T("");
+	m_msgcheck2 = _T("");
+	m_msgdays1 = _T("");
+	m_msgdays2 = _T("");
+	m_msgcontent1 = _T("");
+	m_msgcontent2 = _T("");
+	m_remarks = _T("");
+	m_rate = _T("");
+	m_msgcheck3 = _T("");
+	m_msgcontent3 = _T("");
+	m_salarycheck1 = _T("");
+	m_salarycheck2 = _T("");
+	m_msgcheck4 = _T("");
+	m_msgtime = _T("");
+	m_msgphones = _T("");
+	m_info6 = _T("");
+	m_msgcompanyname = _T("");
+	m_msgphones2 = _T("");
+	m_msgsendtype = _T("");
+	m_msgcontent5 = _T("");
+	m_msgcheck5 = _T("");
+	m_msgcontent6 = _T("");
+	m_msgcheck6 = _T("");
+	m_cardlength = "";
+	m_salarycheck3 = _T("");
+	m_salarycheck4 = _T("");
+	m_setcheck1 = _T("");
+	m_setcheck2 = _T("");
+	m_setcheck3 = _T("");
+	m_setcheck4 = _T("");
+	m_setcheck5 = _T("");
+	m_printer1 = _T("");
+	m_printer2 = _T("");
+	m_printer3 = _T("");
+	m_setprintstyle = _T("");
+	m_uploadcheck1 = _T("");
+	m_uploadcheck2 = _T("");
+	m_uploadcheck3 = _T("");
+	m_uploadcheck4 = _T("");
+	m_bak11 = _T("");
+	m_bak22 = _T("");
+	m_bak33 = _T("");
+	m_bak44 = _T("");
+	m_setprintstyle2 = _T("");
+	m_setcheck10 = _T("");
+	m_ziptype1 = _T("");
+	m_ziptype2 = _T("");
+	m_ziptype3 = _T("");
+	m_ziptype4 = _T("");
+	m_salaryset = _T("");
+	m_limitcount1 = _T("");
+	m_limitcount2 = _T("");
+	m_limitcount3 = _T("");
+	m_rate2 = _T("");
+	m_setcheck11 = _T("");
+	m_setcheck12 = _T("");
+	m_setprintstyle3 = _T("");
+	m_msgcheck7 = _T("");
+	m_msgcheck8 = _T("");
+	m_msgcheck9 = _T("");
+	m_msgcheck10 = _T("");
+	m_msgcontent8 = _T("");
+	m_msgcontent9 = _T("");
+	m_msgcontent10 = _T("");
+	m_setcheck13 = _T("");
+	m_time1 = _T("");
+	m_time2 = _T("");
+	m_time3 = _T("");
+	m_setcheck14 = _T("");
+	m_setcheck15 = _T("");
+	m_msgcheck11 = _T("");
+	m_msgcheck12 = _T("");
+	m_msgcheck13 = _T("");
+	m_msgcheck14 = _T("");
+	m_msgcontent11 = _T("");
+	m_msgcontent12 = _T("");
+	m_msgcontent13 = _T("");
+	m_msgcontent14 = _T("");
+	m_setcheck6 = _T("");
+	m_msgcheck15 = _T("");
+	m_msgcontent15 = _T("");
+	m_logdays = _T("");
+	m_setcheck17 = _T("");
+	m_setcheck18 = _T("");
+	m_setcheck19 = _T("");
+	m_uploadrule = _T("");
+	m_setcheck20 = _T("");
+	m_cardnum = _T("");
+	m_cardscale = _T("");
+	m_info7 = _T("");
+	m_setcheck21 = _T("");
+	m_msgcheck16 = _T("");
+	m_hospitalmsgcheck1 = _T("");
+	m_hospitalmsgcheck2 = _T("");
+	m_serialno = _T("");
+	m_serialno2 = _T("");
+	m_msgcheck17 = _T("");
+	m_msgcontent17 = _T("");
+	m_setcheck22 = _T("");
+	m_setcheck23 = _T("");
+	m_info8 = _T("");
+	m_setcheck24 = _T("");
+	m_outtime = _T("");
+	m_info9 = _T("");
+	m_reverse1 = _T("");
+	m_reverse2 = _T("");
+	m_reverse3 = _T("");
+	m_reverse4 = _T("");
+	m_reverse5 = _T("");
+	m_photo;
+	m_delcheck1 = _T("");
+	m_delcheck2 = _T("");
+	m_delcheck3 = _T("");
+	m_delcheck4 = _T("");
+	m_deledit1 = _T("");
+	m_deledit2 = _T("");
+	m_deledit3 = _T("");
+	m_deledit4 = _T("");
+	m_alarmdays1 = _T("");
+	m_alarmdays2 = _T("");
+	m_alarmdays3 = _T("");
+	m_alarmdays4 = _T("");
+	m_alarmdays5 = _T("");
+	m_alarmdays6 = _T("");
+	m_msAccount = _T("");
+	m_msPassword = _T("");
+	m_uVer = 0.0;
+	m_original = FALSE;
+	m_nFields = 159;
+	m_nDefaultType = dynaset;
+}
+////#error 安全问题: 连接字符串可能包含密码。
+// 此连接字符串中可能包含明文密码和/或其他重要
+// 信息。请在查看完此连接字符串并找到所有与安全
+// 有关的问题后移除 //#error。可能需要将此密码存
+// 储为其他格式或使用其他的用户身份验证。
+CString CTblVersion::GetDefaultConnect()
+{
+	return _T("DSN=classic;UID=sa;PWD=ly1234;APP=Microsoft\x00ae Visual Studio\x00ae;WSID=DESKTOP-QLB7UEO;DATABASE=db;");
+}
+
+CString CTblVersion::GetDefaultSQL()
+{
+	return _T("[dbo].[version]");
+}
+
+void CTblVersion::DoFieldExchange(CFieldExchange* pFX)
+{
+	pFX->SetFieldType(CFieldExchange::outputColumn);
+	// RFX_Text() 和 RFX_Int() 这类宏依赖的是
+	// 成员变量的类型,而不是数据库字段的类型。
+	// ODBC 尝试自动将列值转换为所请求的类型
+	RFX_Text(pFX, _T("[version]"), m_version);
+	RFX_Text(pFX, _T("[curdate]"), m_curdate);
+	RFX_Text(pFX, _T("[check1]"), m_check1);
+	RFX_Text(pFX, _T("[check2]"), m_check2);
+	RFX_Text(pFX, _T("[check3]"), m_check3);
+	RFX_Text(pFX, _T("[check4]"), m_check4);
+	RFX_Text(pFX, _T("[edit1]"), m_edit1);
+	RFX_Text(pFX, _T("[edit2]"), m_edit2);
+	RFX_Text(pFX, _T("[edit3]"), m_edit3);
+	RFX_Text(pFX, _T("[edit4]"), m_edit4);
+	RFX_Text(pFX, _T("[info1]"), m_info1);
+	RFX_Text(pFX, _T("[info2]"), m_info2);
+	RFX_Text(pFX, _T("[info3]"), m_info3);
+	RFX_Text(pFX, _T("[info4]"), m_info4);
+	RFX_Text(pFX, _T("[info5]"), m_info5);
+	RFX_Text(pFX, _T("[bak1]"), m_bak1);
+	RFX_Text(pFX, _T("[bak2]"), m_bak2);
+	RFX_Text(pFX, _T("[bak3]"), m_bak3);
+	RFX_Text(pFX, _T("[bak4]"), m_bak4);
+	RFX_Text(pFX, _T("[bak5]"), m_bak5);
+	RFX_Text(pFX, _T("[bak6]"), m_bak6);
+	RFX_Text(pFX, _T("[baktime]"), m_baktime);
+	RFX_Text(pFX, _T("[bakserver1]"), m_bakserver1);
+	RFX_Text(pFX, _T("[bakserver2]"), m_bakserver2);
+	RFX_Text(pFX, _T("[bakserver3]"), m_bakserver3);
+	RFX_Text(pFX, _T("[bakserver4]"), m_bakserver4);
+	RFX_Text(pFX, _T("[bakserver5]"), m_bakserver5);
+	RFX_Text(pFX, _T("[msgaccount]"), m_msgaccount);
+	RFX_Text(pFX, _T("[msgpsw]"), m_msgpsw);
+	RFX_Text(pFX, _T("[msgused]"), m_msgused);
+	RFX_Text(pFX, _T("[msgbalance]"), m_msgbalance);
+	RFX_Text(pFX, _T("[msgcheck1]"), m_msgcheck1);
+	RFX_Text(pFX, _T("[msgcheck2]"), m_msgcheck2);
+	RFX_Text(pFX, _T("[msgdays1]"), m_msgdays1);
+	RFX_Text(pFX, _T("[msgdays2]"), m_msgdays2);
+	RFX_Text(pFX, _T("[msgcontent1]"), m_msgcontent1);
+	RFX_Text(pFX, _T("[msgcontent2]"), m_msgcontent2);
+	RFX_Text(pFX, _T("[remarks]"), m_remarks);
+	RFX_Text(pFX, _T("[rate]"), m_rate);
+	RFX_Text(pFX, _T("[msgcheck3]"), m_msgcheck3);
+	RFX_Text(pFX, _T("[msgcontent3]"), m_msgcontent3);
+	RFX_Text(pFX, _T("[salarycheck1]"), m_salarycheck1);
+	RFX_Text(pFX, _T("[salarycheck2]"), m_salarycheck2);
+	RFX_Text(pFX, _T("[msgcheck4]"), m_msgcheck4);
+	RFX_Text(pFX, _T("[msgtime]"), m_msgtime);
+	RFX_Text(pFX, _T("[msgphones]"), m_msgphones);
+	RFX_Text(pFX, _T("[info6]"), m_info6);
+	RFX_Text(pFX, _T("[msgcompanyname]"), m_msgcompanyname);
+	RFX_Text(pFX, _T("[msgphones2]"), m_msgphones2);
+	RFX_Text(pFX, _T("[msgsendtype]"), m_msgsendtype);
+	RFX_Text(pFX, _T("[msgcontent5]"), m_msgcontent5);
+	RFX_Text(pFX, _T("[msgcheck5]"), m_msgcheck5);
+	RFX_Text(pFX, _T("[msgcontent6]"), m_msgcontent6);
+	RFX_Text(pFX, _T("[msgcheck6]"), m_msgcheck6);
+	RFX_Text(pFX, _T("[cardlength]"), m_cardlength);
+	RFX_Text(pFX, _T("[salarycheck3]"), m_salarycheck3);
+	RFX_Text(pFX, _T("[salarycheck4]"), m_salarycheck4);
+	RFX_Text(pFX, _T("[setcheck1]"), m_setcheck1);
+	RFX_Text(pFX, _T("[setcheck2]"), m_setcheck2);
+	RFX_Text(pFX, _T("[setcheck3]"), m_setcheck3);
+	RFX_Text(pFX, _T("[setcheck4]"), m_setcheck4);
+	RFX_Text(pFX, _T("[setcheck5]"), m_setcheck5);
+	RFX_Text(pFX, _T("[printer1]"), m_printer1);
+	RFX_Text(pFX, _T("[printer2]"), m_printer2);
+	RFX_Text(pFX, _T("[printer3]"), m_printer3);
+	RFX_Text(pFX, _T("[setprintstyle]"), m_setprintstyle);
+	RFX_Text(pFX, _T("[uploadcheck1]"), m_uploadcheck1);
+	RFX_Text(pFX, _T("[uploadcheck2]"), m_uploadcheck2);
+	RFX_Text(pFX, _T("[uploadcheck3]"), m_uploadcheck3);
+	RFX_Text(pFX, _T("[uploadcheck4]"), m_uploadcheck4);
+	RFX_Text(pFX, _T("[bak11]"), m_bak11);
+	RFX_Text(pFX, _T("[bak22]"), m_bak22);
+	RFX_Text(pFX, _T("[bak33]"), m_bak33);
+	RFX_Text(pFX, _T("[bak44]"), m_bak44);
+	RFX_Text(pFX, _T("[setprintstyle2]"), m_setprintstyle2);
+	RFX_Text(pFX, _T("[setcheck10]"), m_setcheck10);
+	RFX_Text(pFX, _T("[ziptype1]"), m_ziptype1);
+	RFX_Text(pFX, _T("[ziptype2]"), m_ziptype2);
+	RFX_Text(pFX, _T("[ziptype3]"), m_ziptype3);
+	RFX_Text(pFX, _T("[ziptype4]"), m_ziptype4);
+	RFX_Text(pFX, _T("[salaryset]"), m_salaryset);
+	RFX_Text(pFX, _T("[limitcount1]"), m_limitcount1);
+	RFX_Text(pFX, _T("[limitcount2]"), m_limitcount2);
+	RFX_Text(pFX, _T("[limitcount3]"), m_limitcount3);
+	RFX_Text(pFX, _T("[rate2]"), m_rate2);
+	RFX_Text(pFX, _T("[setcheck11]"), m_setcheck11);
+	RFX_Text(pFX, _T("[setcheck12]"), m_setcheck12);
+	RFX_Text(pFX, _T("[setprintstyle3]"), m_setprintstyle3);
+	RFX_Text(pFX, _T("[msgcheck7]"), m_msgcheck7);
+	RFX_Text(pFX, _T("[msgcheck8]"), m_msgcheck8);
+	RFX_Text(pFX, _T("[msgcheck9]"), m_msgcheck9);
+	RFX_Text(pFX, _T("[msgcheck10]"), m_msgcheck10);
+	RFX_Text(pFX, _T("[msgcontent8]"), m_msgcontent8);
+	RFX_Text(pFX, _T("[msgcontent9]"), m_msgcontent9);
+	RFX_Text(pFX, _T("[msgcontent10]"), m_msgcontent10);
+	RFX_Text(pFX, _T("[setcheck13]"), m_setcheck13);
+	RFX_Text(pFX, _T("[time1]"), m_time1);
+	RFX_Text(pFX, _T("[time2]"), m_time2);
+	RFX_Text(pFX, _T("[time3]"), m_time3);
+	RFX_Text(pFX, _T("[setcheck14]"), m_setcheck14);
+	RFX_Text(pFX, _T("[setcheck15]"), m_setcheck15);
+	RFX_Text(pFX, _T("[msgcheck11]"), m_msgcheck11);
+	RFX_Text(pFX, _T("[msgcheck12]"), m_msgcheck12);
+	RFX_Text(pFX, _T("[msgcheck13]"), m_msgcheck13);
+	RFX_Text(pFX, _T("[msgcheck14]"), m_msgcheck14);
+	RFX_Text(pFX, _T("[msgcontent11]"), m_msgcontent11);
+	RFX_Text(pFX, _T("[msgcontent12]"), m_msgcontent12);
+	RFX_Text(pFX, _T("[msgcontent13]"), m_msgcontent13);
+	RFX_Text(pFX, _T("[msgcontent14]"), m_msgcontent14);
+	RFX_Text(pFX, _T("[setcheck6]"), m_setcheck6);
+	RFX_Text(pFX, _T("[msgcheck15]"), m_msgcheck15);
+	RFX_Text(pFX, _T("[msgcontent15]"), m_msgcontent15);
+	RFX_Text(pFX, _T("[logdays]"), m_logdays);
+	RFX_Text(pFX, _T("[setcheck17]"), m_setcheck17);
+	RFX_Text(pFX, _T("[setcheck18]"), m_setcheck18);
+	RFX_Text(pFX, _T("[setcheck19]"), m_setcheck19);
+	RFX_Text(pFX, _T("[uploadrule]"), m_uploadrule);
+	RFX_Text(pFX, _T("[setcheck20]"), m_setcheck20);
+	RFX_Text(pFX, _T("[cardnum]"), m_cardnum);
+	RFX_Text(pFX, _T("[cardscale]"), m_cardscale);
+	RFX_Text(pFX, _T("[info7]"), m_info7);
+	RFX_Text(pFX, _T("[setcheck21]"), m_setcheck21);
+	RFX_Text(pFX, _T("[msgcheck16]"), m_msgcheck16);
+	RFX_Text(pFX, _T("[hospitalmsgcheck1]"), m_hospitalmsgcheck1);
+	RFX_Text(pFX, _T("[hospitalmsgcheck2]"), m_hospitalmsgcheck2);
+	RFX_Text(pFX, _T("[serialno]"), m_serialno);
+	RFX_Text(pFX, _T("[serialno2]"), m_serialno2);
+	RFX_Text(pFX, _T("[msgcheck17]"), m_msgcheck17);
+	RFX_Text(pFX, _T("[msgcontent17]"), m_msgcontent17);
+	RFX_Text(pFX, _T("[setcheck22]"), m_setcheck22);
+	RFX_Text(pFX, _T("[setcheck23]"), m_setcheck23);
+	RFX_Text(pFX, _T("[info8]"), m_info8);
+	RFX_Text(pFX, _T("[setcheck24]"), m_setcheck24);
+	RFX_Text(pFX, _T("[outtime]"), m_outtime);
+	RFX_Text(pFX, _T("[info9]"), m_info9);
+	RFX_Text(pFX, _T("[reverse1]"), m_reverse1);
+	RFX_Text(pFX, _T("[reverse2]"), m_reverse2);
+	RFX_Text(pFX, _T("[reverse3]"), m_reverse3);
+	RFX_Text(pFX, _T("[reverse4]"), m_reverse4);
+	RFX_Text(pFX, _T("[reverse5]"), m_reverse5);
+	RFX_LongBinary(pFX, _T("[photo]"), m_photo);
+	RFX_Text(pFX, _T("[delcheck1]"), m_delcheck1);
+	RFX_Text(pFX, _T("[delcheck2]"), m_delcheck2);
+	RFX_Text(pFX, _T("[delcheck3]"), m_delcheck3);
+	RFX_Text(pFX, _T("[delcheck4]"), m_delcheck4);
+	RFX_Text(pFX, _T("[deledit1]"), m_deledit1);
+	RFX_Text(pFX, _T("[deledit2]"), m_deledit2);
+	RFX_Text(pFX, _T("[deledit3]"), m_deledit3);
+	RFX_Text(pFX, _T("[deledit4]"), m_deledit4);
+	RFX_Text(pFX, _T("[alarmdays1]"), m_alarmdays1);
+	RFX_Text(pFX, _T("[alarmdays2]"), m_alarmdays2);
+	RFX_Text(pFX, _T("[alarmdays3]"), m_alarmdays3);
+	RFX_Text(pFX, _T("[alarmdays4]"), m_alarmdays4);
+	RFX_Text(pFX, _T("[alarmdays5]"), m_alarmdays5);
+	RFX_Text(pFX, _T("[alarmdays6]"), m_alarmdays6);
+	RFX_Text(pFX, _T("[msAccount]"), m_msAccount);
+	RFX_Text(pFX, _T("[msPassword]"), m_msPassword);
+	RFX_Single(pFX, _T("[uVer]"), m_uVer);
+	RFX_Bool(pFX, _T("[original]"), m_original);
+
+}
+/////////////////////////////////////////////////////////////////////////////
+// CTblVersion 诊断
+
+#ifdef _DEBUG
+void CTblVersion::AssertValid() const
+{
+	CRecordset::AssertValid();
+}
+
+void CTblVersion::Dump(CDumpContext& dc) const
+{
+	CRecordset::Dump(dc);
+}
+#endif //_DEBUG
+
+

+ 199 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/TblVersion.h

@@ -0,0 +1,199 @@
+// TblVersion.h : CTblVersion 的声明
+
+#pragma once
+
+// 代码生成在 2018年04月24日, 14:50
+
+class CTblVersion : public CRecordset
+{
+public:
+	CTblVersion(CDatabase* pDatabase = NULL);
+	DECLARE_DYNAMIC(CTblVersion)
+
+	// 字段/参数数据
+
+	// 以下字符串类型(如果存在)反映数据库字段(ANSI 数据类型的 CStringA 和 Unicode
+	// 数据类型的 CString)的实际数据类型。
+	//  这是为防止 ODBC 驱动程序执行可能
+	// 不必要的转换。如果希望,可以将这些成员更改为
+	// CString 类型,ODBC 驱动程序将执行所有必要的转换。
+	// (注意: 必须使用 3.5 版或更高版本的 ODBC 驱动程序
+	// 以同时支持 Unicode 和这些转换)。
+
+	CString	m_version;
+	CStringA	m_curdate;
+	CString	m_check1;
+	CString	m_check2;
+	CString	m_check3;
+	CString	m_check4;
+	CString	m_edit1;
+	CString	m_edit2;
+	CString	m_edit3;
+	CString	m_edit4;
+	CString	m_info1;
+	CString	m_info2;
+	CString	m_info3;
+	CString	m_info4;
+	CString	m_info5;
+	CString	m_bak1;
+	CString	m_bak2;
+	CString	m_bak3;
+	CString	m_bak4;
+	CString	m_bak5;
+	CString	m_bak6;
+	CString	m_baktime;
+	CString	m_bakserver1;
+	CString	m_bakserver2;
+	CString	m_bakserver3;
+	CString	m_bakserver4;
+	CString	m_bakserver5;
+	CString	m_msgaccount;
+	CString	m_msgpsw;
+	CString	m_msgused;
+	CString	m_msgbalance;
+	CString	m_msgcheck1;
+	CString	m_msgcheck2;
+	CString	m_msgdays1;
+	CString	m_msgdays2;
+	CString	m_msgcontent1;
+	CString	m_msgcontent2;
+	CString	m_remarks;
+	CString	m_rate;
+	CString	m_msgcheck3;
+	CString	m_msgcontent3;
+	CString	m_salarycheck1;
+	CString	m_salarycheck2;
+	CString	m_msgcheck4;
+	CString	m_msgtime;
+	CString	m_msgphones;
+	CString	m_info6;
+	CString	m_msgcompanyname;
+	CString	m_msgphones2;
+	CString	m_msgsendtype;
+	CString	m_msgcontent5;
+	CString	m_msgcheck5;
+	CString	m_msgcontent6;
+	CString	m_msgcheck6;
+	CStringA	m_cardlength;
+	CString	m_salarycheck3;
+	CString	m_salarycheck4;
+	CString	m_setcheck1;
+	CString	m_setcheck2;
+	CString	m_setcheck3;
+	CString	m_setcheck4;
+	CString	m_setcheck5;
+	CString	m_printer1;
+	CString	m_printer2;
+	CString	m_printer3;
+	CString	m_setprintstyle;
+	CString	m_uploadcheck1;
+	CString	m_uploadcheck2;
+	CString	m_uploadcheck3;
+	CString	m_uploadcheck4;
+	CString	m_bak11;
+	CString	m_bak22;
+	CString	m_bak33;
+	CString	m_bak44;
+	CString	m_setprintstyle2;
+	CString	m_setcheck10;
+	CString	m_ziptype1;
+	CString	m_ziptype2;
+	CString	m_ziptype3;
+	CString	m_ziptype4;
+	CString	m_salaryset;
+	CString	m_limitcount1;
+	CString	m_limitcount2;
+	CString	m_limitcount3;
+	CString	m_rate2;
+	CString	m_setcheck11;
+	CString	m_setcheck12;
+	CString	m_setprintstyle3;
+	CString	m_msgcheck7;
+	CString	m_msgcheck8;
+	CString	m_msgcheck9;
+	CString	m_msgcheck10;
+	CString	m_msgcontent8;
+	CString	m_msgcontent9;
+	CString	m_msgcontent10;
+	CString	m_setcheck13;
+	CString	m_time1;
+	CString	m_time2;
+	CString	m_time3;
+	CString	m_setcheck14;
+	CString	m_setcheck15;
+	CString	m_msgcheck11;
+	CString	m_msgcheck12;
+	CString	m_msgcheck13;
+	CString	m_msgcheck14;
+	CString	m_msgcontent11;
+	CString	m_msgcontent12;
+	CString	m_msgcontent13;
+	CString	m_msgcontent14;
+	CString	m_setcheck6;
+	CString	m_msgcheck15;
+	CString	m_msgcontent15;
+	CString	m_logdays;
+	CString	m_setcheck17;
+	CString	m_setcheck18;
+	CString	m_setcheck19;
+	CString	m_uploadrule;
+	CString	m_setcheck20;
+	CString	m_cardnum;
+	CString	m_cardscale;
+	CString	m_info7;
+	CString	m_setcheck21;
+	CString	m_msgcheck16;
+	CString	m_hospitalmsgcheck1;
+	CString	m_hospitalmsgcheck2;
+	CString	m_serialno;
+	CString	m_serialno2;
+	CString	m_msgcheck17;
+	CString	m_msgcontent17;
+	CString	m_setcheck22;
+	CString	m_setcheck23;
+	CString	m_info8;
+	CString	m_setcheck24;
+	CString	m_outtime;
+	CString	m_info9;
+	CString	m_reverse1;
+	CString	m_reverse2;
+	CString	m_reverse3;
+	CString	m_reverse4;
+	CString	m_reverse5;
+	CLongBinary	m_photo;
+	CString	m_delcheck1;
+	CString	m_delcheck2;
+	CString	m_delcheck3;
+	CString	m_delcheck4;
+	CString	m_deledit1;
+	CString	m_deledit2;
+	CString	m_deledit3;
+	CString	m_deledit4;
+	CString	m_alarmdays1;
+	CString	m_alarmdays2;
+	CString	m_alarmdays3;
+	CString	m_alarmdays4;
+	CString	m_alarmdays5;
+	CString	m_alarmdays6;
+	CString	m_msAccount;
+	CString	m_msPassword;
+	float	m_uVer;
+	BOOL	m_original;
+
+	// 重写
+		// 向导生成的虚函数重写
+public:
+	virtual CString GetDefaultConnect();	// 默认连接字符串
+
+	virtual CString GetDefaultSQL(); 	// 记录集的默认 SQL
+	virtual void DoFieldExchange(CFieldExchange* pFX);	// RFX 支持
+
+// 实现
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+};
+
+

+ 7785 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.cpp

@@ -0,0 +1,7785 @@
+#include "stdafx.h"
+#include "c2p.h"
+#include "des.h"
+
+/************************************************************************/
+/*  函数:全局的Lambda表达式[4/27/2018 Jeff];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+auto CusName = [](_RecordsetPtr ptr, const TCHAR* field, _variant_t val) {
+	// 姓名和拼音长度为20;
+	int nlen = _tcslen(val.bstrVal);
+	if (nlen > 20)
+		ptr->PutCollect(field, _variant_t(CString(val.bstrVal).Left(20)));
+	else
+		ptr->PutCollect(field, val);
+};
+
+auto VARINT = [](_variant_t var)->_variant_t {
+	_variant_t result = 0;
+	if (var.vt == VT_BSTR)
+	{
+		if (_tcscmp(var.bstrVal, _T("")) != 0)
+			result.intVal = _ttoi(var.bstrVal);
+	}
+
+	return result;
+};
+
+auto VARBSTR = [](_variant_t var)->_variant_t {
+	if (var.vt == VT_NULL)
+		var.bstrVal = _T("");
+
+	return var;
+};
+
+auto VARDATENULL = [](_variant_t var)->_variant_t {
+	if (var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) == 0)
+	{
+		var.vt = VT_DATE;
+		var.date = -1;
+		return var;
+	}
+
+	return String2Date(var.bstrVal);
+};
+
+auto DATENULL = [](_RecordsetPtr &set, TCHAR *pId, _variant_t var) {
+	if (var.vt != VT_NULL && var.vt != VT_EMPTY && _tcscmp(var.bstrVal, _T("")) != 0)
+	{
+		DATE dt = String2Date(var.bstrVal);
+
+		if (dt > 0) //1899年;
+			set->PutCollect(pId, String2Date(var.bstrVal));
+	}
+};
+
+auto DATENULL2 = [](_RecordsetPtr &set, TCHAR *pId, _variant_t var) {
+	if (var.vt != VT_NULL && var.vt != VT_EMPTY && _tcscmp(var.bstrVal, _T("")) != 0)
+	{
+		COleDateTime curdate = COleDateTime::GetCurrentTime();
+		DATE dt = String2Date(var.bstrVal);
+
+		if (dt > 0)
+		{ //1899年;
+			if (dt < curdate.m_dt)
+				set->PutCollect(pId, String2Date(var.bstrVal));
+		}
+	}
+};
+
+auto PRICENULL = [](_RecordsetPtr &set, TCHAR *pId, _variant_t var) {
+	if (var.vt != VT_NULL && var.vt != VT_EMPTY && _tcscmp(var.bstrVal, _T("")) != 0)
+	{
+		if (_tcslen(var.bstrVal) > 8)
+			set->PutCollect(pId, 0);
+		else
+			set->PutCollect(pId, _ttof(var.bstrVal));
+	}
+	else
+	{
+		set->PutCollect(pId, 0);
+	}
+};
+
+auto MKDIR = [](LPCTSTR dir) {
+	//////////////////////////////////////////////////////////////////////////
+	// 创建目录;
+	int nleft = 0;
+	int nIndex = -1;
+	TString strdir = dir;
+
+	if (strdir.at(strdir.size() - 1) != _T('\\'))
+		strdir.append(_T("\\"));
+
+	// 共享路径和硬盘盘符;
+	if (_tcscmp(strdir.substr(0, 2).c_str(), _T("\\\\")) == 0)
+		nleft = strdir.find_first_of(_T("\\"), 2) + 1;	// 去除共享主机名;
+	else if (strdir.at(2) == _T('\\'))
+		nleft = 3;
+
+	do
+	{
+		nIndex = strdir.substr(nleft, -1).find_first_of(_T("\\"));
+
+		if (nIndex != TString::npos)
+		{
+			if (_tmkdir(strdir.substr(0, nIndex + nleft).c_str()) == -1 && (errno != EEXIST))
+			{
+				WriteTextLog(_T("创建目录失败:%s,错误码:%d"), strdir.substr(0, nIndex + nleft).c_str(), errno);
+				break;
+			}
+
+			nleft += nIndex + 1;
+		}
+	} while (nIndex != -1);
+};
+
+// from 和 to, 不要以 '\\'结尾;
+auto COPYFOLDER = [](LPCTSTR from, LPCTSTR to)->BOOL {
+	if (to == NULL || from == NULL || !PathFileExists(from))
+		return FALSE;
+
+	// 创建目录;
+	MKDIR(to);
+
+	//////////////////////////////////////////////////////////////////////////
+	// 复制文件;
+	filehelpImpl filehelper;
+	STR_VEC vtfiles;
+
+	if (filehelper.getfiles_findin_subfolder(from, _T("*.*"), &vtfiles))
+	{
+		int nIndex = 0;
+		TString strnew;
+
+		for (TString file : vtfiles)
+		{
+			strnew = file;
+			nIndex = strnew.find_last_of(_T('\\'));
+
+			if (nIndex != TString::npos)
+			{
+				// 是否是ok,modifytime文件;
+				if (_tcsicmp(strnew.substr(nIndex + 1, -1).c_str(), _T("ok")) == 0 || _tcsicmp(strnew.substr(nIndex + 1, -1).c_str(), _T("modifytime")) == 0 || _tcsicmp(strnew.substr(nIndex + 1, -1).c_str(), _T("thumbs.db")) == 0)
+				{
+					continue;
+				}
+
+				// 是否是s,或m文件;
+				if (strnew.substr(nIndex + 1, -1).at(0) == _T('s') || strnew.substr(nIndex + 1, -1).at(0) == _T('m'))
+				{
+					strnew.erase(nIndex + 1, 1);
+
+					bool bexists = false;
+
+					for (TString item : vtfiles)
+					{
+						//if (strnew.compare(item) == 0 )
+						if (_tcsicmp(strnew.c_str(), item.c_str()) == 0)
+						{ // 不区分大小写;
+							bexists = true;
+							break;
+						}
+					}
+
+					if (bexists)
+						continue;
+				}
+			}
+
+			strnew = to;
+			nIndex = file.find(from);
+
+			if (nIndex != TString::npos)
+			{
+				// 复制文件;
+				strnew.append(file.substr(nIndex + _tcslen(from)));
+				nIndex = strnew.find_last_of(_T('\\'));
+				strnew.insert(nIndex + 1, _T("Original_"));
+				// mkdir;
+				nIndex = strnew.find_last_of(_T('\\'));
+				MKDIR(strnew.substr(0, nIndex).c_str());
+
+				// copy;
+				if (CopyFile(file.c_str(), strnew.c_str(), FALSE) == FALSE)
+				{
+					DWORD dwError = GetLastError();
+					WriteTextLog(_T("%s=>%s,%s"), file.c_str(), strnew.c_str(), GetErrorInfo(dwError));
+				}
+			}
+		}
+	}
+
+	return TRUE;
+};
+
+auto RENAMEFILE = [](CString from, CString to)->BOOL {
+	SHFILEOPSTRUCT FileOp = { 0 };
+	FileOp.fFlags = FOF_NOCONFIRMATION;   //不出现确认对话框
+	FileOp.pFrom = from + _T("/0/0");
+	FileOp.pTo = to + _T("/0/0");
+	FileOp.wFunc = FO_RENAME;
+	int nResult = SHFileOperation(&FileOp);
+
+	if (nResult != 0)
+	{
+		WriteTextLog(_T("复制文件夹出错:%ld,%ld"), nResult, GetLastError());
+	}
+
+	return nResult == 0;
+};
+
+#define AddColumn _T(" IF NOT EXISTS (SELECT * FROM sys.syscolumns WHERE id = OBJECT_ID(N'[dbo].[%s]') AND name = N'%s') \
+ALTER TABLE [dbo].[%s] ADD %s ")
+
+c2p::c2p() : m_pClassicConnection(nullptr), m_pPlatinumConnection(nullptr)
+{
+	m_strClassicDomain = _T("");
+}
+
+
+c2p::~c2p()
+{
+	if (m_pPlatinumConnection != nullptr) m_pPlatinumConnection->Close(), m_pPlatinumConnection.Release(), m_pPlatinumConnection = nullptr;
+
+	if (m_pClassicConnection != nullptr) m_pClassicConnection->Close(), m_pClassicConnection.Release(), m_pClassicConnection = nullptr;
+
+	::CoUninitialize();
+}
+
+bool c2p::InitAdoClassic()
+{
+	if (m_pClassicConnection == nullptr)
+	{
+		try
+		{
+			m_pClassicConnection.CreateInstance(__uuidof(Connection));
+			m_pClassicConnection->PutConnectionTimeout(60);
+			HRESULT hr = m_pClassicConnection->Open(_bstr_t(g_szAdoClassicConnectString), "", "", adModeUnknown);
+
+			return SUCCEEDED(hr);
+		}
+		catch (_com_error &e)
+		{
+			_bstr_t bstrSource(e.Source());
+			_bstr_t bstrDescription(e.Description());
+			WriteTextLog(_T("经典版初始化:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+		}
+	}
+
+	return false;
+}
+
+bool c2p::InitAdoPlatinum()
+{
+	if (m_pPlatinumConnection == nullptr)
+	{
+		try
+		{
+			m_pPlatinumConnection.CreateInstance(__uuidof(Connection));
+			m_pPlatinumConnection->PutConnectionTimeout(60);
+			HRESULT hr = m_pPlatinumConnection->Open(_bstr_t(g_szAdoPlatinumConnectString), "", "", adModeUnknown);
+
+			return SUCCEEDED(hr);
+		}
+		catch (_com_error &e)
+		{
+			_bstr_t bstrSource(e.Source());
+			_bstr_t bstrDescription(e.Description());
+			WriteTextLog(_T("铂金版初始化:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+		}
+	}
+
+	return false;
+}
+
+void c2p::MustAlterPlatinum()
+{
+	if (m_pPlatinumConnection)
+	{
+		try
+		{
+			CString strSql = _T("");
+#if 0// 错误方式留记;
+			// 执行某些非查询的sql语句不能用下面代码;
+			CString strSql = _T("");
+			VARIANT RecordsAffected;
+			m_pPlatinumConnection->Execute(_T("ALTER TABLE [tb_ErpOrder] ALTER COLUMN [Ord_Remark][nvarchar](max) NULL"), &RecordsAffected, adCmdUnknown);
+
+			// 插入字段c2p_order;
+			strSql.Format(AddColumn, _T("tb_ErpCustomerGroup"), _T("c2p_order"), _T("tb_ErpCustomerGroup"), _T("[c2p_order][nvarchar](50) NULL"));
+			m_pPlatinumConnection->Execute(_bstr_t(strSql), &RecordsAffected, adCmdUnknown);
+#endif
+			_CommandPtr m_pCommand;
+			m_pCommand.CreateInstance(__uuidof(Command));
+			// 将库连接赋于它;
+			m_pCommand->ActiveConnection = m_pPlatinumConnection;
+			// SQL语句;
+			m_pCommand->CommandText = _T("ALTER TABLE [tb_ErpOrder] ALTER COLUMN [Ord_Remark][nvarchar](max) NULL");
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// SQL语句;
+			strSql.Format(AddColumn, _T("tb_ErpCustomerGroup"), _T("c2p_order"), _T("tb_ErpCustomerGroup"), _T("[c2p_order][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// SQL语句;
+			m_pCommand->CommandText = _T("ALTER TABLE [tb_ErpCustomer] ALTER COLUMN [Cus_QQ][nvarchar](30) NULL");
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			//[tb_ErpPayment]
+			// SQL语句;
+			strSql.Format(AddColumn, _T("tb_ErpPayment"), _T("c2p_order"), _T("tb_ErpPayment"), _T("[c2p_order][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			strSql.Format(AddColumn, _T("tb_ErpProduct"), _T("c2p_spid"), _T("tb_ErpProduct"), _T("[c2p_spid][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			strSql.Format(AddColumn, _T("tb_ErpOrder"), _T("c2p_status"), _T("tb_ErpOrder"), _T("[c2p_status][int] NULL"));//用于是否转相片;
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// tb_ErpOrder;
+			strSql.Format(AddColumn, _T("tb_ErpOrder"), _T("c2p_order"), _T("tb_ErpOrder"), _T("[c2p_order][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// 增加字段c2p_jdid;
+			strSql.Format(AddColumn, _T("tb_ErpTheScenery"), _T("c2p_jdid"), _T("tb_ErpTheScenery"), _T("[c2p_jdid][nvarchar](30) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// 增加字段c2p_taoxiid;
+			strSql.Format(AddColumn, _T("tb_ErpPackages"), _T("c2p_taoxiid"), _T("tb_ErpPackages"), _T("[c2p_taoxiid][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// 插入字段c2p_order;
+			strSql.Format(AddColumn, _T("tb_ErpOrder"), _T("c2p_order"), _T("tb_ErpOrder"), _T("[c2p_order][nvarchar](50) NULL"));
+			m_pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+
+			// SQL语句;
+			m_pCommand->CommandText = _T("ALTER TABLE [tb_ErpOrderDigital] ALTER COLUMN [Ordv_LookDesignClaim][nvarchar](2048) NULL");
+			// 执行SQL语句,返回记录集
+			m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+		}
+		catch (_com_error &e)
+		{
+			_bstr_t bstrSource(e.Source());
+			_bstr_t bstrDescription(e.Description());
+			WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+		}
+	}
+
+	if (m_pClassicConnection)
+	{
+		try
+		{
+			CString strSql = _T("");
+			_CommandPtr pCommand;
+			pCommand.CreateInstance(__uuidof(Command));
+			pCommand->ActiveConnection = m_pClassicConnection;
+
+			strSql.Format(AddColumn, _T("dindan"), _T("c2p_status"), _T("dindan"), _T("[c2p_status][int] NULL"));//用于是否转相片;
+			pCommand->CommandText = _bstr_t(strSql);
+			// 执行SQL语句,返回记录集
+			pCommand->Execute(NULL, NULL, adCmdText);
+		}
+		catch (_com_error &e)
+		{
+			_bstr_t bstrSource(e.Source());
+			_bstr_t bstrDescription(e.Description());
+			WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+		}
+	}
+}
+
+_variant_t c2p::c2pGetEmployeeId(_variant_t employeeName)
+{
+	CString strSql;
+	_RecordsetPtr rs;
+	rs.CreateInstance(__uuidof(Recordset));
+	strSql.Format(_T("select User_EmployeeID from tb_ErpUser where User_Name = '%s'"), employeeName.bstrVal);
+	HRESULT hr = rs->Open(_bstr_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+	if (FAILED(hr) || rs->adoEOF == VARIANT_TRUE)
+	{
+		rs->Close();
+		return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+	}
+
+	_variant_t var = rs->GetCollect(_T("User_EmployeeID"));
+	rs->Close();
+
+	return var;
+}
+
+_variant_t c2p::c2pGetGroupId(_variant_t & c2p_order)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsGroup;
+		rsGroup.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from tb_ErpCustomerGroup where GP_OrderNumber = '%s%s'"), Global::g_szClassicBranchId, c2p_order.bstrVal);
+		HRESULT hr = rsGroup->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsGroup->adoEOF == VARIANT_TRUE)
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+
+			return rsGroup->GetCollect(_T("GP_CustomerGroupID"));
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetCustomerId(_variant_t & varTelphone)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsCustomer;
+		// 创建实例;
+		rsCustomer.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpCustomer] WHERE Cus_Telephone = '%s'"), varTelphone.bstrVal);
+		HRESULT hr = rsCustomer->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsCustomer->adoEOF == VARIANT_TRUE)
+			{
+				rsCustomer->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t CustomerId = rsCustomer->GetCollect(_T("Cus_CustomerNumber"));
+			rsCustomer->Close();
+			return CustomerId;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetProductId(_variant_t & varGoodsName)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsGoods;
+		// 创建实例;
+		rsGoods.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpProduct] WHERE Prod_Name = '%s'"), varGoodsName.bstrVal);
+		HRESULT hr = rsGoods->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsGoods->adoEOF == VARIANT_TRUE)
+			{
+				rsGoods->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t GoodId = rsGoods->GetCollect(_T("Prod_Number"));
+			rsGoods->Close();
+			return GoodId;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetOrderProductUId(_variant_t & varGoodsName, _variant_t &varViceNumber)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsGoods;
+		// 创建实例;
+		rsGoods.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpOrderProductList] WHERE OPlist_ViceNumber = '%s'  and OPlist_ProdName = '%s'"), varViceNumber.bstrVal, varGoodsName.bstrVal);
+		HRESULT hr = rsGoods->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsGoods->adoEOF == VARIANT_TRUE)
+			{
+				rsGoods->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t GoodUId = rsGoods->GetCollect(_T("OPlist_UniquelyIdentity"));
+			rsGoods->Close();
+			return GoodUId;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetPaymentMethodClass(_variant_t & varPaymentName)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsPayment;
+		// 创建实例;
+		rsPayment.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpSystemCategory] WHERE Sc_ClassCode = 'BEBACCAFCCEAGAIHH' and Sc_ClassName = '%s'"), varPaymentName.bstrVal);
+		HRESULT hr = rsPayment->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsPayment->adoEOF == VARIANT_TRUE)
+			{
+				rsPayment->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t paymentClass = rsPayment->GetCollect(_T("Sc_ClassCode"));
+			rsPayment->Close();
+			return paymentClass;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetScenicSpotByViceNumber(_variant_t & varViceNumber)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsScenicSpot;
+		// 创建实例;
+		rsScenicSpot.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpOrdersPhotography] WHERE Ordpg_ViceNumber = '%s'"), varViceNumber.bstrVal);
+		HRESULT hr = rsScenicSpot->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsScenicSpot->adoEOF == VARIANT_TRUE)
+			{
+				rsScenicSpot->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t ScenicSpot = rsScenicSpot->GetCollect(_T("Ordpg_Sights"));
+			rsScenicSpot->Close();
+			return ScenicSpot;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetOrderStatus(_variant_t & c2p_order)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsOrder;
+		// 创建实例;
+		rsOrder.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT * FROM [tb_ErpOrder] WHERE Ord_Number = '%s%s'"), Global::g_szClassicBranchId, c2p_order.bstrVal);
+		HRESULT hr = rsOrder->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsOrder->adoEOF == VARIANT_TRUE)
+			{
+				rsOrder->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t varStatus = rsOrder->GetCollect(_T("c2p_status"));
+			rsOrder->Close();
+			return varStatus;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+_variant_t c2p::c2pGetOrderNumber(_variant_t & varClassicOrder)
+{
+	try
+	{
+		CString strSql;
+		CString strOrderNumber;
+		_RecordsetPtr rsOrder;
+		// 创建实例;
+		rsOrder.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strOrderNumber.Format(_T("%s%s"), Global::g_szClassicBranchId, varClassicOrder.bstrVal);
+		strSql.Format(_T("SELECT Ord_Number FROM [tb_ErpOrder] WHERE Ord_Number = '%s'"), strOrderNumber);
+		HRESULT hr = rsOrder->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsOrder->adoEOF == VARIANT_TRUE)
+			{
+				rsOrder->Close();
+				return _variant_t();//如果要返回空的使用_variant_t();不要返回VT_NULL,这样会赋值;
+			}
+
+			_variant_t varOrderNumber = rsOrder->GetCollect(_T("Ord_Number"));
+			rsOrder->Close();
+			return varOrderNumber;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _variant_t();
+}
+
+bool c2p::c2pOrderNumberExists(_variant_t & varPlatinumOrder)
+{
+	try
+	{
+		bool result = false;
+		CString strSql;
+		_RecordsetPtr rsOrder;
+		// 创建实例;
+		rsOrder.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("SELECT Ord_Number FROM [tb_ErpOrder] WHERE Ord_Number = '%s'"), varPlatinumOrder.bstrVal);
+		HRESULT hr = rsOrder->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsOrder->adoEOF == VARIANT_TRUE)
+				result = false;
+			else
+				result = true;
+
+			rsOrder->Close();
+			return result;
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return false;
+}
+
+_RecordsetPtr c2p::c2pQueryExspcits(CString strSql, _ConnectionPtr pConnection)
+{
+	try
+	{
+		VARIANT RecordsAffected;
+		_CommandPtr pCommand;
+		pCommand.CreateInstance(__uuidof(Command));
+		pCommand->ActiveConnection = pConnection;
+		pCommand->CommandText = _bstr_t(strSql);
+		return pCommand->Execute(NULL, NULL, adCmdText);
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return _RecordsetPtr();
+}
+
+void c2p::c2pOrderSingles(_variant_t & varOrder, _variant_t & varEmployeeId, _variant_t & varEmployeeId2, _RecordsetPtr pcRecordSet)
+{
+	CString strSql;
+	_variant_t RecordsAffected;
+	_variant_t ren = pcRecordSet->GetCollect(_T("ren"));
+	_variant_t ren2 = pcRecordSet->GetCollect(_T("ren2"));
+	_variant_t time = pcRecordSet->GetCollect(_T("time1"));
+
+	// 主门市;
+	if (ren.vt != VT_NULL && ren.vt != VT_EMPTY && _tcscmp(ren.bstrVal, _T("")) != 0)
+	{
+		if (varEmployeeId.vt != VT_NULL && varEmployeeId.vt != VT_EMPTY && _tcscmp(varEmployeeId.bstrVal, _T("")) != 0)
+		{
+			strSql.Format(_T("select * from tb_ErpOrdersPerson where OrdPe_Type = '0' and OrdPe_OrderNumber='%s' and OrdPe_OrdersPerson='%s'"), varOrder.bstrVal, varEmployeeId.bstrVal);
+			_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+			if (result == NULL || result->adoEOF == VARIANT_TRUE)
+			{
+				// 有些订单的员工,可以被删除了;
+				strSql.Format(_T("insert tb_ErpOrdersPerson(OrdPe_OrderNumber,\
+										OrdPe_OrdersPerson,OrdPe_Type,OrdPe_CreateDateTime) \
+										values('%s','%s','0','%s')"),
+					varOrder.bstrVal, varEmployeeId.bstrVal, time.bstrVal);
+				m_pRecordset = m_pPlatinumConnection->Execute(_bstr_t(strSql), &RecordsAffected, adCmdText);
+				// 不管结果;
+			}
+		}
+	}
+
+	// 副门市;
+	if (ren2.vt != VT_NULL && ren2.vt != VT_EMPTY && _tcscmp(ren2.bstrVal, _T("")) != 0)
+	{
+		if (varEmployeeId2.vt != VT_NULL && varEmployeeId2.vt != VT_EMPTY && _tcscmp(varEmployeeId2.bstrVal, _T("")) != 0)
+		{
+			strSql.Format(_T("select * from tb_ErpOrdersPerson where OrdPe_Type = '1' and  OrdPe_OrderNumber='%s' and OrdPe_OrdersPerson='%s'"), varOrder.bstrVal, varEmployeeId2.bstrVal);
+			_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+			if (result == NULL || result->adoEOF == VARIANT_TRUE)
+			{
+				// 有些订单的员工,可以被删除了;
+				strSql.Format(_T("insert tb_ErpOrdersPerson(OrdPe_OrderNumber,\
+										OrdPe_OrdersPerson,OrdPe_Type,OrdPe_CreateDateTime) \
+										values('%s','%s','1','%s')"),
+					varOrder.bstrVal, varEmployeeId2.bstrVal, time.bstrVal);
+				m_pRecordset = m_pPlatinumConnection->Execute(_bstr_t(strSql), &RecordsAffected, adCmdText);
+				// 不管结果;
+			}
+		}
+	}
+}
+
+void c2p::c2pOrderDigital(_variant_t & varOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+		HRESULT hr = S_OK;
+		_RecordsetPtr rs;
+		rs.CreateInstance(__uuidof(Recordset));
+		hr = rs->Open(_T("select * from tb_ErpOrderDigital"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			rs->AddNew();
+			rs->PutCollect(_T("Ordv_Number"), varOrder);
+			rs->PutCollect(_T("Ordv_ViceNumber"), [&, this]()->_variant_t {
+				TCHAR szViceNumber[50] = { 0 };
+				_stprintf_s(szViceNumber, _T("%s_001"), varOrder.bstrVal);
+				return szViceNumber;
+			}());
+			rs->PutCollect(_T("Ordv_DigitalNumber"), 1);
+			// 服装套数;
+			rs->PutCollect(_T("Ordv_ClothingStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("clothescount"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+				{
+					var.vt = VT_I4;
+					var.intVal = 0;
+				}
+				else
+				{
+					var.vt = VT_I4;
+					var.intVal = 1;
+				}
+				return var;
+			}());
+			// 初修师;
+			rs->PutCollect(_T("Ordv_EarlyRepairName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter5"))));
+			//rs->PutCollect(_T("Ordv_EarlyRepairTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time8"))));
+			DATENULL(rs, _T("Ordv_EarlyRepairTime"), pcRecordSet->GetCollect(_T("time8")));
+			rs->PutCollect(_T("Ordv_EarlyRepairStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status4"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未修")) == 0)
+					return 0;
+				else if (_tcscmp(var.bstrVal, _T("修片中")) == 0)
+					return 1;
+				else
+					return 2;
+			}());
+			// 选片;
+			rs->PutCollect(_T("Ordv_FilmSelectionName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter3"))));
+			//rs->PutCollect(_T("Ordv_FilmSelectionTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time4"))));
+			DATENULL2(rs, _T("Ordv_FilmSelectionTime"), pcRecordSet->GetCollect(_T("time4")));
+			rs->PutCollect(_T("Ordv_FilmSelectionStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status2"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未选")) == 0)
+				{
+					return 0;
+				}
+				else
+				{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+					return 1;
+				}
+			}());
+			// 设计;
+			rs->PutCollect(_T("Ordv_DesignerName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter4"))));
+			//rs->PutCollect(_T("Ordv_DesignerTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time10"))));
+			DATENULL(rs, _T("Ordv_DesignerTime"), pcRecordSet->GetCollect(_T("time10")));
+			rs->PutCollect(_T("Ordv_DesignerStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status5"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未设计")) == 0)
+				{
+					return 0;
+				}
+				else if (_tcscmp(var.bstrVal, _T("设计中")) == 0)
+				{
+					return 1;
+				}
+				else
+				{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+					return 2;
+				}
+			}());
+			// 精修师;
+			rs->PutCollect(_T("Ordv_RefinementName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter7"))));
+			//rs->PutCollect(_T("Ordv_RefinementTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time9"))));
+			DATENULL(rs, _T("Ordv_RefinementTime"), pcRecordSet->GetCollect(_T("time9")));
+			rs->PutCollect(_T("Ordv_RefinementStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status6"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未修")) == 0)
+				{
+					return 0;
+				}
+				else if (_tcscmp(var.bstrVal, _T("修片中")) == 0)
+				{
+					return 1;
+				}
+				else
+				{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+					return 2;
+				}
+			}());
+			// 看设计;
+			rs->PutCollect(_T("Ordv_LookDesignName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter8"))));
+			//rs->PutCollect(_T("Ordv_LookDesignTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time6"))));
+			DATENULL2(rs, _T("Ordv_LookDesignTime"), pcRecordSet->GetCollect(_T("time6")));
+			// 长度200;
+			rs->PutCollect(_T("Ordv_LookDesignClaim"), pcRecordSet->GetCollect(_T("bz2")));
+			rs->PutCollect(_T("Ordv_LookDesignStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status8"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未看")) == 0)
+				{
+					return 0;
+				}
+				else if (_tcscmp(var.bstrVal, _T("修改中")) == 0)
+				{
+					return 3;
+				}
+				else
+				{ //if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+					return 1;
+				}
+			}());
+			// 入底加挑张数;choosezs;(不做入册加挑)
+			rs->PutCollect(_T("Ordv_IntoBottomAddPickQuantity"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("choosezs"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+				{
+					return 0;
+				}
+
+				return _ttoi(var.bstrVal);
+			}());
+			// 入底\入册;
+			[&, this]() {
+				CString str = pcRecordSet->GetCollect(_T("taoxizs")).bstrVal;
+				int nAlbum = -1; // 入册数量,默认-1表示全送;
+				int nNegative = -1;// 入底数量,默认-1表示全送;
+				int nIndex = str.Find(_T("\\"));
+
+				if (nIndex == -1)
+					return;
+
+				// 入底;
+				bool bDigit = true;
+
+				// 使用isdigit会出错,宽字符下;
+				if (!str.Left(nIndex).SpanIncluding(_T("0123456789")))
+				{
+					bDigit = false;
+				}
+
+				if (bDigit)
+					nNegative = _ttoi(str.Left(nIndex));
+
+				rs->PutCollect(_T("Ordv_IntoBottomQuantity"), nNegative);
+
+				// 入册;
+				bDigit = true;
+
+				// 使用isdigit会出错,宽字符下;
+				if (!str.Mid(nIndex + 1).SpanIncluding(_T("0123456789")))
+				{
+					bDigit = false;
+				}
+
+				if (bDigit)
+					nAlbum = _ttoi(str.Mid(nIndex + 1));
+
+				rs->PutCollect(_T("Ordv_IntoRegisterQuantity"), nAlbum);
+
+			}();
+
+			// 数码礼包入底张数;必填为0,否则导入相片时,看不到员工信息;
+			rs->PutCollect(_T("Ordv_IntoBottomQuantityPackage"), 0);
+
+			// 预约选片人员和选片时间;
+			rs->PutCollect(_T("Ordv_ReservationFilmSelectionDividedShop"), Global::g_szPlatinumBranchId);
+			rs->PutCollect(_T("Ordv_ReservationFilmSelectionName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter3"))));
+			rs->PutCollect(_T("Ordv_ReservationFilmSelectionTime"), [&, this]()->_variant_t {
+				_variant_t result;
+				_variant_t date = pcRecordSet->GetCollect(_T("time4"));
+				_variant_t time = pcRecordSet->GetCollect(_T("datetime4"));
+
+				if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+				{
+					CString strdate;
+
+					if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+					{
+						strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+						// time可能包含中文字符;
+						if (strdate.SpanIncluding(_T("0123456789:- ")).IsEmpty())
+							strdate.Format(_T("%s"), date.bstrVal);
+					}
+					else
+					{
+						strdate.Format(_T("%s"), date.bstrVal);
+					}
+
+					DATE dt = String2Date(strdate);
+
+					if (dt > 0) //1899年;
+						result = dt;
+				}
+
+				return result;
+			}());
+
+			// 预约看样人员和看样时间;
+			rs->PutCollect(_T("Ordv_ReservationLookDesignDividedShop"), Global::g_szPlatinumBranchId);
+			rs->PutCollect(_T("Ordv_ReservationLookDesignName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter8"))));
+			rs->PutCollect(_T("Ordv_ReservationLookDesignTime"), [&, this]()->_variant_t {
+				_variant_t result;
+				_variant_t date = pcRecordSet->GetCollect(_T("time6"));
+				_variant_t time = pcRecordSet->GetCollect(_T("datetime6"));
+
+				if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+				{
+					CString strdate;
+
+					if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+					{
+						strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+						// time可能包含中文字符;
+						if (strdate.SpanIncluding(_T("0123456789:- ")).IsEmpty())
+							strdate.Format(_T("%s"), date.bstrVal);
+					}
+					else
+					{
+						strdate.Format(_T("%s"), date.bstrVal);
+					}
+
+					DATE dt = String2Date(strdate);
+
+					if (dt > 0) //1899年;
+						result = dt;
+				}
+
+				return result;
+			}());
+
+			rs->Update();
+			rs->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,订单号:%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderDigitalStatus(_variant_t & varOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+		HRESULT hr = S_OK;
+		_RecordsetPtr rs;
+		rs.CreateInstance(__uuidof(Recordset));
+		hr = rs->Open(_T("select * from tb_ErpOrderDigitalStatus"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			rs->AddNew();
+			rs->PutCollect(_T("Ords_Number"), [&, this]()->_variant_t {
+				// 如果存在, 或者异常,新建spid;
+				TCHAR szUid[50] = { 0 };
+				TCHAR szResult[50] = { 0 };
+				_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 50, 10);
+				_stprintf_s(szResult, _T("ORDS_%s"), &szUid);
+				return szResult;
+			}());
+			rs->PutCollect(_T("Ords_OrdNumber"), varOrder);
+			rs->PutCollect(_T("Ords_ViceNumber"), [&, this]()->_variant_t {
+				TCHAR szViceNumber[50] = { 0 };
+				_stprintf_s(szViceNumber, _T("%s_001"), varOrder.bstrVal);
+				return szViceNumber;
+			}());
+			rs->PutCollect(_T("Ords_DigitalNumber"), 1);
+			rs->PutCollect(_T("Ords_OutSendEarlyRepairStatus"), _T("未发"));//外发初修;
+			rs->PutCollect(_T("Ords_OutSendEarlyRepairQuantity"), 0);
+			//数码拍照状态;
+			rs->PutCollect(_T("Ords_PhotographStatus"), pcRecordSet->GetCollect(_T("status")));//_T("未拍"));
+			rs->PutCollect(_T("Ords_PhotographIntStatus"), [&, this]()->_variant_t {
+				_variant_t var = pcRecordSet->GetCollect(_T("status"));
+
+				if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未拍")) == 0)
+					return 0;
+				else if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+					return 2;
+				else
+					return 1;
+			}());
+			rs->PutCollect(_T("Ords_ProductCount"), 0);
+			rs->PutCollect(_T("Ords_ProductSendStatus"), _T("未发"));
+			rs->PutCollect(_T("Ords_ProductCompletedStatus"), _T("未完"));
+			rs->PutCollect(_T("Ords_ProductPickupStatus"), _T("未取"));
+			rs->PutCollect(_T("Ords_ProductPickupIntStatus"), 0);
+			rs->PutCollect(_T("Ords_ProductIsExpedited"), _T("否"));//是否加急;
+			rs->PutCollect(_T("Ords_ServiceCount"), 0);//数码服务数量
+			rs->PutCollect(_T("Ords_ServiceStatus"), _T("未进行"));//数码服务状态 未进行、已完(OK)、进行中
+			rs->PutCollect(_T("Ords_ServiceIntStatus"), 0);//数码服务状态  0:未进行、1:进行中、2:OK
+			rs->PutCollect(_T("Ords_OutSendRefineRepairStatus"), _T("未发"));//外发精修状态 未发、已发、已回
+			rs->PutCollect(_T("Ords_OutSendRefineRepairQuantity"), 0);//外发精修数量
+
+			rs->Update();
+			rs->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+// 根据id查询dindanjd表,再转换插入tb_ErpOrdersPhotography;
+void c2p::c2pOrderScenicSpot(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+#ifdef _DEBUG
+
+		if (_tcscmp(varClassicOrder.bstrVal, _T("20120324-001")) == 0)
+		{
+			WriteTextLog(_T("c2pOrderScenicSpot"));
+		}
+
+#endif
+		CString strSql;
+		_RecordsetPtr rsdindanjd;
+		rsdindanjd.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from dindanjd where id = '%s'"), varClassicOrder.bstrVal);
+		HRESULT hr = rsdindanjd->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsScenicSpot;
+			rsScenicSpot.CreateInstance(__uuidof(Recordset));
+			hr = rsScenicSpot->Open(_T("select * from tb_ErpOrdersPhotography"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				while (rsdindanjd->adoEOF == VARIANT_FALSE)
+				{
+					rsScenicSpot->AddNew();
+					//////////////////////////////////////////////////////////////////////////
+					rsScenicSpot->PutCollect(_T("Ordpg_IDNumber"), [&, this]()->_variant_t {
+						TCHAR szID[50] = { 0 };
+						TCHAR szResult[50] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szID, 50, 10);
+						_stprintf_s(szResult, _T("ORDS_%s"), &szID);
+						return szResult;
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_Number"), varPlatinumOrder);
+					rsScenicSpot->PutCollect(_T("Ordpg_ViceNumber"), [&, this]()->_variant_t {
+						TCHAR szViceNumber[50] = { 0 };
+						_stprintf_s(szViceNumber, _T("%s_001"), varPlatinumOrder.bstrVal);
+						return szViceNumber;
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_Sights"), rsdindanjd->GetCollect(_T("name")));
+					rsScenicSpot->PutCollect(_T("Ordpg_CostPrice"), 0);
+					rsScenicSpot->PutCollect(_T("Ordpg_SightsLevel"), _T("BEBBBCADDEBFJDFFC"));//景点等级,都是一级;
+					rsScenicSpot->PutCollect(_T("Ordpg_SightsType"), _T("0"));//景点类别 (0:内景 , 1:外景)//经典无此分类;
+					rsScenicSpot->PutCollect(_T("Ordpg_ApparelQuantity"), 0);//服装套数//经典无此分类;
+					// 摄影师;
+					rsScenicSpot->PutCollect(_T("Ordpg_Photographer"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter1"))));
+					//拍摄时间;
+					DATENULL(rsScenicSpot, _T("Ordpg_PhotographyTime"), rsdindanjd->GetCollect(_T("date")));
+					//拍摄状态 0:未拍  1: OK(已拍)   2:拍照中
+					rsScenicSpot->PutCollect(_T("Ordpg_PhotographyStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindanjd->GetCollect(_T("status"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未拍")) == 0)
+							return _T("0");
+						else if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return _T("1");
+						else
+							return _T("2");
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_PhotographyAssistant"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter12"))));//摄影助理;
+
+					if (Global::g_bChildVersion)
+						rsScenicSpot->PutCollect(_T("Ordpg_BootDivision"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter2"))));//引导师;
+					else
+						rsScenicSpot->PutCollect(_T("Ordpg_MakeupArtist"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter2"))));//化妆师;
+
+					rsScenicSpot->PutCollect(_T("Ordpg_MakeupAssistant"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter22"))));//化妆师助理;
+					// 预约拍照日期与时间;
+					//DATENULL(rsScenicSpot, _T("Ordpg_ReservationPhotographyTime"), rsdindanjd->GetCollect(_T("bookingdate")));
+					//rsScenicSpot->PutCollect(_T("Ordpg_Remark"), rsdindanjd->GetCollect(_T("time")));
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyTime"), [&, this]()->_variant_t {
+						_variant_t result;
+						_variant_t date = rsdindanjd->GetCollect(_T("bookingdate"));
+						_variant_t time = rsdindanjd->GetCollect(_T("time"));
+
+						if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+						{
+							CString strdate;
+
+							if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+							{
+								strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+								// time可能包含中文字符;
+								if (strdate.SpanIncluding(_T("0123456789:- ")).IsEmpty())
+									strdate.Format(_T("%s"), date.bstrVal);
+							}
+							else
+							{
+								strdate.Format(_T("%s"), date.bstrVal);
+							}
+
+							DATE dt = String2Date(strdate);
+
+							if (dt > 0) //1899年;
+								result = dt;
+						}
+
+						return result;
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyDividedShop"), Global::g_szPlatinumBranchId);//预约分店;
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyName"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter1"))));//预约摄影师;
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter12"))));//预约摄影师助理;
+
+					if (Global::g_bChildVersion)
+					{
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationBootDivision"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约引导师;
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationBootDivisionAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约引导师助理;
+					}
+					else
+					{
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationMakeupArtist"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约化妆师;
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationMakeupAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约化妆师助理;
+					}
+
+					rsScenicSpot->PutCollect(_T("Ordpg_Remark"), rsdindanjd->GetCollect(_T("bz")));
+					// 售价;
+					rsScenicSpot->PutCollect(_T("Ordpg_SalesPrice"), 0);
+					DATENULL(rsScenicSpot, _T("Ordpg_CreateDateTime"), pcRecordSet->GetCollect(_T("time1")));
+					//////////////////////////////////////////////////////////////////////////
+					rsScenicSpot->Update();
+					rsdindanjd->MoveNext();
+				}
+
+				rsScenicSpot->Close();
+			}
+
+			rsdindanjd->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderCustomerGroup(_variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsCustomerGroup;
+		rsCustomerGroup.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from tb_ErpCustomerGroup where GP_OrderNumber = '%s'"), varPlatinumOrder.bstrVal);
+		HRESULT hr = rsCustomerGroup->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsCustomerGroup->adoEOF == VARIANT_TRUE)
+			{
+				_variant_t var;
+#ifdef _DEBUG
+
+				if (_tcscmp(varClassicOrder.bstrVal, _T("20110526-002")) == 0)
+				{
+					WriteTextLog(_T("c2pOrderCustomerGroup"));
+				}
+
+#endif
+				rsCustomerGroup->AddNew();
+				//////////////////////////////////////////////////////////////////////////
+				//rsCustomerGroup->PutCollect(_T("c2p_order"), varClassicOrder.bstrVal);
+				rsCustomerGroup->PutCollect(_T("GP_DividedShop"), Global::g_szPlatinumBranchId);
+				rsCustomerGroup->PutCollect(_T("GP_OrderNumber"), varPlatinumOrder);
+				rsCustomerGroup->PutCollect(_T("GP_CustomerGroupID"), [&, this]()->_variant_t {
+					TCHAR szUID[24] = { 0 };
+					TCHAR szResult[50] = { 0 };
+					_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+					_stprintf_s(szResult, _T("GP_%s"), szUID);
+					return szResult;
+				}());
+				// 客户组类型 0 为其它客户/订单客户 1 为老客户  2 为意向客户
+				rsCustomerGroup->PutCollect(_T("GP_GroupType"), 0);
+				// 客户类型 - 1:为其它订单客户  0 : 为婚纱订单客户  1 : 为儿童订单客户  2 : 写真订单客户  3 : 为服务订单客户  4 : 婚庆订单客户
+				rsCustomerGroup->PutCollect(_T("GP_CustomerType"), Global::g_bChildVersion);
+				// 客户状态 正常 意向 流失 追回
+				rsCustomerGroup->PutCollect(_T("GP_CustomerStatus"), _T("正常"));
+				var = pcRecordSet->GetCollect(_T("from"));
+
+				if (var.vt == VT_EMPTY || var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+					rsCustomerGroup->PutCollect(_T("GP_CustomerSource"), _T(""));
+				else
+					rsCustomerGroup->PutCollect(_T("GP_CustomerSource"), pcRecordSet->GetCollect(_T("from")));
+
+				DATENULL(rsCustomerGroup, _T("GP_CreateDatetime"), pcRecordSet->GetCollect(_T("time1")));
+				// 非空字段;
+				rsCustomerGroup->PutCollect(_T("GP_LossReason"), _T(""));
+				rsCustomerGroup->PutCollect(_T("GP_DegreeOfIntent"), _T(""));
+				// 0为非意客户,1为录入意向客户,2为订单意向客户
+				rsCustomerGroup->PutCollect(_T("GP_ISIntentionCustomer"), 2);
+				//////////////////////////////////////////////////////////////////////////
+				rsCustomerGroup->Update();
+			}
+
+			rsCustomerGroup->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+// 经典顾客,可重复存在一表,以电话号码判断是否重复;
+void c2p::c2pCustomers(_variant_t & varClassicOrder, _RecordsetPtr pcRecordSet)
+{
+#ifdef _DEBUG
+
+	if (_tcscmp(varClassicOrder.bstrVal, _T("20161108-003")) == 0)
+	{
+		WriteTextLog(_T("c2pCustomers"));
+	}
+
+#endif
+
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsClient;
+		_RecordsetPtr rsCustomer;
+		// 创建实例;
+		rsClient.CreateInstance(__uuidof(Recordset));
+		rsCustomer.CreateInstance(__uuidof(Recordset));
+		// 打开实例;
+		strSql.Format(_T("select * from tb_ErpCustomer"), varClassicOrder.bstrVal);
+		HRESULT hr = rsCustomer->Open(_T("select * from tb_ErpCustomer"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// 打开实例;
+			strSql.Format(_T("select * from client where id = '%s'"), varClassicOrder.bstrVal);
+			hr = rsClient->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				_variant_t varGroupId = c2pGetGroupId(varClassicOrder);
+
+				if (rsClient->adoEOF == VARIANT_FALSE)
+				{
+					_variant_t varCustomerId;
+					_variant_t varCustomerId2;
+					_variant_t name1 = rsClient->GetCollect(_T("name1"));
+					_variant_t name2 = rsClient->GetCollect(_T("name2"));
+
+					// 如果是儿童版本;
+					if (Global::g_bChildVersion)
+					{
+						// 先判断成人电话是否存在,如果没有电话号码,则不录入(铂金成人必需要有电话);
+						_variant_t varTelPhone1 = rsClient->GetCollect(_T("phone1"));
+
+						// 没有电话号码的, 不录入;
+						if (varTelPhone1.vt != VT_NULL && varTelPhone1.vt != VT_EMPTY && _tcscmp(varTelPhone1.bstrVal, _T("")) != 0)
+						{
+							// 到tb_ErpCustomer中查找成人;
+							bool bExsits = false;
+							_variant_t varCusTelephone;
+
+							while (rsCustomer->adoEOF == VARIANT_FALSE)
+							{
+								varCusTelephone = rsCustomer->GetCollect(_T("Cus_Telephone"));
+
+								if (varCusTelephone.vt != VT_NULL && varCusTelephone.vt != VT_EMPTY && _tcscmp(varCusTelephone.bstrVal, varTelPhone1.bstrVal) == 0)
+								{
+									bExsits = true;
+									break;
+								}
+
+								rsCustomer->MoveNext();
+							}
+
+							//////////////////////////////////////////////////////////////////////////
+							// 成人;
+							if (bExsits)
+							{
+								// 直接插入tb_ErpCustomerGroupMember;
+								varCustomerId = rsCustomer->GetCollect(_T("Cus_CustomerNumber"));
+								rsCustomer->MoveFirst();
+							}
+							else
+							{
+								//rsCustomer->MoveFirst();
+								rsCustomer->AddNew();
+								rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+								rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId = [&, this]()->_variant_t {
+									TCHAR szUID[24] = { 0 };
+									_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+									return szUID;
+								}());
+								rsCustomer->PutCollect(_T("Cus_Type"), _T(""));// 成人空;
+
+								// 如果家长姓名空,使用儿童姓名;
+								if (name1.vt == VT_NULL || name1.vt == VT_EMPTY || _tcscmp(name1.bstrVal, _T("")) == 0)
+								{
+									//rsCustomer->PutCollect(_T("Cus_Name"), name2);
+									//rsCustomer->PutCollect(_T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+									CusName(rsCustomer, _T("Cus_Name"), name2);
+									CusName(rsCustomer, _T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+								}
+								else
+								{
+									//rsCustomer->PutCollect(_T("Cus_Name"), name1);
+									//rsCustomer->PutCollect(_T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin1")));
+									CusName(rsCustomer, _T("Cus_Name"), name1);
+									CusName(rsCustomer, _T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin1")));
+								}
+
+								// 生日;
+								//DATENULL(rsCustomer, _T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+								/*_variant_t varCheck = rsClient->GetCollect(_T("check1"));
+								if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+								{
+									if (CalendarEx::IsValidSolarDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}
+								else
+								{
+									if (CalendarEx::IsValidLunanrDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}*/
+								// 电话号码长度过长;
+								[&, this]() {
+									CString str = varTelPhone1.bstrVal;
+
+									if (str.GetLength() > 20)
+										rsCustomer->PutCollect(_T("Cus_Telephone"), _variant_t(str.Left(20)));
+									else
+										rsCustomer->PutCollect(_T("Cus_Telephone"), varTelPhone1);
+								}();
+								rsCustomer->PutCollect(_T("Cus_Sex"), _tcscmp(rsClient->GetCollect(_T("sex")).bstrVal, _T("女")) == 0 ? true : false);
+								DATENULL(rsCustomer, _T("Cus_CreateDateTime"), pcRecordSet->GetCollect(_T("time1")));
+								_variant_t qq = rsClient->GetCollect(_T("qq1"));
+								rsCustomer->PutCollect(_T("Cus_QQ"), _variant_t((qq.vt == VT_EMPTY || qq.vt == VT_NULL) ? _T("") : CString(qq.bstrVal).Left(30)));
+								rsCustomer->PutCollect(_T("Cus_Region"), rsClient->GetCollect(_T("area")));
+								rsCustomer->Update();
+							}
+
+							//////////////////////////////////////////////////////////////////////////
+							// 儿童;//儿童姓名可能空,此时不添加;
+							{
+								if (name2.vt != VT_NULL && name2.vt != VT_EMPTY && _tcscmp(name2.bstrVal, _T("")) != 0)
+								{
+									// 这个宝宝是否存在;
+									varCustomerId2 = [&, this]()->_variant_t {
+										// 根据家长ID来查找tb_ErpCustomerGroupMembers;
+										CString str;
+										str.Format(_T("SELECT * FROM tb_ErpCustomer WHERE Cus_CustomerNumber IN (")
+											_T("SELECT GM_RelatedPersonID FROM [tb_ErpCustomerGroupMembers] WHERE GM_CustomerID = '%s' ) and Cus_Type = '儿童'"), varCustomerId.bstrVal);
+										_RecordsetPtr rsView;
+										_variant_t ChildId;
+										rsView.CreateInstance(__uuidof(Recordset));
+										hr = rsView->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+										if (SUCCEEDED(hr))
+										{
+											while (rsView->adoEOF == VARIANT_FALSE)
+											{
+												if (_tcscmp(rsView->GetCollect(_T("Cus_Name")).bstrVal, name2.bstrVal) == 0)
+												{
+													ChildId = rsView->GetCollect(_T("Cus_CustomerNumber"));
+													break;
+												}
+
+												rsView->MoveNext();
+											}
+
+											rsView->Close();
+										}
+
+										return ChildId;
+									}();
+
+									if (varCustomerId2.vt == VT_NULL || varCustomerId2.vt == VT_EMPTY)
+									{
+										// 没有该儿童, 创建一个;
+										rsCustomer->AddNew();
+										rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+										rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId2 = [&, this]()->_variant_t {
+											TCHAR szUID[24] = { 0 };
+											_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+											return szUID;
+										}());
+										rsCustomer->PutCollect(_T("Cus_Type"), _T("儿童"));
+										//rsCustomer->PutCollect(_T("Cus_Name"), name2);
+										// 拼音;
+										//rsCustomer->PutCollect(_T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+										CusName(rsCustomer, _T("Cus_Name"), name2);
+										CusName(rsCustomer, _T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+										// 生日;
+										//DATENULL(rsCustomer, _T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+										//rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+										//rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), rsClient->GetCollect(_T("check2")));
+										_variant_t varCheck = rsClient->GetCollect(_T("check1"));
+
+										if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+										{
+											if (CalendarEx::IsValidSolarDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+												rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+
+											rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+										}
+										else
+										{
+											if (CalendarEx::IsValidLunanrDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+												rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+
+											rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+										}
+
+										//rsCustomer->PutCollect(_T("Cus_Telephone"), varTelPhone1);
+										rsCustomer->PutCollect(_T("Cus_Zodiac"), rsClient->GetCollect(_T("zodiac")));
+										rsCustomer->PutCollect(_T("Cus_Sex"), _tcscmp(rsClient->GetCollect(_T("sex")).bstrVal, _T("女")) == 0 ? true : false);
+										DATENULL(rsCustomer, _T("Cus_CreateDateTime"), pcRecordSet->GetCollect(_T("time1")));
+										//rsCustomer->PutCollect(_T("Cus_QQ"), rsClient->GetCollect(_T("qq1")));
+										// Cus_DayForMarriage 婚期;Cus_QQ
+										rsCustomer->Update();
+									}
+								}
+							}
+
+							//////////////////////////////////////////////////////////////////////////
+							// 插入到Group中;
+							[&, this]() {
+								_RecordsetPtr rsGroupMember;
+								rsGroupMember.CreateInstance(__uuidof(Recordset));
+								hr = rsGroupMember->Open(_T("select * from tb_ErpCustomerGroupMembers"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+								if (SUCCEEDED(hr))
+								{
+									if (varCustomerId.vt != VT_NULL && varCustomerId.vt != VT_EMPTY)
+									{
+										// 成人;
+										rsGroupMember->AddNew();
+										//////////////////////////////////////////////////////////////////////////
+										rsGroupMember->PutCollect(_T("GM_DividedShop"), Global::g_szPlatinumBranchId);
+										rsGroupMember->PutCollect(_T("GM_CustomerGroupID"), varGroupId);
+										rsGroupMember->PutCollect(_T("GM_CustomerID"), varCustomerId);
+										rsGroupMember->PutCollect(_T("GM_Master"), 1);// 主联系人;
+										rsGroupMember->PutCollect(_T("GM_ProtagonistCustomer"), 0);//拍照对象;
+
+										if (varCustomerId2.vt != VT_EMPTY && varCustomerId2.vt != VT_NULL)
+										{
+											// 宝宝id;
+											rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId2);
+											rsGroupMember->PutCollect(_T("GM_Relation"), _T("家长"));
+										}
+										else
+										{
+											rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId);
+											rsGroupMember->PutCollect(_T("GM_Relation"), _T("本人"));
+										}
+
+										rsGroupMember->PutCollect(_T("GM_IsOrder"), 1);
+										//////////////////////////////////////////////////////////////////////////
+										rsGroupMember->Update();
+									}
+
+									if (varCustomerId2.vt != VT_NULL && varCustomerId2.vt != VT_EMPTY)
+									{
+										// 儿童;
+										rsGroupMember->AddNew();
+										//////////////////////////////////////////////////////////////////////////
+										rsGroupMember->PutCollect(_T("GM_DividedShop"), Global::g_szPlatinumBranchId);
+										rsGroupMember->PutCollect(_T("GM_CustomerGroupID"), varGroupId);
+										rsGroupMember->PutCollect(_T("GM_CustomerID"), varCustomerId2);
+										rsGroupMember->PutCollect(_T("GM_Master"), 0);// 主联系人;
+										rsGroupMember->PutCollect(_T("GM_ProtagonistCustomer"), 1);//拍照对象;
+										// 本人ID;
+										rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId2);
+										rsGroupMember->PutCollect(_T("GM_Relation"), _T("本人"));//家长没有性别,无法判断是父还是母;
+										rsGroupMember->PutCollect(_T("GM_IsOrder"), 1);
+										//////////////////////////////////////////////////////////////////////////
+										rsGroupMember->Update();
+									}
+
+									rsGroupMember->Close();
+								}
+							}();
+							//rsCustomer->MoveFirst();
+						}
+					}
+					else
+					{
+						_variant_t varTelPhone1 = rsClient->GetCollect(_T("phone1"));
+						_variant_t varTelPhone2 = rsClient->GetCollect(_T("phone2"));
+
+						if (name1.vt != VT_EMPTY && name1.vt != VT_NULL && _tcscmp(name1.bstrVal, _T("")) != 0)
+						{
+							// 男宾姓名不为空;
+							if (varTelPhone1.vt != VT_EMPTY && varTelPhone1.vt != VT_NULL && _tcscmp(varTelPhone1.bstrVal, _T("")) != 0)
+							{
+								// 男宾电话不为空;
+								varCustomerId = c2pGetCustomerId(varTelPhone1);
+							}
+
+							if (varCustomerId.vt == VT_EMPTY || varCustomerId.vt == VT_NULL)
+							{
+								// 创建新顾客信息;
+								rsCustomer->AddNew();
+								rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+								rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId = [&, this]()->_variant_t {
+									TCHAR szUID[24] = { 0 };
+									_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+									return szUID;
+								}());
+								rsCustomer->PutCollect(_T("Cus_Type"), _T(""));// 成人空;
+								//rsCustomer->PutCollect(_T("Cus_Name"), name1);
+								// 拼音;
+								//rsCustomer->PutCollect(_T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin1")));
+								CusName(rsCustomer, _T("Cus_Name"), name1);
+								CusName(rsCustomer, _T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin1")));
+								// 生日;
+								//DATENULL(rsCustomer, _T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+								//rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+								//rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), rsClient->GetCollect(_T("check1")));
+								_variant_t varCheck = rsClient->GetCollect(_T("check1"));
+
+								if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+								{
+									if (CalendarEx::IsValidSolarDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}
+								else
+								{
+									if (CalendarEx::IsValidLunanrDate(rsClient->GetCollect(_T("birthday1")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday1")));
+
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}
+
+								// 电话号码长度过长;
+								[&, this]() {
+									CString str = varTelPhone1.bstrVal;
+
+									if (str.GetLength() > 20)
+										rsCustomer->PutCollect(_T("Cus_Telephone"), _variant_t(str.Left(20)));
+									else
+										rsCustomer->PutCollect(_T("Cus_Telephone"), varTelPhone1);
+								}();
+
+								rsCustomer->PutCollect(_T("Cus_Sex"), false);
+								DATENULL(rsCustomer, _T("Cus_CreateDateTime"), pcRecordSet->GetCollect(_T("time1")));
+								_variant_t qq = rsClient->GetCollect(_T("qq1"));
+								rsCustomer->PutCollect(_T("Cus_QQ"), _variant_t((qq.vt == VT_EMPTY || qq.vt == VT_NULL) ? _T("") : CString(qq.bstrVal).Left(30)));
+								// 婚期;//Cus_DayForMarriageLunar
+								DATENULL(rsCustomer, _T("Cus_DayForMarriage"), rsClient->GetCollect(_T("time3")));
+								rsCustomer->PutCollect(_T("Cus_DayForMarriageLunar"), rsClient->GetCollect(_T("check3")));
+								rsCustomer->PutCollect(_T("Cus_Region"), rsClient->GetCollect(_T("area")));
+								rsCustomer->Update();
+							}
+						}
+
+						if (name2.vt != VT_EMPTY && name2.vt != VT_NULL && _tcscmp(name2.bstrVal, _T("")) != 0)
+						{
+							// 女宾姓名不为空;
+							if (varTelPhone2.vt != VT_NULL && _tcscmp(varTelPhone2.bstrVal, _T("")) != 0)
+							{
+								// 女宾电话不为空;
+								// 女宾的电话可能与男宾一样, 一样时,不录入女宾;
+								if (_tcscmp(varTelPhone1.bstrVal, varTelPhone2.bstrVal) != 0)
+									varCustomerId2 = c2pGetCustomerId(varTelPhone2);
+							}
+
+							if (varCustomerId2.vt == VT_EMPTY || varCustomerId2.vt == VT_NULL)
+							{
+								// 创建新顾客信息;
+								rsCustomer->AddNew();
+								rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+								rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId2 = [&, this]()->_variant_t {
+									TCHAR szUID[24] = { 0 };
+									_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+									return szUID;
+								}());
+								rsCustomer->PutCollect(_T("Cus_Type"), _T(""));// 成人空;
+								//rsCustomer->PutCollect(_T("Cus_Name"), name2);
+								// 拼音;
+								//rsCustomer->PutCollect(_T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+								CusName(rsCustomer, _T("Cus_Name"), name2);
+								CusName(rsCustomer, _T("Cus_NamePinyin"), pcRecordSet->GetCollect(_T("pinyin2")));
+								// 生日;
+								//DATENULL(rsCustomer, _T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+								//rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+								//rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), rsClient->GetCollect(_T("check2")));
+								_variant_t varCheck = rsClient->GetCollect(_T("check2"));
+
+								if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+								{
+									if (CalendarEx::IsValidSolarDate(rsClient->GetCollect(_T("birthday2")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}
+								else
+								{
+									if (CalendarEx::IsValidLunanrDate(rsClient->GetCollect(_T("birthday2")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_Birthday"), rsClient->GetCollect(_T("birthday2")));
+
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+								}
+
+								// 电话号码长度过长;
+								[&, this]() {
+									CString str = varTelPhone2.bstrVal;
+
+									if (str.GetLength() > 20)
+										rsCustomer->PutCollect(_T("Cus_Telephone"), _variant_t(str.Left(20)));
+									else
+										rsCustomer->PutCollect(_T("Cus_Telephone"), varTelPhone2);
+								}();
+								rsCustomer->PutCollect(_T("Cus_Sex"), true);
+								DATENULL(rsCustomer, _T("Cus_CreateDateTime"), pcRecordSet->GetCollect(_T("time1")));
+								_variant_t qq = rsClient->GetCollect(_T("qq2"));
+								rsCustomer->PutCollect(_T("Cus_QQ"), _variant_t((qq.vt == VT_EMPTY || qq.vt == VT_NULL) ? _T("") : CString(qq.bstrVal).Left(30)));
+								// 婚期;//Cus_DayForMarriageLunar
+								varCheck = rsClient->GetCollect(_T("check3"));
+
+								if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+								{
+									if (CalendarEx::IsValidSolarDate(rsClient->GetCollect(_T("time3")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_DayForMarriage"), rsClient->GetCollect(_T("time3")));
+
+									rsCustomer->PutCollect(_T("Cus_DayForMarriageLunar"), varCheck);
+								}
+								else
+								{
+									if (CalendarEx::IsValidLunanrDate(rsClient->GetCollect(_T("time3")).bstrVal))
+										rsCustomer->PutCollect(_T("Cus_DayForMarriage"), rsClient->GetCollect(_T("time3")));
+
+									rsCustomer->PutCollect(_T("Cus_DayForMarriageLunar"), varCheck);
+								}
+
+								//DATENULL(rsCustomer, _T("Cus_DayForMarriage"), rsClient->GetCollect(_T("time3")));
+								//rsCustomer->PutCollect(_T("Cus_DayForMarriageLunar"), rsClient->GetCollect(_T("check3")));
+								rsCustomer->PutCollect(_T("Cus_Region"), rsClient->GetCollect(_T("area2")));
+								rsCustomer->Update();
+							}
+						}
+
+						//////////////////////////////////////////////////////////////////////////
+						// 插入到Group中;
+						[&, this]() {
+							_RecordsetPtr rsGroupMember;
+							rsGroupMember.CreateInstance(__uuidof(Recordset));
+							hr = rsGroupMember->Open(_T("select * from tb_ErpCustomerGroupMembers"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+							if (SUCCEEDED(hr))
+							{
+								if (varCustomerId.vt != VT_NULL && varCustomerId.vt != VT_EMPTY)
+								{
+									// 男宾;
+									rsGroupMember->AddNew();
+									//////////////////////////////////////////////////////////////////////////
+									rsGroupMember->PutCollect(_T("GM_DividedShop"), Global::g_szPlatinumBranchId);
+									rsGroupMember->PutCollect(_T("GM_CustomerGroupID"), varGroupId);
+									rsGroupMember->PutCollect(_T("GM_CustomerID"), varCustomerId);
+									rsGroupMember->PutCollect(_T("GM_Master"), 1);// 主联系人;
+									rsGroupMember->PutCollect(_T("GM_ProtagonistCustomer"), 0);//拍照对象;
+									rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId);
+									rsGroupMember->PutCollect(_T("GM_Relation"), _T("家长"));
+									rsGroupMember->PutCollect(_T("GM_IsOrder"), 1);
+									//////////////////////////////////////////////////////////////////////////
+									rsGroupMember->Update();
+								}
+
+								if (varCustomerId2.vt != VT_NULL && varCustomerId2.vt != VT_EMPTY)
+								{
+									// 女宾;
+									rsGroupMember->AddNew();
+									//////////////////////////////////////////////////////////////////////////
+									rsGroupMember->PutCollect(_T("GM_DividedShop"), Global::g_szPlatinumBranchId);
+									rsGroupMember->PutCollect(_T("GM_CustomerGroupID"), varGroupId);
+									rsGroupMember->PutCollect(_T("GM_CustomerID"), varCustomerId2);
+
+									if (varCustomerId.vt == VT_NULL || varCustomerId.vt == VT_EMPTY)
+										rsGroupMember->PutCollect(_T("GM_Master"), 1);// 主联系人;
+									else
+										rsGroupMember->PutCollect(_T("GM_Master"), 0);// 主联系人;
+
+									rsGroupMember->PutCollect(_T("GM_ProtagonistCustomer"), 1);//拍照对象;
+
+									// 男宾ID;
+									if (varCustomerId.vt != VT_NULL && varCustomerId.vt != VT_EMPTY)
+									{
+										rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId);
+										rsGroupMember->PutCollect(_T("GM_Relation"), _T("夫妻"));//家长没有性别,无法判断是父还是母;
+									}
+									else
+									{
+										rsGroupMember->PutCollect(_T("GM_RelatedPersonID"), varCustomerId2);
+										rsGroupMember->PutCollect(_T("GM_Relation"), _T("本人"));//家长没有性别,无法判断是父还是母;
+									}
+
+									rsGroupMember->PutCollect(_T("GM_IsOrder"), 1);
+									//////////////////////////////////////////////////////////////////////////
+									rsGroupMember->Update();
+								}
+
+								rsGroupMember->Close();
+							}
+						}();
+					}
+
+					//rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+				}
+
+				rsClient->Close();
+			}
+
+			rsCustomer->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderGoods(_variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+#ifdef _DEBUG
+
+		if (_tcscmp(varClassicOrder.bstrVal, _T("20170817-026")) == 0)
+		{
+			WriteTextLog(_T("c2pOrderGoods"));
+		}
+
+#endif
+		CString strSql;
+		_RecordsetPtr rsdindansp;
+		rsdindansp.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from dindansp where id = '%s'"), varClassicOrder.bstrVal);
+		// 根据dindan.id查询出dindansp表;
+		HRESULT hr = rsdindansp->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsOrderProduct;
+			rsOrderProduct.CreateInstance(__uuidof(Recordset));
+			hr = rsOrderProduct->Open(_T("select * from tb_ErpOrderProductList"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				int nOrderbyNumber = 0;
+
+				while (rsdindansp->adoEOF == VARIANT_FALSE)
+				{
+					// 遍历dindansp结果表, 逐步转换;
+					[&, this]() {
+						_RecordsetPtr rsGoods;
+						rsGoods.CreateInstance(__uuidof(Recordset));
+						//strSql.Format(_T("select * from tb_ErpProduct where Prod_Name = '%s' and c2p_spid = '%s'"), rsdindansp->GetCollect(_T("name")).bstrVal, rsdindansp->GetCollect(_T("spid")).bstrVal);
+						strSql.Format(_T("select * from tb_ErpProduct where Prod_Name = '%s' "), rsdindansp->GetCollect(_T("name")).bstrVal);
+						hr = rsGoods->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rsGoods->adoEOF == VARIANT_FALSE)
+							{
+								// 有商品记录;
+								nOrderbyNumber++;
+								_variant_t OPlist_UniquelyIdentity = [&, this]()->_variant_t {
+									TCHAR szResult[50] = { 0 };
+									_stprintf_s(szResult, _T("%s%s%ld"), Global::g_szClassicBranchId, rsGoods->GetCollect("Prod_Number").bstrVal, rsdindansp->GetCollect(_T("autoid")).intVal);
+									return szResult;
+								}();
+
+								// "shuliang"字段可能包含中文;
+								int shuliang = 0;
+
+								if (rsdindansp->GetCollect(_T("shuliang")).vt == VT_EMPTY || rsdindansp->GetCollect(_T("shuliang")).vt == VT_NULL || _tcscmp(rsdindansp->GetCollect(_T("shuliang")).bstrVal, _T("")) == 0)
+									shuliang = 0;
+								else
+									shuliang = _ttoi(rsdindansp->GetCollect(_T("shuliang")).bstrVal);
+
+								{
+									// type = 1;
+									//////////////////////////////////////////////////////////////////////////
+									rsOrderProduct->AddNew();
+									rsOrderProduct->PutCollect(_T("OPlist_DividedShop"), Global::g_szPlatinumBranchId);
+									rsOrderProduct->PutCollect(_T("OPlist_OrderNumber"), varPlatinumOrder);
+									rsOrderProduct->PutCollect(_T("OPlist_ViceNumber"), [&, this]()->_variant_t {
+										TCHAR szViceNumber[50] = { 0 };
+										_stprintf_s(szViceNumber, _T("%s_001"), varPlatinumOrder.bstrVal);
+										return szViceNumber;
+									}());
+									rsOrderProduct->PutCollect(_T("OPlist_ProdNumber"), rsGoods->GetCollect("Prod_Number"));
+									rsOrderProduct->PutCollect(_T("OPlist_Type"), 1);
+									rsOrderProduct->PutCollect(_T("OPlist_ProdName"), rsGoods->GetCollect(_T("Prod_Name")));
+									rsOrderProduct->PutCollect(_T("OPlist_Class"), rsGoods->GetCollect(_T("Prod_Class")));
+									// 经典版没有批的概念,固为0 或者使用商品自带的;
+									rsOrderProduct->PutCollect(_T("OPlist_Batch"), rsGoods->GetCollect(_T("Prod_Batch")));
+									rsOrderProduct->PutCollect(_T("OPlist_Unit"), rsGoods->GetCollect(_T("Prod_Unit")));
+									rsOrderProduct->PutCollect(_T("OPlist_CostPrice"), rsGoods->GetCollect(_T("Prod_CostPrice")));
+									//PRICENULL(rsOrderProduct, _T("OPlist_CostPrice"), rsGoods->GetCollect(_T("Prod_CostPrice")));//或者dindansp里的;
+									rsOrderProduct->PutCollect(_T("OPlist_ProdSoldPrice"), rsGoods->GetCollect(_T("Prod_SalesPrice")));
+									//PRICENULL(rsOrderProduct, _T("OPlist_ProdSoldPrice"), rsGoods->GetCollect(_T("Prod_SalesPrice")));//或者dindansp里的;
+									// 商品数量;
+									rsOrderProduct->PutCollect(_T("OPlist_ProdQuantity"), shuliang);
+									// 是否加急;
+									rsOrderProduct->PutCollect(_T("OPlist_IsExpedited"), 0);
+									// 取件状态;
+									rsOrderProduct->PutCollect(_T("OPlist_PickupStatus"), 0);
+									// 取走数量
+									rsOrderProduct->PutCollect(_T("OPlist_PickupQuantity"), 0);
+									// 发出状态;// 根据发出日期;
+									rsOrderProduct->PutCollect(_T("OPlist_SendStatus"), 0);
+									// 返工状态;
+									rsOrderProduct->PutCollect(_T("OPlist_ReworkStatus"), 0);
+									// 返工数量,全部;
+									rsOrderProduct->PutCollect(_T("OPlist_ReworQuantity"), 0);
+									// 完成状态;
+									rsOrderProduct->PutCollect(_T("OPlist_CompletedStatus"), 0);
+									// 完件数量;
+									rsOrderProduct->PutCollect(_T("OPlist_CompletedQuantity"), 0);
+									// 生成日期;
+									//rsOrderProduct->PutCollect(_T("OPlist_CreateDatetime"), pcRecordSet->GetCollect(_T("time1")));
+									DATENULL(rsOrderProduct, _T("OPlist_CreateDatetime"), pcRecordSet->GetCollect(_T("time1")));
+									rsOrderProduct->PutCollect(_T("OPlist_OrderByNumber"), nOrderbyNumber);
+									rsOrderProduct->PutCollect(_T("OPlist_IsSendOuntRemind"), 1);
+									rsOrderProduct->PutCollect(_T("OPlist_UniquelyIdentity"), OPlist_UniquelyIdentity);
+									// 没有此项;
+									rsOrderProduct->PutCollect(_T("OPlist_CompletedHadLessQuantity"), 0);
+									rsOrderProduct->Update();
+									//////////////////////////////////////////////////////////////////////////
+								}
+
+								{
+									// type = 2;
+									//////////////////////////////////////////////////////////////////////////
+									rsOrderProduct->AddNew();
+									rsOrderProduct->PutCollect(_T("OPlist_DividedShop"), Global::g_szPlatinumBranchId);
+									rsOrderProduct->PutCollect(_T("OPlist_OrderNumber"), varPlatinumOrder);
+									rsOrderProduct->PutCollect(_T("OPlist_ViceNumber"), [&, this]()->_variant_t {
+										TCHAR szViceNumber[50] = { 0 };
+										_stprintf_s(szViceNumber, _T("%s_001"), varPlatinumOrder.bstrVal);
+										return szViceNumber;
+									}());
+									rsOrderProduct->PutCollect(_T("OPlist_ProdNumber"), rsGoods->GetCollect("Prod_Number"));
+									rsOrderProduct->PutCollect(_T("OPlist_Type"), 2);
+									rsOrderProduct->PutCollect(_T("OPlist_ProdName"), rsGoods->GetCollect(_T("Prod_Name")));
+									rsOrderProduct->PutCollect(_T("OPlist_Class"), rsGoods->GetCollect(_T("Prod_Class")));
+									// 经典版没有批的概念,固为0 或者使用商品自带的;
+									rsOrderProduct->PutCollect(_T("OPlist_Batch"), rsGoods->GetCollect(_T("Prod_Batch")));
+									rsOrderProduct->PutCollect(_T("OPlist_Unit"), rsGoods->GetCollect(_T("Prod_Unit")));
+									rsOrderProduct->PutCollect(_T("OPlist_CostPrice"), rsGoods->GetCollect(_T("Prod_CostPrice")));//或者dindansp里的;
+									//PRICENULL(rsOrderProduct, _T("OPlist_CostPrice"), rsGoods->GetCollect(_T("Prod_CostPrice")));
+									//rsOrderProduct->PutCollect(_T("OPlist_ProdSoldPrice"), rsdindansp->GetCollect(_T("price")));
+									PRICENULL(rsOrderProduct, _T("OPlist_ProdSoldPrice"), rsdindansp->GetCollect(_T("price")));
+									// 商品数量;
+									rsOrderProduct->PutCollect(_T("OPlist_ProdQuantity"), shuliang);
+									// 是否加急;
+									_variant_t urgent = rsdindansp->GetCollect(_T("urgent"));
+
+									if (urgent.vt == VT_EMPTY || urgent.vt == VT_NULL || _tcscmp(urgent.bstrVal, _T("")) == 0 || _tcscmp(urgent.bstrVal, _T("否")) == 0)
+										rsOrderProduct->PutCollect(_T("OPlist_IsExpedited"), 0);
+									else
+										rsOrderProduct->PutCollect(_T("OPlist_IsExpedited"), 1);
+
+									// 加急日期=经典取件日期;
+									DATENULL(rsOrderProduct, _T("OPlist_ExpeditedTime"), rsdindansp->GetCollect(_T("taketime")));
+									// 取件状态;
+									_variant_t status2 = rsdindansp->GetCollect(_T("status2"));
+
+									if (status2.vt == VT_EMPTY || status2.vt == VT_NULL || _tcscmp(status2.bstrVal, _T("")) == 0 || _tcscmp(status2.bstrVal, _T("未取")) == 0)
+									{
+										rsOrderProduct->PutCollect(_T("OPlist_PickupQuantity"), 0);
+										rsOrderProduct->PutCollect(_T("OPlist_PickupStatus"), 0);
+									}
+									else
+									{
+										rsOrderProduct->PutCollect(_T("OPlist_PickupStatus"), 1);
+										rsOrderProduct->PutCollect(_T("OPlist_PickupQuantity"), shuliang);
+									}
+
+									// 取走日期;
+									DATENULL(rsOrderProduct, _T("OPlist_PickupTime"), rsdindansp->GetCollect(_T("date4")));
+									// 取件师;
+									rsOrderProduct->PutCollect(_T("OPlist_PickupName"), c2pGetEmployeeId(rsdindansp->GetCollect(_T("name4"))));
+
+									// 发出状态;// 根据发出日期;
+									_variant_t date1 = rsdindansp->GetCollect(_T("date1"));
+
+									if (date1.vt == VT_NULL || date1.vt == VT_EMPTY || _tcscmp(date1.bstrVal, _T("")) == 0)
+										rsOrderProduct->PutCollect(_T("OPlist_SendStatus"), 0);
+									else
+										rsOrderProduct->PutCollect(_T("OPlist_SendStatus"), 1);
+
+									// 发出商家;
+									rsOrderProduct->PutCollect(_T("OPlist_SendVendor"), [&, this]()->_variant_t {
+										_variant_t status3 = rsdindansp->GetCollect(_T("status3"));
+
+										if (status3.vt == VT_EMPTY || status3.vt == VT_NULL || _tcscmp(status3.bstrVal, _T("")) == 0)
+										{
+											return _T("");
+										}
+										else
+										{
+											CString strVender = status3.bstrVal;
+											int nIndex = strVender.Find(_T("发出"));
+
+											if (nIndex != -1)
+											{
+												strVender = strVender.Mid(2);
+												return _variant_t(strVender);
+											}
+											else
+											{
+												return _T("");
+											}
+										}
+									}());
+									DATENULL(rsOrderProduct, _T("OPlist_SendTime"), date1);
+
+									// 返工时间;
+									_variant_t date2 = rsdindansp->GetCollect(_T("date2"));
+									_variant_t status4 = rsdindansp->GetCollect(_T("status4"));
+									DATENULL(rsOrderProduct, _T("OPlist_ReworkTime"), date2);
+
+									if (date2.vt == VT_EMPTY || date2.vt == VT_NULL || _tcscmp(date2.bstrVal, _T("")) == 0)
+									{
+										// 返工状态;
+										rsOrderProduct->PutCollect(_T("OPlist_ReworkStatus"), 0);
+										// 返工数量,全部;
+										rsOrderProduct->PutCollect(_T("OPlist_ReworQuantity"), shuliang);
+									}
+									else
+									{
+										// 返工状态;
+										rsOrderProduct->PutCollect(_T("OPlist_ReworkStatus"), 1);
+										// 返工数量,全部;
+										rsOrderProduct->PutCollect(_T("OPlist_ReworQuantity"), shuliang);
+									}
+
+									// 返工记录者;
+									rsOrderProduct->PutCollect(_T("OPlist_ReworName"), c2pGetEmployeeId(rsdindansp->GetCollect(_T("name2"))));
+
+									if (status4.vt != VT_NULL && status4.vt != VT_EMPTY && _tcscmp(status4.bstrVal, _T("")) != 0)
+									{
+										CString strStatus4 = status4.bstrVal;
+
+										if (strStatus4 == _T("返工/(工厂)"))
+										{
+											// 返回原因:工厂或员工;
+											rsOrderProduct->PutCollect(_T("OPlist_ReworkRemark"), _T("工厂"));
+										}
+										else
+										{
+											strStatus4.Delete(0, 4);
+											strStatus4.Delete(strStatus4.GetLength() - 1);
+											// 返回原因:工厂或员工;
+											rsOrderProduct->PutCollect(_T("OPlist_ReworkRemark"), _variant_t(strStatus4));
+										}
+									}
+
+									// 完成状态;
+									_variant_t status1 = rsdindansp->GetCollect(_T("status1"));
+
+									// 完成时间;
+									DATENULL(rsOrderProduct, _T("OPlist_CompletedTime"), rsdindansp->GetCollect(_T("date3")));
+									// 完件员工;
+									rsOrderProduct->PutCollect(_T("OPlist_CompletedName"), c2pGetEmployeeId(rsdindansp->GetCollect(_T("name3"))));
+
+									// 完件数量;
+									if (status1.vt == VT_EMPTY || status1.vt == VT_NULL || _tcscmp(status1.bstrVal, _T("")) == 0 || _tcscmp(status1.bstrVal, _T("未完成")) == 0)
+									{
+										rsOrderProduct->PutCollect(_T("OPlist_CompletedStatus"), 0);
+										rsOrderProduct->PutCollect(_T("OPlist_CompletedQuantity"), 0);
+									}
+									else if (_tcscmp(status1.bstrVal, _T("OK")) == 0)
+									{
+										rsOrderProduct->PutCollect(_T("OPlist_CompletedStatus"), 1);
+										rsOrderProduct->PutCollect(_T("OPlist_CompletedQuantity"), shuliang);
+									}
+
+									// 生成日期;
+									DATENULL(rsOrderProduct, _T("OPlist_CreateDatetime"), pcRecordSet->GetCollect(_T("time1")));
+									rsOrderProduct->PutCollect(_T("OPlist_OrderByNumber"), nOrderbyNumber);
+									rsOrderProduct->PutCollect(_T("OPlist_IsSendOuntRemind"), 1);
+									rsOrderProduct->PutCollect(_T("OPlist_UniquelyIdentity"), OPlist_UniquelyIdentity);
+									rsOrderProduct->PutCollect(_T("OPlist_Remark"), rsdindansp->GetCollect(_T("bz")));
+									rsOrderProduct->PutCollect(_T("OPlist_CompletedHadLessQuantity"), 0);
+									// 单价;//OPlist_CompletedHadLessQuantity
+									//rsOrderProduct->PutCollect(_T("OPlist_UnitPrice"), rsdindansp->GetCollect(_T("date1")));
+									//rsOrderProduct->PutCollect(_T("OPlist_ProdWidth"), rsdindansp->GetCollect(_T("date1")));
+									//rsOrderProduct->PutCollect(_T("OPlist_ProdHeight"), rsdindansp->GetCollect(_T("date1")));
+									// 预约取件人员和时间;
+									rsOrderProduct->PutCollect(_T("OPlist_ReservationTakeDividedShop"), Global::g_szPlatinumBranchId);
+									rsOrderProduct->PutCollect(_T("OPlist_ReservationTakeName"), c2pGetEmployeeId(pcRecordSet->GetCollect(_T("waiter9"))));
+									rsOrderProduct->PutCollect(_T("OPlist_ReservationTakeTime"), [&, this]()->_variant_t {
+										_variant_t result;
+										_variant_t date = pcRecordSet->GetCollect(_T("time5"));
+										_variant_t time = pcRecordSet->GetCollect(_T("datetime5"));
+
+										if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+										{
+											CString strdate;
+
+											if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+											{
+												strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+												// time可能包含中文字符;
+												if (strdate.SpanIncluding(_T("0123456789:- ")).IsEmpty())
+													strdate.Format(_T("%s"), date.bstrVal);
+											}
+											else
+											{
+												strdate.Format(_T("%s"), date.bstrVal);
+											}
+
+											DATE dt = String2Date(strdate);
+
+											if (dt > 0) //1899年;
+												result = dt;
+										}
+
+										return result;
+									}());
+
+									rsOrderProduct->Update();
+									//////////////////////////////////////////////////////////////////////////
+								}
+							}
+
+							rsGoods->Close();
+						}
+					}();
+
+					rsdindansp->MoveNext();
+				}
+
+				rsOrderProduct->Close();
+			}
+
+			rsdindansp->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pRecordOfOrderReceipts(_variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+		// dinanbukuan // tb_ErpPayment;
+		CString strSql;
+		_RecordsetPtr rsdindanbukuan;
+		rsdindanbukuan.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from dindanbukuan where id = '%s'"), varClassicOrder.bstrVal);
+		HRESULT hr = rsdindanbukuan->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsErpPayment;
+			rsErpPayment.CreateInstance(__uuidof(Recordset));
+			hr = rsErpPayment->Open(_T("select * from tb_ErpPayment"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				_variant_t var;
+				_variant_t ViceNumber;
+
+				while (rsdindanbukuan->adoEOF == VARIANT_FALSE)
+				{
+					rsErpPayment->AddNew();
+					//////////////////////////////////////////////////////////////////////////
+					rsErpPayment->PutCollect(_T("c2p_order"), varClassicOrder);
+					rsErpPayment->PutCollect(_T("Pay_DividedShop"), Global::g_szPlatinumBranchId);
+					// 订单号;
+					rsErpPayment->PutCollect(_T("Pay_OrdNumber"), varPlatinumOrder);
+					rsErpPayment->PutCollect(_T("Pay_ViceNumber"), ViceNumber = [&, this]()->_variant_t {
+						TCHAR szViceNumber[50] = { 0 };
+						_stprintf_s(szViceNumber, _T("%s_001"), varPlatinumOrder.bstrVal);
+						return szViceNumber;
+					}());
+					var = rsdindanbukuan->GetCollect(_T("kind"));
+
+					if (_tcscmp(var.bstrVal, _T("3")) == 0)
+					{
+						// 预约补款;
+						rsErpPayment->PutCollect(_T("Pay_Category"), _T("预约补款"));
+					}
+					else if (_tcscmp(var.bstrVal, _T("4")) == 0)
+					{
+						// 预约收款;
+						var = pcRecordSet->GetCollect(_T("taoxijiage"));
+
+						if (var.vt != VT_NULL && var.vt != VT_EMPTY && _tcscmp(var.bstrVal, _T("")) != 0)
+						{
+							int nPrice = _ttoi(var.bstrVal);
+
+							if (nPrice == _ttoi(rsdindanbukuan->GetCollect(_T("money")).bstrVal))
+							{
+								// 全款;
+								rsErpPayment->PutCollect(_T("Pay_Category"), _T("全款"));
+							}
+							else
+							{
+								//预约收款;
+								rsErpPayment->PutCollect(_T("Pay_Category"), _T("预约收款"));
+							}
+						}
+						else
+						{
+							rsErpPayment->PutCollect(_T("Pay_Category"), _T("全款"));
+						}
+					}
+					else
+					{
+						// 后期收款;
+						rsErpPayment->PutCollect(_T("Pay_Category"), _T("后期收款"));
+						//[Pay_ReceivableProject]
+						rsErpPayment->PutCollect(_T("Pay_ReceivableProject"), rsdindanbukuan->GetCollect(_T("item")));
+						//[Pay_PlusPickNumber]
+						rsErpPayment->PutCollect(_T("Pay_PlusPickNumber"), [&, this]()->_variant_t {
+							TCHAR szUID[24] = { 0 };
+							TCHAR szResult[50] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+							_stprintf_s(szResult, _T("PPI%s"), szUID);
+							return szResult;
+						}());
+						rsErpPayment->PutCollect(_T("Pay_ShootingName"), c2pGetScenicSpotByViceNumber(ViceNumber));
+					}
+
+					PRICENULL(rsErpPayment, _T("Pay_AmountOf"), rsdindanbukuan->GetCollect(_T("money")));
+					// 接单门市;[Pay_OpenSingle]
+					[&, this]() {
+						CString str;
+						_variant_t ren = pcRecordSet->GetCollect(_T("ren"));
+						_variant_t ren2 = pcRecordSet->GetCollect(_T("ren2"));
+
+						if (ren.vt != VT_EMPTY && ren.vt != VT_NULL && _tcscmp(ren.bstrVal, _T("")) != 0)
+						{
+							var = c2pGetEmployeeId(ren);
+
+							if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+								str += var.bstrVal;
+						}
+
+						if (ren2.vt != VT_EMPTY && ren2.vt != VT_NULL && _tcscmp(ren2.bstrVal, _T("")) != 0)
+						{
+							if (!str.IsEmpty())
+								str += _T(",");
+
+							var = c2pGetEmployeeId(ren2);
+
+							if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+								str += var.bstrVal;
+						}
+
+						rsErpPayment->PutCollect(_T("Pay_OpenSingle"), _variant_t(str));
+					}();
+					// Pay_CreateName收款人;
+					var = rsdindanbukuan->GetCollect(_T("ren"));
+
+					if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+						rsErpPayment->PutCollect(_T("Pay_CreateName"), var);
+
+					// 录单人;
+					var = rsdindanbukuan->GetCollect(_T("ren2"));
+
+					if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+						rsErpPayment->PutCollect(_T("Pay_ThePayee"), var);
+
+					// Pay_PaymentMethod 收款方式;
+					var = rsdindanbukuan->GetCollect(_T("paytype"));
+
+					if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+					{
+						//var = c2pGetPaymentMethodClass(var);
+						rsErpPayment->PutCollect(_T("Pay_PaymentMethod"), c2pGetPaymentMethodClass(var));
+					}
+
+					// 接单点;
+					rsErpPayment->PutCollect(_T("Pay_OrdersLocation"), rsdindanbukuan->GetCollect(_T("jdd")));
+					//审核是否通过\审核人;
+					[&, this]() {
+						var = rsdindanbukuan->GetCollect(_T("financecheck"));
+
+						if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+						{
+							CString str = var.bstrVal;
+							int nIndex = str.Find(_T("\\"));
+
+							if (nIndex != -1)
+							{
+								rsErpPayment->PutCollect(_T("Pay_FinancialAudit"), _variant_t(str.Left(nIndex)));
+								rsErpPayment->PutCollect(_T("Pay_FinancialAuditdPeople"), c2pGetEmployeeId(_variant_t(str.Mid(nIndex + 1))));
+							}
+						}
+					}();
+					// 生成日期;[Pay_CreateDatetime]
+					DATENULL(rsErpPayment, _T("Pay_CreateDatetime"), rsdindanbukuan->GetCollect(_T("date")));
+					// Pay_Type收款类型 (0:订单,1:其他消费 2:礼服)
+					rsErpPayment->PutCollect(_T("Pay_Type"), 0);
+					// 折扣;
+					var = rsdindanbukuan->GetCollect(_T("discount"));
+
+					if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+					{
+						float fdis = _ttof(var.bstrVal);
+						rsErpPayment->PutCollect(_T("Pay_PaymentDiscount"), fdis);
+					}
+					else
+					{
+						rsErpPayment->PutCollect(_T("Pay_PaymentDiscount"), 0.0);
+					}
+
+					rsErpPayment->PutCollect(_T("Pay_DiscountAmount"), 0.0);
+					//////////////////////////////////////////////////////////////////////////
+					rsErpPayment->Update();
+					// 下一条;
+					rsdindanbukuan->MoveNext();
+				}
+
+				rsErpPayment->Close();
+			}
+
+			rsdindanbukuan->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderReceiptsItem(_variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+#ifdef _DEBUG
+
+	if (_tcscmp(varClassicOrder.bstrVal, _T("20140102-001")) == 0)
+	{
+		WriteTextLog(_T("c2pOrderReceiptsItem"));
+	}
+
+#endif
+
+	try
+	{
+		// dindanbukuan2; // tb_ErpPlusPickItems;
+		CString strSql;
+		_RecordsetPtr rsdindanbukuan2;
+		rsdindanbukuan2.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from dindanbukuan2 where id = '%s'"), varClassicOrder.bstrVal);
+		HRESULT hr = rsdindanbukuan2->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsErpPickItem;
+			rsErpPickItem.CreateInstance(__uuidof(Recordset));
+			hr = rsErpPickItem->Open(_T("select * from tb_ErpPlusPickItems"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				_variant_t var;
+
+				while (rsdindanbukuan2->adoEOF == VARIANT_FALSE)
+				{
+					rsErpPickItem->AddNew();
+					//////////////////////////////////////////////////////////////////////////
+					rsErpPickItem->PutCollect(_T("Plu_DividedShop"), Global::g_szPlatinumBranchId);
+					// 订单号;
+					rsErpPickItem->PutCollect(_T("Plu_OrdNumber"), varPlatinumOrder);
+					rsErpPickItem->PutCollect(_T("Plu_OrdViceNumber"), [&, this]()->_variant_t {
+						TCHAR szViceNumber[50] = { 0 };
+						_stprintf_s(szViceNumber, _T("%s_001"), varPlatinumOrder.bstrVal);
+						return szViceNumber;
+					}());
+
+					// 加挑编号,二销类型;[Plu_TwoPinsCategory]
+					[&, this]() {
+						// 加挑编号;
+						_RecordsetPtr rs;
+						rs.CreateInstance(__uuidof(Recordset));
+						strSql.Format(_T("select * from tb_ErpPayment where c2p_order = '%s' and Pay_ReceivableProject = '%s' and Pay_Category = '后期收款'"),
+							varClassicOrder.bstrVal, rsdindanbukuan2->GetCollect(_T("bz")).bstrVal);
+						hr = rs->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_FALSE)
+							{
+								rsErpPickItem->PutCollect(_T("Plu_Number"), rs->GetCollect(_T("Pay_PlusPickNumber")));
+								rsErpPickItem->PutCollect(_T("Plu_TwoPinsCategory"), rs->GetCollect(_T("Pay_TwoPinsCategory")));
+							}
+							else
+							{
+								// 有些没有找收款的, 经典版里找不到这两个参数,只能随意生成;
+								rsErpPickItem->PutCollect(_T("Plu_Number"), [&, this]()->_variant_t {
+									TCHAR szUID[24] = { 0 };
+									TCHAR szResult[50] = { 0 };
+									_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+									_stprintf_s(szResult, _T("PPI%s"), szUID);
+									return szResult;
+								}());
+								// 默认选片二销;
+								rsErpPickItem->PutCollect(_T("Plu_TwoPinsCategory"), c2pGetPaymentMethodClass(_variant_t(_T("选片二销"))));
+							}
+
+							rs->Close();
+						}
+					}();
+					// 加挑金额;
+					PRICENULL(rsErpPickItem, _T("Plu_Amount"), rsdindanbukuan2->GetCollect(_T("money")));
+					// 加挑物品;[Plu_Goods]
+					rsErpPickItem->PutCollect(_T("Plu_Goods"), rsdindanbukuan2->GetCollect(_T("bz")));
+					// 接单门市;[Plu_OpenSingle]
+					[&, this]() {
+						CString str;
+						_variant_t ren = pcRecordSet->GetCollect(_T("ren"));
+						_variant_t ren2 = pcRecordSet->GetCollect(_T("ren2"));
+
+						if (ren.vt != VT_EMPTY && ren.vt != VT_NULL && _tcscmp(ren.bstrVal, _T("")) != 0)
+						{
+							var = c2pGetEmployeeId(ren);
+
+							if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+								str += var.bstrVal;
+						}
+
+						if (ren2.vt != VT_EMPTY && ren2.vt != VT_NULL && _tcscmp(ren2.bstrVal, _T("")) != 0)
+						{
+							if (!str.IsEmpty())
+								str += _T(",");
+
+							var = c2pGetEmployeeId(ren2);
+
+							if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+								str += var.bstrVal;
+						}
+
+						rsErpPickItem->PutCollect(_T("Plu_OpenSingle"), _variant_t(str));
+					}();
+					// 录单人[Plu_RecordedPerson];
+					var = rsdindanbukuan2->GetCollect(_T("ren2"));
+
+					if (var.vt != VT_EMPTY && var.vt != VT_NULL && _tcscmp(var.bstrVal, _T("")) != 0)
+						rsErpPickItem->PutCollect(_T("Plu_RecordedPerson"), var);
+
+					// 生成日期;[[Plu_CreateTime]]
+					DATENULL(rsErpPickItem, _T("Plu_CreateTime"), rsdindanbukuan2->GetCollect(_T("date")));
+					// [Plu_SourceType]0 为后期二销 1 为选片加挑二销
+					rsErpPickItem->PutCollect(_T("Plu_SourceType"), 0);
+					//////////////////////////////////////////////////////////////////////////
+					rsErpPickItem->Update();
+					// 下一条;
+					rsdindanbukuan2->MoveNext();
+				}
+
+				rsErpPickItem->Close();
+			}
+
+			rsdindanbukuan2->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderSelection(c2pSelection & c2pslt)
+{
+	try
+	{
+#ifdef _DEBUG
+
+		if (c2pslt.strOrder == _T("20170817-026"))
+		{
+			WriteTextLog(_T("c2pOrderSelection"));
+		}
+
+#endif
+		CString strtmp;
+		CString strno;
+		CString strno2;
+		CString strSelection1;
+		CString strSelection2;
+		CString strSql;
+		CString strNoResult;
+		CString strNo2Result;
+		CString strViceNumber;
+		strViceNumber.Format(_T("%s%s_001"), Global::g_szClassicBranchId, c2pslt.strOrder);
+
+		for (c2pSelectionItem item : c2pslt.vtItems)
+		{
+			if (!item.strNo.IsEmpty())
+			{
+				// 选片;
+				// 入册与入底,不用获取商品id;
+				if (item.strSpName == _T("入底") || item.strSpName == _T("入册"))
+					strtmp.Format(_T("%s?%s:"), item.strSpName, item.strSpName);
+				else
+				{
+					_variant_t proUid = c2pGetOrderProductUId(_variant_t(item.strSpName), _variant_t(strViceNumber));
+					strtmp.Format(_T("%s?%s:"), item.strSpName, (proUid.vt == VT_EMPTY || proUid.vt == VT_NULL) ? _T("") : proUid.bstrVal);
+				}
+
+				// 经典版是否加密;
+				if (item.strNo.Left(3) == _T("<?>"))
+				{
+					item.strNo.Delete(0, 3);
+					des_crypt(item.strNo, item.strNo, DES_DECRYPT);
+				}
+
+				item.strNo.TrimRight(_T("|"));
+				item.strNo += _T("|");
+				item.strNo.Replace(_T("|"), _T(".JPG?"));
+				item.strNo.TrimRight(_T("?"));
+				strtmp += item.strNo;
+
+				if (!strno.IsEmpty())
+					strno += _T("|");
+
+				strno += strtmp;
+			}
+
+			if (!item.strNo2.IsEmpty())
+			{
+				// 选版;
+				// 入册与入底,不用获取商品id;
+				if (item.strSpName == _T("入底") || item.strSpName == _T("入册"))
+					strtmp.Format(_T("%s?%s:"), item.strSpName, item.strSpName);
+				else
+				{
+					_variant_t proUid = c2pGetOrderProductUId(_variant_t(item.strSpName), _variant_t(strViceNumber));
+					strtmp.Format(_T("%s?%s:"), item.strSpName, (proUid.vt == VT_EMPTY || proUid.vt == VT_NULL) ? _T("") : proUid.bstrVal);
+				}
+
+				// 经典版是否加密;
+				if (item.strNo2.Left(3) == _T("<?>"))
+				{
+					item.strNo2.Delete(0, 3);
+					des_crypt(item.strNo2, item.strNo2, DES_DECRYPT);
+				}
+
+				item.strNo2.TrimRight(_T("|"));
+				item.strNo2 += _T("|");
+				item.strNo2.Replace(_T("|"), _T(".JPG?"));
+				item.strNo2.TrimRight(_T("?"));
+				strtmp += item.strNo2;
+
+				if (!strno2.IsEmpty())
+					strno2 += _T("|");
+
+				strno2 += strtmp;
+			}
+		}
+
+		//////////////////////////////////////////////////////////////////////////
+		// 选片;
+		//////////////////////////////////////////////////////////////////////////
+		{
+			strNoResult += _T("*");
+			strtmp = c2pslt.strbz3;
+			strtmp += _T("?");
+			// 相片说明;
+			c2pslt.strbz4.Replace(_T(":"), _T(".JPG:"));
+			c2pslt.strbz4.Replace(_T("  "), _T("|"));// 两空格;
+			strtmp += c2pslt.strbz4;
+			strNoResult += EncodeHex16String(strtmp);
+
+			// 删除的相片;
+			strNoResult += _T("*");
+			c2pslt.strDelphotos.TrimLeft(_T("|"));
+
+			if (!c2pslt.strDelphotos.IsEmpty())
+			{
+				if (c2pslt.strDelphotos.Left(3) == _T("<?>"))
+				{
+					c2pslt.strDelphotos.Delete(0, 3);
+					des_crypt(c2pslt.strDelphotos, c2pslt.strDelphotos, DES_DECRYPT);
+				}
+
+				c2pslt.strDelphotos.TrimRight(_T("|"));
+				c2pslt.strDelphotos += _T("|");
+				c2pslt.strDelphotos.Replace(_T("|"), _T(".JPG?"));
+				c2pslt.strDelphotos.TrimRight(_T("?"));
+				strNoResult += c2pslt.strDelphotos;
+			}
+
+			if (strNoResult == _T("*003F*"))
+			{
+				//WriteTextLog(_T("订单号:%s,%s\n"), c2pslt.strOrder,strNoResult);
+				strSelection1 = strno;
+			}
+			else
+			{
+				//WriteTextLog(_T("订单号:%s,%s\n"), c2pslt.strOrder, strno + strNoResult);
+				strSelection1 = strno + strNoResult;
+			}
+		}
+
+		//////////////////////////////////////////////////////////////////////////
+		// 选版;
+		//////////////////////////////////////////////////////////////////////////
+		{
+			strNo2Result += _T("*");
+			strtmp = c2pslt.strbz2;
+			strtmp += _T("?");
+			// 相片说明;
+			c2pslt.strbz5.Replace(_T(":"), _T(".JPG:"));
+			c2pslt.strbz5.Replace(_T("  "), _T("|"));// 两空格;
+			strtmp += c2pslt.strbz5;
+			strNo2Result += EncodeHex16String(strtmp);
+
+			// 删除的相片;
+			strNo2Result += _T("*");
+			c2pslt.strDelphotos2.TrimLeft(_T("|"));
+
+			if (!c2pslt.strDelphotos2.IsEmpty())
+			{
+				if (c2pslt.strDelphotos2.Left(3) == _T("<?>"))
+				{
+					c2pslt.strDelphotos2.Delete(0, 3);
+					des_crypt(c2pslt.strDelphotos2, c2pslt.strDelphotos2, DES_DECRYPT);
+				}
+
+				c2pslt.strDelphotos2.TrimRight(_T("|"));
+				c2pslt.strDelphotos2 += _T("|");
+				c2pslt.strDelphotos2.Replace(_T("|"), _T(".JPG?"));
+				c2pslt.strDelphotos2.TrimRight(_T("?"));
+				strNo2Result += c2pslt.strDelphotos2;
+			}
+
+			if (strNo2Result == _T("*003F*"))
+			{
+				//WriteTextLog(_T("选版订单号:%s,%s\n"), c2pslt.strOrder, strNo2Result);
+				strSelection2 = strno2;
+			}
+			else
+			{
+				//WriteTextLog(_T("选版订单号:%s,%s\n"), c2pslt.strOrder, strno2 + strNo2Result);
+				strSelection2 = strno2 + strNo2Result;
+			}
+		}
+
+		//////////////////////////////////////////////////////////////////////////
+		// 执行更新语句;
+		//////////////////////////////////////////////////////////////////////////
+		_CommandPtr m_pCommand;
+		m_pCommand.CreateInstance(__uuidof(Command));
+		// 将库连接赋于它;
+		m_pCommand->ActiveConnection = m_pPlatinumConnection;
+		// SQL语句;
+		strSql.Format(_T("UPDATE [dbo].[tb_ErpOrderDigital] SET [Ordv_SelectionFilm] = '%s',[Ordv_SelectionDesign] = '%s' WHERE [Ordv_ViceNumber] = '%s'"),
+			strSelection1,
+			strSelection2,
+			strViceNumber);
+		m_pCommand->CommandText = _bstr_t(strSql);
+		// 执行SQL语句,返回记录集
+		m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdText);
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,订单=%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, c2pslt.strOrder, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+bool c2p::isChildOrderType(_variant_t varType)
+{
+	if (varType.vt == VT_EMPTY || varType.vt == VT_NULL || _tcscmp(varType.bstrVal, _T("")) == 0)
+		return false;
+
+	bool found = false;
+
+	for (std::wstring name : m_listResult)
+	{
+		if (_tcsicmp(name.c_str(), varType.bstrVal) == 0)
+		{
+			found = true;
+			break;
+		}
+	}
+
+	return found;
+}
+
+void c2p::c2pOrderImg(CString strOrder)
+{
+	auto funs = [&, this](int nImgType, CString strOrder) {
+		// 根据订单号查找所有目录;
+		CStringArray AryOrderDir;
+
+		for (ShareDir item : m_vtShareDir)
+		{
+			if (item.photoType == nImgType)
+			{
+				CString strDir;
+
+				if (item.strBranchId.IsEmpty())
+				{
+					if (Global::g_bOurBranch)
+						strDir.Format(_T("%s\\%s\\"), item.strSharePath, strOrder);
+					else
+						strDir.Format(_T("%s\\%s\\%s\\"), item.strSharePath, m_strClassicDomain, strOrder);
+
+					AryOrderDir.Add(strDir);
+				}
+				else if (_tcscmp(item.strBranchId, m_strClassicDomain) == 0)
+				{
+					strDir.Format(_T("%s\\%s\\"), item.strSharePath, strOrder);
+					AryOrderDir.Add(strDir);
+				}
+			}
+		}
+
+		// 铂金版订单号;
+		CString strPlatinumOrder;
+		strPlatinumOrder.Format(_T("%s%s"), Global::g_szClassicBranchId, strOrder);
+		CString strPlatinumDir;
+
+		if (nImgType == OImgtype)
+			strPlatinumDir.Format(_T("%s\\%s\\"), g_szPath1, strPlatinumOrder);
+		else if (nImgType == EImgtype)
+			strPlatinumDir.Format(_T("%s\\%s\\"), g_szPath2, strPlatinumOrder);
+		else if (nImgType == FImgtype)
+			strPlatinumDir.Format(_T("%s\\%s\\"), g_szPath3, strPlatinumOrder);
+		else if (nImgType == DImgtype)
+			strPlatinumDir.Format(_T("%s\\%s\\"), g_szPath4, strPlatinumOrder);
+
+		// 复制文件夹;
+		for (int i = 0; i < AryOrderDir.GetSize(); i++)
+		{
+			COPYFOLDER(AryOrderDir.GetAt(i), strPlatinumDir);
+		}
+	};
+
+	funs(OImgtype, strOrder);
+	funs(EImgtype, strOrder);
+	funs(FImgtype, strOrder);
+	funs(DImgtype, strOrder);
+}
+
+
+void c2p::c2pOrderSubClass(_variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr pcRecordSet)
+{
+	try
+	{
+#ifdef _DEBUG
+
+		if (_tcscmp(varClassicOrder.bstrVal, _T("20120324-001")) == 0)
+		{
+			WriteTextLog(_T("c2pOrderScenicSpot"));
+		}
+
+#endif
+		CString strSql;
+		_RecordsetPtr rsdindanjd;
+		rsdindanjd.CreateInstance(__uuidof(Recordset));
+		strSql.Format(_T("select * from dindanjd where id = '%s'"), varClassicOrder.bstrVal);
+		HRESULT hr = rsdindanjd->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			int nSubId = 1;
+
+			while (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+				// 生成子单;
+				_variant_t varSubId = [&, this]()->_variant_t {
+					TCHAR szSubID[50] = { 0 };
+					_stprintf_s(szSubID, _T("%s_%03d"), varPlatinumOrder.bstrVal, nSubId);
+					return szSubID;
+				}();
+
+				// 子单化景点;
+				c2pSubOrderScenicSpot(varSubId, varClassicOrder, varPlatinumOrder, rsdindanjd, pcRecordSet);
+				// 子单化数码;
+				c2pSubOrderDigital(nSubId, varSubId, varClassicOrder, varPlatinumOrder, rsdindanjd, pcRecordSet);
+				// 子单化数码状态;
+				c2pSubOrderDigitalStatus(nSubId, varSubId, varClassicOrder, varPlatinumOrder, rsdindanjd, pcRecordSet);
+
+				nSubId++;
+				rsdindanjd->MoveNext();
+			}
+
+			rsdindanjd->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderScenicSpot(_variant_t &varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// dindanjd; //tb_ErpOrdersPhotography;
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrdersPhotography where Ordpg_ViceNumber = '%s' and Ordpg_Sights = '%s'"),
+			varSubId.bstrVal, rsdindanjd->GetCollect(_T("name")).bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+				_RecordsetPtr rsScenicSpot;
+				rsScenicSpot.CreateInstance(__uuidof(Recordset));
+				HRESULT hr = rsScenicSpot->Open(_T("select * from tb_ErpOrdersPhotography"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					rsScenicSpot->AddNew();
+					//////////////////////////////////////////////////////////////////////////
+					rsScenicSpot->PutCollect(_T("Ordpg_IDNumber"), [&, this]()->_variant_t {
+						TCHAR szID[50] = { 0 };
+						TCHAR szResult[50] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szID, 50, 10);
+						_stprintf_s(szResult, _T("ORDS_%s"), &szID);
+						return szResult;
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_Number"), varPlatinumOrder);
+					rsScenicSpot->PutCollect(_T("Ordpg_ViceNumber"), varSubId);
+					rsScenicSpot->PutCollect(_T("Ordpg_Sights"), rsdindanjd->GetCollect(_T("name")));
+					rsScenicSpot->PutCollect(_T("Ordpg_CostPrice"), 0);
+					rsScenicSpot->PutCollect(_T("Ordpg_SightsLevel"), _T("BEBBBCADDEBFJDFFC"));//景点等级,都是一级;
+					rsScenicSpot->PutCollect(_T("Ordpg_SightsType"), _T("0"));//景点类别 (0:内景 , 1:外景)//经典无此分类;
+					rsScenicSpot->PutCollect(_T("Ordpg_ApparelQuantity"), 0);//服装套数//经典无此分类;
+					// 摄影师;
+					rsScenicSpot->PutCollect(_T("Ordpg_Photographer"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter1"))));
+					//拍摄时间;
+					DATENULL(rsScenicSpot, _T("Ordpg_PhotographyTime"), rsdindanjd->GetCollect(_T("date")));
+					//拍摄状态 0:未拍  1: OK(已拍)   2:拍照中
+					rsScenicSpot->PutCollect(_T("Ordpg_PhotographyStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindanjd->GetCollect(_T("status"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未拍")) == 0)
+							return _T("0");
+						else if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return _T("1");
+						else
+							return _T("2");
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_PhotographyAssistant"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter12"))));//摄影助理;
+
+					if (Global::g_bChildVersion)
+						rsScenicSpot->PutCollect(_T("Ordpg_BootDivision"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter2"))));//引导师;
+					else
+						rsScenicSpot->PutCollect(_T("Ordpg_MakeupArtist"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter2"))));//化妆师;
+
+					rsScenicSpot->PutCollect(_T("Ordpg_MakeupAssistant"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter22"))));//化妆师助理;
+					// 预约拍照日期与时间;Ordpg_ReservationPhotographyDividedShop
+					//DATENULL(rsScenicSpot, _T("Ordpg_ReservationPhotographyTime"), rsdindanjd->GetCollect(_T("bookingdate")));
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyTime"), [&, this]()->_variant_t {
+						_variant_t result;
+						_variant_t date = rsdindanjd->GetCollect(_T("bookingdate"));
+						_variant_t time = rsdindanjd->GetCollect(_T("time"));
+
+						if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+						{
+							CString strdate;
+
+							if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+							{
+								strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+								// time可能包含中文字符;
+								if (strdate.SpanIncluding(_T("0123456789:- ")).IsEmpty())
+									strdate.Format(_T("%s"), date.bstrVal);
+							}
+							else
+							{
+								strdate.Format(_T("%s"), date.bstrVal);
+							}
+
+							DATE dt = String2Date(strdate);
+
+							if (dt > 0) //1899年;
+								result = dt;
+						}
+
+						return result;
+					}());
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyDividedShop"), Global::g_szPlatinumBranchId);//预约分店;
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyName"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter1"))));//预约摄影师;
+					rsScenicSpot->PutCollect(_T("Ordpg_ReservationPhotographyAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter12"))));//预约摄影师助理;
+
+					if (Global::g_bChildVersion)
+					{
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationBootDivision"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约引导师;
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationBootDivisionAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约引导师助理;
+					}
+					else
+					{
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationMakeupArtist"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约化妆师;
+						rsScenicSpot->PutCollect(_T("Ordpg_ReservationMakeupAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约化妆师助理;
+					}
+
+					rsScenicSpot->PutCollect(_T("Ordpg_Remark"), rsdindanjd->GetCollect(_T("bz")));
+					// 售价;
+					rsScenicSpot->PutCollect(_T("Ordpg_SalesPrice"), 0);
+					DATENULL(rsScenicSpot, _T("Ordpg_CreateDateTime"), rsdindan->GetCollect(_T("time1")));
+					//////////////////////////////////////////////////////////////////////////
+					rsScenicSpot->Update();
+					// rsdindanjd->MoveNext();//不需要下一条,由上层函数控制;
+					rsScenicSpot->Close();
+				}
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderDigital(const int &nSubId, _variant_t & varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrderDigital where Ordv_ViceNumber = '%s'"), varSubId.bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				HRESULT hr = rs->Open(_T("select * from tb_ErpOrderDigital"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					rs->AddNew();
+					rs->PutCollect(_T("Ordv_Number"), varPlatinumOrder);
+					rs->PutCollect(_T("Ordv_ViceNumber"), varSubId);
+					rs->PutCollect(_T("Ordv_DigitalNumber"), nSubId);
+					rs->PutCollect(_T("Ordv_ClothingStatus"), [&, this]()->_variant_t {
+						// 服装套数;
+						_variant_t var = rsdindan->GetCollect(_T("clothescount"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+						{
+							var.vt = VT_I4;
+							var.intVal = 0;
+						}
+						else
+						{
+							var.vt = VT_I4;
+							var.intVal = 1;
+						}
+						return var;
+					}());
+					// 初修师;
+					rs->PutCollect(_T("Ordv_EarlyRepairName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter5"))));
+					//rs->PutCollect(_T("Ordv_EarlyRepairTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time8"))));
+					DATENULL(rs, _T("Ordv_EarlyRepairTime"), rsdindan->GetCollect(_T("time8")));
+					rs->PutCollect(_T("Ordv_EarlyRepairStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status4"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未修")) == 0)
+							return 0;
+						else if (_tcscmp(var.bstrVal, _T("修片中")) == 0)
+							return 1;
+						else
+							return 2;
+					}());
+					// 选片;
+					rs->PutCollect(_T("Ordv_FilmSelectionName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter3"))));
+					//rs->PutCollect(_T("Ordv_FilmSelectionTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time4"))));
+					DATENULL2(rs, _T("Ordv_FilmSelectionTime"), rsdindan->GetCollect(_T("time4")));
+					rs->PutCollect(_T("Ordv_FilmSelectionStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status2"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未选")) == 0)
+						{
+							return 0;
+						}
+						else
+						{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return 1;
+						}
+					}());
+					// 设计;
+					rs->PutCollect(_T("Ordv_DesignerName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter4"))));
+					//rs->PutCollect(_T("Ordv_DesignerTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time10"))));
+					DATENULL(rs, _T("Ordv_DesignerTime"), rsdindan->GetCollect(_T("time10")));
+					rs->PutCollect(_T("Ordv_DesignerStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status5"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未设计")) == 0)
+						{
+							return 0;
+						}
+						else if (_tcscmp(var.bstrVal, _T("设计中")) == 0)
+						{
+							return 1;
+						}
+						else
+						{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return 2;
+						}
+					}());
+					// 精修师;
+					rs->PutCollect(_T("Ordv_RefinementName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter7"))));
+					//rs->PutCollect(_T("Ordv_RefinementTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time9"))));
+					DATENULL(rs, _T("Ordv_RefinementTime"), rsdindan->GetCollect(_T("time9")));
+					rs->PutCollect(_T("Ordv_RefinementStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status6"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未修")) == 0)
+						{
+							return 0;
+						}
+						else if (_tcscmp(var.bstrVal, _T("修片中")) == 0)
+						{
+							return 1;
+						}
+						else
+						{ //if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return 2;
+						}
+					}());
+					// 看设计;
+					rs->PutCollect(_T("Ordv_LookDesignName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter8"))));
+					//rs->PutCollect(_T("Ordv_LookDesignTime"), VARDATENULL(pcRecordSet->GetCollect(_T("time6"))));
+					DATENULL2(rs, _T("Ordv_LookDesignTime"), rsdindan->GetCollect(_T("time6")));
+					rs->PutCollect(_T("Ordv_LookDesignClaim"), rsdindan->GetCollect(_T("bz2")));
+					rs->PutCollect(_T("Ordv_LookDesignStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status8"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未看")) == 0)
+						{
+							return 0;
+						}
+						else if (_tcscmp(var.bstrVal, _T("修改中")) == 0)
+						{
+							return 3;
+						}
+						else
+						{ // if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return 1;
+						}
+					}());
+					// 入底加挑张数;choosezs;(不做入册加挑)
+					rs->PutCollect(_T("Ordv_IntoBottomAddPickQuantity"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("choosezs"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+						{
+							return 0;
+						}
+
+						return _ttoi(var.bstrVal);
+					}());
+					// 入底\入册;
+					[&, this]() {
+						CString str = rsdindan->GetCollect(_T("taoxizs")).bstrVal;
+						int nAlbum = -1; // 入册数量,默认-1表示全送;
+						int nNegative = -1;// 入底数量,默认-1表示全送;
+						int nIndex = str.Find(_T("\\"));
+
+						if (nIndex == -1)
+							return;
+
+						// 入底;
+						bool bDigit = true;
+
+						// 使用isdigit会出错,宽字符下;
+						if (!str.Left(nIndex).SpanIncluding(_T("0123456789")))
+						{
+							bDigit = false;
+						}
+
+						if (bDigit)
+							nNegative = _ttoi(str.Left(nIndex));
+
+						rs->PutCollect(_T("Ordv_IntoBottomQuantity"), nNegative);
+
+						// 入册;
+						bDigit = true;
+
+						// 使用isdigit会出错,宽字符下;
+						if (!str.Mid(nIndex + 1).SpanIncluding(_T("0123456789")))
+						{
+							bDigit = false;
+						}
+
+						if (bDigit)
+							nAlbum = _ttoi(str.Mid(nIndex + 1));
+
+						rs->PutCollect(_T("Ordv_IntoRegisterQuantity"), nAlbum);
+
+					}();
+
+					// 预约选片人员和选片时间;
+					rs->PutCollect(_T("Ordv_ReservationFilmSelectionDividedShop"), Global::g_szPlatinumBranchId);
+					rs->PutCollect(_T("Ordv_ReservationFilmSelectionName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter3"))));
+					rs->PutCollect(_T("Ordv_ReservationFilmSelectionTime"), [&, this]()->_variant_t {
+						_variant_t result;
+						_variant_t date = rsdindan->GetCollect(_T("time4"));
+						_variant_t time = rsdindan->GetCollect(_T("datetime4"));
+
+						if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+						{
+							CString strdate;
+
+							if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+							{
+								strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+								// time可能包含中文字符;
+								if (strdate.SpanIncluding(_T("0123456789:")))
+									strdate.Format(_T("%s"), date.bstrVal);
+							}
+							else
+							{
+								strdate.Format(_T("%s"), date.bstrVal);
+							}
+
+							DATE dt = String2Date(strdate);
+
+							if (dt > 0) //1899年;
+								result = dt;
+						}
+
+						return result;
+					}());
+
+					// 预约看样人员和看样时间;
+					rs->PutCollect(_T("Ordv_ReservationLookDesignDividedShop"), Global::g_szPlatinumBranchId);
+					rs->PutCollect(_T("Ordv_ReservationLookDesignName"), c2pGetEmployeeId(rsdindan->GetCollect(_T("waiter8"))));
+					rs->PutCollect(_T("Ordv_ReservationLookDesignTime"), [&, this]()->_variant_t {
+						_variant_t result;
+						_variant_t date = rsdindan->GetCollect(_T("time6"));
+						_variant_t time = rsdindan->GetCollect(_T("datetime6"));
+
+						if (date.vt != VT_EMPTY && date.vt != VT_NULL && _tcscmp(date.bstrVal, _T("")) != 0)
+						{
+							CString strdate;
+
+							if (time.vt != VT_EMPTY && time.vt != VT_NULL)
+							{
+								strdate.Format(_T("%s %s"), date.bstrVal, time.bstrVal);
+
+								// time可能包含中文字符;
+								if (strdate.SpanIncluding(_T("0123456789:")))
+									strdate.Format(_T("%s"), date.bstrVal);
+							}
+							else
+							{
+								strdate.Format(_T("%s"), date.bstrVal);
+							}
+
+							DATE dt = String2Date(strdate);
+
+							if (dt > 0) //1899年;
+								result = dt;
+						}
+
+						return result;
+					}());
+
+					rs->Update();
+					rs->Close();
+				}
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderDigitalStatus(const int &nSubId, _variant_t & varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrderDigitalStatus where Ords_ViceNumber = '%s'"), varSubId.bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				HRESULT hr = rs->Open(_T("select * from tb_ErpOrderDigitalStatus"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					rs->AddNew();
+					rs->PutCollect(_T("Ords_Number"), [&, this]()->_variant_t {
+						// 如果存在, 或者异常,新建spid;
+						TCHAR szUid[50] = { 0 };
+						TCHAR szResult[50] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 50, 10);
+						_stprintf_s(szResult, _T("ORDS_%s"), &szUid);
+						return szResult;
+					}());
+					rs->PutCollect(_T("Ords_OrdNumber"), varPlatinumOrder);
+					rs->PutCollect(_T("Ords_ViceNumber"), varSubId);
+					rs->PutCollect(_T("Ords_DigitalNumber"), nSubId);
+					rs->PutCollect(_T("Ords_OutSendEarlyRepairStatus"), _T("未发"));//外发初修;
+					rs->PutCollect(_T("Ords_OutSendEarlyRepairQuantity"), 0);
+					//数码拍照状态;
+					rs->PutCollect(_T("Ords_PhotographStatus"), rsdindan->GetCollect(_T("status")));//_T("未拍"));
+					rs->PutCollect(_T("Ords_PhotographIntStatus"), [&, this]()->_variant_t {
+						_variant_t var = rsdindan->GetCollect(_T("status"));
+
+						if (var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0 || _tcscmp(var.bstrVal, _T("未拍")) == 0)
+							return 0;
+						else if (_tcscmp(var.bstrVal, _T("OK")) == 0)
+							return 2;
+						else
+							return 1;
+					}());
+					rs->PutCollect(_T("Ords_ProductCount"), 0);
+					rs->PutCollect(_T("Ords_ProductSendStatus"), _T("未发"));
+					rs->PutCollect(_T("Ords_ProductCompletedStatus"), _T("未完"));
+					rs->PutCollect(_T("Ords_ProductPickupStatus"), _T("未取"));
+					rs->PutCollect(_T("Ords_ProductPickupIntStatus"), 0);
+					rs->PutCollect(_T("Ords_ProductIsExpedited"), _T("否"));//是否加急;
+					rs->PutCollect(_T("Ords_ServiceCount"), 0);//数码服务数量
+					rs->PutCollect(_T("Ords_ServiceStatus"), _T("未进行"));//数码服务状态 未进行、已完(OK)、进行中
+					rs->PutCollect(_T("Ords_ServiceIntStatus"), 0);//数码服务状态  0:未进行、1:进行中、2:OK
+					rs->PutCollect(_T("Ords_OutSendRefineRepairStatus"), _T("未发"));//外发精修状态 未发、已发、已回
+					rs->PutCollect(_T("Ords_OutSendRefineRepairQuantity"), 0);//外发精修数量
+
+					rs->Update();
+					rs->Close();
+				}
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderGoods(_variant_t & varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrderProductList where OPlist_ViceNumber = '%s' "), varSubId.bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderReceiptsRecord(_variant_t & varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrderProductList where OPlist_ViceNumber = '%s' "), varSubId.bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSubOrderReceiptsItem(_variant_t & varSubId, _variant_t & varClassicOrder, _variant_t & varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan)
+{
+	try
+	{
+		// 判断子单是否存在;
+		CString strSql;
+		strSql.Format(_T("select * from tb_ErpOrderProductList where OPlist_ViceNumber = '%s' "), varSubId.bstrVal);
+		_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+		if (result == NULL || result->adoEOF == VARIANT_TRUE)
+		{
+			// 不存在;
+			if (rsdindanjd->adoEOF == VARIANT_FALSE)
+			{
+
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, varClassicOrder.bstrVal, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pGetMultipleShareDir()
+{
+	try
+	{
+		// 加入本地目录//不处理备份;
+		{
+			auto ADDLOCALSHAREHOST = [&, this](TCHAR * szDirectory, int nImgType) {
+				bool bhas = false;
+
+				for (ShareDir item : m_vtShareDir)
+				{
+					if (item.strBranchId.IsEmpty() && nImgType == item.photoType && item.strSharePath.CompareNoCase(szDirectory) == 0)
+					{
+						bhas = true;
+						break;
+					}
+				}
+
+				if (!bhas)
+				{
+					ShareDir sd;
+					sd.enable = true;
+					sd.photoType = nImgType;
+					sd.strBranchId = _T("");
+					sd.strSharePath = szDirectory;
+					m_vtShareDir.push_back(sd);
+				}
+			};
+
+			TCHAR szShareDir[MAX_PATH] = { 0 };
+			_stprintf_s(szShareDir, _T("\\\\%s\\%s"), Global::g_szShareImgHost, OImgpath);
+			ADDLOCALSHAREHOST(szShareDir, OImgtype);
+
+			_stprintf_s(szShareDir, _T("\\\\%s\\%s"), Global::g_szShareImgHost, EImgpath);
+			ADDLOCALSHAREHOST(szShareDir, EImgtype);
+
+			_stprintf_s(szShareDir, _T("\\\\%s\\%s"), Global::g_szShareImgHost, FImgpath);
+			ADDLOCALSHAREHOST(szShareDir, FImgtype);
+
+			_stprintf_s(szShareDir, _T("\\\\%s\\%s"), Global::g_szShareImgHost, DImgpath);
+			ADDLOCALSHAREHOST(szShareDir, DImgtype);
+		}
+
+		CString strSql;
+		_RecordsetPtr rsShareInfo;
+		rsShareInfo.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsShareInfo->Open(_T("select * from [NetShareInfo]"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			while (rsShareInfo->adoEOF == VARIANT_FALSE)
+			{
+				ShareDir sd;
+				sd.enable = rsShareInfo->GetCollect(_T("enable")).boolVal;
+				sd.strBranchId = rsShareInfo->GetCollect(_T("branchid")).bstrVal;
+				sd.strSharePath = rsShareInfo->GetCollect(_T("sharePath")).bstrVal;
+				sd.photoType = rsShareInfo->GetCollect(_T("photoType")).intVal;
+				bool bexists = false;
+
+				for (ShareDir item : m_vtShareDir)
+				{
+					if (item.photoType == sd.photoType && item.strSharePath.CompareNoCase(sd.strSharePath) == 0)
+					{
+						bexists = true;
+						break;
+					}
+				}
+
+				if (!bexists)
+				{
+					m_vtShareDir.push_back(sd);
+					WriteTextLog(sd.strSharePath);
+				}
+
+				rsShareInfo->MoveNext();
+			}
+
+			rsShareInfo->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pGetClassicDomain()
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rspath;
+		rspath.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rspath->Open(_T("select * from [path]"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rspath->adoEOF == VARIANT_FALSE)
+			{
+				m_strClassicDomain = rspath->GetCollect(_T("path1")).bstrVal;
+			}
+
+			rspath->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pBranchInfo()
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsVersion;
+		rsVersion.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsVersion->Open(_T("select * from version"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			if (rsVersion->adoEOF == VARIANT_FALSE)
+			{
+				// 店面信息;
+				{
+					// 声明记录集指针;
+					_RecordsetPtr pRecordset;
+					// 创建实例;
+					pRecordset.CreateInstance(__uuidof(Recordset));
+					strSql.Format(_T("select * from tb_ErpCompanyInfo where Company_DividedShop = '%s'"), Global::g_szPlatinumBranchId);
+					HRESULT hr = pRecordset->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						if (pRecordset->adoEOF == VARIANT_TRUE)
+						{
+							// 没有记录;
+							pRecordset->AddNew();
+						}
+
+						pRecordset->PutCollect(_T("Company_DividedShop"), _variant_t(Global::g_szPlatinumBranchId));
+						pRecordset->PutCollect(_T("Company_Name"), rsVersion->GetCollect(_T("info1")));
+						pRecordset->PutCollect(_T("Company_Telephone"), rsVersion->GetCollect(_T("info2")));
+						pRecordset->PutCollect(_T("Company_Address"), rsVersion->GetCollect(_T("info3")));
+						pRecordset->PutCollect(_T("Company_URL"), rsVersion->GetCollect(_T("info4")));
+						pRecordset->PutCollect(_T("Company_Manager"), rsVersion->GetCollect(_T("info5")));
+						pRecordset->PutCollect(_T("Company_SingleTitle"), rsVersion->GetCollect(_T("info6")));
+						pRecordset->PutCollect(_T("Company_SingleExplanation"), rsVersion->GetCollect(_T("info7")));
+						pRecordset->PutCollect(_T("Company_DressDescription"), rsVersion->GetCollect(_T("info8")));
+						pRecordset->PutCollect(_T("Company_ProductionNotes"), rsVersion->GetCollect(_T("info9")));
+						pRecordset->PutCollect(_T("Company_ReservationExplanation"), rsVersion->GetCollect(_T("remarks")));
+						pRecordset->PutCollect(_T("Company_ChildReserveExplain"), rsVersion->GetCollect(_T("remarks")));
+						pRecordset->PutCollect(_T("Company_PortraitReserveExplain"), rsVersion->GetCollect(_T("remarks")));
+						pRecordset->PutCollect(_T("Company_MicroShareAccount"), rsVersion->GetCollect(_T("msAccount")));
+						pRecordset->PutCollect(_T("Company_MicroSharePassword"), rsVersion->GetCollect(_T("msPassword")));
+						pRecordset->Update();
+
+						pRecordset->Close();
+					}
+				}
+
+				// 短信信息;
+				{
+					// 声明记录集指针;
+					_RecordsetPtr pRecordset;
+					// 创建实例;
+					pRecordset.CreateInstance(__uuidof(Recordset));
+					strSql.Format(_T("select * from tb_ErpSmsAccountInfo where Smsa_DividedShop = '%s'"), Global::g_szPlatinumBranchId);
+					HRESULT hr = pRecordset->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						if (pRecordset->adoEOF == VARIANT_TRUE)
+						{
+							// 没有记录;
+							pRecordset->AddNew();
+						}
+
+						pRecordset->PutCollect(_T("Smsa_AccountNumber"), rsVersion->GetCollect(_T("msgaccount")));
+						pRecordset->PutCollect(_T("Smsa_Password"), rsVersion->GetCollect(_T("msgpsw")));
+						pRecordset->PutCollect(_T("Smsa_DividedShop"), _variant_t(Global::g_szPlatinumBranchId));
+						pRecordset->Update();
+						pRecordset->Close();
+					}
+				}
+			}
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pDepartment()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from bumen"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpDepartment"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取部门名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("name"));
+					// 判断部门是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t var = ptrPlatinum->GetCollect(_T("Dt_Name"));
+
+						if (_tcscmp(varName.bstrVal, var.bstrVal) == 0)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Dt_Name"), varName);
+						ptrPlatinum->PutCollect(_T("Dt_ClassParentID"), 0);
+						ptrPlatinum->PutCollect(_T("Dt_DividedShop"), Global::g_szPlatinumBranchId);
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pEmployee()
+{
+	try
+	{
+		m_dwIndex = 0;
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from renyuan"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpUser"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				struct Dept
+				{
+					int nId;
+					CString strName;
+				};
+
+				std::vector<Dept> vtDept;
+				{
+					// 获取部门信息;
+					_RecordsetPtr ptrPlatinum2;
+					ptrPlatinum2.CreateInstance(__uuidof(Recordset));
+					hr = ptrPlatinum2->Open(_T("select * from tb_ErpDepartment"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						while (ptrPlatinum2->adoEOF == VARIANT_FALSE)
+						{
+							Dept dept;
+							dept.nId = ptrPlatinum2->GetCollect(_T("ID"));
+							dept.strName = ptrPlatinum2->GetCollect(_T("Dt_Name"));
+							vtDept.push_back(dept);
+							ptrPlatinum2->MoveNext();
+						}
+
+						ptrPlatinum2->Close();
+					}
+				}
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					m_dwIndex++;
+#ifdef _DEBUG
+
+					if (m_dwIndex == 11)
+					{
+						WriteTextLog(_T("c2pEmployee"));
+					}
+
+#endif
+					// 获取员工名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("name"));
+					_variant_t varPhone = ptrClassic->GetCollect(_T("phone"));
+					_variant_t varIdNo = ptrClassic->GetCollect(_T("idno"));
+					// 判断员工是否存在;
+					bExsits = false;
+					bool bSameName = false; // 账号是否相同;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t varUserName = ptrPlatinum->GetCollect(_T("User_Name"));
+						_variant_t varAccount = ptrPlatinum->GetCollect(_T("User_Account"));
+						_variant_t varTelphone = ptrPlatinum->GetCollect(_T("User_Telephone"));
+						_variant_t varIdCard = ptrPlatinum->GetCollect(_T("User_IdentityCardID"));
+
+						if (_tcscmp(varName.bstrVal, varAccount.bstrVal) == 0)
+						{
+							// 再判断手机号是否相同;//身份证不判断,因为铂金是后来加上的,可以空;
+							if (varTelphone.vt != VT_EMPTY && varTelphone.vt != VT_NULL && _tcscmp(varTelphone.bstrVal, varPhone.bstrVal) == 0)
+							{
+								bExsits = true;
+							}
+							else
+							{
+								bSameName = true;
+							}
+
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						_variant_t var;
+						ptrPlatinum->AddNew();
+
+						if (bSameName)
+						{
+							// 同名账号,不同人;
+							ptrPlatinum->PutCollect(_T("User_Account"), [&, this]()->_variant_t {
+								TCHAR szUid[20] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 20, 10);
+								return szUid;
+							}());
+						}
+						else
+						{
+							ptrPlatinum->PutCollect(_T("User_Account"), ptrClassic->GetCollect(_T("name")));
+						}
+
+						ptrPlatinum->PutCollect(_T("User_Name"), ptrClassic->GetCollect(_T("name")));
+						ptrPlatinum->PutCollect(_T("User_Sex"), ptrClassic->GetCollect(_T("sex")));
+						// 经典版电话长度50, 铂金20;只截取11位长度;
+						var = ptrClassic->GetCollect(_T("phone"));
+
+						if (var.vt == VT_NULL || var.vt == VT_EMPTY || _tcscmp(var.bstrVal, _T("")) == 0)
+							ptrPlatinum->PutCollect(_T("User_Telephone"), _T(""));
+						else
+						{
+							CString strTel = var.bstrVal;
+							ptrPlatinum->PutCollect(_T("User_Telephone"), _variant_t(strTel.Left(11)));
+						}
+
+						ptrPlatinum->PutCollect(_T("User_Hometown"), ptrClassic->GetCollect(_T("address")));
+						ptrPlatinum->PutCollect(_T("User_HometownAddress"), ptrClassic->GetCollect(_T("address")));
+						ptrPlatinum->PutCollect(_T("User_Remark"), ptrClassic->GetCollect(_T("bz")));
+						ptrPlatinum->PutCollect(_T("User_NowAddress"), ptrClassic->GetCollect(_T("address2")));
+						ptrPlatinum->PutCollect(_T("User_IdentityCardID"), ptrClassic->GetCollect(_T("idno")));
+						var = ptrClassic->GetCollect(_T("marry"));
+						ptrPlatinum->PutCollect(_T("User_IsMarried"), _tcscmp(var.bstrVal, _T("已婚")) == 0 ? true : false);
+						ptrPlatinum->PutCollect(_T("User_Status"), ptrClassic->GetCollect(_T("dimission")));
+						// 经典版指纹可能空;
+						var = ptrClassic->GetCollect(_T("loginno1"));
+						ptrPlatinum->PutCollect(_T("User_FirstFingerprintID"), (var.vt == VT_EMPTY || var.vt == VT_NULL) ? _T("") : var);
+						// 经典版指纹可能空;
+						var = ptrClassic->GetCollect(_T("loginno2"));
+						ptrPlatinum->PutCollect(_T("User_SecondaryFingerprintID"), (var.vt == VT_EMPTY || var.vt == VT_NULL) ? _T("") : var);
+						ptrPlatinum->PutCollect(_T("User_EmployeeID"), m_uniqueid.get_unique_id());
+						// 部门id;
+						int ndptId = -1;
+
+						for (Dept &item : vtDept)
+						{
+							if (item.strName.CompareNoCase(ptrClassic->GetCollect(_T("bm")).bstrVal) == 0)
+							{
+								ndptId = item.nId;
+								break;
+							}
+						}
+
+						ptrPlatinum->PutCollect(_T("User_Department"), ndptId);
+						ptrPlatinum->PutCollect(_T("User_DividedShop"), Global::g_szPlatinumBranchId);	//##虽不是必填项,但是是查询项;
+						// 其他非空字段;
+						ptrPlatinum->PutCollect(_T("User_Password"), _T("81dc9bdb52d04dc20036dbd8313ed055"));
+						ptrPlatinum->PutCollect(_T("User_Positions"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_BelongRoles"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_Competence"), _T(""));
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						ptrPlatinum->PutCollect(_T("User_OnlineTime"), time1.m_dt);
+						ptrPlatinum->PutCollect(_T("User_IsDisable"), false);
+						ptrPlatinum->PutCollect(_T("User_Ethnic"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_ICQAccount"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_Email"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_MicroSignal"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_Attachment"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_SubordinateList"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_HeadImgePath"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_DocumentPermissions"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_EntryTime"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_ProbationTime"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_TryWages"), 0);
+						ptrPlatinum->PutCollect(_T("User_PositiveTime"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_ReEntryTime"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_Graduated"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_ProfessionalLearning"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_Education"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_DateOfBirth"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_InsuranceCategory"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_EmergencyContactsOne"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_EmergencyContactsTelephoneOne"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_EmergencyContactsTwo"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_EmergencyContactsTelephoneTwo"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_ContractPeriod"), 0);
+						ptrPlatinum->PutCollect(_T("User_PositiveID"), _T(""));
+						ptrPlatinum->PutCollect(_T("User_IDNegative"), _T(""));
+
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d, nIndex=%ld =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_dwIndex, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pSupplier()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from gongyingshang"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpVendor"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("gyname"));
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t var = ptrPlatinum->GetCollect(_T("Vd_Name"));
+
+						if (_tcscmp(varName.bstrVal, var.bstrVal) == 0)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Vd_Name"), ptrClassic->GetCollect(_T("gyname")));
+						ptrPlatinum->PutCollect(_T("Vd_Address"), ptrClassic->GetCollect(_T("addr")));
+						ptrPlatinum->PutCollect(_T("Vd_Telephone"), ptrClassic->GetCollect(_T("tel")));
+						ptrPlatinum->PutCollect(_T("Vd_Fax"), ptrClassic->GetCollect(_T("fax")));
+						ptrPlatinum->PutCollect(_T("Vd_URL"), ptrClassic->GetCollect(_T("netaddress")));
+						ptrPlatinum->PutCollect(_T("Vd_Remark"), ptrClassic->GetCollect(_T("bz")));
+						ptrPlatinum->PutCollect(_T("Vd_Category"), _T("0"));
+						// ID;
+						ptrPlatinum->PutCollect(_T("Vd_Number"), [&, this]()->_variant_t {
+							// 如果存在, 或者异常,新建spid;
+							TCHAR szUid[24] = { 0 };
+							TCHAR szResult[50] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+							_stprintf_s(szResult, _T("SPH%s"), &szUid[3]);
+							return szResult;
+						}());
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pGoodsType()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from shangpinlb"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAA;BEBBBCADFEBEJBGD;BEBACCAFFHEAJICDF;BEBACCAFEGECFBJFD
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpSystemCategory"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				// 获取铂金版父类id;
+				int nPlatinumGoodsId = -1;
+				int nServiceGoodsId = -1; // 服务类型id;
+
+				while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					_variant_t gid = ptrPlatinum->GetCollect(_T("Sc_ClassCode"));
+
+					if (_tcscmp(_T("AAAAAAA"), gid.bstrVal) == 0)
+					{
+						nPlatinumGoodsId = ptrPlatinum->GetCollect(_T("ID"));
+					}
+
+					_variant_t sid = ptrPlatinum->GetCollect(_T("Sc_ClassCode"));
+
+					if (_tcscmp(_T("BEBADABBEEEGAEGFG"), gid.bstrVal) == 0)
+					{
+						nServiceGoodsId = ptrPlatinum->GetCollect(_T("ID"));
+					}
+
+					if (nPlatinumGoodsId != -1 && nServiceGoodsId != -1)
+						break;
+
+					ptrPlatinum->MoveNext();
+				}
+
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("name"));
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t varParentId = ptrPlatinum->GetCollect(_T("Sc_ClassParentID"));
+						_variant_t varClassName = ptrPlatinum->GetCollect(_T("Sc_ClassName"));
+
+						if (_tcscmp(varName.bstrVal, varClassName.bstrVal) == 0 && (varParentId.intVal == nPlatinumGoodsId || varParentId.intVal == nServiceGoodsId))
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Sc_ClassName"), ptrClassic->GetCollect(_T("name")));
+						ptrPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+							TCHAR szUid[24] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+							for (int i = 0; i < _tcslen(szUid); i++)
+							{
+								szUid[i] += 17;
+							}
+
+							return szUid;
+						}());
+
+						// 其他非空类;
+						ptrPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+
+						if (_tcscmp(ptrClassic->GetCollect(_T("name")).bstrVal, _T("婚庆服务")) == 0)
+							ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nServiceGoodsId);
+						else
+							ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nPlatinumGoodsId);
+
+						ptrPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pGoodsInfo()
+{
+	try
+	{
+		m_dwIndex = 0;
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from shangpin"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			CString strSql;
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpProduct"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("spname")); m_strMsg = varName.bstrVal;
+					// 判断是否存在;
+					bExsits = false;
+#ifdef _DEBUG
+
+					if (m_strMsg == _T("12寸欧莱雅相册"))
+					{
+						WriteTextLog(_T("c2pGoodsInfo"));
+					}
+
+#endif
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t var = ptrPlatinum->GetCollect(_T("Prod_Name"));
+
+						if (_tcscmp(varName.bstrVal, var.bstrVal) == 0)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						_variant_t var;
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("c2p_spid"), ptrClassic->GetCollect(_T("spid")));
+						ptrPlatinum->PutCollect(_T("Prod_DividedShop"), Global::g_szPlatinumBranchId);// 如果存在id存在;
+						ptrPlatinum->PutCollect(_T("Prod_Name"), ptrClassic->GetCollect(_T("spname")));
+						var = ptrClassic->GetCollect(_T("spdanwei"));
+
+						if (var.vt == VT_EMPTY || var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+							ptrPlatinum->PutCollect(_T("Prod_Unit"), _T("Null"));//长度超出铂金,出错;
+						else
+						{
+							CString strUnit = var.bstrVal;
+							ptrPlatinum->PutCollect(_T("Prod_Unit"), _variant_t(strUnit.Left(10)));//长度超出铂金,出错;
+						}
+
+						//成本价;
+						PRICENULL(ptrPlatinum, _T("Prod_CostPrice"), ptrClassic->GetCollect(_T("spjiaga1")));
+						//卖价;
+						PRICENULL(ptrPlatinum, _T("Prod_SalesPrice"), ptrClassic->GetCollect(_T("spjiage2")));
+						//供应商制作费;
+						PRICENULL(ptrPlatinum, _T("Prod_PurchasePrice"), ptrClassic->GetCollect(_T("spjiage3")));
+						ptrPlatinum->PutCollect(_T("Prod_Remark"), ptrClassic->GetCollect(_T("spbz")));
+						ptrPlatinum->PutCollect(_T("Prod_Introduction"), ptrClassic->GetCollect(_T("spbz")));
+						ptrPlatinum->PutCollect(_T("Prod_Detail"), ptrClassic->GetCollect(_T("spbz")));
+						var = ptrClassic->GetCollect(_T("hide"));
+
+						if (var.vt == VT_EMPTY || var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+							ptrPlatinum->PutCollect(_T("Prod_IsEnabled"), false);
+						else
+							ptrPlatinum->PutCollect(_T("Prod_IsEnabled"), _tcscmp(ptrClassic->GetCollect(_T("hide")).bstrVal, _T("上架")) == 0 ? true : false);
+
+						ptrPlatinum->PutCollect(_T("Prod_Width"), ptrClassic->GetCollect(_T("width")));
+						ptrPlatinum->PutCollect(_T("Prod_Height"), ptrClassic->GetCollect(_T("height")));
+						// 生成商品ID;
+						ptrPlatinum->PutCollect(_T("Prod_Number"), [&, this]()->_variant_t {
+							// 如果存在, 或者异常,新建spid;
+							TCHAR szUid[24] = { 0 };
+							TCHAR szResult[50] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+							_stprintf_s(szResult, _T("SP%s"), &szUid[2]);
+							return szResult;
+						}());
+
+						// 供应商;//由于经典商品并没有关联供应商,所以无法关联;
+						ptrPlatinum->PutCollect(_T("Prod_Vendor"), _T(""));
+
+						// 商品类别和商品类别名称;
+						ptrPlatinum->PutCollect(_T("Prod_ClassName"), ptrClassic->GetCollect(_T("splb")));
+						ptrPlatinum->PutCollect(_T("Prod_Class"), [&, this](_variant_t splb)->_variant_t {
+							_RecordsetPtr rs;
+							_variant_t varspid = _T("");
+							rs.CreateInstance(__uuidof(Recordset));
+							CString strSql;
+							strSql.Format(_T("select Sc_ClassCode,Sc_ClassName from tb_ErpSystemCategory where Sc_ClassName='%s'"), splb.bstrVal);
+							hr = rs->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+							if (SUCCEEDED(hr))
+							{
+								bool bClassCode = false;
+
+								while (rs->adoEOF == VARIANT_FALSE)
+								{
+									if (_tcscmp(splb.bstrVal, rs->GetCollect(_T("Sc_ClassName")).bstrVal) == 0)
+									{
+										bClassCode = true;
+										break;
+									}
+
+									rs->MoveNext();
+								}
+
+								if (bClassCode)
+								{
+									varspid = rs->GetCollect(_T("Sc_ClassCode"));
+								}
+
+								rs->Close();
+
+								return varspid;
+							}
+
+							return _T("");
+						}(ptrClassic->GetCollect(_T("splb"))));
+
+						// 其他非字段;
+						ptrPlatinum->PutCollect(_T("Prod_Batch"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_AlarmQuantity"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_SpecialPrice"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_IsRetail"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_Thumbnail"), _T(""));
+						ptrPlatinum->PutCollect(_T("Prod_FullSizeImage"), _T(""));
+						ptrPlatinum->PutCollect(_T("Prod_Expedited"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_CreateDateTime"), []()->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						ptrPlatinum->PutCollect(_T("Prod_CreateName"), _T(""));
+						ptrPlatinum->PutCollect(_T("Prod_UpdateDateTime"), []()->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						ptrPlatinum->PutCollect(_T("Prod_SpecialPrice"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_Availability"), 0);
+						ptrPlatinum->PutCollect(_T("Prod_PrintArea"), _T(""));
+						ptrPlatinum->PutCollect(_T("Prod_UpdateName"), _T(""));
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,商品名=%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pPackageType()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from txlb2"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAB;BEBBBCADFEBEJBGD;BEBACCAFFHEAJICDF;BEBACCAFEGECFBJFD
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpSystemCategory"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				// 获取铂金版父类id;
+				int nPlatinumGoodsId = -1;
+
+				while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					_variant_t gid = ptrPlatinum->GetCollect(_T("Sc_ClassCode"));
+
+					if (_tcscmp(_T("AAAAAAB"), gid.bstrVal) == 0)
+					{
+						nPlatinumGoodsId = ptrPlatinum->GetCollect(_T("ID"));
+						break;
+					}
+
+					ptrPlatinum->MoveNext();
+				}
+
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("name"));
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t varParentId = ptrPlatinum->GetCollect(_T("Sc_ClassParentID"));
+						_variant_t varClassName = ptrPlatinum->GetCollect(_T("Sc_ClassName"));
+
+						if (_tcscmp(varName.bstrVal, varClassName.bstrVal) == 0 && varParentId.intVal == nPlatinumGoodsId)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Sc_ClassName"), ptrClassic->GetCollect(_T("name")));
+						ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nPlatinumGoodsId);
+						ptrPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+							TCHAR szUid[24] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+							for (int i = 0; i < _tcslen(szUid); i++)
+							{
+								szUid[i] += 17;
+							}
+
+							return szUid;
+						}());
+
+						// 其他非空类;
+						ptrPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+						ptrPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pPackageInfo()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from taoxi"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpPackages"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("taoxiname")); m_strMsg = varName.bstrVal;
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t var = ptrPlatinum->GetCollect(_T("Pak_Name"));
+
+						if (_tcscmp(varName.bstrVal, var.bstrVal) == 0)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("c2p_taoxiid"), ptrClassic->GetCollect(_T("taoxiid")));
+						ptrPlatinum->PutCollect(_T("Pak_DividedShop"), Global::g_szPlatinumBranchId);
+						ptrPlatinum->PutCollect(_T("Pak_Name"), ptrClassic->GetCollect(_T("taoxiname")));
+						//ptrPlatinum->PutCollect(_T("Pak_UnitPrice"), PRICENULL(ptrClassic->GetCollect(_T("taoxijiage"))));
+						PRICENULL(ptrPlatinum, _T("Pak_UnitPrice"), ptrClassic->GetCollect(_T("taoxijiage")));
+						ptrPlatinum->PutCollect(_T("Pak_IsDisable"), _tcscmp(ptrClassic->GetCollect(_T("show")).bstrVal, _T("显示")) == 0 ? false : true);
+						ptrPlatinum->PutCollect(_T("Pak_PackagesClassName"), ptrClassic->GetCollect(_T("type")));
+						ptrPlatinum->PutCollect(_T("Pak_PackagesClass"), [&, this](_variant_t txlb)->_variant_t {
+							_RecordsetPtr rs;
+							_variant_t varspid = _T("");
+							rs.CreateInstance(__uuidof(Recordset));
+							CString strSql;
+							strSql.Format(_T("select Sc_ClassCode,Sc_ClassName from tb_ErpSystemCategory where Sc_ClassName='%s'"), txlb.bstrVal);
+							hr = rs->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+							if (SUCCEEDED(hr))
+							{
+								bool bClassCode = false;
+
+								while (rs->adoEOF == VARIANT_FALSE)
+								{
+									if (_tcscmp(txlb.bstrVal, rs->GetCollect(_T("Sc_ClassName")).bstrVal) == 0)
+									{
+										bClassCode = true;
+										break;
+									}
+
+									rs->MoveNext();
+								}
+
+								if (bClassCode)
+								{
+									varspid = rs->GetCollect(_T("Sc_ClassCode"));
+								}
+
+								rs->Close();
+
+								return varspid;
+							}
+
+							return _T("");
+						}(ptrClassic->GetCollect(_T("type"))));
+						ptrPlatinum->PutCollect(_T("Pak_OptionalSeveral"), 0);
+						ptrPlatinum->PutCollect(_T("Pak_PackagesMainClass"), _T("AAAAAAB"));//#坑#: 必须填,不然铂金版中显示不出来;
+						// ID;
+						ptrPlatinum->PutCollect(_T("Pak_PackagesID"), [&, this]()->_variant_t {
+							// 如果存在, 或者异常,新建spid;
+							TCHAR szUid[24] = { 0 };
+							TCHAR szResult[50] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+							_stprintf_s(szResult, _T("TX%s"), &szUid[2]);
+							return szResult;
+						}());
+						// 入底\入册;
+						[&, this]() {
+							CString str = ptrClassic->GetCollect(_T("zs")).bstrVal;
+							int nAlbum = -1; // 入册数量,默认-1表示全送;
+							int nNegative = -1;// 入底数量,默认-1表示全送;
+							int nIndex = str.Find(_T("\\"));
+
+							if (nIndex == -1)
+								return;
+
+							// 入底;
+							bool bDigit = true;
+
+							// 使用isdigit会出错,宽字符下;
+							if (!str.Left(nIndex).SpanIncluding(_T("0123456789")))
+							{
+								bDigit = false;
+							}
+
+							if (bDigit)
+								nNegative = _ttoi(str.Left(nIndex));
+
+							ptrPlatinum->PutCollect(_T("Pak_IntoTheArchive"), nNegative);
+
+							// 入册;
+							bDigit = true;
+
+							// 使用isdigit会出错,宽字符下;
+							if (!str.Mid(nIndex + 1).SpanIncluding(_T("0123456789")))
+							{
+								bDigit = false;
+							}
+
+							if (bDigit)
+								nAlbum = _ttoi(str.Mid(nIndex + 1));
+
+							ptrPlatinum->PutCollect(_T("Pak_IntoTheBook"), nAlbum);
+
+						}();
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pPackageGoods()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		// 被删除的套系和商品不会出现,也就不会被录入,某些订单将不显示商品,原因就是这;
+		HRESULT hr = ptrClassic->Open(_T("SELECT\
+			dbo.taoxishangpin1.id,\
+			dbo.taoxishangpin1.spid1,\
+			dbo.taoxishangpin1.shuliang,\
+			dbo.shangpin.spname,\
+			dbo.shangpin.spjiaga1,\
+			dbo.taoxishangpin1.taoxiid,\
+			dbo.taoxi.taoxiname, \
+			dbo.taoxi.type, \
+			dbo.taoxi.show \
+			FROM dbo.taoxishangpin1 \
+			INNER JOIN dbo.taoxi ON dbo.taoxi.taoxiid = dbo.taoxishangpin1.taoxiid \
+			INNER JOIN dbo.shangpin ON dbo.taoxishangpin1.spid1 = dbo.shangpin.spid"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpPackagesGiftMerchandise"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					m_strMsg = ptrClassic->GetCollect(_T("spid1")).bstrVal;
+					// 通过商品名来获取铂金商品ID;
+					_variant_t varPlatinumGoodsId = [&, this](_variant_t varSpName)->_variant_t {
+						CString str;
+						_RecordsetPtr rs;
+						_variant_t varProdNumber;
+						rs.CreateInstance(__uuidof(Recordset));
+						str.Format(_T("select Prod_Number from tb_ErpProduct where Prod_Name = '%s'"), varSpName.bstrVal);
+						hr = rs->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_FALSE)
+								varProdNumber = rs->GetCollect(_T("Prod_Number"));
+
+							rs->Close();
+						}
+
+						return varProdNumber;
+					}(ptrClassic->GetCollect(_T("spname")));
+
+					_variant_t varPlatinumPackageId = _T("");
+					_variant_t varPlatinumPackageName = _T("");
+					_variant_t varPlatinumPackageTypeId = _T("");
+					// 通过套系名和套系类型来获取铂金套系信息;
+					[&, this](_variant_t varPakName, _variant_t varPakClassName) {
+						CString str;
+						_RecordsetPtr rs;
+						rs.CreateInstance(__uuidof(Recordset));
+						str.Format(_T("select Pak_PackagesClass,Pak_Name,Pak_PackagesID from tb_ErpPackages where Pak_Name = '%s' and Pak_PackagesClassName = '%s'"), varPakName.bstrVal, varPakClassName.bstrVal);
+						hr = rs->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_FALSE)
+							{
+								varPlatinumPackageTypeId = rs->GetCollect(_T("Pak_PackagesClass"));
+								varPlatinumPackageName = rs->GetCollect(_T("Pak_Name"));
+								varPlatinumPackageId = rs->GetCollect(_T("Pak_PackagesID"));
+							}
+
+							rs->Close();
+						}
+					}
+					(ptrClassic->GetCollect(_T("taoxiname")), ptrClassic->GetCollect(_T("type")));
+
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						// 获取名称 ;
+						_variant_t varPackagesId = ptrPlatinum->GetCollect(_T("Pgm_PackagesCode"));
+						_variant_t varProductId = ptrPlatinum->GetCollect(_T("Pgm_ProductNumber"));
+						_variant_t varGiveType = ptrPlatinum->GetCollect(_T("Pgm_GiveType"));
+
+						if (_tcscmp(varPlatinumGoodsId.bstrVal, varProductId.bstrVal) == 0 && _tcscmp(varPlatinumPackageId.bstrVal, varPackagesId.bstrVal) == 0 && varGiveType.intVal == 0)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					// 如果商品不存在,不录入;
+					if (!bExsits && varPlatinumPackageId.vt != VT_EMPTY && varPlatinumPackageId.vt != VT_NULL)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Pgm_GiveType"), 0);
+						ptrPlatinum->PutCollect(_T("Pgm_ProductNumber"), varPlatinumGoodsId);
+						ptrPlatinum->PutCollect(_T("Pgm_Quantity"), VARINT(ptrClassic->GetCollect(_T("shuliang"))));// 含有中文;
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesNumber"), varPlatinumPackageTypeId);//套系类型ID;
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesName"), varPlatinumPackageName);
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesCode"), varPlatinumPackageId);
+						ptrPlatinum->PutCollect(_T("Pgm_ProductName"), ptrClassic->GetCollect(_T("spname")));
+						ptrPlatinum->PutCollect(_T("Pgm_IntoRegisterQuantity"), 0);
+						ptrPlatinum->PutCollect(_T("Pgm_IntoBottomQuantity"), 0);
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,商品Id=%s, =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pPackageGoods2()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("SELECT\
+			dbo.taoxishangpin2.id,\
+			dbo.taoxishangpin2.spid2,\
+			dbo.taoxishangpin2.shuliang,\
+			dbo.taoxishangpin2.taoxiid,\
+			dbo.shangpin.spname,\
+			dbo.shangpin.spjiaga1,\
+			dbo.taoxi.taoxiname, \
+			dbo.taoxi.type, \
+			dbo.taoxi.show \
+			FROM dbo.taoxishangpin2 \
+			INNER JOIN dbo.taoxi ON dbo.taoxi.taoxiid = dbo.taoxishangpin2.taoxiid \
+			INNER JOIN dbo.shangpin ON dbo.taoxishangpin2.spid2 = dbo.shangpin.spid"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpPackagesGiftMerchandise"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 根据商品名的铂金商品ID;
+					_variant_t varPlatinumGoodsId = [&, this](_variant_t varSpName)->_variant_t {
+						CString str;
+						_RecordsetPtr rs;
+						_variant_t varProdNumber;
+						m_strMsg = varSpName.bstrVal;
+						rs.CreateInstance(__uuidof(Recordset));
+						str.Format(_T("select Prod_Number from tb_ErpProduct where Prod_Name = '%s'"), varSpName.bstrVal);
+						hr = rs->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_FALSE)
+								varProdNumber = rs->GetCollect(_T("Prod_Number"));
+
+							rs->Close();
+						}
+
+						return varProdNumber;
+					}(ptrClassic->GetCollect(_T("spname")));
+
+					_variant_t varPlatinumPackageId = _T("");
+					_variant_t varPlatinumPackageName = _T("");
+					_variant_t varPlatinumPackageTypeId = _T("");
+					[&, this](_variant_t varPakName, _variant_t varPakClassName) {
+						CString str;
+						_RecordsetPtr rs;
+						rs.CreateInstance(__uuidof(Recordset));
+						str.Format(_T("select Pak_PackagesClass,Pak_Name,Pak_PackagesID from tb_ErpPackages where Pak_Name = '%s' and Pak_PackagesClassName = '%s'"), varPakName.bstrVal, varPakClassName.bstrVal);
+						hr = rs->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_FALSE)
+							{
+								varPlatinumPackageTypeId = rs->GetCollect(_T("Pak_PackagesClass"));
+								varPlatinumPackageName = rs->GetCollect(_T("Pak_Name"));
+								varPlatinumPackageId = rs->GetCollect(_T("Pak_PackagesID"));
+							}
+
+							rs->Close();
+						}
+					}
+					(ptrClassic->GetCollect(_T("taoxiname")), ptrClassic->GetCollect(_T("type")));
+
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						// 获取名称 ;
+						_variant_t varPackagesId = ptrPlatinum->GetCollect(_T("Pgm_PackagesCode"));
+						_variant_t varProductId = ptrPlatinum->GetCollect(_T("Pgm_ProductNumber"));
+						_variant_t varGiveType = ptrPlatinum->GetCollect(_T("Pgm_GiveType"));
+
+						if (_tcscmp(varPlatinumGoodsId.bstrVal, varProductId.bstrVal) == 0 && _tcscmp(varPlatinumPackageId.bstrVal, varPackagesId.bstrVal) == 0 && varGiveType.intVal == 1)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits && varPlatinumPackageId.vt != VT_EMPTY && varPlatinumPackageId.vt != VT_NULL)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Pgm_GiveType"), 1);
+						ptrPlatinum->PutCollect(_T("Pgm_ProductNumber"), varPlatinumGoodsId);
+						ptrPlatinum->PutCollect(_T("Pgm_Quantity"), VARINT(ptrClassic->GetCollect(_T("shuliang"))));
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesNumber"), varPlatinumPackageTypeId);//套系类型ID;
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesName"), varPlatinumPackageName);
+						ptrPlatinum->PutCollect(_T("Pgm_PackagesCode"), varPlatinumPackageId);
+						ptrPlatinum->PutCollect(_T("Pgm_ProductName"), ptrClassic->GetCollect(_T("spname")));
+						ptrPlatinum->PutCollect(_T("Pgm_IntoRegisterQuantity"), 0);
+						ptrPlatinum->PutCollect(_T("Pgm_IntoBottomQuantity"), 0);
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,商品名=%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pScenicSpot()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from jd"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpTheScenery"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 同时添加普通景点和儿童阶段;
+					auto func = [&, this](int n) {
+						CString str;
+						_RecordsetPtr rs;
+						rs.CreateInstance(__uuidof(Recordset));
+						//str.Format(_T("select c2p_jdid from tb_ErpTheScenery where c2p_jdid = '%s_%d' and Tsc_Type = '%d'"), Global::g_szClassicBranchId, ptrClassic->GetCollect(_T("id")).intVal, n);
+						str.Format(_T("select id from tb_ErpTheScenery where Tsc_Name = '%s' and Tsc_Type = '%d'"), ptrClassic->GetCollect(_T("name")).intVal, n);
+						hr = rs->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rs->adoEOF == VARIANT_TRUE)
+							{
+								// 不存在;
+								ptrPlatinum->AddNew();
+								//ptrPlatinum->PutCollect(_T("c2p_jdid"), ptrClassic->GetCollect(_T("id")));
+								ptrPlatinum->PutCollect(_T("Tsc_Type"), n);
+								ptrPlatinum->PutCollect(_T("Tcs_Category"), 0);
+								ptrPlatinum->PutCollect(_T("Tsc_IsDisable"), 0);
+								ptrPlatinum->PutCollect(_T("Tsc_DividedShop"), Global::g_szPlatinumBranchId);
+								ptrPlatinum->PutCollect(_T("Tsc_CostPrice"), 0);
+								ptrPlatinum->PutCollect(_T("Tsc_SalesPrice"), 0);
+								ptrPlatinum->PutCollect(_T("Tsc_PackagesMainClass"), 0);
+								ptrPlatinum->PutCollect(_T("Tsc_Name"), ptrClassic->GetCollect(_T("name")));
+								ptrPlatinum->PutCollect(_T("Tsc_Rating"), _T("BEBBBCADDEBFJDFFC"));//一级;
+								ptrPlatinum->Update();
+							}
+
+							rs->Close();
+						}
+					};
+
+					func(0);
+					func(1);
+
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pCustomerRelationShip()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		// AAAAAAB;BEBBBCADFEBEJBGD;BEBACCAFFHEAJICDF;BEBACCAFEGECFBJFD
+		HRESULT	hr = ptrPlatinum->Open(_T("select * from tb_ErpSystemCategory"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// 获取铂金版父类id;
+			int nRelationShipId = -1;
+
+			while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				_variant_t gid = ptrPlatinum->GetCollect(_T("Sc_ClassCode"));
+
+				if (_tcscmp(_T("BFABDBAJBJCEBDJCJ"), gid.bstrVal) == 0)
+				{
+					nRelationShipId = ptrPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				ptrPlatinum->MoveNext();
+			}
+
+			{
+				// 家长;
+				bool bExsits = false;
+				ptrPlatinum->MoveFirst();
+
+				while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (_tcscmp(ptrPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("家长")) == 0 &&
+						ptrPlatinum->GetCollect(_T("Sc_ClassParentID")).intVal == nRelationShipId)
+					{
+						bExsits = true;
+						break;
+					}
+
+					ptrPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					ptrPlatinum->AddNew();
+					ptrPlatinum->PutCollect(_T("Sc_ClassName"), _T("家长"));
+					ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nRelationShipId);
+					ptrPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					ptrPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					ptrPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					ptrPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					ptrPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+					ptrPlatinum->Update();
+				}
+			}
+
+			{
+				// 夫妻;
+				bool bExsits = false;
+				ptrPlatinum->MoveFirst();
+
+				while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (_tcscmp(ptrPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("夫妻")) == 0 &&
+						ptrPlatinum->GetCollect(_T("Sc_ClassParentID")).intVal == nRelationShipId)
+					{
+						bExsits = true;
+						break;
+					}
+
+					ptrPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					ptrPlatinum->AddNew();
+					ptrPlatinum->PutCollect(_T("Sc_ClassName"), _T("夫妻"));
+					ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nRelationShipId);
+					ptrPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					ptrPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					ptrPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					ptrPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					ptrPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+					ptrPlatinum->Update();
+				}
+			}
+		}
+
+		ptrPlatinum->Close();
+
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pCustomerSource()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from clientfrom"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAF
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpSystemCategory"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				// 获取铂金版父类id;
+				int nSourceId = -1;
+
+				while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (_tcscmp(_T("AAAAAAF"), ptrPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal) == 0)
+					{
+						nSourceId = ptrPlatinum->GetCollect(_T("ID"));
+						break;
+					}
+
+					ptrPlatinum->MoveNext();
+				}
+
+				bool bExsits = false;
+
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 获取名称 ;
+					_variant_t varName = ptrClassic->GetCollect(_T("name"));
+					// 判断是否存在;
+					bExsits = false;
+
+					while (ptrPlatinum->adoEOF == VARIANT_FALSE)
+					{
+						if (_tcscmp(varName.bstrVal, ptrPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal) == 0
+							&& ptrPlatinum->GetCollect(_T("Sc_ClassParentID")).intVal == nSourceId)
+						{
+							bExsits = true;
+							break;
+						}
+
+						ptrPlatinum->MoveNext();
+					}
+
+					if (!bExsits)
+					{
+						ptrPlatinum->AddNew();
+						ptrPlatinum->PutCollect(_T("Sc_ClassName"), varName);
+						ptrPlatinum->PutCollect(_T("Sc_ClassParentID"), nSourceId);
+						ptrPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+							TCHAR szUid[24] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+							for (int i = 0; i < _tcslen(szUid); i++)
+							{
+								szUid[i] += 17;
+							}
+
+							return szUid;
+						}());
+
+						// 其他非空类;
+						ptrPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+						ptrPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+						ptrPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						ptrPlatinum->Update();
+					}
+
+					ptrPlatinum->MoveFirst();
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pPaymentMethod()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// BEBACCAFCCEAGAIHH;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("BEBACCAFCCEAGAIHH")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//支付宝
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("支付宝")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("支付宝"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//财会通
+				bExsits = false;
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("财会通")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("财会通"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//微信支付
+				bExsits = false;
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("微信支付")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("微信支付"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rsPaymentMethod;
+				rsPaymentMethod.CreateInstance(__uuidof(Recordset));
+				hr = rsPaymentMethod->Open(_T("select * from CustomPayType"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varPaymentName;
+
+					while (rsPaymentMethod->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varPaymentName = rsPaymentMethod->GetCollect(_T("TypeName"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varPaymentName.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varPaymentName);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rsPaymentMethod->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pTwopinType()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// BEBACCAFCCEAGAIHH;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("BEBACDAJDFDDEACGJ")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//摄影二销
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("摄影二销")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("摄影二销"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//选片二销
+				rsPlatinum->MoveFirst();
+				bExsits = false;
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("选片二销")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("选片二销"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//化妆二销
+				rsPlatinum->MoveFirst();
+				bExsits = false;
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("化妆二销")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("化妆二销"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//引导二销
+				rsPlatinum->MoveFirst();
+				bExsits = false;
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("引导二销")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("引导二销"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//自定义
+				_RecordsetPtr rsPaymentMethod;
+				rsPaymentMethod.CreateInstance(__uuidof(Recordset));
+				hr = rsPaymentMethod->Open(_T("select * from expendtype"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varName;
+
+					while (rsPaymentMethod->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varName = rsPaymentMethod->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varName.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varName);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rsPaymentMethod->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pClientRegion()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAC;
+			_variant_t varID;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAC")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rsClientRegion;
+				rsClientRegion.CreateInstance(__uuidof(Recordset));
+				hr = rsClientRegion->Open(_T("select * from area"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varRegionName;
+
+					while (rsClientRegion->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varRegionName = rsClientRegion->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varRegionName.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varRegionName);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rsClientRegion->MoveNext();
+					}
+				}
+			}
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderType()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// BFAGAHBFDGCABAJIH;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("BFAGAHBFDGCABAJIH")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			rsPlatinum->MoveFirst();
+
+			bool bExsits = false;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("经典订单")) == 0)
+				{
+					bExsits = true;
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			if (bExsits)
+				return;
+
+			// 添加订单类别: 经典订单;
+			rsPlatinum->AddNew();
+			rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("经典订单"));
+			rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+				TCHAR szUid[24] = { 0 };
+				_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+				for (int i = 0; i < _tcslen(szUid); i++)
+				{
+					szUid[i] += 17;
+				}
+
+				return szUid;
+			}());
+
+			// 其他非空类;
+			rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+			rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+			rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+			rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+			rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+				time_t osBinaryTime;
+				time(&osBinaryTime);
+				COleDateTime time1(osBinaryTime);
+				return time1.m_dt;
+			}());
+
+			rsPlatinum->Update();
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pCustomerOrder(CString strOrder)
+{
+	try
+	{
+		CString strSql;
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		_RecordsetPtr ptrPlatinum;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		ptrPlatinum.CreateInstance(__uuidof(Recordset));
+
+		if (!strOrder.IsEmpty())
+			strSql.Format(_T("select * from dindan where id = '%s'"), strOrder);
+		else
+			strSql = _T("select * from dindan");
+
+		HRESULT hr = ptrClassic->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			hr = ptrPlatinum->Open(_T("select * from tb_ErpOrder"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				bool bConverted = false;
+
+				// 遍历经典数据;
+				while (ptrClassic->adoEOF == VARIANT_FALSE)
+				{
+					// 判断订单是否已经转换过;
+					_variant_t varClassicOrder = ptrClassic->GetCollect(_T("id"));
+					strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, varClassicOrder.bstrVal);
+					_variant_t varOrderNumber = strSql;
+					m_strMsg = varClassicOrder.bstrVal;
+#ifdef _DEBUG
+
+					if (_tcscmp(varOrderNumber.bstrVal, _T("JJ20170816-001")) == 0)
+					{
+						WriteTextLog(_T("c2pCustomerOrder"));
+					}
+
+#endif
+					bConverted = c2pOrderNumberExists(varOrderNumber);
+
+					if (!bConverted)
+					{
+						// 获取订单类别;
+						ptrPlatinum->AddNew();
+						//_variant_t varId;
+						//ptrPlatinum->PutCollect(_T("c2p_order"), varId = ptrClassic->GetCollect(_T("id")));
+						ptrPlatinum->PutCollect(_T("Ord_DividedShop"), Global::g_szPlatinumBranchId);
+						// 订单号;
+						ptrPlatinum->PutCollect(_T("Ord_Number"), varOrderNumber);
+						ptrPlatinum->PutCollect(_T("Ord_SinceOrderNumber"), _variant_t(strSql));
+						// 订单类型,根据加密狗来识别或手动设置;
+						_variant_t txtype = ptrClassic->GetCollect(_T("txtype"));
+
+						if (Global::g_bChildVersion)
+						{
+							if (isChildOrderType(txtype))
+								ptrPlatinum->PutCollect(_T("Ord_Type"), 1);
+							else
+								ptrPlatinum->PutCollect(_T("Ord_Type"), 2);
+						}
+						else
+						{
+							//婚纱订单;
+							ptrPlatinum->PutCollect(_T("Ord_Type"), 0);
+						}
+
+						ptrPlatinum->PutCollect(_T("Ord_Class"), _T("1"));// 客户订单;
+						//ptrPlatinum->PutCollect(_T("Ord_CustomerListID"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_MainContact"), _T(""));
+						ptrPlatinum->PutCollect(_T("Ord_OrderClass"), _T("经典订单"));//订单套系类别;
+
+						ptrPlatinum->PutCollect(_T("Ord_PhotographyCategory"), txtype);//套系类别
+						ptrPlatinum->PutCollect(_T("Ord_CustomerSource"), ptrClassic->GetCollect(_T("from")));//客户来源;
+						ptrPlatinum->PutCollect(_T("Ord_SeriesName"), ptrClassic->GetCollect(_T("taoxiname")));//套系名称
+						/*ptrPlatinum->PutCollect(_T("Ord_SeriesPrice"), [&, this]()->_variant_t {
+							// 经典版中,该字段可能带有中文;//2229元;
+							_variant_t var = ptrClassic->GetCollect(_T("taoxijiage"));
+
+							if (var.vt == VT_EMPTY || var.vt == VT_NULL || _tcscmp(var.bstrVal, _T("")) == 0)
+								return 0;
+
+							return _ttoi(var.bstrVal);
+						}());//套系价格*/
+						PRICENULL(ptrPlatinum, _T("Ord_SeriesPrice"), ptrClassic->GetCollect(_T("taoxijiage")));
+						ptrPlatinum->PutCollect(_T("Ord_Discount"), VARINT(ptrClassic->GetCollect(_T("discount"))));
+						ptrPlatinum->PutCollect(_T("Ord_AfterDiscount"), VARINT(ptrClassic->GetCollect(_T("discount2"))));
+						//ptrPlatinum->PutCollect(_T("Ord_Authorize"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_AfterAuthorize"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_Price"), ptrClassic->GetCollect(_T("payed1")));//预约收款
+						PRICENULL(ptrPlatinum, _T("Ord_Price"), ptrClassic->GetCollect(_T("payed1")));
+						//ptrPlatinum->PutCollect(_T("Ord_IntoRegister"), _T(""));//入册
+						//ptrPlatinum->PutCollect(_T("Ord_IntoBottom"), _T(""));//入底
+						// 入底\入册;
+						[&, this]() {
+							CString str = ptrClassic->GetCollect(_T("taoxizs")).bstrVal;
+							int nAlbum = -1; // 入册数量,默认-1表示全送;
+							int nNegative = -1;// 入底数量,默认-1表示全送;
+							int nIndex = str.Find(_T("\\"));
+
+							if (nIndex == -1)
+								return;
+
+							// 入底;
+							bool bDigit = true;
+
+							// 使用isdigit会出错,宽字符下;
+							if (!str.Left(nIndex).SpanIncluding(_T("0123456789")))
+							{
+								bDigit = false;
+							}
+
+							if (bDigit)
+								nNegative = _ttoi(str.Left(nIndex));
+
+							ptrPlatinum->PutCollect(_T("Ord_IntoBottom"), nNegative);
+
+							// 入册;
+							bDigit = true;
+
+							// 使用isdigit会出错,宽字符下;
+							if (!str.Mid(nIndex + 1).SpanIncluding(_T("0123456789")))
+							{
+								bDigit = false;
+							}
+
+							if (bDigit)
+								nAlbum = _ttoi(str.Mid(nIndex + 1));
+
+							ptrPlatinum->PutCollect(_T("Ord_IntoBottom"), nAlbum);
+
+						}();
+
+						//ptrPlatinum->PutCollect(_T("Ord_LovedStyle"), _T(""));//喜爱格调
+						//ptrPlatinum->PutCollect(_T("Ord_RealPickQuantity"), _T(""));//选片张数
+						//ptrPlatinum->PutCollect(_T("Ord_PlusPickNumber"), _T(""));//入底加挑张数
+						//ptrPlatinum->PutCollect(_T("Ord_PhotoCategoryTheme"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_PhotoPath"), _T(""));//相片路径
+						//ptrPlatinum->PutCollect(_T("Ord_PhotoBackupPath"), _T(""));//相片备份路径
+						//ptrPlatinum->PutCollect(_T("Ord_SelectionFilm"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_SelectionDesign"), _T(""));
+						if (ptrClassic->GetCollect(_T("bz")).vt != VT_NULL)
+						{
+							// 长度问题造成出错->铂金长度=800, 经典长度=max;
+							CString strBz = ptrClassic->GetCollect(_T("bz")).bstrVal;
+							ptrPlatinum->PutCollect(_T("Ord_Remark"), _variant_t(strBz.Left(800)));//订单备注
+						}
+
+						//ptrPlatinum->PutCollect(_T("Ord_CreateDateTime"), Global::String2Date(ptrClassic->GetCollect(_T("time1"))));
+						DATENULL(ptrPlatinum, _T("Ord_CreateDateTime"), ptrClassic->GetCollect(_T("time1")));
+						//ptrPlatinum->PutCollect(_T("Ord_CreateName"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_UpdateDateTime"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_UpdateName"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_IntoBookPickQuantity"), _T(""));//入册加挑张数
+						//ptrPlatinum->PutCollect(_T("Ord_HotelInfo"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_PackageName"), _T(""));//礼包套系名称
+						//ptrPlatinum->PutCollect(_T("Ord_PackagePrice"), _T(""));//礼包价格
+						//ptrPlatinum->PutCollect(_T("Ord_SaveOrderDateTime"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_OrderAnnotation"), _T(""));
+						// 主副门市;
+						_variant_t employeeId;
+						_variant_t employeeId2;
+						[&, this]() {
+							_RecordsetPtr rs;
+							rs.CreateInstance(__uuidof(Recordset));
+
+							_variant_t ren = ptrClassic->GetCollect(_T("ren"));
+							_variant_t ren2 = ptrClassic->GetCollect(_T("ren2"));
+
+							if (ren2.vt == VT_NULL || _tcscmp(ren2.bstrVal, _T("")) == 0)
+							{
+								strSql.Format(_T("select User_Name,User_EmployeeID from tb_ErpUser where User_Name = '%s'"), ren.bstrVal);
+							}
+							else
+							{
+								strSql.Format(_T("select User_Name,User_EmployeeID from tb_ErpUser where User_Name in ('%s', '%s')"), ren.bstrVal, ren2.bstrVal);
+							}
+
+							hr = rs->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+							strSql = _T("");
+							CString strEmployeeId = _T("");
+
+							if (SUCCEEDED(hr))
+							{
+								while (rs->adoEOF == VARIANT_FALSE)
+								{
+									strSql += rs->GetCollect(_T("User_Name")).bstrVal;
+									strSql += _T(",");
+
+									strEmployeeId += rs->GetCollect(_T("User_EmployeeID")).bstrVal;
+									strEmployeeId += _T(",");
+
+									if (_tcscmp(rs->GetCollect(_T("User_Name")).bstrVal, ren.bstrVal) == 0)
+										employeeId = rs->GetCollect(_T("User_EmployeeID"));
+									else if (ren2.vt != VT_NULL && _tcscmp(rs->GetCollect(_T("User_Name")).bstrVal, ren2.bstrVal) == 0)
+										employeeId2 = rs->GetCollect(_T("User_EmployeeID"));
+
+									rs->MoveNext();
+								}
+
+								rs->Close();
+							}
+
+							ptrPlatinum->PutCollect(_T("Ord_OrderPersonNumber"), _variant_t(strEmployeeId));//订单人员编号,多个用逗号分割
+							ptrPlatinum->PutCollect(_T("Ord_OrderPersonName"), _variant_t(strSql));//订单人员名称,多个用逗号分割
+						}();
+						//ptrPlatinum->PutCollect(_T("Ord_OldSeriesName"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_OldSeriesCode"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_OldSeriesPrice"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_MicroAppletOrderID"), _T(""));
+						//ptrPlatinum->PutCollect(_T("Ord_CommissionRatio"), _T(""));//业绩比例
+						//ptrPlatinum->PutCollect(_T("Ord_UploadPath"), _T(""));
+						//ptrPlatinum->PutCollect(_T("ord_AutoColor"), _T(""));
+						ptrPlatinum->Update();
+
+						// 成功插入订单后, 转换其他数据表;
+						// 订单签单人表;
+						c2pOrderSingles(varOrderNumber, employeeId, employeeId2, ptrClassic);
+
+						//if (txtype.vt != VT_NULL && txtype.vt != VT_EMPTY && _tcscmp(txtype.bstrVal, _T("成长套系")) == 0 && Global::g_bChildVersion)
+						if (isChildOrderType(txtype))
+						{
+							// 经典儿童成长套系;
+							// 订单数码表;
+							c2pOrderSubClass(varClassicOrder, varOrderNumber, ptrClassic);
+							// 用户组表;
+							c2pOrderCustomerGroup(varClassicOrder, varOrderNumber, ptrClassic);
+							// 用户组成员表+ 用户表;
+							c2pCustomers(varClassicOrder, ptrClassic);
+							// 订单商品;
+							c2pOrderGoods(varClassicOrder, varOrderNumber, ptrClassic);
+							// 订单收款;
+							c2pRecordOfOrderReceipts(varClassicOrder, varOrderNumber, ptrClassic);
+							// 订单加挑;
+							c2pOrderReceiptsItem(varClassicOrder, varOrderNumber, ptrClassic);
+						}
+						else
+						{
+							// 订单数码表;
+							c2pOrderDigital(varOrderNumber, ptrClassic);
+							// 数码状态表;
+							c2pOrderDigitalStatus(varOrderNumber, ptrClassic);
+							// 景点表;
+							c2pOrderScenicSpot(varClassicOrder, varOrderNumber, ptrClassic);
+							// 用户组表;
+							c2pOrderCustomerGroup(varClassicOrder, varOrderNumber, ptrClassic);
+							// 用户组成员表+ 用户表;
+							c2pCustomers(varClassicOrder, ptrClassic);
+							// 订单商品;
+							c2pOrderGoods(varClassicOrder, varOrderNumber, ptrClassic);
+							// 订单收款;
+							c2pRecordOfOrderReceipts(varClassicOrder, varOrderNumber, ptrClassic);
+							// 订单加挑;
+							c2pOrderReceiptsItem(varClassicOrder, varOrderNumber, ptrClassic);
+						}
+					}
+
+					// 回滚第一条;
+					//ptrPlatinum->MoveFirst();
+					// 下一条;
+					ptrClassic->MoveNext();
+				}
+			}
+
+			ptrPlatinum->Close();
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d, %s=>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pMemberShip()
+{
+	try
+	{
+		CString strSql = _T("select ")
+			_T("dbo.membermanage.memberno, ")
+			_T("dbo.membermanage.name, ")
+			_T("dbo.membermanage.date,")
+			_T("dbo.membermanage.money, ")
+			_T("dbo.membermanage.autoid,")
+			_T("dbo.membermanage.sex, ")
+			_T("dbo.membermanage.phone, ")
+			_T("dbo.membermanage.qq,")
+			_T("dbo.membermanage.addr, ")
+			_T("dbo.membermanage.occupation,")
+			_T("dbo.membermanage.birthday, ")
+			_T("dbo.membermanage.pinyin, ")
+			_T("dbo.membermanage.balance,")
+			_T("dbo.membermanage.sendmark1, ")
+			_T("dbo.membermanage.sendmark2,")
+			_T("dbo.membermanage.psw, ")
+			_T("dbo.membermanage.cardtype,")
+			_T("dbo.membermanage.check1,")
+			_T("dbo.membermanage.discount, ")
+			_T("isnull((select sum(cast(memberreg3.money as float)) from memberreg3 where memberreg3.memberno = membermanage.memberno),0) as totalMoney ")
+			_T(" from dbo.membermanage ");
+		// membermanage+membercard2副卡=memberview2;//tb_ErpMemberCard//tb_ErpMemberCardViceCard副卡;
+		_RecordsetPtr rsClassicMember;
+		rsClassicMember.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsClassicMember->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsPlatinumMember;
+			rsPlatinumMember.CreateInstance(__uuidof(Recordset));
+			hr = rsPlatinumMember->Open(_T("select * from tb_ErpMemberCard"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				while (rsClassicMember->adoEOF == VARIANT_FALSE)
+				{
+					// 查询顾客ID;
+					_variant_t varCusID = c2pGetCustomerId(rsClassicMember->GetCollect(_T("phone")));
+					if (varCusID.vt == VT_EMPTY || varCusID.vt == VT_NULL)
+					{
+						rsClassicMember->MoveNext();
+						continue;
+					}
+					// 判断卡号是否存在;
+					strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, rsClassicMember->GetCollect(_T("memberno")).bstrVal);
+					_variant_t varCradNumber = m_strMsg = strSql;
+					strSql.Format(_T("select * from tb_ErpMemberCard where Mc_CradNumber='%s' or Mc_CustomerNumber = '%s'"), varCradNumber.bstrVal, varCusID.bstrVal);
+					_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+#ifdef  DEBUG
+
+					if (m_strMsg == _T("JD00085"))
+					{
+						WriteTextLog(_T("c2pMemberShip"));
+					}
+
+#endif //  DEBUG
+
+					if (result != NULL && result->adoEOF == VARIANT_TRUE)
+					{
+						_variant_t var = rsClassicMember->GetCollect(_T("phone"));
+
+						if (var.vt == VT_NULL || var.vt == VT_EMPTY || _tcscmp(var.bstrVal, _T("")) == 0)
+						{
+							// 如果电话号码空, 不录入;
+							rsClassicMember->MoveNext();
+							continue;
+						}
+
+						_variant_t varMcNumber;
+						rsPlatinumMember->AddNew();
+						//////////////////////////////////////////////////////////////////////////
+						rsPlatinumMember->PutCollect(_T("Mc_DividedShop"), Global::g_szPlatinumBranchId);
+						rsPlatinumMember->PutCollect(_T("Mc_Number"), varMcNumber = [&, this]()->_variant_t {
+							TCHAR szUID[24] = { 0 };
+							TCHAR szResult[50] = { 0 };
+							_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+							_stprintf_s(szResult, _T("M%s"), szUID);
+							return szResult;
+						}());
+						rsPlatinumMember->PutCollect(_T("Mc_CradNumber"), varCradNumber);
+						// 查找顾客//如果经典没有电话号码,不录入;
+						strSql.Format(_T("select * from tb_ErpCustomer where Cus_Name ='%s' and Cus_Telephone = '%s' and Cus_Type <> '儿童'"), rsClassicMember->GetCollect(_T("name")).bstrVal, rsClassicMember->GetCollect(_T("phone")).bstrVal);
+						result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+						if (result != NULL && result->adoEOF == VARIANT_FALSE)
+						{
+							rsPlatinumMember->PutCollect(_T("Mc_CustomerNumber"), result->GetCollect(_T("Cus_CustomerNumber")));
+						}
+						else
+						{
+							// 不存在用户记录,新增用户;
+							_variant_t varCustomerId;
+							_RecordsetPtr rsCustomer;
+							rsCustomer.CreateInstance(__uuidof(Recordset));
+							hr = rsCustomer->Open(_T("select * from tb_ErpCustomer"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+							if (SUCCEEDED(hr))
+							{
+								// 创建新顾客信息;
+								rsCustomer->AddNew();
+								rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+								rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId = [&, this]()->_variant_t {
+									TCHAR szUID[24] = { 0 };
+									_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+									return szUID;
+								}());
+								rsCustomer->PutCollect(_T("Cus_Type"), _T(""));// 成人空;
+								rsCustomer->PutCollect(_T("Cus_Name"), rsClassicMember->GetCollect(_T("name")));
+								// 拼音;
+								rsCustomer->PutCollect(_T("Cus_NamePinyin"), rsClassicMember->GetCollect(_T("pinyin")));
+								// 生日;
+								//DATENULL(rsCustomer, _T("Cus_Birthday"), rsClassicMember->GetCollect(_T("birthday")));
+								rsCustomer->PutCollect(_T("Cus_Birthday"), rsClassicMember->GetCollect(_T("birthday")));
+								_variant_t varCheck = rsClassicMember->GetCollect(_T("check1"));
+
+								if (varCheck.vt == VT_EMPTY || varCheck.vt == VT_NULL || _tcscmp(varCheck.bstrVal, _T("")) == 0)
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), 0);
+								else
+									rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), rsClassicMember->GetCollect(_T("check1")));
+
+								rsCustomer->PutCollect(_T("Cus_Telephone"), rsClassicMember->GetCollect(_T("phone")));
+								rsCustomer->PutCollect(_T("Cus_Sex"), _tcscmp(rsClassicMember->GetCollect(_T("sex")).bstrVal, _T("女")) == 0 ? true : false);
+								DATENULL(rsCustomer, _T("Cus_CreateDateTime"), rsClassicMember->GetCollect(_T("date")));
+								rsCustomer->PutCollect(_T("Cus_QQ"), rsClassicMember->GetCollect(_T("qq")));
+								// 婚期;//Cus_DayForMarriageLunar
+								//DATENULL(rsCustomer, _T("Cus_DayForMarriage"), rsClient->GetCollect(_T("time3")));
+								//rsCustomer->PutCollect(_T("Cus_DayForMarriageLunar"), rsClient->GetCollect(_T("check3")));
+								rsCustomer->Update();
+							}
+
+							rsCustomer->Close();
+
+							rsPlatinumMember->PutCollect(_T("Mc_CustomerNumber"), varCustomerId);
+						}
+
+						rsPlatinumMember->PutCollect(_T("Mc_CardType"), _T("无"));
+						// 历史充值;
+						rsPlatinumMember->PutCollect(_T("Mc_TotalMoney"), rsClassicMember->GetCollect(_T("totalMoney")));
+						// 剩余金额;
+						PRICENULL(rsPlatinumMember, _T("Mc_Money"), rsClassicMember->GetCollect(_T("balance")));
+						// 全部重置成1234;
+						rsPlatinumMember->PutCollect(_T("Mc_TraderPassword"), _T("81dc9bdb52d04dc20036dbd8313ed055"));
+						//rsPlatinumMember->PutCollect(_T("Mc_UsedNumber"), Global::g_szPlatinumBranchId);
+						rsPlatinumMember->PutCollect(_T("Mc_Status"), _T("1"));
+						rsPlatinumMember->PutCollect(_T("Mc_TouchAccount"), 0.0);
+						rsPlatinumMember->PutCollect(_T("Mc_TotalTouchAccount"), 0.0);
+						//rsPlatinumMember->PutCollect(_T("Mc_Remark"), Global::g_szPlatinumBranchId);
+						rsPlatinumMember->PutCollect(_T("Mc_CreateDatetime"), []() ->_variant_t {
+							time_t osBinaryTime;
+							time(&osBinaryTime);
+							COleDateTime time1(osBinaryTime);
+							return time1.m_dt;
+						}());
+						//rsPlatinumMember->PutCollect(_T("Mc_CreateName"), Global::g_szPlatinumBranchId);
+						//rsPlatinumMember->PutCollect(_T("Mc_UpdateDateTime"), Global::g_szPlatinumBranchId);
+						//rsPlatinumMember->PutCollect(_T("Mc_UpdateName"), Global::g_szPlatinumBranchId);
+						//rsPlatinumMember->PutCollect(_T("Mc_OpenCardSource"), Global::g_szPlatinumBranchId);
+						//rsPlatinumMember->PutCollect(_T("Mc_SecondQueryName"), Global::g_szPlatinumBranchId);
+						//////////////////////////////////////////////////////////////////////////
+						rsPlatinumMember->Update();
+
+						{
+							// 查找副卡,并添加;
+							//varMcNumber
+							_RecordsetPtr rsSubCard;
+							rsSubCard.CreateInstance(__uuidof(Recordset));
+							strSql.Format(_T("select * from membercard2 where memberno ='%s'"), rsClassicMember->GetCollect(_T("memberno")).bstrVal);
+							hr = rsSubCard->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+							if (SUCCEEDED(hr))
+							{
+								while (rsSubCard->adoEOF == VARIANT_FALSE)
+								{
+									_RecordsetPtr rsViceCard;
+									rsViceCard.CreateInstance(__uuidof(Recordset));
+									strSql.Format(_T("select * from tb_ErpMemberCardViceCard where Mvc_Number = '%s' and Mvc_ViceCardNumber = '%s'"), varMcNumber.bstrVal, rsSubCard->GetCollect(_T("card2no")).bstrVal);
+									hr = rsViceCard->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+									if (SUCCEEDED(hr))
+									{
+										if (rsViceCard->adoEOF == VARIANT_TRUE)
+										{
+											// 不存在,新增;
+											rsViceCard->AddNew();
+											//////////////////////////////////////////////////////////////////////////
+											rsViceCard->PutCollect(_T("Mvc_DividedShop"), Global::g_szPlatinumBranchId);
+											rsViceCard->PutCollect(_T("Mvc_Number"), varMcNumber);
+											rsViceCard->PutCollect(_T("Mvc_ViceNumber"), [&, this]()->_variant_t {
+												TCHAR szUID[24] = { 0 };
+												TCHAR szResult[50] = { 0 };
+												_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+												_stprintf_s(szResult, _T("V%s"), szUID);
+												return szResult;
+											}());
+											rsViceCard->PutCollect(_T("Mvc_ViceCardNumber"), rsSubCard->GetCollect(_T("card2no")));
+											rsViceCard->PutCollect(_T("Mvc_ViceMoney"), 0);
+											rsViceCard->PutCollect(_T("Mvc_Status"), 1);
+											DATENULL(rsViceCard, _T("Mvc_CreateDatetime"), rsSubCard->GetCollect(_T("date")));
+											rsViceCard->PutCollect(_T("Mvc_CashBackGroup"), 1);
+											//////////////////////////////////////////////////////////////////////////
+											rsViceCard->Update();
+										}
+
+										rsViceCard->Close();
+									}
+
+									// 下一条;
+									rsSubCard->MoveNext();
+								}
+
+								rsSubCard->Close();
+							}
+						}
+					}
+
+					// 下一条;
+					rsClassicMember->MoveNext();
+				}
+
+				rsPlatinumMember->Close();
+			}
+
+			rsClassicMember->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,会员=%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pGetClassicPackageType()
+{
+	try
+	{
+		// 声明记录集指针;
+		_RecordsetPtr ptrClassic;
+		// 创建实例;
+		ptrClassic.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = ptrClassic->Open(_T("select * from txlb"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockPessimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			m_listPackageType.clear();
+
+			while (ptrClassic->adoEOF == VARIANT_FALSE)
+			{
+				m_listPackageType.push_back(ptrClassic->GetCollect(_T("name")).bstrVal);
+				ptrClassic->MoveNext();
+			}
+		}
+
+		ptrClassic->Close();
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pCustomerType()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAL;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAL")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				hr = rs->Open(_T("select * from clienttype"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varname;
+
+					while (rs->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varname = rs->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varname.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varname);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rs->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pBusinessIntention()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAL;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAO")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				hr = rs->Open(_T("select * from businessintention"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varname;
+
+					while (rs->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varname = rs->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varname.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varname);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rs->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pHostpital()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAL;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAK")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				hr = rs->Open(_T("select * from hospital"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varname;
+
+					while (rs->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varname = rs->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varname.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varname);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rs->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pBusinessTypes()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAL;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAM")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//自定义,有些老的数据库可能没有这个表;
+				_RecordsetPtr rs;
+				rs.CreateInstance(__uuidof(Recordset));
+				hr = rs->Open(_T("select * from businesstype"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					_variant_t varname;
+
+					while (rs->adoEOF == VARIANT_FALSE)
+					{
+						bExsits = false;
+						rsPlatinum->MoveFirst();
+						varname = rs->GetCollect(_T("name"));
+
+						while (rsPlatinum->adoEOF == VARIANT_FALSE)
+						{
+							if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, varname.bstrVal) == 0)
+							{
+								bExsits = true;
+								break;
+							}
+
+							rsPlatinum->MoveNext();
+						}
+
+						if (!bExsits)
+						{
+							// 添加订单类别: 经典订单;
+							rsPlatinum->AddNew();
+							rsPlatinum->PutCollect(_T("Sc_ClassName"), varname);
+							rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+								TCHAR szUid[24] = { 0 };
+								_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+								for (int i = 0; i < _tcslen(szUid); i++)
+								{
+									szUid[i] += 17;
+								}
+
+								return szUid;
+							}());
+
+							// 其他非空类;
+							rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+							rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+							rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+							rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+								time_t osBinaryTime;
+								time(&osBinaryTime);
+								COleDateTime time1(osBinaryTime);
+								return time1.m_dt;
+							}());
+
+							rsPlatinum->Update();
+						}
+
+						rs->MoveNext();
+					}
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pFeedingMode()
+{
+	try
+	{
+		_RecordsetPtr rsPlatinum;
+		rsPlatinum.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsPlatinum->Open(_T("select * from tb_ErpSystemCategory "), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			// AAAAAAL;
+			_variant_t varID = VT_NULL;
+
+			while (rsPlatinum->adoEOF == VARIANT_FALSE)
+			{
+				if (_tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassCode")).bstrVal, _T("AAAAAAN")) == 0)
+				{
+					varID = rsPlatinum->GetCollect(_T("ID"));
+					break;
+				}
+
+				rsPlatinum->MoveNext();
+			}
+
+			bool bExsits = false;
+			{
+				//混合
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("混合")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("混合"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//母乳
+				bExsits = false;
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("母乳")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("母乳"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			{
+				//人工
+				bExsits = false;
+				rsPlatinum->MoveFirst();
+
+				while (rsPlatinum->adoEOF == VARIANT_FALSE)
+				{
+					if (rsPlatinum->GetCollect(_T("Sc_ClassParentID")) == varID && _tcscmp(rsPlatinum->GetCollect(_T("Sc_ClassName")).bstrVal, _T("人工")) == 0)
+					{
+						bExsits = true;
+						break;
+					}
+
+					rsPlatinum->MoveNext();
+				}
+
+				if (!bExsits)
+				{
+					// 添加订单类别: 经典订单;
+					rsPlatinum->AddNew();
+					rsPlatinum->PutCollect(_T("Sc_ClassName"), _T("人工"));
+					rsPlatinum->PutCollect(_T("Sc_ClassCode"), [this]()->_variant_t {
+						TCHAR szUid[24] = { 0 };
+						_ui64tot_s(m_uniqueid.get_unique_id(), szUid, 24, 10);
+
+						for (int i = 0; i < _tcslen(szUid); i++)
+						{
+							szUid[i] += 17;
+						}
+
+						return szUid;
+					}());
+
+					// 其他非空类;
+					rsPlatinum->PutCollect(_T("Sc_IsDisable"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsReadOnly"), false);
+					rsPlatinum->PutCollect(_T("Sc_IsEnabledURL"), false);
+					rsPlatinum->PutCollect(_T("Sc_ClassParentID"), varID);
+					rsPlatinum->PutCollect(_T("Sc_CreateDatetime"), []() ->_variant_t {
+						time_t osBinaryTime;
+						time(&osBinaryTime);
+						COleDateTime time1(osBinaryTime);
+						return time1.m_dt;
+					}());
+
+					rsPlatinum->Update();
+				}
+			}
+
+			rsPlatinum->Close();
+		}
+	}
+	catch (_com_error& e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pHospitalCustomer()
+{
+	try
+	{
+		//hospitalclient;tb_ErpHospitalClient
+		CString strSql;
+		_RecordsetPtr rsClassic;
+		rsClassic.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsClassic->Open(_T("select * from hospitalclient"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			_RecordsetPtr rsPlatinum;
+			rsPlatinum.CreateInstance(__uuidof(Recordset));
+			hr = rsPlatinum->Open(_T("select * from tb_ErpHospitalClient"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				m_dwIndex = 0;
+
+				while (rsClassic->adoEOF == VARIANT_FALSE)
+				{
+					m_dwIndex++;
+#ifdef _DEBUG
+
+					if (m_dwIndex == 0)
+					{
+						WriteTextLog(_T("c2pHospitalCustomer"));
+					}
+
+#endif
+					// 判断是否存在;
+					_variant_t varHostpitalOrder;
+					strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, rsClassic->GetCollect(_T("id")).bstrVal);
+					varHostpitalOrder = strSql;
+
+					strSql.Format(_T("select * from tb_ErpHospitalClient where Hct_Oddnumber = '%s'"), varHostpitalOrder.bstrVal);
+					_RecordsetPtr result = c2pQueryExspcits(strSql, m_pPlatinumConnection);
+
+					if (result != NULL && result->adoEOF == VARIANT_TRUE)
+					{
+						// 不存在订单,添加;
+						rsPlatinum->AddNew();
+						//////////////////////////////////////////////////////////////////////////
+						rsPlatinum->PutCollect(_T("Hct_DividedShop"), Global::g_szPlatinumBranchId);
+						rsPlatinum->PutCollect(_T("Hct_Oddnumber"), varHostpitalOrder);
+						rsPlatinum->PutCollect(_T("Hct_CustomerName"), rsClassic->GetCollect(_T("name1")));
+						rsPlatinum->PutCollect(_T("Hct_BabyName"), rsClassic->GetCollect(_T("name2")));
+						rsPlatinum->PutCollect(_T("Hct_BabySex"), rsClassic->GetCollect(_T("sex")));
+						rsPlatinum->PutCollect(_T("Hct_BabyBirthday"), rsClassic->GetCollect(_T("birthday")));
+						rsPlatinum->PutCollect(_T("Hct_AreLunar"), rsClassic->GetCollect(_T("check1")));
+						rsPlatinum->PutCollect(_T("Hct_BirthdayType"), rsClassic->GetCollect(_T("birthdaytype")));
+						rsPlatinum->PutCollect(_T("Hct_MessageSingle"), rsClassic->GetCollect(_T("checkmsg")));
+						rsPlatinum->PutCollect(_T("Hct_CustomerOrders"), 0);
+						//rsPlatinum->PutCollect(_T("Hct_OrderNumber"), rsClassic->GetCollect(_T("id")));
+						rsPlatinum->PutCollect(_T("Hct_BabyFeeding"), rsClassic->GetCollect(_T("food")));
+						rsPlatinum->PutCollect(_T("Hct_CustomerRegions"), rsClassic->GetCollect(_T("from")));
+						//rsPlatinum->PutCollect(_T("Hct_CustomerGroups"), rsClassic->GetCollect(_T("id")));
+						//rsPlatinum->PutCollect(_T("Hct_DealStatus"), rsClassic->GetCollect(_T("id")));//成交状态
+						rsPlatinum->PutCollect(_T("Hct_SingleHospital"), rsClassic->GetCollect(_T("hospital")));
+						rsPlatinum->PutCollect(_T("Hct_MyselfMobile"), rsClassic->GetCollect(_T("phone1")));
+						rsPlatinum->PutCollect(_T("Hct_HusbandMobile"), rsClassic->GetCollect(_T("phone2")));
+						rsPlatinum->PutCollect(_T("Hct_FamilyPhone"), rsClassic->GetCollect(_T("phone3")));
+						rsPlatinum->PutCollect(_T("Hct_Husbandphone"), rsClassic->GetCollect(_T("phone4")));
+						rsPlatinum->PutCollect(_T("Hct_Maidenphone"), rsClassic->GetCollect(_T("phone5")));
+						rsPlatinum->PutCollect(_T("Hct_QQ"), rsClassic->GetCollect(_T("qq")));
+						_variant_t varDays = rsClassic->GetCollect(_T("pregnancydays"));
+
+						if (varDays.vt == VT_EMPTY || varDays.vt == VT_NULL || _tcscmp(varDays.bstrVal, _T("")) == 0)
+							rsPlatinum->PutCollect(_T("Hct_PregnantDay"), 0);
+						else
+							rsPlatinum->PutCollect(_T("Hct_PregnantDay"), _ttoi(varDays.bstrVal));
+
+						// 门市;
+						rsPlatinum->PutCollect(_T("Hct_Retail"), rsClassic->GetCollect(_T("clerk")));
+						rsPlatinum->PutCollect(_T("Hct_Remarks"), rsClassic->GetCollect(_T("remark")));
+						rsPlatinum->PutCollect(_T("Hct_HomeAddress"), rsClassic->GetCollect(_T("addr1")));
+						rsPlatinum->PutCollect(_T("Hct_HomePostcode"), rsClassic->GetCollect(_T("post1")));
+						rsPlatinum->PutCollect(_T("Hct_HusbandAddress"), rsClassic->GetCollect(_T("addr2")));
+						rsPlatinum->PutCollect(_T("Hct_HusbandPostcode"), rsClassic->GetCollect(_T("post2")));
+						rsPlatinum->PutCollect(_T("Hct_MaidenAddress"), rsClassic->GetCollect(_T("addr3")));
+						rsPlatinum->PutCollect(_T("Hct_MaidenPostcode"), rsClassic->GetCollect(_T("post3")));
+						// 签单日期;
+						//rsPlatinum->PutCollect(_T("Hct_SingleDatetime"), rsClassic->GetCollect(_T("date1")));
+						DATENULL(rsPlatinum, _T("Hct_SingleDatetime"), rsClassic->GetCollect(_T("date1")));
+						rsPlatinum->PutCollect(_T("Hcr_BusinessType"), rsClassic->GetCollect(_T("type")));
+						//rsPlatinum->PutCollect(_T("Hct_BusinessIntention"), rsClassic->GetCollect(_T("id")));
+						//rsPlatinum->PutCollect(_T("Hct_CreateDatetime"), rsClassic->GetCollect(_T("inputdate")));
+						DATENULL(rsPlatinum, _T("Hct_CreateDatetime"), rsClassic->GetCollect(_T("inputdate")));
+						rsPlatinum->PutCollect(_T("Hct_CreateName"), rsClassic->GetCollect(_T("inputer")));
+						//////////////////////////////////////////////////////////////////////////
+						rsPlatinum->Update();
+					}
+
+					rsClassic->MoveNext();
+				}
+
+				rsPlatinum->Close();
+			}
+
+			rsClassic->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%ld =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_dwIndex, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOrderSelection(bool bImg, CString strOrder)
+{
+	try
+	{
+		CString strSql;
+		_RecordsetPtr rsdindan;
+		rsdindan.CreateInstance(__uuidof(Recordset));
+		if (strOrder.IsEmpty())
+			strSql = _T("select * from dindan");
+		else
+			strSql.Format(_T("select * from dindan where id = '%s'"), strOrder);
+		HRESULT hr = rsdindan->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			CString strResult;
+			_variant_t varNo, varNo2, varspid, varOrder, varDelphotos, varDelphotos2, varbz3;
+
+			while (rsdindan->adoEOF == VARIANT_FALSE)
+			{
+				_variant_t varStatus = rsdindan->GetCollect(_T("c2p_status"));
+
+				if (varStatus.vt == VT_EMPTY || varStatus.vt == VT_NULL || varStatus.intVal != 1)
+				{
+					c2pSelection c2pslt;
+					c2pslt.strOrder = rsdindan->GetCollect(_T("id")).bstrVal;
+					_variant_t del = rsdindan->GetCollect(_T("delphotos"));
+					_variant_t del2 = rsdindan->GetCollect(_T("delphotos2"));
+					_variant_t bz2 = rsdindan->GetCollect(_T("bz2"));
+					_variant_t bz3 = rsdindan->GetCollect(_T("bz3"));
+					_variant_t bz4 = rsdindan->GetCollect(_T("bz4"));
+					_variant_t bz5 = rsdindan->GetCollect(_T("bz5"));
+
+					if (del.vt == VT_EMPTY || del.vt == VT_NULL)
+						c2pslt.strDelphotos = _T("");
+					else
+						c2pslt.strDelphotos = del.bstrVal;
+
+					if (del2.vt == VT_EMPTY || del2.vt == VT_NULL)
+						c2pslt.strDelphotos2 = _T("");
+					else
+						c2pslt.strDelphotos2 = del2.bstrVal;
+
+					if (bz2.vt == VT_EMPTY || bz2.vt == VT_NULL)
+						c2pslt.strbz2 = _T("");
+					else
+						c2pslt.strbz2 = bz2.bstrVal;
+
+					if (bz3.vt == VT_EMPTY || bz3.vt == VT_NULL)
+						c2pslt.strbz3 = _T("");
+					else
+						c2pslt.strbz3 = bz3.bstrVal;
+
+					if (bz4.vt == VT_EMPTY || bz4.vt == VT_NULL)
+						c2pslt.strbz4 = _T("");
+					else
+						c2pslt.strbz4 = bz4.bstrVal;
+
+					if (bz5.vt == VT_EMPTY || bz5.vt == VT_NULL)
+						c2pslt.strbz5 = _T("");
+					else
+						c2pslt.strbz5 = bz5.bstrVal;
+
+					m_strMsg = c2pslt.strOrder;
+#ifdef _DEBUG
+
+					if (m_strMsg == _T("ZPQ002"))
+					{
+						WriteTextLog(_T("c2pOrderSelection"));
+					}
+
+#endif
+					_RecordsetPtr rsdindansp;
+					rsdindansp.CreateInstance(__uuidof(Recordset));
+					strSql.Format(_T("select * from dindansp where id = '%s'"), rsdindan->GetCollect(_T("id")).bstrVal);
+					hr = rsdindansp->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						while (rsdindansp->adoEOF == VARIANT_FALSE)
+						{
+							c2pSelectionItem c2pslti;
+							c2pslti.strSpId = rsdindansp->GetCollect(_T("spid")).bstrVal;
+							c2pslti.strSpName = rsdindansp->GetCollect(_T("name")).bstrVal;
+							_variant_t no = rsdindansp->GetCollect(_T("no"));
+							_variant_t no2 = rsdindansp->GetCollect(_T("no2"));
+
+							if (no.vt == VT_EMPTY || no.vt == VT_NULL)
+								c2pslti.strNo = _T("");
+							else
+								c2pslti.strNo = no.bstrVal;
+
+							if (no2.vt == VT_EMPTY || no2.vt == VT_NULL)
+								c2pslti.strNo2 = _T("");
+							else
+								c2pslti.strNo2 = no2.bstrVal;
+
+							c2pslt.vtItems.push_back(c2pslti);
+
+							rsdindansp->MoveNext();
+						}
+
+						rsdindansp->Close();
+					}
+
+					// 转换选片数据;
+					c2pOrderSelection(c2pslt);
+
+					// 复制相片到目标路径, 并修改相片名称;
+					if (bImg)
+					{
+						c2pOrderImg(c2pslt.strOrder);
+						// 成功后, 设置c2p_status=1;
+						rsdindan->PutCollect(_T("c2p_status"), 1);
+					}
+
+					rsdindan->Update();
+				}
+
+				rsdindan->MoveNext();
+			}
+
+			rsdindan->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+bool c2p::c2pResetImgConvert()
+{
+	try
+	{
+		if (m_pClassicConnection == NULL)
+			return false;
+
+		CString strSql;
+		_CommandPtr pCommand;
+		pCommand.CreateInstance(__uuidof(Command));
+		pCommand->ActiveConnection = m_pClassicConnection;
+		pCommand->CommandTimeout = 120;
+		pCommand->CommandText = _T("update dindan set c2p_status = 0");
+		pCommand->Execute(NULL, NULL, adCmdText);
+
+		return true;
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+
+	return false;
+}
+
+void c2p::c2pResetOrderPerson()
+{
+	try
+	{
+		CString strSql;
+		_CommandPtr pCommand;
+		pCommand.CreateInstance(__uuidof(Command));
+		pCommand->ActiveConnection = m_pPlatinumConnection;
+		pCommand->CommandTimeout = 120;
+		strSql.Format(_T("delete from [tb_ErpOrdersPerson] where [OrdPe_OrderNumber] like '%s%%'"), Global::g_szClassicBranchId);
+		pCommand->CommandText = _bstr_t(strSql);
+		pCommand->Execute(NULL, NULL, adCmdText);
+
+		_RecordsetPtr rsdindan;
+		rsdindan.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsdindan->Open(_T("select id, ren, ren2,time1 from dindan"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			while (rsdindan->adoEOF == VARIANT_FALSE)
+			{
+				// 判断铂金订单号是否存在;
+				_variant_t varClassicOrder = rsdindan->GetCollect(_T("id"));
+				strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, varClassicOrder.bstrVal);
+				_variant_t varOrderNumber = strSql;
+
+				// 主副门市;
+				_variant_t employeeId;
+				_variant_t employeeId2;
+				[&, this]() {
+					_RecordsetPtr rs;
+					rs.CreateInstance(__uuidof(Recordset));
+
+					_variant_t ren = rsdindan->GetCollect(_T("ren"));
+					_variant_t ren2 = rsdindan->GetCollect(_T("ren2"));
+
+					if (ren2.vt == VT_NULL || ren2.vt == VT_EMPTY || _tcscmp(ren2.bstrVal, _T("")) == 0)
+					{
+						strSql.Format(_T("select User_Name,User_EmployeeID from tb_ErpUser where User_Name = '%s'"), ren.bstrVal);
+					}
+					else
+					{
+						strSql.Format(_T("select User_Name,User_EmployeeID from tb_ErpUser where User_Name in ('%s', '%s')"), ren.bstrVal, ren2.bstrVal);
+					}
+
+					hr = rs->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenForwardOnly, adLockReadOnly, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						while (rs->adoEOF == VARIANT_FALSE)
+						{
+							if (_tcscmp(rs->GetCollect(_T("User_Name")).bstrVal, ren.bstrVal) == 0)
+								employeeId = rs->GetCollect(_T("User_EmployeeID"));
+							else if (ren2.vt != VT_NULL && ren2.vt != VT_EMPTY && _tcscmp(rs->GetCollect(_T("User_Name")).bstrVal, ren2.bstrVal) == 0)
+								employeeId2 = rs->GetCollect(_T("User_EmployeeID"));
+
+							rs->MoveNext();
+						}
+
+						rs->Close();
+					}
+				}();
+
+				// 订单签单人表;
+				c2pOrderSingles(varOrderNumber, employeeId, employeeId2, rsdindan);
+
+				rsdindan->MoveNext();
+			}
+
+			rsdindan->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pResetOrderScenicSpot()
+{
+	try
+	{
+		//////////////////////////////////////////////////////////////////////////
+		CString strSql;
+		_CommandPtr pCommand;
+		pCommand.CreateInstance(__uuidof(Command));
+		pCommand->ActiveConnection = m_pPlatinumConnection;
+		pCommand->CommandTimeout = 120;
+		strSql.Format(_T("delete from [tb_ErpOrdersPhotography] where [Ordpg_Number] like '%s%%'"), Global::g_szClassicBranchId);
+		pCommand->CommandText = _bstr_t(strSql);
+		pCommand->Execute(NULL, NULL, adCmdText);
+
+		_RecordsetPtr rsdindan;
+		rsdindan.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsdindan->Open(_T("select * from dindan"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			while (rsdindan->adoEOF == VARIANT_FALSE)
+			{
+				_variant_t id = rsdindan->GetCollect(_T("id"));
+				strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, id.bstrVal);
+				_variant_t order = strSql;
+				_variant_t txtype = rsdindan->GetCollect(_T("txtype"));
+
+				if (txtype.vt != VT_NULL && txtype.vt != VT_EMPTY && _tcscmp(txtype.bstrVal, _T("成长套系")) == 0 && Global::g_bChildVersion)
+				{
+					// 经典儿童成长套系;
+					// 订单数码表;
+					CString strSql;
+					_RecordsetPtr rsdindanjd;
+					rsdindanjd.CreateInstance(__uuidof(Recordset));
+					strSql.Format(_T("select * from dindanjd where id = '%s'"), id.bstrVal);
+					HRESULT hr = rsdindanjd->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+					if (SUCCEEDED(hr))
+					{
+						int nSubId = 1;
+
+						while (rsdindanjd->adoEOF == VARIANT_FALSE)
+						{
+							// 生成子单;
+							_variant_t varSubId = [&, this]()->_variant_t {
+								TCHAR szSubID[50] = { 0 };
+								_stprintf_s(szSubID, _T("%s_%03d"), order.bstrVal, nSubId);
+								return szSubID;
+							}();
+
+							// 子单化景点;
+							c2pSubOrderScenicSpot(varSubId, id, order, rsdindanjd, rsdindan);
+
+							nSubId++;
+							rsdindanjd->MoveNext();
+						}
+
+						rsdindanjd->Close();
+					}
+				}
+				else
+				{
+					// 景点表;
+					c2pOrderScenicSpot(id, order, rsdindan);
+				}
+
+				rsdindan->MoveNext();
+			}
+
+			rsdindan->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pResetOrderScenicSpot2()
+{
+	try
+	{
+		//////////////////////////////////////////////////////////////////////////
+		CString strSql;
+		_RecordsetPtr rsdindan;
+		rsdindan.CreateInstance(__uuidof(Recordset));
+		HRESULT hr = rsdindan->Open(_T("select * from dindan"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+		if (SUCCEEDED(hr))
+		{
+			while (rsdindan->adoEOF == VARIANT_FALSE)
+			{
+				// 经典订单号;
+				_variant_t id = rsdindan->GetCollect(_T("id"));
+				// 套系;
+				_variant_t txtype = rsdindan->GetCollect(_T("txtype"));
+				// 铂金订单号;
+				strSql.Format(_T("%s%s"), Global::g_szClassicBranchId, id.bstrVal);
+				_variant_t order = strSql;
+				_RecordsetPtr rsdindanjd;
+				rsdindanjd.CreateInstance(__uuidof(Recordset));
+				strSql.Format(_T("select * from dindanjd where id = '%s'"), id.bstrVal);
+				HRESULT hr = rsdindanjd->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+
+				if (SUCCEEDED(hr))
+				{
+					while (rsdindanjd->adoEOF == VARIANT_FALSE)
+					{
+						_variant_t varScenicSpot = rsdindanjd->GetCollect(_T("name"));
+						_RecordsetPtr rsPhotography;
+						rsPhotography.CreateInstance(__uuidof(Recordset));
+						strSql.Format(_T("select * from tb_ErpOrdersPhotography where Ordpg_Number = '%s' and Ordpg_Sights = '%s'"), order.bstrVal, varScenicSpot.bstrVal);
+						hr = rsPhotography->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+						if (SUCCEEDED(hr))
+						{
+							if (rsPhotography->adoEOF == VARIANT_FALSE)
+							{
+								rsPhotography->PutCollect(_T("Ordpg_ReservationPhotographyDividedShop"), Global::g_szPlatinumBranchId);//预约分店;
+								rsPhotography->PutCollect(_T("Ordpg_ReservationPhotographyName"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter1"))));//预约摄影师;
+								rsPhotography->PutCollect(_T("Ordpg_ReservationPhotographyAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter12"))));//预约摄影师助理;
+
+								if (Global::g_bChildVersion)
+								{
+									rsPhotography->PutCollect(_T("Ordpg_ReservationBootDivision"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约引导师;
+									rsPhotography->PutCollect(_T("Ordpg_ReservationBootDivisionAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约引导师助理;
+								}
+								else
+								{
+									rsPhotography->PutCollect(_T("Ordpg_ReservationMakeupArtist"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter2"))));//预约化妆师;
+									rsPhotography->PutCollect(_T("Ordpg_ReservationMakeupAssistant"), c2pGetEmployeeId(rsdindanjd->GetCollect(_T("waiter22"))));//预约化妆师助理;
+								}
+
+								rsPhotography->Update();
+							}
+							else
+							{
+								// 暂时不处理;
+							}
+
+							rsPhotography->Close();
+						}
+
+						rsdindanjd->MoveNext();
+					}
+
+					rsdindanjd->Close();
+				}
+
+				rsdindan->MoveNext();
+			}
+
+			rsdindan->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pOnlyConvertImg(CString strOrders)
+{
+	if (strOrders.IsEmpty())
+	{
+		try
+		{
+			CString strSql;
+			_RecordsetPtr rsdindan;
+			rsdindan.CreateInstance(__uuidof(Recordset));
+			HRESULT hr = rsdindan->Open(_T("select id from dindan"), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+			if (SUCCEEDED(hr))
+			{
+				while (rsdindan->adoEOF == VARIANT_FALSE)
+				{
+					c2pOrderImg(rsdindan->GetCollect(_T("id")).bstrVal);
+					rsdindan->MoveNext();
+				}
+
+				rsdindan->Close();
+			}
+		}
+		catch (_com_error &e)
+		{
+			_bstr_t bstrSource(e.Source());
+			_bstr_t bstrDescription(e.Description());
+			WriteTextLog(_T("%s,%d,%s =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, m_strMsg, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+		}
+	}
+	else
+	{
+		CString strId;
+		strOrders.TrimRight(_T(","));
+		strOrders += _T(",");
+		int nIndex = strOrders.Find(_T(","));
+		WriteTextLog(strOrders);
+
+		do
+		{
+			nIndex = strOrders.Find(_T(","));
+
+			if (nIndex != -1)
+			{
+				strId = strOrders.Left(nIndex);
+				strOrders.Delete(0, nIndex + 1);
+				c2pOrderImg(strId);
+			}
+		} while (nIndex != -1);
+	}
+}
+
+void c2p::c2pRepairCustomer(CString strOrder)
+{
+	try
+	{
+		//////////////////////////////////////////////////////////////////////////
+		CString strSql;
+		_RecordsetPtr rsclient;
+		rsclient.CreateInstance(__uuidof(Recordset));
+		if (strOrder.IsEmpty())
+			strSql = _T("select client.*, dindan.pinyin1, dindan.pinyin2,dindan.time1 from client inner join dindan on client.id = dindan.id");
+		else
+			strSql.Format(_T("select client.*, dindan.pinyin1, dindan.pinyin2,dindan.time1 from client inner join dindan on client.id = dindan.id where dindan.id = '%s'"), strOrder);
+
+		HRESULT hr = rsclient->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pClassicConnection, true), adOpenDynamic, adLockReadOnly, adCmdText);
+		if (SUCCEEDED(hr))
+		{
+			while (rsclient->adoEOF == VARIANT_FALSE)
+			{
+				_variant_t varCustomerId;
+				_variant_t varCustomerId2;
+				_variant_t name1 = rsclient->GetCollect(_T("name1"));
+				_variant_t name2 = rsclient->GetCollect(_T("name2"));
+				_variant_t varGroupId = c2pGetGroupId(rsclient->GetCollect(_T("id")));
+				if (varGroupId.vt != VT_EMPTY && varGroupId.vt != VT_NULL)
+				{
+					// 查询指定订单号的顾客组信息;
+					{// 本人;
+						strSql.Format(_T("select * from tb_ErpCustomerGroupMembers where GM_CustomerGroupID = '%s' and GM_Relation = '本人'"), varGroupId.bstrVal);
+						_RecordsetPtr rsCusMembers;
+						rsCusMembers.CreateInstance(__uuidof(Recordset));
+						hr = rsCusMembers->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+						if (SUCCEEDED(hr))
+						{
+							CString str;
+							if (rsCusMembers->adoEOF == VARIANT_FALSE)
+							{
+								str = rsCusMembers->GetCollect(_T("GM_RelatedPersonID"));
+								if (str.SpanIncluding(_T("0123456789")).IsEmpty())
+								{// 不是数字;
+									/*str = rsCusMembers->GetCollect(_T("GM_CustomerID"));
+									if (str.SpanIncluding(_T("0123456789")).IsEmpty())
+									{// 不是数字;
+
+									}*/
+
+									// 重新生成新的顾客信息;
+									// 儿童;//儿童姓名可能空,此时不添加;
+									if (name2.vt != VT_NULL && name2.vt != VT_EMPTY && _tcscmp(name2.bstrVal, _T("")) != 0)
+									{
+										// 这个宝宝是否存在;
+										varCustomerId2 = [&, this]()->_variant_t {
+											// 根据家长ID来查找tb_ErpCustomerGroupMembers;
+											CString str;
+											str.Format(_T("SELECT * FROM tb_ErpCustomer WHERE Cus_CustomerNumber IN (")
+												_T("SELECT GM_RelatedPersonID FROM [tb_ErpCustomerGroupMembers] WHERE GM_CustomerID = '%s' ) and Cus_Type = '儿童'"), varCustomerId.bstrVal);
+											_RecordsetPtr rsView;
+											_variant_t ChildId;
+											rsView.CreateInstance(__uuidof(Recordset));
+											hr = rsView->Open(_variant_t(str), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+
+											if (SUCCEEDED(hr))
+											{
+												while (rsView->adoEOF == VARIANT_FALSE)
+												{
+													if (_tcscmp(rsView->GetCollect(_T("Cus_Name")).bstrVal, name2.bstrVal) == 0)
+													{
+														ChildId = rsView->GetCollect(_T("Cus_CustomerNumber"));
+														break;
+													}
+
+													rsView->MoveNext();
+												}
+
+												rsView->Close();
+											}
+
+											return ChildId;
+										}();
+
+										if (varCustomerId2.vt == VT_NULL || varCustomerId2.vt == VT_EMPTY)
+										{
+											// 没有该儿童, 创建一个;
+											_RecordsetPtr rsCustomer;
+											rsCustomer.CreateInstance(__uuidof(Recordset));
+											hr = rsCustomer->Open(_T("select * from tb_ErpCustomer"), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+											if (SUCCEEDED(hr))
+											{
+												rsCustomer->AddNew();
+												rsCustomer->PutCollect(_T("Cus_DividedShop"), Global::g_szPlatinumBranchId);
+												rsCustomer->PutCollect(_T("Cus_CustomerNumber"), varCustomerId2 = [&, this]()->_variant_t {
+													TCHAR szUID[24] = { 0 };
+													_ui64tot_s(m_uniqueid.get_unique_id(), szUID, 24, 10);
+													return szUID;
+												}());
+												rsCustomer->PutCollect(_T("Cus_Type"), _T("儿童"));
+												rsCustomer->PutCollect(_T("Cus_Name"), name2);
+												// 拼音;
+												rsCustomer->PutCollect(_T("Cus_NamePinyin"), rsclient->GetCollect(_T("pinyin2")));
+												// 生日;
+												_variant_t varCheck = rsclient->GetCollect(_T("check1"));
+
+												if (varCheck.vt != VT_EMPTY && varCheck.vt != VT_NULL && _tcscmp(varCheck.bstrVal, _T("0")) == 0)
+												{
+													if (CalendarEx::IsValidSolarDate(rsclient->GetCollect(_T("birthday1")).bstrVal))
+														rsCustomer->PutCollect(_T("Cus_Birthday"), rsclient->GetCollect(_T("birthday1")));
+
+													rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+												}
+												else
+												{
+													if (CalendarEx::IsValidLunanrDate(rsclient->GetCollect(_T("birthday1")).bstrVal))
+														rsCustomer->PutCollect(_T("Cus_Birthday"), rsclient->GetCollect(_T("birthday1")));
+
+													rsCustomer->PutCollect(_T("Cus_BirthdayLunar"), varCheck);
+												}
+
+												//rsCustomer->PutCollect(_T("Cus_Telephone"), varTelPhone1);
+												rsCustomer->PutCollect(_T("Cus_Zodiac"), rsclient->GetCollect(_T("zodiac")));
+												rsCustomer->PutCollect(_T("Cus_Sex"), _tcscmp(rsclient->GetCollect(_T("sex")).bstrVal, _T("女")) == 0 ? true : false);
+												DATENULL(rsCustomer, _T("Cus_CreateDateTime"), rsclient->GetCollect(_T("time1")));
+												//rsCustomer->PutCollect(_T("Cus_QQ"), rsClient->GetCollect(_T("qq1")));
+												// Cus_DayForMarriage 婚期;Cus_QQ
+												rsCustomer->Update();
+											}
+										}
+									}
+
+									// 更新组信息;
+									if (varCustomerId2.vt != VT_EMPTY && varCustomerId2.vt != VT_NULL)
+									{
+										rsCusMembers->PutCollect(_T("GM_RelatedPersonID"), varCustomerId2);
+										rsCusMembers->PutCollect(_T("GM_CustomerID"), varCustomerId2);
+										rsCusMembers->Update();
+									}
+								}
+								else
+								{
+									varCustomerId2 = rsCusMembers->GetCollect(_T("GM_CustomerID"));
+								}
+							}
+
+							rsCusMembers->Close();
+						}
+					}
+
+					{// 家长;
+						strSql.Format(_T("select * from tb_ErpCustomerGroupMembers where GM_CustomerGroupID = '%s' and GM_Relation = '家长'"), varGroupId.bstrVal);
+						_RecordsetPtr rsCusMembers;
+						rsCusMembers.CreateInstance(__uuidof(Recordset));
+						hr = rsCusMembers->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+						if (SUCCEEDED(hr))
+						{
+							CString str;
+							if (rsCusMembers->adoEOF == VARIANT_FALSE)
+							{
+								str = rsCusMembers->GetCollect(_T("GM_RelatedPersonID"));
+								if (str.SpanIncluding(_T("0123456789")).IsEmpty())
+								{// 不是数字;
+								 // 顾客id;
+									varCustomerId = rsCusMembers->GetCollect(_T("GM_CustomerID"));
+
+									// 更正组信息;
+									if (varCustomerId2.vt != VT_EMPTY && varCustomerId2.vt != VT_NULL)
+									{
+										rsCusMembers->PutCollect(_T("GM_RelatedPersonID"), varCustomerId2);
+										rsCusMembers->Update();
+									}
+
+									// 更正家长信息;
+									if (varCustomerId.vt != VT_EMPTY && varCustomerId.vt != VT_NULL)
+									{
+										_RecordsetPtr rsCustomer;
+										rsCustomer.CreateInstance(__uuidof(Recordset));
+										strSql.Format(_T("select * from tb_ErpCustomer where Cus_CustomerNumber = '%s'"), varCustomerId.bstrVal);
+										hr = rsCustomer->Open(_variant_t(strSql), _variant_t((IDispatch*)m_pPlatinumConnection, true), adOpenDynamic, adLockOptimistic, adCmdText);
+										if (SUCCEEDED(hr))
+										{
+											if (rsCustomer->adoEOF == VARIANT_FALSE)
+											{
+												rsCustomer->PutCollect(_T("Cus_Name"), name1);
+												rsCustomer->PutCollect(_T("Cus_NamePinyin"), rsclient->GetCollect(_T("pinyin1")));
+												rsCustomer->Update();
+											}
+
+											rsCustomer->Close();
+										}
+									}
+								}
+							}
+
+							rsCusMembers->Close();
+						}
+					}
+				}
+				rsclient->MoveNext();
+			}
+			rsclient->Close();
+		}
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+void c2p::c2pResetNotChildOrder(CString strOrder)
+{
+	try
+	{
+		//////////////////////////////////////////////////////////////////////////
+		{
+			CString strSql;
+			auto fun = [&, this](CString sql) {
+				_CommandPtr pCommand;
+				pCommand.CreateInstance(__uuidof(Command));
+				pCommand->ActiveConnection = m_pPlatinumConnection;
+				pCommand->CommandTimeout = 120;
+				pCommand->CommandText = _bstr_t(sql);
+				pCommand->Execute(NULL, NULL, adCmdText);
+			};
+
+			//CString str = _T("(select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			// 加挑数据;
+			strSql = _T("delete from tb_ErpPlusPickItems where Plu_OrdNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 收款数据;
+			strSql = _T("delete from tb_ErpPayment where Pay_OrdNumber in  (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单商品;
+			strSql = _T("delete from tb_ErpOrderProductList where OPlist_OrderNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单阶段;
+			strSql = _T("delete from tb_ErpOrdersPhotography where Ordpg_Number in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单数码表;
+			strSql = _T("delete from tb_ErpOrderDigital where Ordv_Number in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单数码状态;
+			strSql = _T("delete from tb_ErpOrderDigitalStatus where Ords_OrdNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单接单人;
+			strSql = _T("delete from tb_ErpOrdersPerson where OrdPe_OrderNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单顾客组成员;
+			strSql = _T("delete from tb_ErpCustomerGroupMembers where GM_CustomerGroupID in(select GP_CustomerGroupID from tb_ErpCustomerGroup where GP_OrderNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单'))");
+			fun(strSql);
+
+			// 订单顾客组;
+			strSql = _T("delete from tb_ErpCustomerGroup where GP_OrderNumber in (select Ord_Number from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单')");
+			fun(strSql);
+
+			// 订单;
+			strSql = _T("delete from tb_ErpOrder where Ord_Type = 2 and Ord_Number like 'JD%' and Ord_OrderClass = '经典订单'");
+			fun(strSql);
+		}
+
+		c2pCustomerOrder(strOrder);
+	}
+	catch (_com_error &e)
+	{
+		_bstr_t bstrSource(e.Source());
+		_bstr_t bstrDescription(e.Description());
+		WriteTextLog(_T("%s,%d =>%08lx,%s,%s,%s"), __FUNCTIONW__, __LINE__, e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
+	}
+}
+
+
+

+ 255 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.h

@@ -0,0 +1,255 @@
+#ifndef __C2P__
+#define __C2P__
+
+#pragma once
+#include "CUniqueId.h"
+
+typedef struct C2PSELECTIONITEM
+{
+	CString strSpId;
+	CString strSpName;
+	CString strNo;
+	CString strNo2;
+}c2pSelectionItem, *pc2pSelectionItem;
+
+typedef struct C2PSELECTION 
+{
+	CString strOrder;
+	CString strDelphotos;
+	CString strDelphotos2;
+	CString strbz3; //选片客户要求
+	CString strbz4; //选片相片修改说明
+	CString strbz2; //设计客户要求
+	CString strbz5; //设计相片修改说明
+	std::vector<c2pSelectionItem> vtItems;
+}c2pSelection, *pc2pSelection;
+
+
+typedef struct SHAREDIR 
+{
+	bool enable;
+	CString strBranchId;
+	CString strSharePath;
+	int photoType;
+}ShareDir, *pShareDir;
+
+class c2p
+{
+	c2p();
+public:
+	static c2p* GetInstance()
+	{
+		static c2p *pInstatnce = nullptr;
+		if (!pInstatnce)
+		{
+			static std::mutex _mutex;
+			std::unique_lock<std::mutex> lock{ _mutex };
+			if (nullptr == pInstatnce)
+			{
+				static c2p obj;
+				pInstatnce = &obj;
+				::CoInitialize(NULL);//初始化COM环境  
+				pInstatnce->InitAdoPlatinum();
+				pInstatnce->InitAdoClassic();
+				// 全局uid,64位整型,转字符长度17位;
+				pInstatnce->m_uniqueid.setWorkerId(10);
+				pInstatnce->m_uniqueid.setDatacenterId(20);
+				// 必要的数据库修改;
+				pInstatnce->MustAlterPlatinum();
+				// 获取经典套系;
+				pInstatnce->c2pGetClassicPackageType();
+			}
+		}
+
+		return pInstatnce;
+	}
+
+	~c2p();
+
+private:
+	_ConnectionPtr m_pPlatinumConnection;
+	_ConnectionPtr m_pClassicConnection;
+	_RecordsetPtr m_pRecordset;
+	CUniqueId m_uniqueid;
+	DWORD m_dwIndex;
+	CString m_strMsg;
+	// 经典版加密狗域名;
+	CString m_strClassicDomain;
+	// 多目录共享;
+	std::vector<ShareDir> m_vtShareDir;
+	// 转铂金儿童订单;
+	std::vector<std::wstring> m_listPackageType;
+	std::vector<std::wstring> m_listResult;
+public:
+	bool InitAdoClassic();
+	bool InitAdoPlatinum();
+	const std::vector<std::wstring> &getpackagetype()const {
+		return m_listPackageType; 
+	};
+	void setIntersection(std::vector<std::wstring> &list) {
+		// 先排序;
+		std::sort(m_listPackageType.begin(), m_listPackageType.end());
+		std::sort(list.begin(),list.end());
+
+		m_listResult.clear();
+		m_listResult.resize(m_listPackageType.size());
+
+		// 交集;
+		std::vector<std::wstring>::iterator it = std::set_intersection(list.begin(), list.end(), m_listPackageType.begin(), m_listPackageType.end(), m_listResult.begin());
+		m_listResult.resize(it - m_listResult.begin());
+
+		m_listResult.push_back(_T("成长套系"));
+	}
+
+	void setResult(std::vector<std::wstring> &list) {
+		m_listResult.clear();
+		m_listResult.resize(list.size());
+		std::copy(list.begin(), list.end(), m_listResult.begin());
+		m_listResult.push_back(_T("成长套系"));
+	}
+private:
+	// 必须修改的铂金字段;
+	void MustAlterPlatinum();
+	// 获取铂金员工编号;
+	_variant_t c2pGetEmployeeId(_variant_t employeeName);
+	// 使用c2p_order来获取tb_ErpCustomerGroup.GP_CustomerGroupID
+	_variant_t c2pGetGroupId(_variant_t &c2p_order);
+	// 指定电话是否存在;
+	_variant_t c2pGetCustomerId(_variant_t &varTelphone);
+	// 获取指定商品名的商品ID;
+	_variant_t c2pGetProductId(_variant_t &varGoodsName);
+	// 获取订单商品唯一id;
+	_variant_t c2pGetOrderProductUId(_variant_t &varGoodsName, _variant_t &varViceNumber);
+	// 获取支付方式Code值;
+	_variant_t c2pGetPaymentMethodClass(_variant_t &varPaymentName);
+	// 通过子单号来获取景点或阶段名称;
+	_variant_t c2pGetScenicSpotByViceNumber(_variant_t &varViceNumber);
+	// 获取tb_ErpOrder.c2p_status;
+	_variant_t c2pGetOrderStatus(_variant_t &c2p_order);
+	// 获取铂金版订单号;
+	_variant_t c2pGetOrderNumber(_variant_t &varClassicOrder);
+	// 订单号是否存在;
+	bool c2pOrderNumberExists(_variant_t &varPlatinumOrder);
+	// 查询语句是否存在记录集;
+	_RecordsetPtr c2pQueryExspcits(CString strSql, _ConnectionPtr pConnection);
+private:
+	// 订单签单人(接单人);
+	void c2pOrderSingles(_variant_t &varOrder, _variant_t &varEmployeeId, _variant_t &varEmployeeId2, _RecordsetPtr pcRecordSet);
+	// 订单数码表;//需要子单化;
+	void c2pOrderDigital(_variant_t &varOrder, _RecordsetPtr pcRecordSet);
+	// 订单数码状态表;//需要子单化;
+	void c2pOrderDigitalStatus(_variant_t &varOrder, _RecordsetPtr pcRecordSet);
+	// 订单拍摄表;//需要子单化;
+	void c2pOrderScenicSpot(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 订单顾客组表;
+	void c2pOrderCustomerGroup(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 顾客表;
+	void c2pCustomers(_variant_t &varClassicOrder, _RecordsetPtr pcRecordSet);
+	// 订单商品表;//需要子单化;
+	void c2pOrderGoods(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 订单收款;
+	void c2pRecordOfOrderReceipts(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 订单加挑物品表;
+	void c2pOrderReceiptsItem(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 转换选片数据;
+	void c2pOrderSelection(c2pSelection &c2pslt);
+	// 是否是指定转成儿童订单的套系;
+	bool isChildOrderType(_variant_t varType);
+public:
+	// 获取指定订单目录;
+	void c2pOrderImg(CString strOrder);
+private:
+	// 儿童成长套系子单化;
+	void c2pOrderSubClass(_variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr pcRecordSet);
+	// 子单化scenicspot;
+	void c2pSubOrderScenicSpot(_variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+	// 子单化digital; 
+	void c2pSubOrderDigital(const int &nSubId,_variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+	// 子单化digitalstatus; 
+	void c2pSubOrderDigitalStatus(const int &nSubId, _variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+	// 子单化goods; 
+	void c2pSubOrderGoods(_variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+	// 子单化订单收款; 
+	void c2pSubOrderReceiptsRecord(_variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+	// 子单化订单加挑; 
+	void c2pSubOrderReceiptsItem(_variant_t &varSubId, _variant_t &varClassicOrder, _variant_t &varPlatinumOrder, _RecordsetPtr rsdindanjd, _RecordsetPtr rsdindan);
+public:
+	// 获取多目录信息;
+	void c2pGetMultipleShareDir();
+	// 域名是否空;
+	bool IsClassicDomainEmpty() { return m_strClassicDomain.IsEmpty(); };
+	// 获取域名;
+	void c2pGetClassicDomain();
+	// 店信息+短信;
+	void c2pBranchInfo();
+	// 部门信息;
+	void c2pDepartment();
+	// 员工信息;
+	void c2pEmployee();
+	// 供应商;
+	void c2pSupplier();
+	// 商品类别;
+	void c2pGoodsType();
+	// 商品信息;
+	void c2pGoodsInfo();
+	// 套系类型;
+	void c2pPackageType();
+	// 套系信息;
+	void c2pPackageInfo();
+	// 套系商品;
+	void c2pPackageGoods();
+	// 套系服务;
+	void c2pPackageGoods2();
+	// 景点信息;
+	void c2pScenicSpot();
+	// 顾客关系;//只添加"家长","夫妻"
+	void c2pCustomerRelationShip();
+	// 顾客来源;
+	void c2pCustomerSource();
+	// 收款方式;
+	void c2pPaymentMethod();
+	// 二销类型;
+	void c2pTwopinType();
+	// 客户区域;
+	void c2pClientRegion();
+	// 订单类别;//经典无数据,固化几个内容;
+	void c2pOrderType();
+	// 客户订单+订单签单人(接单人)+订单商品+订单景点+收款;
+	void c2pCustomerOrder(CString strOrder = _T(""));
+	// 订单会员;//卡号+姓名+电话;
+	void c2pMemberShip();
+	// 获取经典套系名称;
+	void c2pGetClassicPackageType();
+public:
+	// 客户类别;
+	void c2pCustomerType();
+	// 业务意向;
+	void c2pBusinessIntention();
+	// 来单医院;
+	void c2pHostpital();
+	// 业务种类;
+	void c2pBusinessTypes();
+	// 喂养方式;
+	void c2pFeedingMode();
+	// 医院跟踪系统;
+	void c2pHospitalCustomer();
+public:
+	// 选片记录;
+	void c2pOrderSelection(bool bImg, CString strOrder = _T(""));
+	// 重置选片记录和转换;
+	bool c2pResetImgConvert();
+	// 重置接单人;
+	void c2pResetOrderPerson();
+	// 重置拍照预约;
+	void c2pResetOrderScenicSpot();
+	// 重置拍照预约;订单号+景点名;
+	void c2pResetOrderScenicSpot2();
+	// 只转相片;
+	void c2pOnlyConvertImg(CString strOrders = _T(""));
+	// 修复儿童客资错误问题;
+	void c2pRepairCustomer(CString strOrder = _T(""));
+	// 删除非成长套系订单,重新转;
+	void c2pResetNotChildOrder(CString strOrder = _T(""));
+};
+
+#endif

+ 46 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/c2p.ini

@@ -0,0 +1,46 @@
+;经典版信息;
+[ClassicInfo]
+;店类型:儿童或婚纱
+IsChildVersion=1
+;分店ID,用于转换前缀;
+BranchId=JD
+;数据库地址,如:LYFZ-PC\SQLEXPRESS 或 127.0.0.1,1433
+dbSource=
+;数据库端口,如果dbSource里包含了端口号或实例名,此处请不要填写;
+dbServerPort=1433
+;数据库账号
+dbAccount=sa
+;数据库密码
+dbPassWord=ly1234
+;数据库名
+dbName=db
+;相片共享主机;
+ShareImgHost=
+;多店转换相片时,是主机还是分机
+IsOurBranch=1
+;是否转会员
+IsConvMemberShip=0
+
+
+;铂金版信息;
+[PlatinumInfo]
+;分店ID;
+BranchId=SSN001
+;数据库地址,如:LYFZ-PC\SQLEXPRESS 或 127.0.0.1,1433
+dbSource=
+;数据库端口,如果dbSource里包含了端口号或实例名,此处请不要填写;
+dbServerPort=1433
+;数据库账号
+dbAccount=sa
+;数据库密码
+dbPassWord=ly1234
+;数据库名
+dbName=LYFZDBRelease
+;铂金版原片目录
+Path1=
+;铂金版初修目录
+Path2=
+;铂金版精修目录
+Path3=
+;铂金版设计目录
+Path4=

+ 924 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/des.cpp

@@ -0,0 +1,924 @@
+#include "stdafx.h"
+#include "des.h"
+#include <string.h>
+#include "Base64.h"
+#include "EncodingConversion.h"
+
+static const unsigned char deskey[9] = "mygz/ndu";//lyfz.net的偶校验结果;
+//static const unsigned char desiv[9] = "WorkbyIT";
+
+// 32-bit integer manipulation macros (big endian)
+#ifndef GET_ULONG_BE
+#define GET_ULONG_BE(n,b,i)                             \
+{                                                       \
+	(n) = ( (unsigned long) (b)[(i)] << 24 )        \
+	| ( (unsigned long) (b)[(i) + 1] << 16 )        \
+	| ( (unsigned long) (b)[(i) + 2] <<  8 )        \
+	| ( (unsigned long) (b)[(i) + 3]       );       \
+}
+#endif
+
+#ifndef PUT_ULONG_BE
+#define PUT_ULONG_BE(n,b,i)                             \
+{                                                       \
+	(b)[(i)    ] = (unsigned char) ( (n) >> 24 );       \
+	(b)[(i) + 1] = (unsigned char) ( (n) >> 16 );       \
+	(b)[(i) + 2] = (unsigned char) ( (n) >>  8 );       \
+	(b)[(i) + 3] = (unsigned char) ( (n)       );       \
+}
+#endif
+
+//Expanded DES S-boxes
+static const unsigned long SB1[64] =
+{
+	0x01010400, 0x00000000, 0x00010000, 0x01010404,
+	0x01010004, 0x00010404, 0x00000004, 0x00010000,
+	0x00000400, 0x01010400, 0x01010404, 0x00000400,
+	0x01000404, 0x01010004, 0x01000000, 0x00000004,
+	0x00000404, 0x01000400, 0x01000400, 0x00010400,
+	0x00010400, 0x01010000, 0x01010000, 0x01000404,
+	0x00010004, 0x01000004, 0x01000004, 0x00010004,
+	0x00000000, 0x00000404, 0x00010404, 0x01000000,
+	0x00010000, 0x01010404, 0x00000004, 0x01010000,
+	0x01010400, 0x01000000, 0x01000000, 0x00000400,
+	0x01010004, 0x00010000, 0x00010400, 0x01000004,
+	0x00000400, 0x00000004, 0x01000404, 0x00010404,
+	0x01010404, 0x00010004, 0x01010000, 0x01000404,
+	0x01000004, 0x00000404, 0x00010404, 0x01010400,
+	0x00000404, 0x01000400, 0x01000400, 0x00000000,
+	0x00010004, 0x00010400, 0x00000000, 0x01010004
+};
+
+static const unsigned long SB2[64] =
+{
+	0x80108020, 0x80008000, 0x00008000, 0x00108020,
+	0x00100000, 0x00000020, 0x80100020, 0x80008020,
+	0x80000020, 0x80108020, 0x80108000, 0x80000000,
+	0x80008000, 0x00100000, 0x00000020, 0x80100020,
+	0x00108000, 0x00100020, 0x80008020, 0x00000000,
+	0x80000000, 0x00008000, 0x00108020, 0x80100000,
+	0x00100020, 0x80000020, 0x00000000, 0x00108000,
+	0x00008020, 0x80108000, 0x80100000, 0x00008020,
+	0x00000000, 0x00108020, 0x80100020, 0x00100000,
+	0x80008020, 0x80100000, 0x80108000, 0x00008000,
+	0x80100000, 0x80008000, 0x00000020, 0x80108020,
+	0x00108020, 0x00000020, 0x00008000, 0x80000000,
+	0x00008020, 0x80108000, 0x00100000, 0x80000020,
+	0x00100020, 0x80008020, 0x80000020, 0x00100020,
+	0x00108000, 0x00000000, 0x80008000, 0x00008020,
+	0x80000000, 0x80100020, 0x80108020, 0x00108000
+};
+
+static const unsigned long SB3[64] =
+{
+	0x00000208, 0x08020200, 0x00000000, 0x08020008,
+	0x08000200, 0x00000000, 0x00020208, 0x08000200,
+	0x00020008, 0x08000008, 0x08000008, 0x00020000,
+	0x08020208, 0x00020008, 0x08020000, 0x00000208,
+	0x08000000, 0x00000008, 0x08020200, 0x00000200,
+	0x00020200, 0x08020000, 0x08020008, 0x00020208,
+	0x08000208, 0x00020200, 0x00020000, 0x08000208,
+	0x00000008, 0x08020208, 0x00000200, 0x08000000,
+	0x08020200, 0x08000000, 0x00020008, 0x00000208,
+	0x00020000, 0x08020200, 0x08000200, 0x00000000,
+	0x00000200, 0x00020008, 0x08020208, 0x08000200,
+	0x08000008, 0x00000200, 0x00000000, 0x08020008,
+	0x08000208, 0x00020000, 0x08000000, 0x08020208,
+	0x00000008, 0x00020208, 0x00020200, 0x08000008,
+	0x08020000, 0x08000208, 0x00000208, 0x08020000,
+	0x00020208, 0x00000008, 0x08020008, 0x00020200
+};
+
+static const unsigned long SB4[64] =
+{
+	0x00802001, 0x00002081, 0x00002081, 0x00000080,
+	0x00802080, 0x00800081, 0x00800001, 0x00002001,
+	0x00000000, 0x00802000, 0x00802000, 0x00802081,
+	0x00000081, 0x00000000, 0x00800080, 0x00800001,
+	0x00000001, 0x00002000, 0x00800000, 0x00802001,
+	0x00000080, 0x00800000, 0x00002001, 0x00002080,
+	0x00800081, 0x00000001, 0x00002080, 0x00800080,
+	0x00002000, 0x00802080, 0x00802081, 0x00000081,
+	0x00800080, 0x00800001, 0x00802000, 0x00802081,
+	0x00000081, 0x00000000, 0x00000000, 0x00802000,
+	0x00002080, 0x00800080, 0x00800081, 0x00000001,
+	0x00802001, 0x00002081, 0x00002081, 0x00000080,
+	0x00802081, 0x00000081, 0x00000001, 0x00002000,
+	0x00800001, 0x00002001, 0x00802080, 0x00800081,
+	0x00002001, 0x00002080, 0x00800000, 0x00802001,
+	0x00000080, 0x00800000, 0x00002000, 0x00802080
+};
+
+static const unsigned long SB5[64] =
+{
+	0x00000100, 0x02080100, 0x02080000, 0x42000100,
+	0x00080000, 0x00000100, 0x40000000, 0x02080000,
+	0x40080100, 0x00080000, 0x02000100, 0x40080100,
+	0x42000100, 0x42080000, 0x00080100, 0x40000000,
+	0x02000000, 0x40080000, 0x40080000, 0x00000000,
+	0x40000100, 0x42080100, 0x42080100, 0x02000100,
+	0x42080000, 0x40000100, 0x00000000, 0x42000000,
+	0x02080100, 0x02000000, 0x42000000, 0x00080100,
+	0x00080000, 0x42000100, 0x00000100, 0x02000000,
+	0x40000000, 0x02080000, 0x42000100, 0x40080100,
+	0x02000100, 0x40000000, 0x42080000, 0x02080100,
+	0x40080100, 0x00000100, 0x02000000, 0x42080000,
+	0x42080100, 0x00080100, 0x42000000, 0x42080100,
+	0x02080000, 0x00000000, 0x40080000, 0x42000000,
+	0x00080100, 0x02000100, 0x40000100, 0x00080000,
+	0x00000000, 0x40080000, 0x02080100, 0x40000100
+};
+
+static const unsigned long SB6[64] =
+{
+	0x20000010, 0x20400000, 0x00004000, 0x20404010,
+	0x20400000, 0x00000010, 0x20404010, 0x00400000,
+	0x20004000, 0x00404010, 0x00400000, 0x20000010,
+	0x00400010, 0x20004000, 0x20000000, 0x00004010,
+	0x00000000, 0x00400010, 0x20004010, 0x00004000,
+	0x00404000, 0x20004010, 0x00000010, 0x20400010,
+	0x20400010, 0x00000000, 0x00404010, 0x20404000,
+	0x00004010, 0x00404000, 0x20404000, 0x20000000,
+	0x20004000, 0x00000010, 0x20400010, 0x00404000,
+	0x20404010, 0x00400000, 0x00004010, 0x20000010,
+	0x00400000, 0x20004000, 0x20000000, 0x00004010,
+	0x20000010, 0x20404010, 0x00404000, 0x20400000,
+	0x00404010, 0x20404000, 0x00000000, 0x20400010,
+	0x00000010, 0x00004000, 0x20400000, 0x00404010,
+	0x00004000, 0x00400010, 0x20004010, 0x00000000,
+	0x20404000, 0x20000000, 0x00400010, 0x20004010
+};
+
+static const unsigned long SB7[64] =
+{
+	0x00200000, 0x04200002, 0x04000802, 0x00000000,
+	0x00000800, 0x04000802, 0x00200802, 0x04200800,
+	0x04200802, 0x00200000, 0x00000000, 0x04000002,
+	0x00000002, 0x04000000, 0x04200002, 0x00000802,
+	0x04000800, 0x00200802, 0x00200002, 0x04000800,
+	0x04000002, 0x04200000, 0x04200800, 0x00200002,
+	0x04200000, 0x00000800, 0x00000802, 0x04200802,
+	0x00200800, 0x00000002, 0x04000000, 0x00200800,
+	0x04000000, 0x00200800, 0x00200000, 0x04000802,
+	0x04000802, 0x04200002, 0x04200002, 0x00000002,
+	0x00200002, 0x04000000, 0x04000800, 0x00200000,
+	0x04200800, 0x00000802, 0x00200802, 0x04200800,
+	0x00000802, 0x04000002, 0x04200802, 0x04200000,
+	0x00200800, 0x00000000, 0x00000002, 0x04200802,
+	0x00000000, 0x00200802, 0x04200000, 0x00000800,
+	0x04000002, 0x04000800, 0x00000800, 0x00200002
+};
+
+static const unsigned long SB8[64] =
+{
+	0x10001040, 0x00001000, 0x00040000, 0x10041040,
+	0x10000000, 0x10001040, 0x00000040, 0x10000000,
+	0x00040040, 0x10040000, 0x10041040, 0x00041000,
+	0x10041000, 0x00041040, 0x00001000, 0x00000040,
+	0x10040000, 0x10000040, 0x10001000, 0x00001040,
+	0x00041000, 0x00040040, 0x10040040, 0x10041000,
+	0x00001040, 0x00000000, 0x00000000, 0x10040040,
+	0x10000040, 0x10001000, 0x00041040, 0x00040000,
+	0x00041040, 0x00040000, 0x10041000, 0x00001000,
+	0x00000040, 0x10040040, 0x00001000, 0x00041040,
+	0x10001000, 0x00000040, 0x10000040, 0x10040000,
+	0x10040040, 0x10000000, 0x00040000, 0x10001040,
+	0x00000000, 0x10041040, 0x00040040, 0x10000040,
+	0x10040000, 0x10001000, 0x10001040, 0x00000000,
+	0x10041040, 0x00041000, 0x00041000, 0x00001040,
+	0x00001040, 0x00040040, 0x10000000, 0x10041000
+};
+
+//PC1: left and right halves bit-swap
+static const unsigned long LHs[16] =
+{
+	0x00000000, 0x00000001, 0x00000100, 0x00000101,
+	0x00010000, 0x00010001, 0x00010100, 0x00010101,
+	0x01000000, 0x01000001, 0x01000100, 0x01000101,
+	0x01010000, 0x01010001, 0x01010100, 0x01010101
+};
+
+static const unsigned long RHs[16] =
+{
+	0x00000000, 0x01000000, 0x00010000, 0x01010000,
+	0x00000100, 0x01000100, 0x00010100, 0x01010100,
+	0x00000001, 0x01000001, 0x00010001, 0x01010001,
+	0x00000101, 0x01000101, 0x00010101, 0x01010101,
+};
+
+static const unsigned char odd_parity_table[128] = { 1,  2,  4,  7,  8,
+11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 31, 32, 35, 37, 38, 41, 42, 44,
+47, 49, 50, 52, 55, 56, 59, 61, 62, 64, 67, 69, 70, 73, 74, 76, 79, 81,
+82, 84, 87, 88, 91, 93, 94, 97, 98, 100, 103, 104, 107, 109, 110, 112,
+115, 117, 118, 121, 122, 124, 127, 128, 131, 133, 134, 137, 138, 140,
+143, 145, 146, 148, 151, 152, 155, 157, 158, 161, 162, 164, 167, 168,
+171, 173, 174, 176, 179, 181, 182, 185, 186, 188, 191, 193, 194, 196,
+199, 200, 203, 205, 206, 208, 211, 213, 214, 217, 218, 220, 223, 224,
+227, 229, 230, 233, 234, 236, 239, 241, 242, 244, 247, 248, 251, 253,
+254 
+};
+
+#define WEAK_KEY_COUNT 16
+
+static const unsigned char weak_key_table[WEAK_KEY_COUNT][DES_KEY_SIZE] =
+{
+	{ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
+	{ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE },
+	{ 0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x0E, 0x0E, 0x0E },
+	{ 0xE0, 0xE0, 0xE0, 0xE0, 0xF1, 0xF1, 0xF1, 0xF1 },
+
+	{ 0x01, 0x1F, 0x01, 0x1F, 0x01, 0x0E, 0x01, 0x0E },
+	{ 0x1F, 0x01, 0x1F, 0x01, 0x0E, 0x01, 0x0E, 0x01 },
+	{ 0x01, 0xE0, 0x01, 0xE0, 0x01, 0xF1, 0x01, 0xF1 },
+	{ 0xE0, 0x01, 0xE0, 0x01, 0xF1, 0x01, 0xF1, 0x01 },
+	{ 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE },
+	{ 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01 },
+	{ 0x1F, 0xE0, 0x1F, 0xE0, 0x0E, 0xF1, 0x0E, 0xF1 },
+	{ 0xE0, 0x1F, 0xE0, 0x1F, 0xF1, 0x0E, 0xF1, 0x0E },
+	{ 0x1F, 0xFE, 0x1F, 0xFE, 0x0E, 0xFE, 0x0E, 0xFE },
+	{ 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x0E, 0xFE, 0x0E },
+	{ 0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1, 0xFE },
+	{ 0xFE, 0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1 }
+};
+
+// Initial Permutation macro
+#define DES_IP(X,Y)                                             \
+{                                                               \
+	T = ((X >>  4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T <<  4);   \
+	T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16);   \
+	T = ((Y >>  2) ^ X) & 0x33333333; X ^= T; Y ^= (T <<  2);   \
+	T = ((Y >>  8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T <<  8);   \
+	Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF;                    \
+	T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T;                   \
+	X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF;                    \
+}
+
+// Final Permutation macro
+#define DES_FP(X,Y)                                             \
+{                                                               \
+	X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF;                    \
+	T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T;                   \
+	Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF;                    \
+	T = ((Y >>  8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T <<  8);   \
+	T = ((Y >>  2) ^ X) & 0x33333333; X ^= T; Y ^= (T <<  2);   \
+	T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16);   \
+	T = ((X >>  4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T <<  4);   \
+}
+
+// DES round macro
+#define DES_ROUND(X,Y)                          \
+{                                               \
+	T = *SK++ ^ X;                              \
+	Y ^= SB8[ (T) & 0x3F ] ^              		\
+	SB6[ (T >>  8) & 0x3F ] ^              \
+	SB4[ (T >> 16) & 0x3F ] ^              \
+	SB2[ (T >> 24) & 0x3F ];               \
+	\
+	T = *SK++ ^ ((X << 28) | (X >> 4));         \
+	Y ^= SB7[ (T) & 0x3F ] ^              		\
+	SB5[ (T >>  8) & 0x3F ] ^              \
+	SB3[ (T >> 16) & 0x3F ] ^              \
+	SB1[ (T >> 24) & 0x3F ];               \
+}
+
+#define SWAP(a,b) { unsigned long t = a; a = b; b = t; t = 0; }
+
+void des_key_set_parity( unsigned char key[DES_KEY_SIZE] )
+{
+	for(int i = 0; i < DES_KEY_SIZE; i++ )
+		key[i] = odd_parity_table[key[i] / 2];
+}
+
+int des_key_check_key_parity( const unsigned char key[DES_KEY_SIZE] )
+{
+	for(int i = 0; i < DES_KEY_SIZE; i++ )
+		if( key[i] != odd_parity_table[key[i] / 2] )
+			return( 1 );
+
+	return( 0 );
+}
+
+int des_key_check_weak( const unsigned char key[DES_KEY_SIZE] )
+{
+	for(int i = 0; i < WEAK_KEY_COUNT; i++ )
+		if( memcmp( weak_key_table[i], key, DES_KEY_SIZE) == 0 )
+			return( 1 );
+
+	return( 0 );
+}
+
+unsigned __int64 des_enc_len(const unsigned __int64& nlen)
+{
+	unsigned __int64 npaddinglen = nlen;
+	int npad = nlen&7;//nFileLen & 7 <=> nFileLen%8
+	if ( npad != 0 )
+	{
+		npaddinglen += 8 - npad;
+	}
+	return npaddinglen;
+}
+
+unsigned __int64 des_dec_len(const unsigned char* input, unsigned __int64 nlen)
+{
+	while( input[--nlen] == 0x00 );
+	return ++nlen;
+}
+
+/************************************************************************/
+/*  函数:des_setkey[6/5/2016 IT];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+static void des_setkey( unsigned long SK[32], const unsigned char key[8] )
+{
+	int i;
+	unsigned long X, Y, T;
+
+	GET_ULONG_BE( X, key, 0 );
+	GET_ULONG_BE( Y, key, 4 );
+
+	// Permuted Choice 1
+	T =  ((Y >>  4) ^ X) & 0x0F0F0F0F;  X ^= T; Y ^= (T <<  4);
+	T =  ((Y      ) ^ X) & 0x10101010;  X ^= T; Y ^= (T      );
+
+	X =   (LHs[ (X      ) & 0xF] << 3) | (LHs[ (X >>  8) & 0xF ] << 2)
+		| (LHs[ (X >> 16) & 0xF] << 1) | (LHs[ (X >> 24) & 0xF ]     )
+		| (LHs[ (X >>  5) & 0xF] << 7) | (LHs[ (X >> 13) & 0xF ] << 6)
+		| (LHs[ (X >> 21) & 0xF] << 5) | (LHs[ (X >> 29) & 0xF ] << 4);
+
+	Y =   (RHs[ (Y >>  1) & 0xF] << 3) | (RHs[ (Y >>  9) & 0xF ] << 2)
+		| (RHs[ (Y >> 17) & 0xF] << 1) | (RHs[ (Y >> 25) & 0xF ]     )
+		| (RHs[ (Y >>  4) & 0xF] << 7) | (RHs[ (Y >> 12) & 0xF ] << 6)
+		| (RHs[ (Y >> 20) & 0xF] << 5) | (RHs[ (Y >> 28) & 0xF ] << 4);
+
+	X &= 0x0FFFFFFF;
+	Y &= 0x0FFFFFFF;
+
+	// calculate subkeys
+	for( i = 0; i < 16; i++ )
+	{
+		if( i < 2 || i == 8 || i == 15 )
+		{
+			X = ((X <<  1) | (X >> 27)) & 0x0FFFFFFF;
+			Y = ((Y <<  1) | (Y >> 27)) & 0x0FFFFFFF;
+		}
+		else
+		{
+			X = ((X <<  2) | (X >> 26)) & 0x0FFFFFFF;
+			Y = ((Y <<  2) | (Y >> 26)) & 0x0FFFFFFF;
+		}
+
+		*SK++ =   ((X <<  4) & 0x24000000) | ((X << 28) & 0x10000000)
+			| ((X << 14) & 0x08000000) | ((X << 18) & 0x02080000)
+			| ((X <<  6) & 0x01000000) | ((X <<  9) & 0x00200000)
+			| ((X >>  1) & 0x00100000) | ((X << 10) & 0x00040000)
+			| ((X <<  2) & 0x00020000) | ((X >> 10) & 0x00010000)
+			| ((Y >> 13) & 0x00002000) | ((Y >>  4) & 0x00001000)
+			| ((Y <<  6) & 0x00000800) | ((Y >>  1) & 0x00000400)
+			| ((Y >> 14) & 0x00000200) | ((Y      ) & 0x00000100)
+			| ((Y >>  5) & 0x00000020) | ((Y >> 10) & 0x00000010)
+			| ((Y >>  3) & 0x00000008) | ((Y >> 18) & 0x00000004)
+			| ((Y >> 26) & 0x00000002) | ((Y >> 24) & 0x00000001);
+
+		*SK++ =   ((X << 15) & 0x20000000) | ((X << 17) & 0x10000000)
+			| ((X << 10) & 0x08000000) | ((X << 22) & 0x04000000)
+			| ((X >>  2) & 0x02000000) | ((X <<  1) & 0x01000000)
+			| ((X << 16) & 0x00200000) | ((X << 11) & 0x00100000)
+			| ((X <<  3) & 0x00080000) | ((X >>  6) & 0x00040000)
+			| ((X << 15) & 0x00020000) | ((X >>  4) & 0x00010000)
+			| ((Y >>  2) & 0x00002000) | ((Y <<  8) & 0x00001000)
+			| ((Y >> 14) & 0x00000808) | ((Y >>  9) & 0x00000400)
+			| ((Y      ) & 0x00000200) | ((Y <<  7) & 0x00000100)
+			| ((Y >>  7) & 0x00000020) | ((Y >>  3) & 0x00000011)
+			| ((Y <<  2) & 0x00000004) | ((Y >> 21) & 0x00000002);
+	}
+}
+
+/************************************************************************/
+/*  函数:des_setkey_enc[6/5/2016 IT];
+/*  描述:设置DES加密密钥(56bit,加密);
+/*  参数:;
+/*  	[IN] ctx:要被初始化的DES结构体;
+/*  	[IN] key:8字节长度的加解密密钥;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+void des_setkey_enc( IN des_context *ctx, IN const unsigned char key[8] )
+{
+	des_setkey( ctx->sk, key );
+}
+
+/************************************************************************/
+/*  函数:des_setkey_dec[6/5/2016 IT];
+/*  描述:设置DES解密密钥(56bit,解密);;
+/*  参数:;
+/*  	[IN] ctx:要被初始化的DES结构体;
+/*  	[IN] key:8字节长度的加解密密钥;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+void des_setkey_dec( IN des_context *ctx, IN const unsigned char key[8] )
+{
+	int i;
+
+	des_setkey( ctx->sk, key );
+
+	for( i = 0; i < 16; i += 2 )
+	{
+		SWAP( ctx->sk[i], ctx->sk[30 - i] );
+		SWAP( ctx->sk[i + 1], ctx->sk[31 - i] );
+	}
+}
+
+/************************************************************************/
+/*  函数:[6/5/2016 IT];
+/*  描述:DES-ECB模式下加解密;
+/*  参数:;
+/*  	[IN] ctx:已经初始化过的DES结构体;
+/*  	[IN] input:64bit的输入缓存块;
+/*  	[OUT] output:64bit的输出缓存块;
+/*  返回:成功返回0;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+int des_crypt_ecb( IN des_context *ctx, IN const unsigned char input[8], OUT unsigned char output[8] )
+{
+	int i;
+	unsigned long X, Y, T, *SK;
+
+	SK = ctx->sk;
+
+	GET_ULONG_BE( X, input, 0 );
+	GET_ULONG_BE( Y, input, 4 );
+
+	DES_IP( X, Y );
+
+	for( i = 0; i < 8; i++ )
+	{
+		DES_ROUND( Y, X );
+		DES_ROUND( X, Y );
+	}
+
+	DES_FP( Y, X );
+
+	PUT_ULONG_BE( Y, output, 0 );
+	PUT_ULONG_BE( X, output, 4 );
+
+	return( 0 );
+}
+
+
+/************************************************************************/
+/*  函数:des_crypt_cbc[6/5/2016 IT];
+/*  描述:DES-CBC模式加解密;
+/*  参数:;
+/*  	[IN] ctx:已经初始化过的DES结构体;
+/*  	[IN] mode:加密或解密模式;
+/*  	[IN] length:input长度;
+/*  	[IN] iv:初始向量(使用后更新);
+/*  	[IN] input:要加密或解密的数据;
+/*  	[OUT] output:加密或解密的数据;
+/*  返回:成功返回0;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+int des_crypt_cbc( IN des_context *ctx, IN int mode, IN int length, IN unsigned char iv[8], IN const unsigned char *input, OUT unsigned char *output )
+{
+	int i;
+	unsigned char temp[8];
+
+	if( length % 8 )
+		return( POLARSSL_ERR_DES_INVALID_INPUT_LENGTH );
+
+	if( mode == DES_ENCRYPT )
+	{
+		while( length > 0 )
+		{
+			for( i = 0; i < 8; i++ )
+				output[i] = (unsigned char)( input[i] ^ iv[i] );
+
+			des_crypt_ecb( ctx, output, output );
+			memcpy( iv, output, 8 );
+
+			input  += 8;
+			output += 8;
+			length -= 8;
+		}
+	}
+	else /* DES_DECRYPT */
+	{
+		while( length > 0 )
+		{
+			memcpy( temp, input, 8 );
+			des_crypt_ecb( ctx, input, output );
+
+			for( i = 0; i < 8; i++ )
+				output[i] = (unsigned char)( output[i] ^ iv[i] );
+
+			memcpy( iv, temp, 8 );
+
+			input  += 8;
+			output += 8;
+			length -= 8;
+		}
+	}
+
+	return( 0 );
+}
+
+/************************************************************************/
+/*  函数:des_crypt_cbc[6/5/2016 IT];
+/*  描述:DES-CBC模式加解密;
+/*  参数:;
+/*  	[IN] ctx:已经初始化过的DES结构体;
+/*  	[IN] mode:加密或解密模式;
+/*  	[IN] length:input长度;
+/*  	[IN] iv:初始向量(使用后更新);
+/*  	[IN] input:要加密或解密的数据;
+/*  	[OUT] output:加密或解密的数据;
+/*  返回:成功返回0;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+int des_crypt_cbc(IN int mode, IN int length, IN const unsigned char *input, OUT unsigned char *output, IN const int& outMaxlen )
+{
+	if ( length == 0 )
+		return -1;
+
+	int i;
+	des_context ctx;
+	if ( mode == DES_ENCRYPT )
+		des_setkey_enc(&ctx, deskey);
+	else
+		des_setkey_dec(&ctx, deskey);
+
+	int nInputlen = length;
+	unsigned char *result = output;
+	unsigned char iv[9] = "WorkbyIT";
+	unsigned char temp[8];
+
+	int npadlen = length & 7;
+	if( npadlen != 0 )
+	{
+		length += 8 - npadlen;
+		nInputlen = length;
+	}
+
+	if( mode == DES_ENCRYPT )
+	{
+		while( length > 0 )
+		{
+			for( i = 0; i < 8; i++ )
+			{
+				if ( length == 8 && npadlen != 0)
+				{
+					if ( i >= npadlen )
+						output[i] = (unsigned char)( 0x00 ^ iv[i] );
+					else
+						output[i] = (unsigned char)( input[i] ^ iv[i] );
+				}
+				else
+					output[i] = (unsigned char)( input[i] ^ iv[i] );
+			}
+
+			des_crypt_ecb( &ctx, output, output );
+			memcpy( iv, output, 8 );
+
+			input  += 8;
+			output += 8;
+			length -= 8;
+		}
+
+		// 将加密结果转换成base64;
+		// 1.计算出Base64的长度,CalcBase64Len的参数必须是字节长度,而非字符数;
+		INT nBaseLen = CBase64::CalcBase64Len(nInputlen);
+		if ( nBaseLen > outMaxlen )
+			return -1;
+
+		// 2.创建Base64缓存;
+		CHAR *pBase64 = new CHAR[nBaseLen + 1];
+		memset(pBase64, 0, nBaseLen + 1);
+
+		// 3.转化出Base64字符;
+		CBase64::binToBase64(result, nInputlen, pBase64);
+		memset(result, 0, outMaxlen);
+		memcpy(result, pBase64, nBaseLen);
+
+		if ( pBase64 )
+			delete []pBase64;
+	}
+	else /* DES_DECRYPT */
+	{
+		// 将base64转换成密文状态;
+		// 1.计算出字节长度;
+		INT nByteLen = CBase64::CalcBinLen(length);
+
+		// 2.创建Byte缓存区;
+		BYTE *pBytes = new BYTE[nByteLen];
+		memset(pBytes, 0, nByteLen);
+
+		// 3.转化成字节;
+		length = CBase64::base64ToBin((char*)input, pBytes, nByteLen);
+		result = pBytes;
+		while ( pBytes[length-1] == 0x00 )
+			--length;
+
+		while( length > 0 )
+		{
+			memcpy( temp, pBytes, 8 );
+			des_crypt_ecb( &ctx, pBytes, output );
+
+			for( i = 0; i < 8; i++ )
+				output[i] = (unsigned char)( output[i] ^ iv[i] );
+
+			memcpy( iv, temp, 8 );
+
+			pBytes += 8;
+			output += 8;
+			length -= 8;
+		}
+
+		if ( result )
+			delete []result;
+	}
+
+	return( 0 );
+}
+
+int des_crypt(IN CString strInput, IN CString& strOutput, IN const int &mode /* = DES_ENCRYPT */)
+{
+	if ( strInput.IsEmpty() )
+		return -1;
+
+	unsigned char* pInput = NULL;
+	int nInputlen = strInput.GetLength();
+
+#ifdef UNICODE
+	pInput = (unsigned char*)EncodingConverion::UNICODE2ASCII(strInput.GetBuffer());
+	nInputlen = strlen((char*)pInput);
+#else
+	pInput = new unsigned char[nInputlen+1];
+	memset(pInput, 0, nInputlen+1);
+	memcpy(pInput, strInput, nInputlen);
+#endif
+
+	int nOutputlen = nInputlen;
+	if ( mode == DES_ENCRYPT )
+	{
+		// 计算密文长度,不足8位补齐;
+		nOutputlen = des_enc_len(nInputlen);
+		// 计算密文转成base64的长度,用于创建输出缓存;
+		nOutputlen = CBase64::CalcBase64Len(nOutputlen);
+	}
+	else
+	{
+		nOutputlen = CBase64::CalcBinLen(nInputlen);
+	}
+
+	unsigned char* pOutput = new unsigned char[nOutputlen+1];
+	memset(pOutput, 0, nOutputlen + 1);
+
+	if ( des_crypt_cbc(mode, nInputlen, pInput, pOutput, nOutputlen) == -1)
+		return -1;
+
+#ifdef UNICODE
+	WCHAR* pWide = EncodingConverion::ASCII2UNICODE((char*)pOutput);
+	strOutput.Format(_T("%s"), pWide);
+	if ( pWide )
+		delete []pWide;
+#else
+	strOutput.Format(_T("%s"), pOutput);
+#endif
+
+	if ( pInput )
+		delete []pInput;
+	if ( pOutput )
+		delete []pOutput;
+
+	return 0;
+}
+
+/************************************************************************/
+/*  函数:[12/21/2016 IT];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+void DES_EncryptFile(IN LPCTSTR lpFile, IN LPBYTE lpKey, IN LPBYTE lpVI, IN LPCTSTR lpEncryFile)
+{
+	if ( lpFile == NULL )
+		return;
+
+	if ( lpKey == NULL || lpVI == NULL )
+		return;
+
+	BYTE szKey[9] = {0};
+	INT nKeyLen = strlen((char*)lpKey);
+	if (nKeyLen != 8 )
+		return;
+
+	memcpy(szKey, lpKey, 8);
+
+	BYTE szvi[9] = {0};
+	INT nVILen = strlen((char*)lpVI);
+	if ( nVILen != 8 ) 
+		return;
+
+	memcpy(szvi, lpVI, 8);
+
+	CFile cf;
+	BYTE *pFileData = NULL;
+	BYTE *pOutData = NULL;
+	INT nPadLen = 0;
+	UINT64 nFileLen = 0;
+	UINT64 nOutLen = 0;
+	if ( cf.Open(lpFile, CFile::modeRead) )
+	{
+		nFileLen = cf.GetLength();
+		pFileData = new BYTE[nFileLen];
+		memset(pFileData, 0, nFileLen);
+
+		cf.Read(pFileData,nFileLen);
+		cf.Close();
+	}
+	else
+	{
+		DWORD dwError = GetLastError();
+		TRACE("%d", dwError);
+		return;
+	}
+
+	if ( strncmp((char*)pFileData, "<?>", 3) == 0 )
+	{// 已加密的,退出;
+		delete []pFileData;
+		return;
+	}
+
+	// 不足8的倍数,补齐;
+	nOutLen = des_enc_len(nFileLen);
+	pOutData = new BYTE[nOutLen + 1 ];
+	memset(pOutData, 0, nOutLen + 1 );
+
+	des_context des;
+	if ( des_key_check_key_parity(szKey) == 1)
+	{
+		des_key_set_parity(szKey);
+		if ( des_key_check_key_parity(szKey) == 0 )
+		{
+			des_setkey_enc(&des, szKey);
+		}
+	}
+	else
+		des_setkey_enc(&des, szKey);
+
+	des_crypt_cbc(&des, DES_ENCRYPT, nOutLen, szvi, pFileData, pOutData);
+
+	CFile cfo;
+	if ( cfo.Open(lpEncryFile, CFile::modeCreate|CFile::modeWrite) )
+	{
+		cfo.Write("<?>", 3);
+		cfo.Write(&nFileLen, sizeof(UINT64));
+		cfo.Write(pOutData, nOutLen);
+		cfo.Close();
+	}
+
+	if ( pOutData )
+		delete []pOutData;
+
+	if ( pFileData)
+		delete []pFileData;
+}
+
+/************************************************************************/
+/*  函数:[12/21/2016 IT];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+void DES_DecryptFile(IN LPCTSTR lpFile, IN LPBYTE lpKey, IN LPBYTE lpVI, IN LPCTSTR lpDecryFile)
+{
+	if ( lpFile == NULL )
+		return;
+
+	if ( lpKey == NULL || lpVI == NULL )
+		return;
+
+	INT nKeyLen = strlen((char*)lpKey);
+	if (nKeyLen != 8 )
+		return;
+
+	BYTE szvi[9] = {0};
+	INT nVILen = strlen((char*)lpVI);
+	if ( nVILen != 8 ) 
+		return;
+
+	memcpy(szvi, lpVI, 8);
+
+	CFile cf;
+	BYTE *pFileData = NULL;
+	BYTE *pOutData = NULL;
+	UINT64 nFileLen = 0;
+	if ( cf.Open(lpFile, CFile::modeRead) )
+	{
+		nFileLen = cf.GetLength();
+		pFileData = new BYTE[nFileLen];
+		memset(pFileData, 0, nFileLen);
+
+		cf.Read(pFileData,nFileLen);
+		cf.Close();
+	}
+	else
+	{
+		DWORD dwError = GetLastError();
+		TRACE("%d", dwError);
+		return;
+	}
+
+	if ( strncmp((char*)pFileData, "<?>", 3) != 0 )
+	{// 不是加密文件;
+		delete []pFileData;
+		return;
+	}
+
+	// 加密的长度,必定是8的倍数;
+	UINT64 nOutLen = nFileLen-3-sizeof(UINT64);
+	pOutData = new BYTE[nOutLen + 1];
+	memset(pOutData, 0, nOutLen + 1);
+
+	des_context des;
+	if ( des_key_check_key_parity(lpKey) == 1)
+	{
+		des_key_set_parity(lpKey);
+		if ( des_key_check_key_parity(lpKey) == 0 )
+		{
+			des_setkey_dec(&des, lpKey);
+		}
+	}
+	else
+		des_setkey_dec(&des, lpKey);
+	des_crypt_cbc(&des, DES_DECRYPT, nOutLen, szvi, pFileData+3+sizeof(UINT64), pOutData);
+
+	CFile cfo;
+	memcpy(&nOutLen, pFileData+3, sizeof(UINT64)); // 获取实际文件长度;
+	if ( cfo.Open(lpDecryFile, CFile::modeCreate|CFile::modeWrite) )
+	{
+		cfo.Write(pOutData, nOutLen);
+		cfo.Close();
+	}
+
+	if ( pOutData )
+		delete []pOutData;
+
+	if (pFileData)
+		delete []pFileData;
+}

+ 59 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/des.h

@@ -0,0 +1,59 @@
+/************************************************************************/
+/*  Copyright (C), 2016-2020, [ItCivilian], 保留所有权利;
+/*  模 块 名:;
+/*  描    述:;
+/*
+/*  版    本:[V];	
+/*  作    者:[Home];
+/*  日    期:[6/5/2016];
+/*
+/*
+/*  注    意:;
+/*
+/*  修改记录:[ItCivilian];
+/*  修改日期:;
+/*  修改版本:;
+/*  修改内容:;
+/************************************************************************/
+
+#ifndef __SSL_DES_20160606__
+#define __SSL_DES_20160606__
+
+#define DES_ENCRYPT     1
+#define DES_DECRYPT     0
+#define DES_KEY_SIZE    8
+
+#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH               -0x0C00
+
+// DES结构体;
+typedef struct
+{
+	unsigned long sk[32];       // DES 子密钥(由用户输入的密钥生成);
+}des_context;
+
+// 设置密钥校验位为偶校验;
+void des_key_set_parity( unsigned char key[8] );
+// 判断密钥校验位是否为偶校验;
+int des_key_check_key_parity( const unsigned char key[8] );
+// 判断密钥是否为弱密钥;
+int des_key_check_weak( const unsigned char key[8] );
+
+// 返回加密时填充后的明文长度;
+unsigned __int64 des_enc_len(const unsigned __int64& nlen);
+// 返回解密后,去除填充的长度;
+unsigned __int64 des_dec_len(const unsigned char* input, unsigned __int64 nlen);
+
+// DES-ECB模式加解密;
+int des_crypt_ecb( IN des_context *ctx, IN const unsigned char input[8], IN unsigned char output[8] );
+// DES-CBC模式加解密;
+int des_crypt_cbc( IN des_context *ctx, IN int mode, IN int length, IN unsigned char iv[8], IN const unsigned char *input, IN unsigned char *output );
+
+// DES-CBC模式加解密;
+int des_crypt_cbc(IN int mode, IN int length, IN const unsigned char *input, IN unsigned char *output, IN const int& outMaxlen );
+int des_crypt(IN CString strInput, IN CString& strOutput, IN const int &mode = DES_ENCRYPT);
+// 加密文件;
+void DES_EncryptFile(IN LPCTSTR lpFile, IN LPBYTE lpKey, IN LPBYTE lpVI, IN LPCTSTR lpEncryFile);
+// 解密文件;
+void DES_DecryptFile(IN LPCTSTR lpFile, IN LPBYTE lpKey, IN LPBYTE lpVI, IN LPCTSTR lpDecryFile);
+
+#endif // __SSL_DES_20160606__

+ 610 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv.c

@@ -0,0 +1,610 @@
+/*
+ * Copyright (C) 1999-2008, 2011, 2016 Free Software Foundation, Inc.
+ * This file is part of the GNU LIBICONV Library.
+ *
+ * The GNU LIBICONV Library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * The GNU LIBICONV Library is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
+ * If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <iconv.h>
+
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "localcharset.h"
+
+#ifdef __CYGWIN__
+#include <cygwin/version.h>
+#endif
+
+#if ENABLE_EXTRA
+/*
+ * Consider all system dependent encodings, for any system,
+ * and the extra encodings.
+ */
+#define USE_AIX
+#define USE_OSF1
+#define USE_DOS
+#define USE_EXTRA
+#else
+/*
+ * Consider those system dependent encodings that are needed for the
+ * current system.
+ */
+#ifdef _AIX
+#define USE_AIX
+#endif
+#if defined(__osf__) || defined(VMS)
+#define USE_OSF1
+#endif
+#if defined(__DJGPP__) || (defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__)))
+#define USE_DOS
+#endif
+#endif
+
+/*
+ * Data type for general conversion loop.
+ */
+struct loop_funcs {
+	size_t (*loop_convert) (iconv_t icd,
+		const char* * inbuf, size_t *inbytesleft,
+		char* * outbuf, size_t *outbytesleft);
+	size_t (*loop_reset) (iconv_t icd,
+		char* * outbuf, size_t *outbytesleft);
+};
+
+/*
+ * Converters.
+ */
+#include "converters.h"
+
+/*
+ * Transliteration tables.
+ */
+#include "cjk_variants.h"
+#include "translit.h"
+
+/*
+ * Table of all supported encodings.
+ */
+struct encoding {
+  struct mbtowc_funcs ifuncs; /* conversion multibyte -> unicode */
+  struct wctomb_funcs ofuncs; /* conversion unicode -> multibyte */
+  int oflags;                 /* flags for unicode -> multibyte conversion */
+};
+#define DEFALIAS(xxx_alias,xxx) /* nothing */
+enum {
+#define DEFENCODING(xxx_names,xxx,xxx_ifuncs1,xxx_ifuncs2,xxx_ofuncs1,xxx_ofuncs2) \
+  ei_##xxx ,
+#include "encodings.def"
+#ifdef USE_AIX
+# include "encodings_aix.def"
+#endif
+#ifdef USE_OSF1
+# include "encodings_osf1.def"
+#endif
+#ifdef USE_DOS
+# include "encodings_dos.def"
+#endif
+#ifdef USE_EXTRA
+# include "encodings_extra.def"
+#endif
+#include "encodings_local.def"
+#undef DEFENCODING
+ei_for_broken_compilers_that_dont_like_trailing_commas
+};
+#include "flags.h"
+static struct encoding const all_encodings[] = {
+#define DEFENCODING(xxx_names,xxx,xxx_ifuncs1,xxx_ifuncs2,xxx_ofuncs1,xxx_ofuncs2) \
+  { xxx_ifuncs1,xxx_ifuncs2, xxx_ofuncs1,xxx_ofuncs2, ei_##xxx##_oflags },
+#include "encodings.def"
+#ifdef USE_AIX
+# include "encodings_aix.def"
+#endif
+#ifdef USE_OSF1
+# include "encodings_osf1.def"
+#endif
+#ifdef USE_DOS
+# include "encodings_dos.def"
+#endif
+#ifdef USE_EXTRA
+# include "encodings_extra.def"
+#endif
+#undef DEFENCODING
+#define DEFENCODING(xxx_names,xxx,xxx_ifuncs1,xxx_ifuncs2,xxx_ofuncs1,xxx_ofuncs2) \
+  { xxx_ifuncs1,xxx_ifuncs2, xxx_ofuncs1,xxx_ofuncs2, 0 },
+#include "encodings_local.def"
+#undef DEFENCODING
+};
+#undef DEFALIAS
+
+/*
+ * Conversion loops.
+ */
+#include "loops.h"
+
+/*
+ * Alias lookup function.
+ * Defines
+ *   struct alias { int name; unsigned int encoding_index; };
+ *   const struct alias * aliases_lookup (const char *str, unsigned int len);
+ *   #define MAX_WORD_LENGTH ...
+ */
+#if defined _AIX
+# include "aliases_sysaix.h"
+#elif defined hpux || defined __hpux
+# include "aliases_syshpux.h"
+#elif defined __osf__
+# include "aliases_sysosf1.h"
+#elif defined __sun
+# include "aliases_syssolaris.h"
+#else
+# include "aliases.h"
+#endif
+
+/*
+ * System dependent alias lookup function.
+ * Defines
+ *   const struct alias * aliases2_lookup (const char *str);
+ */
+#if defined(USE_AIX) || defined(USE_OSF1) || defined(USE_DOS) || defined(USE_EXTRA) /* || ... */
+struct stringpool2_t {
+#define S(tag,name,encoding_index) char stringpool_##tag[sizeof(name)];
+#include "aliases2.h"
+#undef S
+};
+static const struct stringpool2_t stringpool2_contents = {
+#define S(tag,name,encoding_index) name,
+#include "aliases2.h"
+#undef S
+};
+#define stringpool2 ((const char *) &stringpool2_contents)
+static const struct alias sysdep_aliases[] = {
+#define S(tag,name,encoding_index) { (int)(long)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
+#include "aliases2.h"
+#undef S
+};
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const struct alias *
+aliases2_lookup (register const char *str)
+{
+  const struct alias * ptr;
+  unsigned int count;
+  for (ptr = sysdep_aliases, count = sizeof(sysdep_aliases)/sizeof(sysdep_aliases[0]); count > 0; ptr++, count--)
+    if (!strcmp(str, stringpool2 + ptr->name))
+      return ptr;
+  return NULL;
+}
+#else
+#define aliases2_lookup(str)  NULL
+#define stringpool2  NULL
+#endif
+
+#if 0
+/* Like !strcasecmp, except that the both strings can be assumed to be ASCII
+   and the first string can be assumed to be in uppercase. */
+static int strequal (const char* str1, const char* str2)
+{
+  unsigned char c1;
+  unsigned char c2;
+  for (;;) {
+    c1 = * (unsigned char *) str1++;
+    c2 = * (unsigned char *) str2++;
+    if (c1 == 0)
+      break;
+    if (c2 >= 'a' && c2 <= 'z')
+      c2 -= 'a'-'A';
+    if (c1 != c2)
+      break;
+  }
+  return (c1 == c2);
+}
+#endif
+
+iconv_t iconv_open (const char* tocode, const char* fromcode)
+{
+  struct conv_struct * cd;
+  unsigned int from_index;
+  int from_wchar;
+  unsigned int to_index;
+  int to_wchar;
+  int transliterate;
+  int discard_ilseq;
+
+#include "iconv_open1.h"
+
+  cd = (struct conv_struct *) malloc(from_wchar != to_wchar
+                                     ? sizeof(struct wchar_conv_struct)
+                                     : sizeof(struct conv_struct));
+  if (cd == NULL) {
+    errno = ENOMEM;
+    return (iconv_t)(-1);
+  }
+
+#include "iconv_open2.h"
+
+  return (iconv_t)cd;
+invalid:
+  errno = EINVAL;
+  return (iconv_t)(-1);
+}
+
+size_t iconv (iconv_t icd, const char** inbuf, size_t *inbytesleft, char** outbuf, size_t *outbytesleft)
+{
+	conv_t cd = (conv_t) icd;
+	if (inbuf == NULL || *inbuf == NULL)
+		return cd->lfuncs.loop_reset(icd,outbuf,outbytesleft);
+	else
+		return cd->lfuncs.loop_convert(icd,(const char* *)inbuf,inbytesleft,outbuf,outbytesleft);
+}
+
+int iconv_close (iconv_t icd)
+{
+  conv_t cd = (conv_t) icd;
+  free(cd);
+  return 0;
+}
+
+#ifndef LIBICONV_PLUG
+
+/*
+ * Verify that a 'struct conv_struct' and a 'struct wchar_conv_struct' each
+ * fit in an iconv_allocation_t.
+ * If this verification fails, iconv_allocation_t must be made larger and
+ * the major version in LIBICONV_VERSION_INFO must be bumped.
+ * Currently 'struct conv_struct' has 21 integer/pointer fields, and
+ * 'struct wchar_conv_struct' additionally has an 'mbstate_t' field.
+ */
+typedef int verify_size_1[2 * (sizeof (struct conv_struct) <= sizeof (iconv_allocation_t)) - 1];
+typedef int verify_size_2[2 * (sizeof (struct wchar_conv_struct) <= sizeof (iconv_allocation_t)) - 1];
+
+int iconv_open_into (const char* tocode, const char* fromcode,
+                     iconv_allocation_t* resultp)
+{
+  struct conv_struct * cd;
+  unsigned int from_index;
+  int from_wchar;
+  unsigned int to_index;
+  int to_wchar;
+  int transliterate;
+  int discard_ilseq;
+
+#include "iconv_open1.h"
+
+  cd = (struct conv_struct *) resultp;
+
+#include "iconv_open2.h"
+
+  return 0;
+invalid:
+  errno = EINVAL;
+  return -1;
+}
+
+int iconvctl (iconv_t icd, int request, void* argument)
+{
+  conv_t cd = (conv_t) icd;
+  switch (request) {
+    case ICONV_TRIVIALP:
+      *(int *)argument =
+        ((cd->lfuncs.loop_convert == unicode_loop_convert
+          && cd->iindex == cd->oindex)
+         || cd->lfuncs.loop_convert == wchar_id_loop_convert
+         ? 1 : 0);
+      return 0;
+    case ICONV_GET_TRANSLITERATE:
+      *(int *)argument = cd->transliterate;
+      return 0;
+    case ICONV_SET_TRANSLITERATE:
+      cd->transliterate = (*(const int *)argument ? 1 : 0);
+      return 0;
+    case ICONV_GET_DISCARD_ILSEQ:
+      *(int *)argument = cd->discard_ilseq;
+      return 0;
+    case ICONV_SET_DISCARD_ILSEQ:
+      cd->discard_ilseq = (*(const int *)argument ? 1 : 0);
+      return 0;
+    case ICONV_SET_HOOKS:
+      if (argument != NULL) {
+        cd->hooks = *(const struct iconv_hooks *)argument;
+      } else {
+        cd->hooks.uc_hook = NULL;
+        cd->hooks.wc_hook = NULL;
+        cd->hooks.data = NULL;
+      }
+      return 0;
+    case ICONV_SET_FALLBACKS:
+      if (argument != NULL) {
+        cd->fallbacks = *(const struct iconv_fallbacks *)argument;
+      } else {
+        cd->fallbacks.mb_to_uc_fallback = NULL;
+        cd->fallbacks.uc_to_mb_fallback = NULL;
+        cd->fallbacks.mb_to_wc_fallback = NULL;
+        cd->fallbacks.wc_to_mb_fallback = NULL;
+        cd->fallbacks.data = NULL;
+      }
+      return 0;
+    default:
+      errno = EINVAL;
+      return -1;
+  }
+}
+
+/* An alias after its name has been converted from 'int' to 'const char*'. */
+struct nalias { const char* name; unsigned int encoding_index; };
+
+static int compare_by_index (const void * arg1, const void * arg2)
+{
+  const struct nalias * alias1 = (const struct nalias *) arg1;
+  const struct nalias * alias2 = (const struct nalias *) arg2;
+  return (int)alias1->encoding_index - (int)alias2->encoding_index;
+}
+
+static int compare_by_name (const void * arg1, const void * arg2)
+{
+  const char * name1 = *(const char **)arg1;
+  const char * name2 = *(const char **)arg2;
+  /* Compare alphabetically, but put "CS" names at the end. */
+  int sign = strcmp(name1,name2);
+  if (sign != 0) {
+    sign = ((name1[0]=='C' && name1[1]=='S') - (name2[0]=='C' && name2[1]=='S'))
+           * 4 + (sign >= 0 ? 1 : -1);
+  }
+  return sign;
+}
+
+void iconvlist (int (*do_one) (unsigned int namescount,
+                               const char * const * names,
+                               void* data),
+                void* data)
+{
+#define aliascount1  sizeof(aliases)/sizeof(aliases[0])
+#ifndef aliases2_lookup
+#define aliascount2  sizeof(sysdep_aliases)/sizeof(sysdep_aliases[0])
+#else
+#define aliascount2  0
+#endif
+#define aliascount  (aliascount1+aliascount2)
+  struct nalias aliasbuf[aliascount];
+  const char * namesbuf[aliascount];
+  size_t num_aliases;
+  {
+    /* Put all existing aliases into a buffer. */
+    size_t i;
+    size_t j;
+    j = 0;
+    for (i = 0; i < aliascount1; i++) {
+      const struct alias * p = &aliases[i];
+      if (p->name >= 0
+          && p->encoding_index != ei_local_char
+          && p->encoding_index != ei_local_wchar_t) {
+        aliasbuf[j].name = stringpool + p->name;
+        aliasbuf[j].encoding_index = p->encoding_index;
+        j++;
+      }
+    }
+#ifndef aliases2_lookup
+    for (i = 0; i < aliascount2; i++) {
+      aliasbuf[j].name = stringpool2 + sysdep_aliases[i].name;
+      aliasbuf[j].encoding_index = sysdep_aliases[i].encoding_index;
+      j++;
+    }
+#endif
+    num_aliases = j;
+  }
+  /* Sort by encoding_index. */
+  if (num_aliases > 1)
+    qsort(aliasbuf, num_aliases, sizeof(struct nalias), compare_by_index);
+  {
+    /* Process all aliases with the same encoding_index together. */
+    size_t j;
+    j = 0;
+    while (j < num_aliases) {
+      unsigned int ei = aliasbuf[j].encoding_index;
+      size_t i = 0;
+      do
+        namesbuf[i++] = aliasbuf[j++].name;
+      while (j < num_aliases && aliasbuf[j].encoding_index == ei);
+      if (i > 1)
+        qsort(namesbuf, i, sizeof(const char *), compare_by_name);
+      /* Call the callback. */
+      if (do_one(i,namesbuf,data))
+        break;
+    }
+  }
+#undef aliascount
+#undef aliascount2
+#undef aliascount1
+}
+
+/*
+ * Table of canonical names of encodings.
+ * Instead of strings, it contains offsets into stringpool and stringpool2.
+ */
+static const unsigned short all_canonical[] = {
+#if defined _AIX
+# include "canonical_sysaix.h"
+#elif defined hpux || defined __hpux
+# include "canonical_syshpux.h"
+#elif defined __osf__
+# include "canonical_sysosf1.h"
+#elif defined __sun
+# include "canonical_syssolaris.h"
+#else
+# include "canonical.h"
+#endif
+#ifdef USE_AIX
+# if defined _AIX
+#  include "canonical_aix_sysaix.h"
+# else
+#  include "canonical_aix.h"
+# endif
+#endif
+#ifdef USE_OSF1
+# if defined __osf__
+#  include "canonical_osf1_sysosf1.h"
+# else
+#  include "canonical_osf1.h"
+# endif
+#endif
+#ifdef USE_DOS
+# include "canonical_dos.h"
+#endif
+#ifdef USE_EXTRA
+# include "canonical_extra.h"
+#endif
+#if defined _AIX
+# include "canonical_local_sysaix.h"
+#elif defined hpux || defined __hpux
+# include "canonical_local_syshpux.h"
+#elif defined __osf__
+# include "canonical_local_sysosf1.h"
+#elif defined __sun
+# include "canonical_local_syssolaris.h"
+#else
+# include "canonical_local.h"
+#endif
+};
+
+const char * iconv_canonicalize (const char * name)
+{
+  const char* code;
+  char buf[MAX_WORD_LENGTH+10+1];
+  const char* cp;
+  char* bp;
+  const struct alias * ap;
+  unsigned int count;
+  unsigned int index;
+  const char* pool;
+
+  /* Before calling aliases_lookup, convert the input string to upper case,
+   * and check whether it's entirely ASCII (we call gperf with option "-7"
+   * to achieve a smaller table) and non-empty. If it's not entirely ASCII,
+   * or if it's too long, it is not a valid encoding name.
+   */
+  for (code = name;;) {
+    /* Search code in the table. */
+    for (cp = code, bp = buf, count = MAX_WORD_LENGTH+10+1; ; cp++, bp++) {
+      unsigned char c = * (unsigned char *) cp;
+      if (c >= 0x80)
+        goto invalid;
+      if (c >= 'a' && c <= 'z')
+        c -= 'a'-'A';
+      *bp = c;
+      if (c == '\0')
+        break;
+      if (--count == 0)
+        goto invalid;
+    }
+    for (;;) {
+      if (bp-buf >= 10 && memcmp(bp-10,"//TRANSLIT",10)==0) {
+        bp -= 10;
+        *bp = '\0';
+        continue;
+      }
+      if (bp-buf >= 8 && memcmp(bp-8,"//IGNORE",8)==0) {
+        bp -= 8;
+        *bp = '\0';
+        continue;
+      }
+      break;
+    }
+    if (buf[0] == '\0') {
+      code = locale_charset();
+      /* Avoid an endless loop that could occur when using an older version
+         of localcharset.c. */
+      if (code[0] == '\0')
+        goto invalid;
+      continue;
+    }
+    pool = stringpool;
+    ap = aliases_lookup(buf,bp-buf);
+    if (ap == NULL) {
+      pool = stringpool2;
+      ap = aliases2_lookup(buf);
+      if (ap == NULL)
+        goto invalid;
+    }
+    if (ap->encoding_index == ei_local_char) {
+      code = locale_charset();
+      /* Avoid an endless loop that could occur when using an older version
+         of localcharset.c. */
+      if (code[0] == '\0')
+        goto invalid;
+      continue;
+    }
+    if (ap->encoding_index == ei_local_wchar_t) {
+      /* On systems which define __STDC_ISO_10646__, wchar_t is Unicode.
+         This is also the case on native Woe32 systems and Cygwin >= 1.7, where
+         we know that it is UTF-16.  */
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007)
+      if (sizeof(wchar_t) == 4) {
+        index = ei_ucs4internal;
+        break;
+      }
+      if (sizeof(wchar_t) == 2) {
+# if WORDS_LITTLEENDIAN
+        index = ei_utf16le;
+# else
+        index = ei_utf16be;
+# endif
+        break;
+      }
+#elif __STDC_ISO_10646__
+      if (sizeof(wchar_t) == 4) {
+        index = ei_ucs4internal;
+        break;
+      }
+      if (sizeof(wchar_t) == 2) {
+        index = ei_ucs2internal;
+        break;
+      }
+      if (sizeof(wchar_t) == 1) {
+        index = ei_iso8859_1;
+        break;
+      }
+#endif
+    }
+    index = ap->encoding_index;
+    break;
+  }
+  return all_canonical[index] + pool;
+ invalid:
+  return name;
+}
+
+int _libiconv_version = _LIBICONV_VERSION;
+
+#if defined __FreeBSD__ && !defined __gnu_freebsd__
+/* GNU libiconv is the native FreeBSD iconv implementation since 2002.
+   It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.  */
+#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+#define _strong_alias(name, aliasname) \
+  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+#undef iconv_open
+#undef iconv
+#undef iconv_close
+strong_alias (libiconv_open, iconv_open)
+strong_alias (libiconv, iconv)
+strong_alias (libiconv_close, iconv_close)
+#endif
+
+#endif

+ 345 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv_impl.cpp

@@ -0,0 +1,345 @@
+#include "stdafx.h"
+#include "iconv.h"
+#include "iconv_impl.h"
+
+/************************************************************************/
+/*  函数:[1/22/2018 Home];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+std::string convert2(const char *from, const char* to, const char* inbuf, const size_t &inbufsize)
+{
+	int iconv_ret = 0;
+	// 打开字符集转换;
+	iconv_t hIconv = iconv_open(to, from);
+	if (-1 == (int)hIconv)
+		return "";//打开失败,可能不支持的字符集
+
+	size_t insize = inbufsize;
+	std::string strout;
+	// 循环利用;
+	size_t outsize = 512;
+	// 513多一位用做字符结束符;
+	char out[513] = { 0 };
+
+	while (insize > 0)
+	{
+		outsize = 512;
+		memset(out, 0, outsize);
+		// out地址保存不变,以便重复使用;
+		char *p = out;
+
+		// 开始转换;
+		iconv_ret = iconv(hIconv, (const char**)(&inbuf), &insize, &p, &outsize);
+		if (((iconv_ret == (size_t)-1) && (E2BIG == errno)) || (iconv_ret != (size_t)-1))
+		{
+			// out和p地址不同, p-out指针相减得到长度;
+			//strout.append(out, p - out);
+			strout.insert(strout.size(), out, p - out);
+		}
+	}
+
+	//关闭字符集转换
+	iconv_close(hIconv);
+
+	return strout;
+}
+
+std::string convert(const char *from, const char* to, const char* inbuf, const size_t &inbufsize)
+{
+	int iconv_ret = 0;
+	// 打开字符集转换;
+	iconv_t hIconv = iconv_open(to, from);
+	if (-1 == (int)hIconv)
+		return "";//打开失败,可能不支持的字符集
+
+	int status = 0;
+	int times = (inbufsize / 512) + 1;	// 预计可转换的次数;
+	iconv(hIconv, NULL, NULL, NULL, NULL);
+	size_t insize = inbufsize;
+	std::string strout;
+	// 循环利用;
+	size_t outsize = 512;
+	// 513多一位用做字符结束符;
+	char out[513] = { 0 };
+
+	while (insize > 0)
+	{
+		outsize = 512;
+		memset(out, 0, outsize);
+		// out地址保存不变,以便重复使用;
+		char *p = out;
+
+		// 开始转换;
+		//times--;
+		iconv_ret = iconv(hIconv, (const char**)(&inbuf), &insize, &p, &outsize);
+		if (out != p)
+		{
+			int saved_errno = errno;
+			strout.insert(strout.size(), out, p - out);
+			errno = saved_errno;
+		}
+
+		if (iconv_ret == (size_t)(-1))
+		{
+			if (errno == EILSEQ)
+			{//	输入中遇到无效的多字节序列;
+				int one = 1;
+				// 非法序列丢弃并继续;
+				iconvctl(hIconv, ICONV_SET_DISCARD_ILSEQ, &one);
+				status = -3;
+			}
+			else if (errno == EINVAL)
+			{// 输入中遇到了一个不完整的多字节序列;
+				if (inbufsize == 0)
+				{
+					status = -4;
+					goto done;
+				}
+				else
+				{
+					break;
+				}
+			}
+			else if (errno == E2BIG)
+			{// *outbuf没有足够的空间;
+				status = -5;
+				//goto done;
+			}
+			else {
+				status = -6;
+				goto done;
+			}
+		}
+		/*if (((iconv_ret == (size_t)-1) && (E2BIG == errno)) || (iconv_ret != (size_t)-1))
+		{
+		// out和p地址不同, p-out指针相减得到长度;
+		//strout.append(out, p - out);
+		strout.insert(strout.size(), out, p - out);
+		}*/
+	}
+
+done:
+	//关闭字符集转换
+	iconv_close(hIconv);
+
+	return strout;
+}
+
+/************************************************************************/
+/*  函数:[7/26/2016 IT];
+/*  描述:;
+/*  参数:;
+/*  	[IN] :;
+/*  	[OUT] :;
+/*  	[IN/OUT] :;
+/*  返回:void;
+/*  注意:;
+/*  示例:;
+/*
+/*  修改:;
+/*  日期:;
+/*  内容:;
+/************************************************************************/
+TString EnCode_UTF8URL(const TCHAR* pText)
+{
+	if (pText == NULL || pText[0] == '\0')
+		return _T("");
+
+	std::string tt = "";
+	std::string dd = "";
+	//ASCII2UTF8(pText, tt);
+#ifdef UNICODE 
+	tt = convert("UCS-2LE", "UTF-8", (char*)pText, _tcslen(pText) * sizeof(TCHAR));
+#else
+	tt = convert("ASCII", "UTF-8", pText, strlen(pText));
+#endif
+
+	size_t len = tt.length();
+	for (size_t i = 0; i < len; i++)
+	{
+		if (isalnum((BYTE)tt.at(i)))
+		{
+			char tempbuff[2] = { 0 };
+			sprintf_s(tempbuff, "%c", (BYTE)tt.at(i));
+			dd.append(tempbuff);
+		}
+		else if (isspace((BYTE)tt.at(i)))
+		{
+			dd.append("+");
+		}
+		else
+		{
+			char tempbuff[4];
+			sprintf_s(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16);
+			dd.append(tempbuff);
+		}
+	}
+
+#ifdef UNICODE 
+	//tt = convert("ASCII", "UCS-2LE", dd.c_str(), dd.size());
+	//TString result;
+	//result.append((TCHAR*)tt.c_str(), dd.size());
+	//return result;
+	// 将以上4行代码,简化成一行;
+	return TString().append((TCHAR*)convert("ASCII", "UCS-2LE", dd.c_str(), dd.size()).c_str(), dd.size());
+#else
+	return dd;
+#endif
+
+}
+
+void EnCode_UTF8URL(const TCHAR* pText, TString& strResult)
+{
+	std::string tt = "";
+
+	//ASCII2UTF8(pText, tt);
+#ifdef UNICODE 
+	std::string result = "";
+	tt = convert("UCS-2LE", "UTF-8", (char*)pText, _tcslen(pText) * sizeof(TCHAR));
+#else
+	tt = convert("ASCII", "UTF-8", pText, strlen(pText));
+#endif
+
+	size_t len = tt.length();
+	for (size_t i = 0; i < len; i++)
+	{
+		if (isalnum((BYTE)tt.at(i)))
+		{
+			char tempbuff[2] = { 0 };
+			sprintf_s(tempbuff, "%c", (BYTE)tt.at(i));
+#ifdef UNICODE
+			result.append(tempbuff);
+#else
+			strResult.append(tempbuff);
+#endif
+		}
+		else if (isspace((BYTE)tt.at(i)))
+		{
+#ifdef UNICODE
+			result.append("+");
+#else
+			strResult.append("+");
+#endif
+		}
+		else
+		{
+			char tempbuff[4];
+			sprintf_s(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16);
+#ifdef UNICODE
+			result.append(tempbuff);
+#else
+			strResult.append(tempbuff);
+#endif
+		}
+	}
+
+#ifdef UNICODE 
+	//tt = convert("ASCII", "UCS-2LE", dd.c_str(), dd.size());
+	//TString result;
+	//result.append((TCHAR*)tt.c_str(), dd.size());
+	// 将以上代码,简化成一行;
+	strResult.append((TCHAR*)convert("ASCII", "UCS-2LE", result.c_str(), result.size()).c_str(), result.size());
+#endif
+}
+
+//做为解Url使用
+char CharToInt(char ch)
+{
+	if (ch >= '0' && ch <= '9')return (char)(ch - '0');
+	if (ch >= 'a' && ch <= 'f')return (char)(ch - 'a' + 10);
+	if (ch >= 'A' && ch <= 'F')return (char)(ch - 'A' + 10);
+	return -1;
+}
+
+char StrToBin(IN char(&str)[2])
+{
+	char tempWord[2];
+	char chn;
+
+	tempWord[0] = CharToInt(str[0]);                         //make the B to 11 -- 00001011
+	tempWord[1] = CharToInt(str[1]);                         //make the 0 to 0  -- 00000000
+
+	chn = (tempWord[0] << 4) | tempWord[1];                //to change the BO to 10110000
+
+	return chn;
+}
+
+
+/************************************************************************/
+	/*  函数:[7/26/2016 IT];
+	/*  描述:;
+	/*  参数:;
+	/*  	[IN] :;
+	/*  	[OUT] :;
+	/*  	[IN/OUT] :;
+	/*  返回:void;
+	/*  注意:;
+	/*  示例:;
+	/*
+	/*  修改:;
+	/*  日期:;
+	/*  内容:;
+	/************************************************************************/
+	string DeCode_URLGB2312(IN const CHAR* pURLText)
+	{
+		string output = "";
+		char tmp[2];
+		int i = 0, idx = 0, ndx, len = strlen(pURLText);
+
+		while (i < len) {
+			if (pURLText[i] == '%')
+			{
+				tmp[0] = pURLText[i + 1];
+				tmp[1] = pURLText[i + 2];
+				output += StrToBin(tmp);
+				i = i + 3;
+			}
+			else if (pURLText[i] == '+')
+			{
+				output += ' ';
+				i++;
+			}
+			else {
+				output += pURLText[i];
+				i++;
+			}
+		}
+
+		return output;
+	}
+
+	void DeCode_URLGB2312(IN const CHAR* pURLText, OUT string& strResult)
+	{
+		char tmp[2];
+		int i = 0, idx = 0, ndx, len = strlen(pURLText);
+
+		while (i < len) {
+			if (pURLText[i] == '%')
+			{
+				tmp[0] = pURLText[i + 1];
+				tmp[1] = pURLText[i + 2];
+				strResult += StrToBin(tmp);
+				i = i + 3;
+			}
+			else if (pURLText[i] == '+')
+			{
+				strResult += ' ';
+				i++;
+			}
+			else {
+				strResult += pURLText[i];
+				i++;
+			}
+		}
+	}

+ 15 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/iconv_impl.h

@@ -0,0 +1,15 @@
+#ifndef __ICONV_IMPL__
+#define __ICONV_IMPL__
+
+
+extern std::string convert2(const char *from, const char* to, const char* inbuf, const size_t &inbufsize);
+
+extern std::string convert(const char *from, const char* to, const char* inbuf, const size_t &inbufsize);
+
+extern TString EnCode_UTF8URL(const TCHAR* pText);
+
+extern void EnCode_UTF8URL(const TCHAR* pText, TString& strResult);
+
+extern string DeCode_URLGB2312(const CHAR* pURLText);
+extern void DeCode_URLGB2312(const CHAR* pURLText, string& strResult);
+#endif

+ 613 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/localcharset.c

@@ -0,0 +1,613 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+   Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "localcharset.h"
+
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
+# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# define WINDOWS_NATIVE
+# include <locale.h>
+#endif
+
+#if defined __EMX__
+/* Assume EMX program runs on OS/2, even if compiled under DOS.  */
+# ifndef OS2
+#  define OS2
+# endif
+#endif
+
+#if !defined WINDOWS_NATIVE
+# include <unistd.h>
+# if HAVE_LANGINFO_CODESET
+#  include <langinfo.h>
+# else
+#  if 0 /* see comment below */
+#   include <locale.h>
+#  endif
+# endif
+# ifdef __CYGWIN__
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+# endif
+#elif defined WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
+#if ENABLE_RELOCATABLE
+# include "relocatable.h"
+#else
+# define relocate(pathname) (pathname)
+#endif
+
+/* Get LIBDIR.  */
+//#ifndef LIBDIR
+//# include "configmake.h"
+//#endif
+
+/* Define O_NOFOLLOW to 0 on platforms where it does not exist.  */
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
+#ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+#endif
+
+#if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
+/* The following static variable is declared 'volatile' to avoid a
+   possible multithread problem in the function get_charset_aliases. If we
+   are running in a threaded environment, and if two threads initialize
+   'charset_aliases' simultaneously, both will produce the same value,
+   and everything will be ok if the two assignments to 'charset_aliases'
+   are atomic. But I don't know what will happen if the two assignments mix.  */
+#if __STDC__ != 1
+# define volatile /* empty */
+#endif
+/* Pointer to the contents of the charset.alias file, if it has already been
+   read, else NULL.  Its format is:
+   ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0'  */
+static const char * volatile charset_aliases;
+
+/* Return a pointer to the contents of the charset.alias file.  */
+static const char *
+get_charset_aliases (void)
+{
+  const char *cp;
+
+  cp = charset_aliases;
+  if (cp == NULL)
+    {
+#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2)
+      const char *dir;
+      const char *base = "charset.alias";
+      char *file_name;
+
+      /* Make it possible to override the charset.alias location.  This is
+         necessary for running the testsuite before "make install".  */
+      dir = getenv ("CHARSETALIASDIR");
+      if (dir == NULL || dir[0] == '\0')
+        dir = relocate (LIBDIR);
+
+      /* Concatenate dir and base into freshly allocated file_name.  */
+      {
+        size_t dir_len = strlen (dir);
+        size_t base_len = strlen (base);
+        int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+        file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+        if (file_name != NULL)
+          {
+            memcpy (file_name, dir, dir_len);
+            if (add_slash)
+              file_name[dir_len] = DIRECTORY_SEPARATOR;
+            memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+          }
+      }
+
+      if (file_name == NULL)
+        /* Out of memory.  Treat the file as empty.  */
+        cp = "";
+      else
+        {
+          int fd;
+
+          /* Open the file.  Reject symbolic links on platforms that support
+             O_NOFOLLOW.  This is a security feature.  Without it, an attacker
+             could retrieve parts of the contents (namely, the tail of the
+             first line that starts with "* ") of an arbitrary file by placing
+             a symbolic link to that file under the name "charset.alias" in
+             some writable directory and defining the environment variable
+             CHARSETALIASDIR to point to that directory.  */
+          fd = open (file_name,
+                     O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
+          if (fd < 0)
+            /* File not found.  Treat it as empty.  */
+            cp = "";
+          else
+            {
+              FILE *fp;
+
+              fp = fdopen (fd, "r");
+              if (fp == NULL)
+                {
+                  /* Out of memory.  Treat the file as empty.  */
+                  close (fd);
+                  cp = "";
+                }
+              else
+                {
+                  /* Parse the file's contents.  */
+                  char *res_ptr = NULL;
+                  size_t res_size = 0;
+
+                  for (;;)
+                    {
+                      int c;
+                      char buf1[50+1];
+                      char buf2[50+1];
+                      size_t l1, l2;
+                      char *old_res_ptr;
+
+                      c = getc (fp);
+                      if (c == EOF)
+                        break;
+                      if (c == '\n' || c == ' ' || c == '\t')
+                        continue;
+                      if (c == '#')
+                        {
+                          /* Skip comment, to end of line.  */
+                          do
+                            c = getc (fp);
+                          while (!(c == EOF || c == '\n'));
+                          if (c == EOF)
+                            break;
+                          continue;
+                        }
+                      ungetc (c, fp);
+                      if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+                        break;
+                      l1 = strlen (buf1);
+                      l2 = strlen (buf2);
+                      old_res_ptr = res_ptr;
+                      if (res_size == 0)
+                        {
+                          res_size = l1 + 1 + l2 + 1;
+                          res_ptr = (char *) malloc (res_size + 1);
+                        }
+                      else
+                        {
+                          res_size += l1 + 1 + l2 + 1;
+                          res_ptr = (char *) realloc (res_ptr, res_size + 1);
+                        }
+                      if (res_ptr == NULL)
+                        {
+                          /* Out of memory. */
+                          res_size = 0;
+                          free (old_res_ptr);
+                          break;
+                        }
+                      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+                      strcpy (res_ptr + res_size - (l2 + 1), buf2);
+                    }
+                  fclose (fp);
+                  if (res_size == 0)
+                    cp = "";
+                  else
+                    {
+                      *(res_ptr + res_size) = '\0';
+                      cp = res_ptr;
+                    }
+                }
+            }
+
+          free (file_name);
+        }
+
+#else
+
+# if defined DARWIN7
+      /* To avoid the trouble of installing a file that is shared by many
+         GNU packages -- many packaging systems have problems with this --,
+         simply inline the aliases here.  */
+      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+           "ISO8859-2" "\0" "ISO-8859-2" "\0"
+           "ISO8859-4" "\0" "ISO-8859-4" "\0"
+           "ISO8859-5" "\0" "ISO-8859-5" "\0"
+           "ISO8859-7" "\0" "ISO-8859-7" "\0"
+           "ISO8859-9" "\0" "ISO-8859-9" "\0"
+           "ISO8859-13" "\0" "ISO-8859-13" "\0"
+           "ISO8859-15" "\0" "ISO-8859-15" "\0"
+           "KOI8-R" "\0" "KOI8-R" "\0"
+           "KOI8-U" "\0" "KOI8-U" "\0"
+           "CP866" "\0" "CP866" "\0"
+           "CP949" "\0" "CP949" "\0"
+           "CP1131" "\0" "CP1131" "\0"
+           "CP1251" "\0" "CP1251" "\0"
+           "eucCN" "\0" "GB2312" "\0"
+           "GB2312" "\0" "GB2312" "\0"
+           "eucJP" "\0" "EUC-JP" "\0"
+           "eucKR" "\0" "EUC-KR" "\0"
+           "Big5" "\0" "BIG5" "\0"
+           "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
+           "GBK" "\0" "GBK" "\0"
+           "GB18030" "\0" "GB18030" "\0"
+           "SJIS" "\0" "SHIFT_JIS" "\0"
+           "ARMSCII-8" "\0" "ARMSCII-8" "\0"
+           "PT154" "\0" "PT154" "\0"
+         /*"ISCII-DEV" "\0" "?" "\0"*/
+           "*" "\0" "UTF-8" "\0";
+# endif
+
+# if defined VMS
+      /* To avoid the troubles of an extra file charset.alias_vms in the
+         sources of many GNU packages, simply inline the aliases here.  */
+      /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
+         "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+         section 10.7 "Handling Different Character Sets".  */
+      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+           "ISO8859-2" "\0" "ISO-8859-2" "\0"
+           "ISO8859-5" "\0" "ISO-8859-5" "\0"
+           "ISO8859-7" "\0" "ISO-8859-7" "\0"
+           "ISO8859-8" "\0" "ISO-8859-8" "\0"
+           "ISO8859-9" "\0" "ISO-8859-9" "\0"
+           /* Japanese */
+           "eucJP" "\0" "EUC-JP" "\0"
+           "SJIS" "\0" "SHIFT_JIS" "\0"
+           "DECKANJI" "\0" "DEC-KANJI" "\0"
+           "SDECKANJI" "\0" "EUC-JP" "\0"
+           /* Chinese */
+           "eucTW" "\0" "EUC-TW" "\0"
+           "DECHANYU" "\0" "DEC-HANYU" "\0"
+           "DECHANZI" "\0" "GB2312" "\0"
+           /* Korean */
+           "DECKOREAN" "\0" "EUC-KR" "\0";
+# endif
+
+# if defined WINDOWS_NATIVE || defined __CYGWIN__
+      /* To avoid the troubles of installing a separate file in the same
+         directory as the DLL and of retrieving the DLL's directory at
+         runtime, simply inline the aliases here.  */
+
+      cp = "CP936" "\0" "GBK" "\0"
+           "CP1361" "\0" "JOHAB" "\0"
+           "CP20127" "\0" "ASCII" "\0"
+           "CP20866" "\0" "KOI8-R" "\0"
+           "CP20936" "\0" "GB2312" "\0"
+           "CP21866" "\0" "KOI8-RU" "\0"
+           "CP28591" "\0" "ISO-8859-1" "\0"
+           "CP28592" "\0" "ISO-8859-2" "\0"
+           "CP28593" "\0" "ISO-8859-3" "\0"
+           "CP28594" "\0" "ISO-8859-4" "\0"
+           "CP28595" "\0" "ISO-8859-5" "\0"
+           "CP28596" "\0" "ISO-8859-6" "\0"
+           "CP28597" "\0" "ISO-8859-7" "\0"
+           "CP28598" "\0" "ISO-8859-8" "\0"
+           "CP28599" "\0" "ISO-8859-9" "\0"
+           "CP28605" "\0" "ISO-8859-15" "\0"
+           "CP38598" "\0" "ISO-8859-8" "\0"
+           "CP51932" "\0" "EUC-JP" "\0"
+           "CP51936" "\0" "GB2312" "\0"
+           "CP51949" "\0" "EUC-KR" "\0"
+           "CP51950" "\0" "EUC-TW" "\0"
+           "CP54936" "\0" "GB18030" "\0"
+           "CP65001" "\0" "UTF-8" "\0";
+# endif
+# if defined OS2
+      /* To avoid the troubles of installing a separate file in the same
+         directory as the DLL and of retrieving the DLL's directory at
+         runtime, simply inline the aliases here.  */
+
+      /* The list of encodings is taken from "List of OS/2 Codepages"
+         by Alex Taylor:
+         <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
+         See also "IBM Globalization - Code page identifiers":
+         <http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>.  */
+      cp = "CP813" "\0" "ISO-8859-7" "\0"
+           "CP878" "\0" "KOI8-R" "\0"
+           "CP819" "\0" "ISO-8859-1" "\0"
+           "CP912" "\0" "ISO-8859-2" "\0"
+           "CP913" "\0" "ISO-8859-3" "\0"
+           "CP914" "\0" "ISO-8859-4" "\0"
+           "CP915" "\0" "ISO-8859-5" "\0"
+           "CP916" "\0" "ISO-8859-8" "\0"
+           "CP920" "\0" "ISO-8859-9" "\0"
+           "CP921" "\0" "ISO-8859-13" "\0"
+           "CP923" "\0" "ISO-8859-15" "\0"
+           "CP954" "\0" "EUC-JP" "\0"
+           "CP964" "\0" "EUC-TW" "\0"
+           "CP970" "\0" "EUC-KR" "\0"
+           "CP1089" "\0" "ISO-8859-6" "\0"
+           "CP1208" "\0" "UTF-8" "\0"
+           "CP1381" "\0" "GB2312" "\0"
+           "CP1386" "\0" "GBK" "\0"
+           "CP3372" "\0" "EUC-JP" "\0";
+# endif
+#endif
+
+      charset_aliases = cp;
+    }
+
+  return cp;
+}
+
+/* Determine the current locale's character encoding, and canonicalize it
+   into one of the canonical names listed in config.charset.
+   The result must not be freed; it is statically allocated.
+   If the canonical name cannot be determined, the result is a non-canonical
+   name.  */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset (void)
+{
+  const char *codeset;
+  const char *aliases;
+
+#if !(defined WINDOWS_NATIVE || defined OS2)
+
+# if HAVE_LANGINFO_CODESET
+
+  /* Most systems support nl_langinfo (CODESET) nowadays.  */
+  codeset = nl_langinfo (CODESET);
+
+#  ifdef __CYGWIN__
+  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
+     returns "US-ASCII".  Return the suffix of the locale name from the
+     environment variables (if present) or the codepage as a number.  */
+  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+    {
+      const char *locale;
+      static char buf[2 + 10 + 1];
+
+      locale = getenv ("LC_ALL");
+      if (locale == NULL || locale[0] == '\0')
+        {
+          locale = getenv ("LC_CTYPE");
+          if (locale == NULL || locale[0] == '\0')
+            locale = getenv ("LANG");
+        }
+      if (locale != NULL && locale[0] != '\0')
+        {
+          /* If the locale name contains an encoding after the dot, return
+             it.  */
+          const char *dot = strchr (locale, '.');
+
+          if (dot != NULL)
+            {
+              const char *modifier;
+
+              dot++;
+              /* Look for the possible @... trailer and remove it, if any.  */
+              modifier = strchr (dot, '@');
+              if (modifier == NULL)
+                return dot;
+              if (modifier - dot < sizeof (buf))
+                {
+                  memcpy (buf, dot, modifier - dot);
+                  buf [modifier - dot] = '\0';
+                  return buf;
+                }
+            }
+        }
+
+      /* The Windows API has a function returning the locale's codepage as a
+         number: GetACP().  This encoding is used by Cygwin, unless the user
+         has set the environment variable CYGWIN=codepage:oem (which very few
+         people do).
+         Output directed to console windows needs to be converted (to
+         GetOEMCP() if the console is using a raster font, or to
+         GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
+         this conversion transparently (see winsup/cygwin/fhandler_console.cc),
+         converting to GetConsoleOutputCP().  This leads to correct results,
+         except when SetConsoleOutputCP has been called and a raster font is
+         in use.  */
+      sprintf (buf, "CP%u", GetACP ());
+      codeset = buf;
+    }
+#  endif
+
+# else
+
+  /* On old systems which lack it, use setlocale or getenv.  */
+  const char *locale = NULL;
+
+  /* But most old systems don't have a complete set of locales.  Some
+     (like SunOS 4 or DJGPP) have only the C locale.  Therefore we don't
+     use setlocale here; it would return "C" when it doesn't support the
+     locale name the user has set.  */
+#  if 0
+  locale = setlocale (LC_CTYPE, NULL);
+#  endif
+  if (locale == NULL || locale[0] == '\0')
+    {
+      locale = getenv ("LC_ALL");
+      if (locale == NULL || locale[0] == '\0')
+        {
+          locale = getenv ("LC_CTYPE");
+          if (locale == NULL || locale[0] == '\0')
+            locale = getenv ("LANG");
+        }
+    }
+
+  /* On some old systems, one used to set locale = "iso8859_1". On others,
+     you set it to "language_COUNTRY.charset". In any case, we resolve it
+     through the charset.alias file.  */
+  codeset = locale;
+
+# endif
+
+#elif defined WINDOWS_NATIVE
+
+  static char buf[13];
+
+  /* The Windows API has a function returning the locale's codepage as
+     a number, but the value doesn't change according to what the
+     'setlocale' call specified.  So we use it as a last resort, in
+     case the string returned by 'setlocale' doesn't specify the
+     codepage.  */
+  char *current_locale = setlocale (LC_ALL, NULL);
+  char *pdot;
+
+  /* If they set different locales for different categories,
+     'setlocale' will return a semi-colon separated list of locale
+     values.  To make sure we use the correct one, we choose LC_CTYPE.  */
+  if (strchr (current_locale, ';'))
+    current_locale = setlocale (LC_CTYPE, NULL);
+
+  pdot = strrchr (current_locale, '.');
+  if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
+    sprintf_s (buf, 13,"CP%s", pdot + 1);
+  else
+    {
+      /* The Windows API has a function returning the locale's codepage as a
+        number: GetACP().
+        When the output goes to a console window, it needs to be provided in
+        GetOEMCP() encoding if the console is using a raster font, or in
+        GetConsoleOutputCP() encoding if it is using a TrueType font.
+        But in GUI programs and for output sent to files and pipes, GetACP()
+        encoding is the best bet.  */
+      sprintf_s (buf, 13,"CP%u", GetACP ());
+    }
+  codeset = buf;
+
+#elif defined OS2
+
+  const char *locale;
+  static char buf[2 + 10 + 1];
+  ULONG cp[3];
+  ULONG cplen;
+
+  codeset = NULL;
+
+  /* Allow user to override the codeset, as set in the operating system,
+     with standard language environment variables.  */
+  locale = getenv ("LC_ALL");
+  if (locale == NULL || locale[0] == '\0')
+    {
+      locale = getenv ("LC_CTYPE");
+      if (locale == NULL || locale[0] == '\0')
+        locale = getenv ("LANG");
+    }
+  if (locale != NULL && locale[0] != '\0')
+    {
+      /* If the locale name contains an encoding after the dot, return it.  */
+      const char *dot = strchr (locale, '.');
+
+      if (dot != NULL)
+        {
+          const char *modifier;
+
+          dot++;
+          /* Look for the possible @... trailer and remove it, if any.  */
+          modifier = strchr (dot, '@');
+          if (modifier == NULL)
+            return dot;
+          if (modifier - dot < sizeof (buf))
+            {
+              memcpy (buf, dot, modifier - dot);
+              buf [modifier - dot] = '\0';
+              return buf;
+            }
+        }
+
+      /* For the POSIX locale, don't use the system's codepage.  */
+      if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+        codeset = "";
+    }
+
+  if (codeset == NULL)
+    {
+      /* OS/2 has a function returning the locale's codepage as a number.  */
+      if (DosQueryCp (sizeof (cp), cp, &cplen))
+        codeset = "";
+      else
+        {
+          sprintf (buf, "CP%u", cp[0]);
+          codeset = buf;
+        }
+    }
+
+#endif
+
+  if (codeset == NULL)
+    /* The canonical name cannot be determined.  */
+    codeset = "";
+
+  /* Resolve alias. */
+  for (aliases = get_charset_aliases ();
+       *aliases != '\0';
+       aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+    if (strcmp (codeset, aliases) == 0
+        || (aliases[0] == '*' && aliases[1] == '\0'))
+      {
+        codeset = aliases + strlen (aliases) + 1;
+        break;
+      }
+
+  /* Don't return an empty string.  GNU libc and GNU libiconv interpret
+     the empty string as denoting "the locale's character encoding",
+     thus GNU libiconv would call this function a second time.  */
+  if (codeset[0] == '\0')
+    codeset = "ASCII";
+
+#ifdef DARWIN7
+  /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+     (the default codeset) does not work when MB_CUR_MAX is 1.  */
+  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+    codeset = "ASCII";
+#endif
+
+  return codeset;
+}

+ 53 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/localcharset.h

@@ -0,0 +1,53 @@
+/* Determine a canonical name for the current locale's character encoding.
+   Copyright (C) 2000-2003 Free Software Foundation, Inc.
+   This file is part of the GNU CHARSET Library.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LOCALCHARSET_H
+#define _LOCALCHARSET_H
+
+// #if HAVE_VISIBILITY && BUILDING_LIBCHARSET
+// #define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default")))
+// #else
+// #define LIBCHARSET_DLL_EXPORTED
+// #endif
+#ifdef BUILDING_LIBCHARSET
+#define LIBCHARSET_DLL_EXPORTED __declspec(dllexport)
+#elif USING_STATIC_LIBICONV
+#define LIBCHARSET_DLL_EXPORTED
+#else
+#define LIBCHARSET_DLL_EXPORTED __declspec(dllimport)
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+   into one of the canonical names listed in config.charset.
+   The result must not be freed; it is statically allocated.
+   If the canonical name cannot be determined, the result is a non-canonical
+   name.  */
+extern LIBCHARSET_DLL_EXPORTED const char * locale_charset (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */

BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.h


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.rc


+ 488 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.vcxproj

@@ -0,0 +1,488 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Win7Debug|Win32">
+      <Configuration>Win7Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Win7Debug|x64">
+      <Configuration>Win7Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Win7Release|Win32">
+      <Configuration>Win7Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Win7Release|x64">
+      <Configuration>Win7Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCProjectVersion>15.0</VCProjectVersion>
+    <ProjectGuid>{8E3E238F-E0D9-4910-8C8A-DDE349A026B5}</ProjectGuid>
+    <Keyword>MFCProj</Keyword>
+    <RootNamespace>lyfzClassic2Platinum</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141_xp</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141_xp</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141_xp</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <UseOfMfc>Dynamic</UseOfMfc>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>..\..\..\..\bin\$(ProjectName)\</OutDir>
+    <IntDir>$(OutDir)$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>..\..\..\..\bin\$(ProjectName)\</OutDir>
+    <IntDir>$(OutDir)$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>..\..\..\..\bin\$(ProjectName)\</OutDir>
+    <IntDir>$(OutDir)$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>..\..\..\..\bin\$(ProjectName)\</OutDir>
+    <IntDir>$(OutDir)$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;USING_STATIC_LIBICONV;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\repos_main\common\UniqueId;..\..\..\..\repos_util\lunarcalendar\test;..\..\..\..\repos_util\libiconv\include;..\..\..\..\repos_main\common\STL-findfile</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <PreBuildEvent>
+      <Command>subwcrev.exe $(SolutionDir) $(ProjectDir)$(ProjectName).rc $(ProjectDir)$(ProjectName).rc_</Command>
+    </PreBuildEvent>
+    <PreLinkEvent>
+      <Command>rc.exe /l 0x409 /fo "$(IntDir)$(ProjectName).res" /d "_AUTOVERSION_" /d "_AFXDLL" "$(ProjectDir)$(ProjectName).rc_"</Command>
+    </PreLinkEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;USING_STATIC_LIBICONV;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\repos_main\common\UniqueId;..\..\..\..\repos_util\lunarcalendar\test;..\..\..\..\repos_util\libiconv\include;..\..\..\..\repos_main\common\STL-findfile</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+    <PreLinkEvent>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;USING_STATIC_LIBICONV;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\repos_main\common\UniqueId;..\..\..\..\repos_util\lunarcalendar\test;..\..\..\..\repos_util\libiconv\include;..\..\..\..\repos_main\common\STL-findfile</AdditionalIncludeDirectories>
+      <WholeProgramOptimization>true</WholeProgramOptimization>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <PreLinkEvent>
+      <Command>rc.exe /l 0x409 /fo "$(IntDir)$(ProjectName).res" /d "_AUTOVERSION_" /d "_AFXDLL" "$(ProjectDir)$(ProjectName).rc_"</Command>
+    </PreLinkEvent>
+    <PreBuildEvent>
+      <Command>subwcrev.exe $(SolutionDir) $(ProjectDir)$(ProjectName).rc $(ProjectDir)$(ProjectName).rc_</Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;USING_STATIC_LIBICONV;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\repos_main\common\UniqueId;..\..\..\..\repos_util\lunarcalendar\test;..\..\..\..\repos_util\libiconv\include;..\..\..\..\repos_main\common\STL-findfile</AdditionalIncludeDirectories>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <PreLinkEvent>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7Release|x64'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>odbc32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <Midl>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+      <ValidateAllParameters>true</ValidateAllParameters>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </Midl>
+    <ResourceCompile>
+      <Culture>0x0804</Culture>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\..\repos_main\common\STL-findfile\filehelp.h" />
+    <ClInclude Include="..\..\..\..\repos_main\common\STL-findfile\findfile.h" />
+    <ClInclude Include="..\..\..\..\repos_main\common\UniqueId\CUniqueId.h" />
+    <ClInclude Include="..\..\..\..\repos_util\LunarCalendar\Test\CalendarEx.h" />
+    <ClInclude Include="Base64.h" />
+    <ClInclude Include="c2p.h" />
+    <ClInclude Include="CDlgOrders.h" />
+    <ClInclude Include="CDlgOther.h" />
+    <ClInclude Include="CDlgSelectPackageType.h" />
+    <ClInclude Include="des.h" />
+    <ClInclude Include="EncodingConversion.h" />
+    <ClInclude Include="Global.h" />
+    <ClInclude Include="iconv_impl.h" />
+    <ClInclude Include="localcharset.h" />
+    <ClInclude Include="lyfzClassic2Platinum.h" />
+    <ClInclude Include="lyfzClassic2PlatinumDlg.h" />
+    <ClInclude Include="relocatable.h" />
+    <ClInclude Include="Resource.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\..\..\repos_main\common\STL-findfile\filehelp.cpp" />
+    <ClCompile Include="..\..\..\..\repos_main\common\STL-findfile\findfile.cpp" />
+    <ClCompile Include="..\..\..\..\repos_main\common\UniqueId\CUniqueId.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">NotUsing</PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\repos_util\LunarCalendar\Test\CalendarEx..cpp" />
+    <ClCompile Include="Base64.cpp" />
+    <ClCompile Include="c2p.cpp" />
+    <ClCompile Include="CDlgOrders.cpp" />
+    <ClCompile Include="CDlgOther.cpp" />
+    <ClCompile Include="CDlgSelectPackageType.cpp" />
+    <ClCompile Include="des.cpp" />
+    <ClCompile Include="EncodingConversion.cpp" />
+    <ClCompile Include="Global.cpp" />
+    <ClCompile Include="iconv.c">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">NotUsing</PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="iconv_impl.cpp" />
+    <ClCompile Include="localcharset.c">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">NotUsing</PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="lyfzClassic2Platinum.cpp" />
+    <ClCompile Include="lyfzClassic2PlatinumDlg.cpp" />
+    <ClCompile Include="relocatable.c">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">NotUsing</PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Debug|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win7Release|x64'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="lyfzClassic2Platinum.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="c2p.ini" />
+    <None Include="res\lyfzClassic2Platinum.rc2" />
+  </ItemGroup>
+  <ItemGroup>
+    <Image Include="res\lyfzClassic2Platinum.ico" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 172 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2Platinum.vcxproj.filters

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+    <Filter Include="Global">
+      <UniqueIdentifier>{1b87da1a-ae1e-462e-ad61-f102727ce1df}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="UniqueId">
+      <UniqueIdentifier>{1c421360-4542-4d7c-bf37-4718062e94db}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="date">
+      <UniqueIdentifier>{b449ef61-431a-45b3-8791-c472ad8a2939}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="iconv">
+      <UniqueIdentifier>{b919b9b3-3ce9-457b-9fbf-7e626e55fa32}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="des">
+      <UniqueIdentifier>{165088b0-f3cd-49b7-9e72-9f7b42662b96}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="findfile">
+      <UniqueIdentifier>{3a7d96df-2e6d-4460-97bb-31ece828ccc7}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="lyfzClassic2Platinum.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="lyfzClassic2PlatinumDlg.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="Resource.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="Global.h">
+      <Filter>Global</Filter>
+    </ClInclude>
+    <ClInclude Include="c2p.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\repos_main\common\UniqueId\CUniqueId.h">
+      <Filter>UniqueId</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\repos_util\LunarCalendar\Test\CalendarEx.h">
+      <Filter>date</Filter>
+    </ClInclude>
+    <ClInclude Include="iconv_impl.h">
+      <Filter>iconv</Filter>
+    </ClInclude>
+    <ClInclude Include="localcharset.h">
+      <Filter>iconv</Filter>
+    </ClInclude>
+    <ClInclude Include="relocatable.h">
+      <Filter>iconv</Filter>
+    </ClInclude>
+    <ClInclude Include="Base64.h">
+      <Filter>des</Filter>
+    </ClInclude>
+    <ClInclude Include="des.h">
+      <Filter>des</Filter>
+    </ClInclude>
+    <ClInclude Include="EncodingConversion.h">
+      <Filter>des</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\repos_main\common\STL-findfile\filehelp.h">
+      <Filter>findfile</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\repos_main\common\STL-findfile\findfile.h">
+      <Filter>findfile</Filter>
+    </ClInclude>
+    <ClInclude Include="CDlgOther.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="CDlgOrders.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="CDlgSelectPackageType.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="lyfzClassic2Platinum.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="lyfzClassic2PlatinumDlg.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="Global.cpp">
+      <Filter>Global</Filter>
+    </ClCompile>
+    <ClCompile Include="c2p.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\repos_main\common\UniqueId\CUniqueId.cpp">
+      <Filter>UniqueId</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\repos_util\LunarCalendar\Test\CalendarEx..cpp">
+      <Filter>date</Filter>
+    </ClCompile>
+    <ClCompile Include="iconv_impl.cpp">
+      <Filter>iconv</Filter>
+    </ClCompile>
+    <ClCompile Include="iconv.c">
+      <Filter>iconv</Filter>
+    </ClCompile>
+    <ClCompile Include="localcharset.c">
+      <Filter>iconv</Filter>
+    </ClCompile>
+    <ClCompile Include="relocatable.c">
+      <Filter>iconv</Filter>
+    </ClCompile>
+    <ClCompile Include="Base64.cpp">
+      <Filter>des</Filter>
+    </ClCompile>
+    <ClCompile Include="des.cpp">
+      <Filter>des</Filter>
+    </ClCompile>
+    <ClCompile Include="EncodingConversion.cpp">
+      <Filter>des</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\repos_main\common\STL-findfile\filehelp.cpp">
+      <Filter>findfile</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\repos_main\common\STL-findfile\findfile.cpp">
+      <Filter>findfile</Filter>
+    </ClCompile>
+    <ClCompile Include="CDlgOther.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="CDlgOrders.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="CDlgSelectPackageType.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="lyfzClassic2Platinum.rc">
+      <Filter>资源文件</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="res\lyfzClassic2Platinum.rc2">
+      <Filter>资源文件</Filter>
+    </None>
+    <None Include="c2p.ini" />
+  </ItemGroup>
+  <ItemGroup>
+    <Image Include="res\lyfzClassic2Platinum.ico">
+      <Filter>资源文件</Filter>
+    </Image>
+  </ItemGroup>
+</Project>

BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2PlatinumDlg.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/lyfzClassic2PlatinumDlg.h


+ 577 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/relocatable.c

@@ -0,0 +1,577 @@
+/* Provide relocatable packages.
+   Copyright (C) 2003-2006, 2008-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+
+/* Tell glibc's <stdio.h> to provide a prototype for getline().
+   This must come before <config.h> because <config.h> may include
+   <features.h>, and once <features.h> has been included, it's too late.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+/* Specification.  */
+#include "relocatable.h"
+
+#if ENABLE_RELOCATABLE
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef NO_XMALLOC
+# define xmalloc malloc
+#else
+# include "xalloc.h"
+#endif
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#ifdef __EMX__
+# define INCL_DOS
+# include <os2.h>
+
+# define strcmp  stricmp
+# define strncmp strnicmp
+#endif
+
+#if DEPENDS_ON_LIBCHARSET
+# include <libcharset.h>
+#endif
+#if DEPENDS_ON_LIBICONV && HAVE_ICONV
+# include <iconv.h>
+#endif
+#if DEPENDS_ON_LIBINTL && ENABLE_NLS
+# include <libintl.h>
+#endif
+
+/* Faked cheap 'bool'.  */
+#undef bool
+#undef false
+#undef true
+#define bool int
+#define false 0
+#define true 1
+
+/* Pathname support.
+   ISSLASH(C)           tests whether C is a directory separator character.
+   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
+ */
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+     && (P)[1] == ':')
+# define IS_PATH_WITH_DIR(P) \
+    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+#else
+  /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define FILE_SYSTEM_PREFIX_LEN(P) 0
+#endif
+
+/* Whether to enable the more costly support for relocatable libraries.
+   It allows libraries to be have been installed with a different original
+   prefix than the program.  But it is quite costly, especially on Cygwin
+   platforms, see below.  Therefore we enable it by default only on native
+   Windows platforms.  */
+#ifndef ENABLE_COSTLY_RELOCATABLE
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#  define ENABLE_COSTLY_RELOCATABLE 1
+# else
+#  define ENABLE_COSTLY_RELOCATABLE 0
+# endif
+#endif
+
+/* Original installation prefix.  */
+static char *orig_prefix;
+static size_t orig_prefix_len;
+/* Current installation prefix.  */
+static char *curr_prefix;
+static size_t curr_prefix_len;
+/* These prefixes do not end in a slash.  Anything that will be concatenated
+   to them must start with a slash.  */
+
+/* Sets the original and the current installation prefix of this module.
+   Relocation simply replaces a pathname starting with the original prefix
+   by the corresponding pathname with the current prefix instead.  Both
+   prefixes should be directory names without trailing slash (i.e. use ""
+   instead of "/").  */
+static void
+set_this_relocation_prefix (const char *orig_prefix_arg,
+                            const char *curr_prefix_arg)
+{
+  if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
+      /* Optimization: if orig_prefix and curr_prefix are equal, the
+         relocation is a nop.  */
+      && strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
+    {
+      /* Duplicate the argument strings.  */
+      char *memory;
+
+      orig_prefix_len = strlen (orig_prefix_arg);
+      curr_prefix_len = strlen (curr_prefix_arg);
+      memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
+#ifdef NO_XMALLOC
+      if (memory != NULL)
+#endif
+        {
+          memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
+          orig_prefix = memory;
+          memory += orig_prefix_len + 1;
+          memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
+          curr_prefix = memory;
+          return;
+        }
+    }
+  orig_prefix = NULL;
+  curr_prefix = NULL;
+  /* Don't worry about wasted memory here - this function is usually only
+     called once.  */
+}
+
+/* Sets the original and the current installation prefix of the package.
+   Relocation simply replaces a pathname starting with the original prefix
+   by the corresponding pathname with the current prefix instead.  Both
+   prefixes should be directory names without trailing slash (i.e. use ""
+   instead of "/").  */
+void
+set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
+{
+  set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+
+  /* Now notify all dependent libraries.  */
+#if DEPENDS_ON_LIBCHARSET
+  libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
+  libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
+  libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+#endif
+}
+
+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
+
+/* Convenience function:
+   Computes the current installation prefix, based on the original
+   installation prefix, the original installation directory of a particular
+   file, and the current pathname of this file.
+   Returns it, freshly allocated.  Returns NULL upon failure.  */
+#ifdef IN_LIBRARY
+#define compute_curr_prefix local_compute_curr_prefix
+static
+#endif
+char *
+compute_curr_prefix (const char *orig_installprefix,
+                     const char *orig_installdir,
+                     const char *curr_pathname)
+{
+  char *curr_installdir;
+  const char *rel_installdir;
+
+  if (curr_pathname == NULL)
+    return NULL;
+
+  /* Determine the relative installation directory, relative to the prefix.
+     This is simply the difference between orig_installprefix and
+     orig_installdir.  */
+  if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
+      != 0)
+    /* Shouldn't happen - nothing should be installed outside $(prefix).  */
+    return NULL;
+  rel_installdir = orig_installdir + strlen (orig_installprefix);
+
+  /* Determine the current installation directory.  */
+  {
+    const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname);
+    const char *p = curr_pathname + strlen (curr_pathname);
+    char *q;
+
+    while (p > p_base)
+      {
+        p--;
+        if (ISSLASH (*p))
+          break;
+      }
+
+    q = (char *) xmalloc (p - curr_pathname + 1);
+#ifdef NO_XMALLOC
+    if (q == NULL)
+      return NULL;
+#endif
+    memcpy (q, curr_pathname, p - curr_pathname);
+    q[p - curr_pathname] = '\0';
+    curr_installdir = q;
+  }
+
+  /* Compute the current installation prefix by removing the trailing
+     rel_installdir from it.  */
+  {
+    const char *rp = rel_installdir + strlen (rel_installdir);
+    const char *cp = curr_installdir + strlen (curr_installdir);
+    const char *cp_base =
+      curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir);
+
+    while (rp > rel_installdir && cp > cp_base)
+      {
+        bool same = false;
+        const char *rpi = rp;
+        const char *cpi = cp;
+
+        while (rpi > rel_installdir && cpi > cp_base)
+          {
+            rpi--;
+            cpi--;
+            if (ISSLASH (*rpi) || ISSLASH (*cpi))
+              {
+                if (ISSLASH (*rpi) && ISSLASH (*cpi))
+                  same = true;
+                break;
+              }
+            /* Do case-insensitive comparison if the file system is always or
+               often case-insensitive.  It's better to accept the comparison
+               if the difference is only in case, rather than to fail.  */
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+            /* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */
+            if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
+                != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
+              break;
+#else
+            if (*rpi != *cpi)
+              break;
+#endif
+          }
+        if (!same)
+          break;
+        /* The last pathname component was the same.  opi and cpi now point
+           to the slash before it.  */
+        rp = rpi;
+        cp = cpi;
+      }
+
+    if (rp > rel_installdir)
+      {
+        /* Unexpected: The curr_installdir does not end with rel_installdir.  */
+        free (curr_installdir);
+        return NULL;
+      }
+
+    {
+      size_t curr_prefix_len = cp - curr_installdir;
+      char *curr_prefix;
+
+      curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
+#ifdef NO_XMALLOC
+      if (curr_prefix == NULL)
+        {
+          free (curr_installdir);
+          return NULL;
+        }
+#endif
+      memcpy (curr_prefix, curr_installdir, curr_prefix_len);
+      curr_prefix[curr_prefix_len] = '\0';
+
+      free (curr_installdir);
+
+      return curr_prefix;
+    }
+  }
+}
+
+#endif /* !IN_LIBRARY || PIC */
+
+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
+
+/* Full pathname of shared library, or NULL.  */
+static char *shared_library_fullname;
+
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+/* Native Windows only.
+   On Cygwin, it is better to use the Cygwin provided /proc interface, than
+   to use native Windows API and cygwin_conv_to_posix_path, because it
+   supports longer file names
+   (see <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>).  */
+
+/* Determine the full pathname of the shared library when it is loaded.  */
+
+BOOL WINAPI
+DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
+{
+  (void) reserved;
+
+  if (event == DLL_PROCESS_ATTACH)
+    {
+      /* The DLL is being loaded into an application's address range.  */
+      static char location[MAX_PATH];
+
+      if (!GetModuleFileName (module_handle, location, sizeof (location)))
+        /* Shouldn't happen.  */
+        return FALSE;
+
+      if (!IS_PATH_WITH_DIR (location))
+        /* Shouldn't happen.  */
+        return FALSE;
+
+      shared_library_fullname = strdup (location);
+    }
+
+  return TRUE;
+}
+
+#elif defined __EMX__
+
+extern int  _CRT_init (void);
+extern void _CRT_term (void);
+extern void __ctordtorInit (void);
+extern void __ctordtorTerm (void);
+
+unsigned long _System
+_DLL_InitTerm (unsigned long hModule, unsigned long ulFlag)
+{
+  static char location[CCHMAXPATH];
+
+  switch (ulFlag)
+    {
+      case 0:
+        if (_CRT_init () == -1)
+          return 0;
+
+        __ctordtorInit();
+
+        /* See http://cyberkinetica.homeunix.net/os2tk45/cp1/1247_L2H_DosQueryModuleNameSy.html
+           for specification of DosQueryModuleName(). */
+        if (DosQueryModuleName (hModule, sizeof (location), location))
+          return 0;
+
+        _fnslashify (location);
+        shared_library_fullname = strdup (location);
+        break;
+
+      case 1:
+        __ctordtorTerm();
+
+        _CRT_term ();
+        break;
+    }
+
+  return 1;
+}
+
+#else /* Unix */
+
+static void
+find_shared_library_fullname ()
+{
+#if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
+  /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
+     function.
+     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
+     But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
+     Cygwin 1.7.  */
+  FILE *fp;
+
+  /* Open the current process' maps file.  It describes one VMA per line.  */
+  fp = fopen ("/proc/self/maps", "r");
+  if (fp)
+    {
+      unsigned long address = (unsigned long) &find_shared_library_fullname;
+      for (;;)
+        {
+          unsigned long start, end;
+          int c;
+
+          if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
+            break;
+          if (address >= start && address <= end - 1)
+            {
+              /* Found it.  Now see if this line contains a filename.  */
+              while (c = getc (fp), c != EOF && c != '\n' && c != '/')
+                continue;
+              if (c == '/')
+                {
+                  size_t size;
+                  int len;
+
+                  ungetc (c, fp);
+                  shared_library_fullname = NULL; size = 0;
+                  len = getline (&shared_library_fullname, &size, fp);
+                  if (len >= 0)
+                    {
+                      /* Success: filled shared_library_fullname.  */
+                      if (len > 0 && shared_library_fullname[len - 1] == '\n')
+                        shared_library_fullname[len - 1] = '\0';
+                    }
+                }
+              break;
+            }
+          while (c = getc (fp), c != EOF && c != '\n')
+            continue;
+        }
+      fclose (fp);
+    }
+#endif
+}
+
+#endif /* Native Windows / EMX / Unix */
+
+/* Return the full pathname of the current shared library.
+   Return NULL if unknown.
+   Guaranteed to work only on Linux, EMX, Cygwin, and native Windows.  */
+static char *
+get_shared_library_fullname ()
+{
+#if (!((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) \
+     && !defined __EMX__)
+  static bool tried_find_shared_library_fullname;
+  if (!tried_find_shared_library_fullname)
+    {
+      find_shared_library_fullname ();
+      tried_find_shared_library_fullname = true;
+    }
+#endif
+  return shared_library_fullname;
+}
+
+#endif /* PIC */
+
+/* Returns the pathname, relocated according to the current installation
+   directory.
+   The returned string is either PATHNAME unmodified or a freshly allocated
+   string that you can free with free() after casting it to 'char *'.  */
+const char *
+relocate (const char *pathname)
+{
+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
+  static int initialized;
+
+  /* Initialization code for a shared library.  */
+  if (!initialized)
+    {
+      /* At this point, orig_prefix and curr_prefix likely have already been
+         set through the main program's set_program_name_and_installdir
+         function.  This is sufficient in the case that the library has
+         initially been installed in the same orig_prefix.  But we can do
+         better, to also cover the cases that 1. it has been installed
+         in a different prefix before being moved to orig_prefix and (later)
+         to curr_prefix, 2. unlike the program, it has not moved away from
+         orig_prefix.  */
+      const char *orig_installprefix = INSTALLPREFIX;
+      const char *orig_installdir = INSTALLDIR;
+      char *curr_prefix_better;
+
+      curr_prefix_better =
+        compute_curr_prefix (orig_installprefix, orig_installdir,
+                             get_shared_library_fullname ());
+
+      set_relocation_prefix (orig_installprefix,
+                             curr_prefix_better != NULL
+                             ? curr_prefix_better
+                             : curr_prefix);
+
+      if (curr_prefix_better != NULL)
+        free (curr_prefix_better);
+
+      initialized = 1;
+    }
+#endif
+
+  /* Note: It is not necessary to perform case insensitive comparison here,
+     even for DOS-like file systems, because the pathname argument was
+     typically created from the same Makefile variable as orig_prefix came
+     from.  */
+  if (orig_prefix != NULL && curr_prefix != NULL
+      && strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
+    {
+      if (pathname[orig_prefix_len] == '\0')
+        {
+          /* pathname equals orig_prefix.  */
+          char *result = (char *) xmalloc (strlen (curr_prefix) + 1);
+
+#ifdef NO_XMALLOC
+          if (result != NULL)
+#endif
+            {
+              strcpy (result, curr_prefix);
+              return result;
+            }
+        }
+      else if (ISSLASH (pathname[orig_prefix_len]))
+        {
+          /* pathname starts with orig_prefix.  */
+          const char *pathname_tail = &pathname[orig_prefix_len];
+          char *result =
+            (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
+
+#ifdef NO_XMALLOC
+          if (result != NULL)
+#endif
+            {
+              memcpy (result, curr_prefix, curr_prefix_len);
+              strcpy (result + curr_prefix_len, pathname_tail);
+              return result;
+            }
+        }
+    }
+
+#ifdef __EMX__
+# ifdef __KLIBC__
+#  undef strncmp
+
+  if (pathname && strncmp (pathname, "/@unixroot", 10) == 0
+      && (pathname[10] == '\0' || pathname[10] == '/' || pathname[10] == '\\'))
+    {
+      /* kLIBC itself processes /@unixroot prefix */
+
+      return pathname;
+    }
+  else
+# endif
+  if (pathname && ISSLASH (pathname[0]))
+    {
+      const char *unixroot = getenv ("UNIXROOT");
+
+      if (unixroot && HAS_DEVICE (unixroot) && !unixroot[2])
+        {
+          char *result = (char *) xmalloc (2 + strlen (pathname) + 1);
+#ifdef NO_XMALLOC
+          if (result != NULL)
+#endif
+            {
+              strcpy (result, unixroot);
+              strcpy (result + 2, pathname);
+              return result;
+            }
+        }
+    }
+#endif
+
+  /* Nothing to relocate.  */
+  return pathname;
+}
+
+#endif

+ 81 - 0
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/relocatable.h

@@ -0,0 +1,81 @@
+/* Provide relocatable packages.
+   Copyright (C) 2003, 2005, 2008-2011 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _RELOCATABLE_H
+#define _RELOCATABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* This can be enabled through the configure --enable-relocatable option.  */
+#if ENABLE_RELOCATABLE
+
+/* When building a DLL, we must export some functions.  Note that because
+   this is a private .h file, we don't need to use __declspec(dllimport)
+   in any case.  */
+#if HAVE_VISIBILITY && BUILDING_DLL
+# define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif defined _MSC_VER && BUILDING_DLL
+# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
+#else
+# define RELOCATABLE_DLL_EXPORTED
+#endif
+
+/* Sets the original and the current installation prefix of the package.
+   Relocation simply replaces a pathname starting with the original prefix
+   by the corresponding pathname with the current prefix instead.  Both
+   prefixes should be directory names without trailing slash (i.e. use ""
+   instead of "/").  */
+extern RELOCATABLE_DLL_EXPORTED void
+       set_relocation_prefix (const char *orig_prefix,
+                              const char *curr_prefix);
+
+/* Returns the pathname, relocated according to the current installation
+   directory.
+   The returned string is either PATHNAME unmodified or a freshly allocated
+   string that you can free with free() after casting it to 'char *'.  */
+extern const char * relocate (const char *pathname);
+
+/* Memory management: relocate() potentially allocates memory, because it has
+   to construct a fresh pathname.  If this is a problem because your program
+   calls relocate() frequently, think about caching the result.  Or free the
+   return value if it was different from the argument pathname.  */
+
+/* Convenience function:
+   Computes the current installation prefix, based on the original
+   installation prefix, the original installation directory of a particular
+   file, and the current pathname of this file.
+   Returns it, freshly allocated.  Returns NULL upon failure.  */
+extern char * compute_curr_prefix (const char *orig_installprefix,
+                                   const char *orig_installdir,
+                                   const char *curr_pathname);
+
+#else
+
+/* By default, we use the hardwired pathnames.  */
+#define relocate(pathname) (pathname)
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RELOCATABLE_H */

BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/res/lyfzClassic2Platinum.ico


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/res/lyfzClassic2Platinum.rc2


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/stdafx.cpp


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/stdafx.h


BIN
bygone/lyfzClassic2Platinum/lyfzClassic2Platinum/targetver.h


+ 30 - 0
bygone/lyfzClassic2Platinum/将dindan表客户资料更新到client表.sql

@@ -0,0 +1,30 @@
+USE [db]
+-- 定义变量;
+DECLARE @COUNT INT				-- 数量;
+DECLARE @SIZE INT				-- 数量;
+DECLARE @OrderId NVARCHAR(80)	-- 订单号;
+DECLARE @Phone1 NVARCHAR(80)	-- 电话1;
+DECLARE @Phone2 NVARCHAR(80)	-- 电话2;
+DECLARE @Name1 NVARCHAR(80)		-- 姓名1;
+DECLARE @Name2 NVARCHAR(80)		-- 姓名2;
+
+-- 查询出所有订单的电话,并插入到临时表中;
+SELECT IDENTITY(INT,1,1) AS AutoId, id, name1, name2, phone1, phone2 INTO #temp_dindan FROM dindan
+-- 获取临时表最大ID;
+SELECT @COUNT = MAX(AutoId) FROM #temp_dindan
+
+-- 循环将dindan表里的订单电话更新到client对应的订单记录中;
+WHILE @COUNT > 0
+BEGIN
+	SELECT @OrderId = id , @Name1 = name1, @Name2 =  name2, @Phone1 = phone1, @Phone2 = phone2 FROM #temp_dindan WHERE AutoId = @COUNT
+	SELECT @SIZE = COUNT(*) FROM client WHERE id = @OrderId
+	if @SIZE > 0
+		UPDATE client SET name1 = @Name1, name2 = @Name2, phone1 = @Phone1, phone2 = @Phone2 WHERE id = @OrderId
+	ELSE
+		INSERT INTO client([id],[name1],[name2],[phone1],[phone2])VALUES(@OrderId, @Name1, @Name2, @Phone1, @Phone2)
+	SET @COUNT = @COUNT -1
+	SET @SIZE = 0
+END
+
+-- 最后,清除临时表;
+DROP TABLE #temp_dindan

+ 3 - 0
bygone/lyfzClassic2Platinum/注意.txt

@@ -0,0 +1,3 @@
+1,经典版儿童订单中,家长是没有性别的,转到铂金版中是随宝宝性别的; 所以,这里需要影楼自己处理;
+2,由于铂金版的儿童订单是没有单个景点的,只有成长阶段;而经典版只有景点级别的,故经典儿童订单转到铂金后,只能以婚纱订单存在;
+注:如果要以铂金成长阶段来转, 

BIN
bygone/lyfzClassic2Platinum/说明.doc


+ 198 - 0
数据库/db.sql

@@ -0,0 +1,198 @@
+-- ----------------------------
+-- Table structure for supplier
+-- 供应商表;
+-- ----------------------------
+CREATE TABLE "supplier" (
+"supplier_id"  INTEGER NOT NULL,		                        -- 供应商id; 
+"supplier_company_type" TEXT,                                   -- 供应商企业类型:合资,独资,国有,私营,等...
+"supplier_business_type" TEXT,                                  -- 供应商(主要)业务类型,其实就是行业;
+"supplier_name"  TEXT,					                        -- 供应商名称;
+"supplier_address"  TEXT,				                        -- 供应商地址;
+"supplier_remarks"  TEXT,				                        -- 供应商备注;
+"supplier_fax"  TEXT,					                        -- 供应商传真;
+"supplier_web_site"  TEXT,				                        -- 供应商网站;
+"supplier_postcode"  TEXT,				                        -- 供应商邮政编码;
+"supplier_established_date"  TEXT,		                        -- 供应商成立日期(使用UTC时间戳);
+"supplier_credit_standing"  TEXT,		                        -- 供应商信用状况;
+PRIMARY KEY ("supplier_id" ASC)
+);
+
+-- ----------------------------
+-- Table structure for supplier_contacts
+-- 供应商联系人表;
+-- ----------------------------
+DROP TABLE IF EXISTS "main"."supplier_contacts";
+CREATE TABLE "supplier_contacts" (
+"supplier_id"  INTEGER NOT NULL,		                        -- 供应商id; 
+"supplier_contacts_id"  TEXT,			                        -- 供应商联系人id; 
+"supplier_contacts_name"  TEXT,			                        -- 供应商联系人名称;
+"supplier_contacts_phone"  TEXT,		                        -- 供应商联系人电话;
+"supplier_contacts_weixin"  TEXT,		                        -- 供应商联系人微信;
+"supplier_contacts_qq"  TEXT,			                        -- 供应商联系人QQ; 
+"supplier_contacts_email"  TEXT,		                        -- 供应商联系人邮箱;
+"supplier_contacts_image"  BLOB,		                        -- 供应商联系人头像(文件路径)	
+"supplier_contacts_grade"  INTEGER,		                        -- 供应商联系人级别(老板, 老板娘, 员工, 业务员等分类);
+"supplier_contacts_native_place"  TEXT,	                        -- 供应商联系人籍贯(哪里人);
+"supplier_contacts_gender"  INTEGER,	                        -- 供应商联系人性别;
+"supplier_contacts_birthday"  TEXT,		                        -- 供应商联系人生日;
+"supplier_contacts_remarks"  TEXT,		                        -- 供应商联系人备注;
+"supplier_contacts_status"  INTEGER,	                        -- 供应商联系人状态:有效, 无效.
+PRIMARY KEY ("supplier_id" ASC)
+);
+
+-- ----------------------------
+-- Table structure for supplier_goods
+-- 供应商供应商品表;
+-- 不需要商品价格,颜色等具体参数,因为商品价格会浮动,颜色也可能会改变,价格都在进货批次里;
+-- 商品列表, 不应该做删除, 只能做下架处理;
+-- 疑问: 供应商->商品 多对一的关系;
+-- ----------------------------
+DROP TABLE IF EXISTS "main"."supplier_goods";
+CREATE TABLE "supplier_goods" (
+"supplier_id"  INTEGER NOT NULL,                                -- 供应商id;
+"supplier_goods_id"  INTEGER,                                   -- 供应商品的id; 
+"supplier_goods_name"  TEXT,                                    -- 供应商品的名称;
+"supplier_goods_unit" TEXT,                                     -- 供应商品的单位;
+"supplier_goods_status" TEXT,                                   -- 供应商品的状态:上架, 下架;
+"supplier_goods_remarks"  TEXT,                                 -- 供应商品的备注;
+PRIMARY KEY ("supplier_id" ASC)
+);
+
+-- ----------------------------
+-- Table structure for stock_goods
+-- 进货;
+-- 不需要商品价格,颜色等具体参数,因为商品价格会浮动,颜色也可能会改变,价格都在进货批次里;
+-- ----------------------------
+DROP TABLE IF EXISTS "main"."stock_goods";
+CREATE TABLE "stock_goods" (
+"supplier_id"  INTEGER NOT NULL,                                -- 供应商id;
+"stock_goods_id"  INTEGER,                                      -- 进货批次; 
+"supplier_goods_id"  INTEGER,                                   -- 进货商品id; 
+"supplier_goods_name"  TEXT,                                    -- 进货的商品的名称;
+"supplier_goods_unit" TEXT,                                     -- 进货的商品的单位;
+"stock_goods_total_price"  TEXT,                                -- 进货总价;
+"quantity_of_goods"  TEXT,                                      -- 商品数量;
+"transport_costs"  TEXT,                                        -- 运输费用;
+"stock_goods_date"  TEXT,                                       -- 进货日期;
+PRIMARY KEY ("supplier_id" ASC)
+);
+
+--1.进货批次表;
+/* 
+    进货批次, 
+    进货商品, 
+    进货时间, 
+    进货供应商, 
+    进货总价, 
+    进货数量,
+    进货实数(实际数量,因某些原因缺斤短量),
+    损坏数量(有些货物,会因运输过程中损坏),
+    不合格数量,
+    运输费用, 
+    运输时长,
+    验货人, 
+    验货结果说明, 
+    批次备注, 
+    进货单据照片.
+*/
+CREATE TABLE [dbo].[basket_purchase](
+	[basket_purchase_id] [nvarchar](50) NULL,									-- 进货批次id;
+	
+) ON [PRIMARY]
+GO
+
+/*////////////////////////////////////////////////////////////////////////////////
+------------------------------
+人员信息表: personnel
+personnel_id: 全局id(由分店id做前缀,长度固定4字节);
+personnel_name: 姓名;
+personnel_gender: 性别;
+personnel_native_place:籍贯;
+personnel_identity_card:身份证;
+personnel_self_phone:电话(个人电话)
+personnel_allocated_phone:分配的电话(公司分配的)
+personnel_family_address:家庭住址;
+personnel_present_address:现居地;
+personnel_weixin:微信号;
+personnel_self_qq:个人qq; 
+personnel_allocated_qq;分配的qq
+personnel_seft_email;个人邮箱;
+personnel_allocated_email;分配的email(有的公司有自己的邮箱服务器)
+personnel_educational_background;学历;
+personnel_marital_status:婚姻状况;
+personnel_birthday;生日;
+personnel_graduate_institutions:毕业院校;
+personnel_fingerprinted1:指纹1;
+personnel_fingerprinted2:指纹2;
+personnel_probation_period:试用期;
+personnel_hiredate:入职日期;
+personnel_leavedate:离职日期;
+证件照字段:相片可以存在aliyun上,也可以存在本地目录;不建议存在数据库中;
+多张相片使用'|'号或其他特殊符号来分隔串联;
+紧急联系人1姓名, 电话, 住址, 关系;
+紧急联系人2姓名, 电话, 住址, 关系;
+备注;
+身体健康状况:~~
+所属分店id(长度一个字节,用字符表示A~Z);
+
+------------------------------
+分店信息表:
+branch_id:分店id(长度一个字节,用字符表示A~Z)
+branch_name:分店名称;
+branch_telphone:分店电话;
+branch_address:分店地址;
+branch_website:分店网址;
+branch_publicwexin:分店公众号;
+branch_fax:分店传真;
+branch_responsible:分店负责人(店长);
+branch_qr_code分店二维码(路径或http地址);
+
+
+---------------------------
+客户表.
+客户主表(物理表):
+customer_id:客户id(全局唯一)
+customer_name:客户姓名;
+customer_gender:客户性别;
+customer_birthday:客户生日(年龄);
+customer_birthday_lunar:客户生日是否农历;
+customer_address:客户住址;
+customer_phone:客户电话;
+customer_weixin:客户微信;
+customer_qq:客户QQ; 
+customer_email:客户邮箱;
+customer_source:客户来源;
+
+
+--------------------------
+客户附表(生理表):
+
+
+
+-------------------------
+客户关系表(一个客户,可以与多人产生关系):
+customer_id:客户id
+customer_relationship:关系(格式:主关系-从关系 );
+customer_persons:人或人群,当一对多关系时分隔符使用'|'
+说明:关系有一对一的, 也有一对多的.如:父-子: ;
+
+////////////////////////////////////////////////////////////////////////////////*/
+
+
+
+
+
+(
+商品进货批次001时, 单价是10, 数量100, 进货后库存100; 
+商品进货批次002时, 单价是15, 数量200, 进货后库存250,表示有50是上一批次的; 
+
+商品成本价自动变化, 售价也自动变化(售价 = 成本价 * %1.x ):
+批次001时, 成本单价是10, 保持不变直接批次001的商品使用完毕后;
+批次002时, 如果库存数量 != 批次002时进货数量, 成本价依旧是001时的, 直到 库存数量=批次002时进货数量时, 成本价=15;
+
+情况一, 有些店的商品成本和售价都要固定不变的;
+)
+
+
+
+

BIN
数据库/数据库设计.xls