Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2265 kivins 1
//---------------------------------------------------------------------------
2
 
3
#include <vcl.h>
4
#pragma hdrstop
5
 
6
#include "TestHosts.h"
7
#include "DataModule.h"
8
 
9
//---------------------------------------------------------------------------
10
#pragma package(smart_init)
11
#pragma link "Grids_ts"
12
#pragma link "TSDBGrid"
13
#pragma link "TSGrid"
14
#pragma resource "*.dfm"
15
TTestHostsForm *TestHostsForm;
16
//---------------------------------------------------------------------------
17
__fastcall TTestHostsForm::TTestHostsForm(TComponent* Owner)
18
	: TForm(Owner)
19
{
20
}
21
//---------------------------------------------------------------------------
22
 
23
void __fastcall TTestHostsForm::SpeedButton1Click(TObject *Sender)
24
{
25
	if ( (TestHostsQuery->State != dsEdit) && (TestHostsQuery->State != dsInsert) )
26
    {
27
		TestHostsQuery->Append();
28
    }
29
    else
30
    {
31
    	MessageDlg("Please Save or Cancel existing database change",
32
               		mtError, TMsgDlgButtons() << mbOK, 0);
33
 
34
    }
35
}
36
//---------------------------------------------------------------------------
37
void __fastcall TTestHostsForm::SpeedButton3Click(TObject *Sender)
38
{
39
	if ( (TestHostsQuery->State == dsEdit) || (TestHostsQuery->State == dsInsert) )
40
    {
41
		TestHostsQuery->Cancel();
42
    }
43
    else
44
    {
45
    	MessageDlg("Nothing to Cancel",
46
               		mtError, TMsgDlgButtons() << mbOK, 0);
47
    }
48
}
49
//---------------------------------------------------------------------------
50
void __fastcall TTestHostsForm::SpeedButton5Click(TObject *Sender)
51
{
52
	TestHostsQuery->Delete();
53
}
54
//---------------------------------------------------------------------------
55
void __fastcall TTestHostsForm::CloseBtnClick(TObject *Sender)
56
{
57
	if ( (TestHostsQuery->State == dsEdit) || (TestHostsQuery->State == dsInsert) )
58
    {
59
    	MessageDlg("There are currently unsaved changes; Please either save or cancel changes.",
60
               		mtError, TMsgDlgButtons() << mbOK, 0);
61
    }
62
    else
63
    {
64
		Close();
65
    }
66
}
67
//---------------------------------------------------------------------------