31 |
|
interface |
32 |
|
|
33 |
|
uses |
34 |
< |
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, |
35 |
< |
StdCtrls, ComCtrls, ibselectsqleditor, IBSQLEditFrame, IBLookupComboEditBox, |
36 |
< |
IBDynamicGrid, IBDatabase, IBSQL, IB; |
34 |
> |
Classes, SysUtils, FileUtil, SynEdit, LResources, Forms, Controls, Graphics, |
35 |
> |
Dialogs, StdCtrls, ComCtrls, ibinsertsqleditor, IBSQLEditFrame, |
36 |
> |
IBLookupComboEditBox, IBDynamicGrid, IBDatabase, IBSQL, IBQuery, IB; |
37 |
|
|
38 |
|
type |
39 |
|
|
40 |
|
{ TIBSQLEditorForm } |
41 |
|
|
42 |
< |
TIBSQLEditorForm = class(TIBSelectSQLEditorForm) |
42 |
> |
TIBSQLEditorForm = class(TIBInsertSQLEditorForm) |
43 |
|
IncludePrimaryKeys: TCheckBox; |
44 |
|
TabControl1: TTabControl; |
45 |
|
procedure FormShow(Sender: TObject); |
46 |
|
procedure GenerateBtnClick(Sender: TObject); |
47 |
– |
procedure IncludePrimaryKeysChange(Sender: TObject); |
47 |
|
procedure TabControl1Change(Sender: TObject); |
48 |
|
private |
49 |
|
procedure SetupFlags; |
81 |
|
end; |
82 |
|
with IBSQLEditFrame1 do |
83 |
|
begin |
85 |
– |
IncludePrimaryKeys := true; |
84 |
|
IncludeReadOnlyFields := true; |
85 |
|
ExecuteOnlyProcs := false; |
86 |
|
SQLText.Lines.Assign(aIBSQL.SQL); |
125 |
|
1: |
126 |
|
IBSQLEditFrame1.GenerateInsertSQL(QuoteFields.Checked); |
127 |
|
2: |
128 |
< |
IBSQLEditFrame1.GenerateModifySQL(QuoteFields.Checked); |
128 |
> |
IBSQLEditFrame1.GenerateModifySQL(QuoteFields.Checked,IncludePrimaryKeys.Checked); |
129 |
|
3: |
130 |
|
IBSQLEditFrame1.GenerateDeleteSQL(QuoteFields.Checked); |
131 |
|
4: |
133 |
|
end; |
134 |
|
end; |
135 |
|
|
138 |
– |
procedure TIBSQLEditorForm.IncludePrimaryKeysChange(Sender: TObject); |
139 |
– |
begin |
140 |
– |
IBSQLEditFrame1.IncludePrimaryKeys := IncludePrimaryKeys.Checked; |
141 |
– |
end; |
142 |
– |
|
136 |
|
procedure TIBSQLEditorForm.SetupFlags; |
137 |
|
begin |
145 |
– |
IBSQLEditFrame1.IncludePrimaryKeys := (TabControl1.TabIndex <= 1) or ((TabControl1.TabIndex = 2) and IncludePrimaryKeys.Checked); |
138 |
|
IBSQLEditFrame1.IncludeReadOnlyFields := (TabControl1.TabIndex = 0); |
139 |
|
IncludePrimaryKeys.Visible := TabControl1.TabIndex = 2; |
140 |
|
FieldNamesGrid.Visible := TabControl1.TabIndex <> 3; |
141 |
|
Label2.Visible := TabControl1.TabIndex <> 3; |
142 |
< |
PrimaryKeysGrid.Visible := TabControl1.TabIndex <> 1; |
143 |
< |
Label4.Visible := TabControl1.TabIndex <> 1; |
142 |
> |
IdentityGrid.Visible := TabControl1.TabIndex <> 3; |
143 |
> |
Label6.Visible := TabControl1.TabIndex <> 3; |
144 |
> |
ReadOnlyGrid.Visible := TabControl1.TabIndex <> 3; |
145 |
> |
Label5.Visible := TabControl1.TabIndex <> 3; |
146 |
|
SelectSelectAll.Visible := TabControl1.TabIndex <> 3; |
147 |
|
end; |
148 |
|
|