92 lines
2.7 KiB
C++
92 lines
2.7 KiB
C++
|
|
|
|
#include <oledb.h>
|
|
#include <icrsint.h>
|
|
|
|
#include <toolkit/XConsole.h>
|
|
|
|
#include "ErrorCode/ErrorCode.h"
|
|
|
|
#include "StructEventItemManager.h"
|
|
#include "DB_Commands.h"
|
|
|
|
|
|
bool DB_UpdateEventItemDropInfo::proc( DBConnection & db )
|
|
{
|
|
_CommandPtr cmd;
|
|
if( db.CreateCommand( cmd ) == false ) throw XException( "DB_UpdateEventItemDropInfo : CreateInstance(command) error" );
|
|
|
|
cmd->CommandType = adCmdStoredProc;
|
|
cmd->CommandText = _bstr_t( "dbo.smp_update_event_item_drop_info" );
|
|
// Store the name of current stored-procedure for debugging
|
|
szStoredProcedureName = "dbo.smp_update_event_item_drop_info";
|
|
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_SID", adInteger, adParamInput, 4, m_nSID ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_REMAIN_TIME", adInteger, adParamInput,4, m_nRemainTime ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_DURATION", adInteger, adParamInput, 4, m_nDuration ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_COUNT", adInteger, adParamInput, 4, m_nLeftCount ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_TOTAL_COUNT", adInteger, adParamInput, 4, m_nTotalCount ) );
|
|
|
|
cmd->Execute(NULL,NULL,adCmdStoredProc);
|
|
|
|
return true;
|
|
}
|
|
|
|
bool DB_UpdateEventItemDropInfo::onProcess( DBConnection & db )
|
|
{
|
|
try
|
|
{
|
|
proc( db );
|
|
}
|
|
catch( ... )
|
|
{
|
|
StructEventItemManager::GetInstance().onEndQuery();
|
|
|
|
throw;
|
|
}
|
|
|
|
StructEventItemManager::GetInstance().onEndQuery();
|
|
|
|
return true;
|
|
}
|
|
|
|
bool DB_InsertEventItemDropInfo::proc( DBConnection & db )
|
|
{
|
|
_CommandPtr cmd;
|
|
if( db.CreateCommand( cmd ) == false ) throw XException( "DB_InsertEventItemDropInfo : CreateInstance(command) error" );
|
|
|
|
cmd->CommandType = adCmdStoredProc;
|
|
cmd->CommandText = _bstr_t( "dbo.smp_insert_event_item_drop_info" );
|
|
szStoredProcedureName = "dbo.smp_insert_event_item_drop_info";
|
|
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_SID", adInteger, adParamInput, 4, m_nSID ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_CODE", adInteger, adParamInput, 4, m_nCode ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_REMAIN_TIME", adInteger, adParamInput, 4, m_nRemainTime ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_COUNT", adInteger, adParamInput, 4, m_nLeftCount ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_DURATION", adInteger, adParamInput, 4, m_nDuration ) );
|
|
cmd->Parameters->Append( cmd->CreateParameter( "IN_TOTAL_COUNT", adInteger, adParamInput, 4, m_nTotalCount ) );
|
|
|
|
cmd->Execute(NULL,NULL,adCmdStoredProc);
|
|
|
|
return true;
|
|
}
|
|
|
|
bool DB_InsertEventItemDropInfo::onProcess( DBConnection & db )
|
|
{
|
|
try
|
|
{
|
|
proc( db );
|
|
}
|
|
catch( ... )
|
|
{
|
|
StructEventItemManager::GetInstance().onEndQuery();
|
|
|
|
throw;
|
|
}
|
|
|
|
StructEventItemManager::GetInstance().onEndQuery();
|
|
|
|
return true;
|
|
}
|
|
|