⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 midrequest.cpp

📁 联通接收发送新程序
💻 CPP
字号:
#include "MidRequest.h"
#include <string>
using namespace std ;

int CMidRequest::InsertRequest( StruRequest &stRequest )
{
	long j = 0 ;
	long RequestID = oCode.NewCode( "REQUEST_ID" ) ;
	if ( RequestID == 0 )
		return -1 ;
	
	oTime.GetLocalTime() ;
	string str = oTime.GetDate() ;
	str += oTime.GetTime() ;

	t_mid_request.Clear() ;
	t_mid_request.REQUEST_ID = RequestID ;
	t_mid_request.ACCT_NBR = stRequest.acct_nbr ;
	t_mid_request.MSG_LENGTH = stRequest.msg_length ;
	t_mid_request.MSG_CONTENT = stRequest.msg_content ;
	t_mid_request.MO_TIME = str.c_str() ;
	
	str = stRequest.sp_code ;
	str += stRequest.inf_type_id ;
		
	t_mid_request.SP_CODE = str.c_str() ;
	
	str = GATEWAY_ID ; //char[1]
	t_mid_request.GATEWAY_ID = str.c_str() ;
	
	j = t_mid_request.Insert() ;
	if( j > 0 )
		Connect.Commit() ;
	else
		Connect.Rollback() ;
	return (int)j ;
}

int CMidRequest::GetRequest( StruRequest &stRequest )
{
	long j = 0 ;
	
	j = t_mid_request.Query( " 1=1 ORDER BY REQUEST_ID " ) ;
	if ( j > 0 )
	{
		strcpy( stRequest.acct_nbr,t_mid_request.ACCT_NBR.Char() ) ;
		strcpy( stRequest.msg_content,t_mid_request.MSG_CONTENT.Char() ) ;
		strcpy( stRequest.mo_time,t_mid_request.MO_TIME.Char() ) ;
		strcpy( stRequest.sp_code,t_mid_request.SP_CODE.Char() ) ;
		stRequest.msg_length = t_mid_request.MSG_LENGTH.Int() ;

		j = t_mid_request.Delete() ;
		if( j > 0 )
			Connect.Commit() ;
		else
			Connect.Rollback() ;
	}

	return int(j) ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -