Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TestScenarioProperties.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "AdvPageControl"
#pragma link "AdvEdit"
#pragma link "DBAdvEd"
#pragma link "AdvSpin"
#pragma link "DBAdvSp"
#pragma resource "*.dfm"
TTestScenarioPropertiesForm *TestScenarioPropertiesForm;
//---------------------------------------------------------------------------
__fastcall TTestScenarioPropertiesForm::TTestScenarioPropertiesForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TTestScenarioPropertiesForm::ShowForm( const int & testScenario )
{
        m_testScenario = testScenario;

        AnsiString sql;
        sql.sprintf(
                "SELECT "
                        "* "
                "FROM "
                        "TEST_SCENARIOS "
                "WHERE "
                        "TESTSCENARIO_NO=%d",
                testScenario );

        TestScenarioPropertiesQuery->Close();
        TestScenarioPropertiesQuery->SQL->Text = sql;
        TestScenarioPropertiesQuery->Open();

        ShowModal();
}


void __fastcall TTestScenarioPropertiesForm::DescriptionChange(
      TObject *Sender)
{
        Apply->Enabled = true;
}
//---------------------------------------------------------------------------


void __fastcall TTestScenarioPropertiesForm::BatchSizeChange(
          TObject *Sender)
{
        m_modified = true;
        Apply->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TTestScenarioPropertiesForm::RepeatCountChange(
          TObject *Sender)
{
        m_modified = true;
        Apply->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TTestScenarioPropertiesForm::ApplyClick(TObject *Sender)
{
        m_modified = false;
        Apply->Enabled = false;
        
        TestScenarioPropertiesQuery->Post();
}
//---------------------------------------------------------------------------

void __fastcall TTestScenarioPropertiesForm::FormShow(TObject *Sender)
{
        m_modified = false;
        Apply->Enabled = false;
}
//---------------------------------------------------------------------------

void __fastcall TTestScenarioPropertiesForm::OKClick(TObject *Sender)
{
        if ( m_modified )
        {
                TestScenarioPropertiesQuery->Post();
        }
}
//---------------------------------------------------------------------------