|
@@ -13,6 +13,38 @@ CAdoConnGuard tagConnGuard(pObj, dwTimeOut);\
|
|
if ( pObj == NULL)\
|
|
if ( pObj == NULL)\
|
|
return FALSE\
|
|
return FALSE\
|
|
|
|
|
|
|
|
+// 添加参数;
|
|
|
|
+auto AddSTRParameters = [](_CommandPtr cmd, LPCTSTR lpszFieldName, LPCTSTR lpszFieldValue)->BOOL {
|
|
|
|
+ if (lpszFieldName == NULL || lpszFieldValue == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+ _ParameterPtr param;
|
|
|
|
+ param.CreateInstance(__uuidof(Parameter));
|
|
|
|
+ param = cmd->CreateParameter(_bstr_t(lpszFieldName), adBSTR, adParamInput, _tclen(lpszFieldValue), lpszFieldValue);
|
|
|
|
+ cmd->Parameters->Append(param);
|
|
|
|
+ return TRUE;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+auto AddIntParameters = [](_CommandPtr cmd, LPCTSTR lpszFieldName, int nFieldValue)->BOOL {
|
|
|
|
+ if (lpszFieldName == NULL )
|
|
|
|
+ return FALSE;
|
|
|
|
+ _ParameterPtr param;
|
|
|
|
+ param.CreateInstance(__uuidof(Parameter));
|
|
|
|
+ param = cmd->CreateParameter(_bstr_t(lpszFieldName), adInteger, adParamInput, sizeof(nFieldValue), nFieldValue);
|
|
|
|
+ cmd->Parameters->Append(param);
|
|
|
|
+ return TRUE;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+auto AddBoolParameters = [](_CommandPtr cmd, LPCTSTR lpszFieldName, BOOL bFieldValue)->BOOL {
|
|
|
|
+ if (lpszFieldName == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+ _ParameterPtr param;
|
|
|
|
+ param.CreateInstance(__uuidof(Parameter));
|
|
|
|
+ param = cmd->CreateParameter(_bstr_t(lpszFieldName), adBoolean, adParamInput, sizeof(bFieldValue), bFieldValue);
|
|
|
|
+ cmd->Parameters->Append(param);
|
|
|
|
+ return TRUE;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
enum UserLogInStatus
|
|
enum UserLogInStatus
|
|
{
|
|
{
|
|
USER_LOGIN = 1, // 登录成功;
|
|
USER_LOGIN = 1, // 登录成功;
|
|
@@ -384,10 +416,7 @@ BOOL CWxAdoImpl::IsUserExist( IN LPCTSTR lpPhone, IN LPCTSTR lpPassword, OUT LPV
|
|
if (lpPhone == NULL || lpPassword == NULL || pObj == NULL)
|
|
if (lpPhone == NULL || lpPassword == NULL || pObj == NULL)
|
|
return FALSE;
|
|
return FALSE;
|
|
|
|
|
|
- _ParameterPtr QueryParam;
|
|
|
|
- QueryParam.CreateInstance(__uuidof(Parameter));
|
|
|
|
- QueryParam = pObj->pCommand->CreateParameter(_bstr_t(_T("csr_phone")), adBSTR, adParamInput, _tclen(lpPhone), lpPhone);
|
|
|
|
- pObj->pCommand->Parameters->Append(QueryParam);
|
|
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_phone"), lpPhone);
|
|
pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable from customer where csr_phone = ?"));
|
|
pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable from customer where csr_phone = ?"));
|
|
|
|
|
|
// 执行SQL语句,返回记录集
|
|
// 执行SQL语句,返回记录集
|
|
@@ -478,10 +507,7 @@ INT CWxAdoImpl::QueryUserDetail(IN LPCTSTR lpPhone, IN LPVOID lpOutValue, IN con
|
|
if (lpPhone == NULL || pObj == NULL)
|
|
if (lpPhone == NULL || pObj == NULL)
|
|
return FALSE;
|
|
return FALSE;
|
|
|
|
|
|
- _ParameterPtr QueryParam;
|
|
|
|
- QueryParam.CreateInstance(__uuidof(Parameter));
|
|
|
|
- QueryParam = pObj->pCommand->CreateParameter(_bstr_t(_T("csr_phone")), adBSTR, adParamInput, _tclen(lpPhone), lpPhone);
|
|
|
|
- pObj->pCommand->Parameters->Append(QueryParam);
|
|
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_phone"), lpPhone);
|
|
pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable from customer where csr_phone = ?"));
|
|
pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable from customer where csr_phone = ?"));
|
|
|
|
|
|
// 执行SQL语句,返回记录集
|
|
// 执行SQL语句,返回记录集
|
|
@@ -522,6 +548,98 @@ INT CWxAdoImpl::QueryUserDetail(IN LPCTSTR lpPhone, IN LPVOID lpOutValue, IN con
|
|
return TRUE;
|
|
return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+INT CWxAdoImpl::QueryRecordOfType(IN LPCTSTR lpCustomerId, IN LPVOID lpOutValue, IN const DWORD & dwTimeOut)
|
|
|
|
+{
|
|
|
|
+ GETDBPTR(dwTimeOut);
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (lpCustomerId == NULL )
|
|
|
|
+ return FALSE;
|
|
|
|
+
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_id"), lpCustomerId);
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,type_id,type_name,type_gen_time from reply_type where csr_id = ?"));
|
|
|
|
+
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ rec_type &listType = *(rec_type*)lpOutValue;
|
|
|
|
+ while (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ tb_type *pTypeObj = listType.add_types();
|
|
|
|
+ pTypeObj->set_customer_id(_bstr_t(rst->GetCollect(_T("csr_id")).bstrVal));
|
|
|
|
+ pTypeObj->set_type_id(_bstr_t(rst->GetCollect(_T("type_id")).bstrVal));
|
|
|
|
+ pTypeObj->set_type_name(_bstr_t(rst->GetCollect(_T("type_name")).bstrVal));
|
|
|
|
+ _variant_t var = rst->GetCollect(_T("type_gen_time"));
|
|
|
|
+ if (var.vt == VT_EMPTY || var.vt == VT_NULL)
|
|
|
|
+ pTypeObj->set_type_gen_time(_T(""));
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ COleDateTime dt(var);
|
|
|
|
+ pTypeObj->set_type_gen_time(dt.Format(_T("%Y-%m-%d %H:%M:%S")));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+ pObj->pCommand->Parameters->Release();
|
|
|
|
+ }
|
|
|
|
+ catch (_com_error &e)
|
|
|
|
+ {
|
|
|
|
+ _bstr_t bstrSource(e.Source());
|
|
|
|
+ _bstr_t bstrDescription(e.Description());
|
|
|
|
+ SolveDBError(e.Error(), pObj);
|
|
|
|
+ WriteTextLog(_T("SQL出错:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+INT CWxAdoImpl::QueryRecordOfReply(IN LPCTSTR lpCustomerId, IN LPCTSTR lpTypeId, IN LPVOID lpOutValue, IN const DWORD & dwTimeOut)
|
|
|
|
+{
|
|
|
|
+ GETDBPTR(dwTimeOut);
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (lpCustomerId == NULL || lpTypeId == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_id"), lpCustomerId);
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@type_id"), lpTypeId);
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(_T("select csr_id,type_id,reply_id,reply_name,reply_content,reply_gen_time from reply where csr_id = ? and type_id = ?"));
|
|
|
|
+
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ rec_reply &listReply = *(rec_reply*)lpOutValue;
|
|
|
|
+ while (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ tb_reply *pReplyObj = listReply.add_replys();
|
|
|
|
+ pReplyObj->set_customer_id(_bstr_t(rst->GetCollect(_T("csr_id")).bstrVal));
|
|
|
|
+ pReplyObj->set_type_id(_bstr_t(rst->GetCollect(_T("type_id")).bstrVal));
|
|
|
|
+ pReplyObj->set_reply_id(_bstr_t(rst->GetCollect(_T("reply_id")).bstrVal));
|
|
|
|
+ pReplyObj->set_reply_name(_bstr_t(rst->GetCollect(_T("reply_name")).bstrVal));
|
|
|
|
+ pReplyObj->set_reply_content(_bstr_t(rst->GetCollect(_T("reply_content")).bstrVal));
|
|
|
|
+
|
|
|
|
+ _variant_t var = rst->GetCollect(_T("reply_gen_time"));
|
|
|
|
+ if (var.vt == VT_EMPTY || var.vt == VT_NULL)
|
|
|
|
+ pReplyObj->set_reply_gen_time(_T(""));
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ COleDateTime dt(var);
|
|
|
|
+ pReplyObj->set_reply_gen_time(dt.Format(_T("%Y-%m-%d %H:%M:%S")));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+ pObj->pCommand->Parameters->Release();
|
|
|
|
+ }
|
|
|
|
+ catch (_com_error &e)
|
|
|
|
+ {
|
|
|
|
+ _bstr_t bstrSource(e.Source());
|
|
|
|
+ _bstr_t bstrDescription(e.Description());
|
|
|
|
+ SolveDBError(e.Error(), pObj);
|
|
|
|
+ WriteTextLog(_T("SQL出错:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
BOOL CWxAdoImpl::AddCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOut)
|
|
BOOL CWxAdoImpl::AddCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOut)
|
|
{
|
|
{
|
|
if (lpCustomerInfo == NULL)
|
|
if (lpCustomerInfo == NULL)
|
|
@@ -533,21 +651,12 @@ BOOL CWxAdoImpl::AddCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOu
|
|
{
|
|
{
|
|
#if 1
|
|
#if 1
|
|
CString strSql = _T("");
|
|
CString strSql = _T("");
|
|
|
|
+ customer.set_customer_id(GetUID().c_str());
|
|
|
|
+ if (customer.customer_vcode_expiry_time().size() == 0)
|
|
|
|
+ customer.set_customer_vcode_expiry_time(_T("0000-00-00 00:00:00"));
|
|
strSql.Format(_T("INSERT INTO customer(csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable) "
|
|
strSql.Format(_T("INSERT INTO customer(csr_id,csr_name,csr_phone,csr_gender,csr_password,csr_old_phone,csr_vcode,vcode_expiry_time,enable) "
|
|
"VALUES('%s','%s','%s',%d,'%s','%s','%s','%s',%d) "),
|
|
"VALUES('%s','%s','%s',%d,'%s','%s','%s','%s',%d) "),
|
|
- //customer.customer_id().c_str(),
|
|
|
|
- //[&]()->TCHAR* {
|
|
|
|
- // // 如果存在, 或者异常,新建spid;
|
|
|
|
- // TCHAR szUid[50] = { 0 };
|
|
|
|
- // _ui64tot_s(m_uniqueid.get_unique_id(), szUid, 50, 10);
|
|
|
|
- // return szUid;
|
|
|
|
- //}(),
|
|
|
|
- [&]()->TString {
|
|
|
|
- // 如果存在, 或者异常,新建spid;
|
|
|
|
- TCHAR szUid[50] = { 0 };
|
|
|
|
- _ui64tot_s(m_uniqueid.get_unique_id(), szUid, 50, 10);
|
|
|
|
- return TString(szUid);
|
|
|
|
- }().c_str(),
|
|
|
|
|
|
+ customer.customer_id().c_str(),
|
|
customer.customer_name().c_str(),
|
|
customer.customer_name().c_str(),
|
|
customer.customer_phone().c_str(),
|
|
customer.customer_phone().c_str(),
|
|
customer.customer_gender(),
|
|
customer.customer_gender(),
|
|
@@ -560,15 +669,27 @@ BOOL CWxAdoImpl::AddCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOu
|
|
|
|
|
|
pObj->pCommand->CommandText = _bstr_t(strSql);
|
|
pObj->pCommand->CommandText = _bstr_t(strSql);
|
|
// 执行SQL语句,返回记录集
|
|
// 执行SQL语句,返回记录集
|
|
|
|
+ pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+#else
|
|
|
|
+ // 出错:对象关闭时,不允许操作;
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_id"), customer.customer_id().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_name"), customer.customer_name().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_phone"), customer.customer_phone().c_str());
|
|
|
|
+ AddBoolParameters(pObj->pCommand, _T("@csr_gender"), BOOL(customer.customer_gender()));
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_password"), customer.customer_password().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_old_phone"), customer.customer_old_phone().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_vcode"), customer.customer_vcode().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@vcode_expiry_time"), customer.customer_vcode_expiry_time().c_str());
|
|
|
|
+ AddBoolParameters(pObj->pCommand, _T("@enable"), customer.customer_enable());
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(_T("INSERT INTO customer(csr_id, csr_name, csr_phone, csr_gender, csr_password, csr_old_phone, csr_vcode, vcode_expiry_time, enable) VALUES(?,?,?,?,?,?,?,?,?)"));
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
_RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
_RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
if (!rst->adoEOF)
|
|
if (!rst->adoEOF)
|
|
{
|
|
{
|
|
;
|
|
;
|
|
}
|
|
}
|
|
rst->Close();
|
|
rst->Close();
|
|
-#else
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ pObj->pCommand->Parameters->Release();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
catch (_com_error &e)
|
|
catch (_com_error &e)
|
|
@@ -583,14 +704,126 @@ BOOL CWxAdoImpl::AddCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOu
|
|
return TRUE;
|
|
return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
-BOOL CWxAdoImpl::AddType(IN LPVOID lpStudioInfo, IN const DWORD & dwTimeOut)
|
|
|
|
|
|
+BOOL CWxAdoImpl::AddType(IN LPVOID lpTypeInfo, IN const DWORD & dwTimeOut)
|
|
{
|
|
{
|
|
- return 0;
|
|
|
|
|
|
+ if (lpTypeInfo == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+
|
|
|
|
+ GETDBPTR(dwTimeOut);
|
|
|
|
+ tb_type &type = *(tb_type*)lpTypeInfo;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+#if 1
|
|
|
|
+ CString strSql = _T("");
|
|
|
|
+ type.set_type_id(GetUID().c_str());
|
|
|
|
+ if (type.type_gen_time().size() == 0)
|
|
|
|
+ type.set_type_gen_time(GetCurrentLocalTime().c_str());
|
|
|
|
+ strSql.Format(_T("INSERT INTO reply_type(csr_id,type_id,type_name,type_gen_time) "
|
|
|
|
+ "VALUES('%s','%s','%s','%s') "),
|
|
|
|
+ type.customer_id().c_str(),
|
|
|
|
+ type.type_id().c_str(),
|
|
|
|
+ type.type_name().c_str(),
|
|
|
|
+ type.type_gen_time().c_str()
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(strSql);
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ if (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ ;
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+#else
|
|
|
|
+ // 出错:对象关闭时,不允许操作;
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_id"), type.customer_id().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@type_id"), GetUID().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@type_name"), type.type_name().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@type_gen_time"), type.type_gen_time().c_str());
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(_T("INSERT INTO reply_type(csr_id,type_id,type_name,type_gen_time) VALUES(?,?,?,?)"));
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ if (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ ;
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+ pObj->pCommand->Parameters->Release();
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
|
|
+ catch (_com_error &e)
|
|
|
|
+ {
|
|
|
|
+ _bstr_t bstrSource(e.Source());
|
|
|
|
+ _bstr_t bstrDescription(e.Description());
|
|
|
|
+ SolveDBError(e.Error(), pObj);
|
|
|
|
+ WriteTextLog(_T("SQL出错:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
-BOOL CWxAdoImpl::AddReply(IN LPVOID lpStudioInfo, IN const DWORD & dwTimeOut)
|
|
|
|
|
|
+BOOL CWxAdoImpl::AddReply(IN LPVOID lpReplyInfo, IN const DWORD & dwTimeOut)
|
|
{
|
|
{
|
|
- return 0;
|
|
|
|
|
|
+ if (lpReplyInfo == NULL)
|
|
|
|
+ return FALSE;
|
|
|
|
+
|
|
|
|
+ GETDBPTR(dwTimeOut);
|
|
|
|
+ tb_reply &reply = *(tb_reply*)lpReplyInfo;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+#if 1
|
|
|
|
+ CString strSql = _T("");
|
|
|
|
+ reply.set_reply_id(GetUID().c_str());
|
|
|
|
+ if (reply.reply_gen_time().size() == 0)
|
|
|
|
+ reply.set_reply_gen_time(GetCurrentLocalTime().c_str());
|
|
|
|
+
|
|
|
|
+ strSql.Format(_T("INSERT INTO reply(csr_id,type_id,reply_id,reply_name,reply_content,reply_gen_time) "
|
|
|
|
+ "VALUES('%s','%s','%s','%s','%s','%s') "),
|
|
|
|
+ reply.customer_id().c_str(),
|
|
|
|
+ reply.type_id().c_str(),
|
|
|
|
+ reply.reply_id().c_str(),
|
|
|
|
+ reply.reply_name().c_str(),
|
|
|
|
+ reply.reply_content().c_str(),
|
|
|
|
+ reply.reply_gen_time().c_str());
|
|
|
|
+
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(strSql);
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ if (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ ;
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+#else
|
|
|
|
+ // 出错:对象关闭时,不允许操作;
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@csr_id"), reply.customer_id().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@type_id"), reply.type_id().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@reply_id"), GetUID().c_str());
|
|
|
|
+ AddBoolParameters(pObj->pCommand, _T("@reply_name"), reply.reply_name().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@reply_content"), reply.reply_content().c_str());
|
|
|
|
+ AddSTRParameters(pObj->pCommand, _T("@reply_gen_time"), reply.reply_gen_time().c_str());
|
|
|
|
+ pObj->pCommand->CommandText = _bstr_t(_T("INSERT INTO reply(csr_id,type_id,reply_id,reply_name,reply_content,reply_gen_time) VALUES(?,?,?,?,?,?)"));
|
|
|
|
+ // 执行SQL语句,返回记录集
|
|
|
|
+ _RecordsetPtr rst = pObj->pCommand->Execute(NULL, NULL, adCmdText);
|
|
|
|
+ if (!rst->adoEOF)
|
|
|
|
+ {
|
|
|
|
+ ;
|
|
|
|
+ }
|
|
|
|
+ rst->Close();
|
|
|
|
+ pObj->pCommand->Parameters->Release();
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
|
|
+ catch (_com_error &e)
|
|
|
|
+ {
|
|
|
|
+ _bstr_t bstrSource(e.Source());
|
|
|
|
+ _bstr_t bstrDescription(e.Description());
|
|
|
|
+ SolveDBError(e.Error(), pObj);
|
|
|
|
+ WriteTextLog(_T("SQL出错:%08lx,%s,%s,%s"), e.Error(), e.ErrorMessage(), (TCHAR*)bstrSource, (TCHAR*)bstrDescription);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
BOOL CWxAdoImpl::UpdateCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOut)
|
|
BOOL CWxAdoImpl::UpdateCustomer(IN LPVOID lpCustomerInfo, IN const DWORD & dwTimeOut)
|