/*
*	©Copyright 2002,2003, Microsoft Corporation
*	Microsoft Confidential.
*	Written by Sergey Vasilevskiy, 2002-2003.
*/
#pragma once

#include "stdafx.h"

typedef struct TTradeStatusFrame1Ind
{
	SQLINTEGER		broker_name;
	SQLINTEGER		charge[TPCE::max_trade_status_len];
	SQLINTEGER		cust_f_name;
	SQLINTEGER		cust_l_name;
	SQLINTEGER		ex_name[TPCE::max_trade_status_len];
	SQLINTEGER		exec_name[TPCE::max_trade_status_len];
	SQLINTEGER		s_name[TPCE::max_trade_status_len];
	SQLINTEGER		status[TPCE::max_trade_status_len];
	SQLINTEGER		status_name[TPCE::max_trade_status_len];
	SQLINTEGER		symbol[TPCE::max_trade_status_len];
	SQLINTEGER		trade_dts[TPCE::max_trade_status_len];
	SQLINTEGER		trade_id[TPCE::max_trade_status_len];
	SQLINTEGER		trade_qty[TPCE::max_trade_status_len];
	SQLINTEGER		type_name[TPCE::max_trade_status_len];
} *PTradeStatusFrame1Ind;

class CTradeStatusDB : public CTxnHarnessDBBase, public TPCE::CTradeStatusDBInterface
{
	SQLHSTMT					m_hstmtFrame1;

	TPCE::TTradeStatusFrame1Input	Frame1Input;
	TPCE::TTradeStatusFrame1Output	Frame1Output;

	TTradeStatusFrame1Ind		Frame1Ind;

	SQLHDESC					m_descFrame1Col1;
	SQLHDESC					m_descFrame1Col2;

	SQLINTEGER					m_len;

public:
	CTradeStatusDB(CDBConnection *pDBConn);
	~CTradeStatusDB();

	void DoTradeStatusFrame1(   const TPCE::TTradeStatusFrame1Input*    pFrame1Input, 
                                TPCE::PTradeStatusFrame1Output          pFrame1Output);

	// Function to pass any exception thrown inside
	// database class frame implementation
	// back into the database class
	void Cleanup(void* pException);

};
