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

#include "stdafx.h"

class CTradeResultDB : public CTxnHarnessDBBase, public TPCE::CTradeResultDBInterface
{
	SQLHSTMT		m_hstmtFrame1;
	SQLHSTMT		m_hstmtFrame2;
	SQLHSTMT		m_hstmtFrame3;
	SQLHSTMT		m_hstmtFrame4;
	SQLHSTMT		m_hstmtFrame5;
	SQLHSTMT		m_hstmtFrame6;

	// two result sets from Frame2
	SQLHDESC		m_descFrame2Col1;
	SQLHDESC		m_descFrame2Col2;

	//stored procs input/output parameters for binding
	TPCE::TTradeResultFrame1Input	Frame1Input;
	TPCE::TTradeResultFrame1Output	Frame1Output;
	TPCE::TTradeResultFrame2Input	Frame2Input;
	TPCE::TTradeResultFrame2Output	Frame2Output;
	TPCE::TTradeResultFrame3Input	Frame3Input;
	TPCE::TTradeResultFrame3Output	Frame3Output;
	TPCE::TTradeResultFrame4Input	Frame4Input;
	TPCE::TTradeResultFrame4Output	Frame4Output;
	TPCE::TTradeResultFrame5Input	Frame5Input;

	TPCE::TTradeResultFrame6Input	Frame6Input;
	TPCE::TTradeResultFrame6Output	Frame6Output;

	SQLINTEGER		m_HS_QTY_ind;	// indicator variable

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

	void DoTradeResultFrame1(   const TPCE::TTradeResultFrame1Input*    pFrame1Input, 
                                TPCE::PTradeResultFrame1Output          pFrame1Output);

	void DoTradeResultFrame2(   const TPCE::TTradeResultFrame2Input*    pFrame2Input,
                                TPCE::PTradeResultFrame2Output          pFrame2Output);

	void DoTradeResultFrame3(   const TPCE::TTradeResultFrame3Input*    pFrame3Input, 
                                TPCE::PTradeResultFrame3Output          pFrame3Output);

	void DoTradeResultFrame4(   const TPCE::TTradeResultFrame4Input*    pFrame4Input, 
                                TPCE::PTradeResultFrame4Output          pFrame4Output);

	void DoTradeResultFrame5(   const TPCE::TTradeResultFrame5Input*    pFrame5Input);

	void DoTradeResultFrame6(   const TPCE::TTradeResultFrame6Input*    pFrame6Input, 
                                TPCE::PTradeResultFrame6Output          pFrame6Output);

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