Полный код программы
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, IBCustomDataSet, IBDatabase, IBTable, Grids, DBGrids, Menus, ExtCtrls, DBCtrls, IBStoredProc, StdCtrls, ComCtrls, jpeg;
type TForm1 = class(TForm) IBDatabase1: TIBDatabase; IBTransaction1: TIBTransaction; IBDataSet1: TIBDataSet; DataSource1: TDataSource; DBGrid1: TDBGrid; MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; N9: TMenuItem; N10: TMenuItem; DBGrid2: TDBGrid; DataSource2: TDataSource; IBDataSet2: TIBDataSet; IBStoredProc1: TIBStoredProc; DataSource3: TDataSource; DBGrid3: TDBGrid; IBStoredProc2: TIBStoredProc; Button2: TButton; IBStoredProc3: TIBStoredProc; IBStoredProc4: TIBStoredProc; DBLookupComboBox1: TDBLookupComboBox; DBLookupComboBox2: TDBLookupComboBox; Label1: TLabel; Label2: TLabel; Button3: TButton; IBStoredProc5: TIBStoredProc; Label3: TLabel; Label4: TLabel; Edit2: TEdit; DateTimePicker1: TDateTimePicker; фон: TImage; N11: TMenuItem; procedure N4Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N9Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure N11Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
uses Unit2, Unit3, Unit7, Unit4, Unit5, Unit6, Unit8, Unit9, Unit10;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject); begin form6.show; form6.IBDataSet1.SelectSQL.text:='select * from gr('''+FORM1.DBLookupComboBox1.text+''')'; form6.IBDataSet1.CLOSE; form6.IBDataSet1.Open; end;
procedure TForm1.Button3Click(Sender: TObject); begin ibdataset2.Close; IBDataset2.Open; IBStoredProc5.ParamByName('ID_VIDACHI_A').AsInteger:=strtoint(DBLookupComboBox1.Text); IBStoredProc5.ParamByName('ID_KLIENTA_A').AsInteger:=strtoint(DBLookupComboBox1.Text); IBStoredProc5.ParamByName('ID_KREDITA_A').AsInteger:=strtoint(DBLookupComboBox2.Text); IBStoredProc5.ParamByName('DATA_VIDACHI_A').AsDate:=DateTimePicker1.DATE; IBStoredProc5.ParamByName('SYMMA_KREDITA_A').AsInteger:=strtoint(edit2.Text); IBStoredProc5.ParamByName('SYMMA_KREDITA_POLN_A').AsInteger:=STRTOINT('0'); IBStoredProc5.ExecProc; Form1.IBTransaction1.Commit; IBDataset2.Close; IBDataset2.Open; form5.IBDataSet1.Close; form5.IBDataSet1.open; FORM3.IBDataSet1.Close; FORM3.IBDataSet1.OPEN; Edit2.Text:='';
end;
procedure TForm1.N10Click(Sender: TObject); begin form10.show; form10.IBDataSet1.Close; form10.IBDataSet1.Open; end;
procedure TForm1.N11Click(Sender: TObject); begin form9.Show; form9.IBDataSet1.Close; form9.IBDataSet2.Close; form9.IBDataSet1.Open; form9.IBDataSet2.Close; form9.Ibdataset1.SelectSQL.text:='select * from KL('''+FORM1.DBLookupComboBox1.text+''')'; form9.Ibdataset2.SelectSQL.text:='select * from gr('''+FORM1.DBLookupComboBox1.text+''')'; form9.Ibdataset2.CLOSE; form9.Ibdataset2.Open; form9.Ibdataset1.CLOSE; form9.Ibdataset1.Open; end;
procedure TForm1.N3Click(Sender: TObject); begin form8.show; form8.IBDataSet1.Close; form8.IBDataSet1.Open; end;
procedure TForm1.N4Click(Sender: TObject); begin form2.show; form2.IBDataSet1.Close; form2.IBDataSet1.Open; end;
procedure TForm1.N5Click(Sender: TObject); begin form7.show; form7.IBDataSet1.Close; form7.IBDataSet1.Open; end;
procedure TForm1.N6Click(Sender: TObject); begin form4.show; form4.IBDataSet1.Close; form4.IBDataSet1.Open; end;
procedure TForm1.N7Click(Sender: TObject); begin form5.show; form5.IBDataSet1.Close; form5.IBDataSet1.Open; end;
procedure TForm1.N8Click(Sender: TObject); begin form3.show; form3.IBDataSet1.Close; form3.IBDataSet1.Open; end;
procedure TForm1.N9Click(Sender: TObject); begin form6.show; form6.IBDataSet1.Close; form6.IBDataSet1.Open; end; end.
unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, DB, IBCustomDataSet, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, IBStoredProc, jpeg; type TForm2 = class(TForm) DBNavigator1: TDBNavigator; IBDataSet1: TIBDataSet; DataSource1: TDataSource; DBGrid1: TDBGrid; IBStoredProc1: TIBStoredProc; фон: TImage; procedure N2Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end;
var Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); begin
end;
procedure TForm2.N2Click(Sender: TObject); begin Form1.visible:=true; Form2.visible:=false; end;
procedure TForm2.N3Click(Sender: TObject); begin Form2.visible:=true; Form1.visible:=false; end; end.
unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, DB, IBCustomDataSet, Grids, DBGrids, jpeg;
type TForm3 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource; IBDataSet1: TIBDataSet; DBNavigator1: TDBNavigator; фон: TImage; procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); begin
end; end.
unit Unit4;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, IBCustomDataSet, jpeg;
type TForm4 = class(TForm) DataSource1: TDataSource; IBDataSet1: TIBDataSet; DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; фон: TImage; procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end;
var Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); begin
end; end.
unit Unit5;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, IBCustomDataSet, ExtCtrls, DBCtrls, Grids, DBGrids, jpeg;
type TForm5 = class(TForm) DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; DataSource1: TDataSource; IBDataSet1: TIBDataSet; фон: TImage; procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end;
var Form5: TForm5;
implementation
{$R *.dfm}
procedure TForm5.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); begin
end;
end.
unit Unit6;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, IBCustomDataSet, StdCtrls, IBStoredProc, jpeg;
type TForm6 = class(TForm) IBDataSet1: TIBDataSet; DataSource1: TDataSource; DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; IBStoredProc1: TIBStoredProc; фон: TImage; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form6: TForm6;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm6.Button1Click(Sender: TObject); begin IBStoredProc1.ParamByName('ID_VIDACHI_A').AsInteger:= FORM1.IBDataSet2.FieldByName('ID_VIDACHI').AsInteger; IBStoredProc1.ParamByName('ID_KREDITA_A').AsString:=FORM1.IBDataSet2.FieldByName('ID_KREDITA').AsString; IBStoredProc1.ExecProc; IBDataSet1.Close; IBDataSet1.Open; Form6.IBDataSet1.close; Form6.IBDataSet1.open; end;
end.
unit Unit7;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, IBCustomDataSet, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, jpeg;
type TForm7 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource; IBDataSet1: TIBDataSet; фон: TImage; private { Private declarations } public { Public declarations } end;
var Form7: TForm7;
implementation
{$R *.dfm}
end.
unit Unit8;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IBStoredProc, DB, IBCustomDataSet, Grids, DBGrids, jpeg, ExtCtrls;
type TForm8 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource; IBDataSet1: TIBDataSet; IBStoredProc1: TIBStoredProc; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; Button1: TButton; Label1: TLabel; Edit1: TEdit; фон: TImage; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form8: TForm8;
implementation
uses Unit1, Unit2, Unit5;
{$R *.dfm}
procedure TForm8.Button1Click(Sender: TObject); begin if (edit1.text='')OR (edit2.text='') or (edit3.text='') or (edit4.text='') or (edit5.text='') or (edit6.text='') then showmessage('Введите информацию') else begin IBDataset1.Open; IBStoredProc1.ParamByName('ID_KLIENTA_A').AsInteger:=strtoint(edit1.Text); IBStoredProc1.ParamByName('FIO_A').AsString:=edit2.Text; IBStoredProc1.ParamByName('NOMER_PASPORTA_A').AsString:=edit3.Text; IBStoredProc1.ParamByName('COBSTV_A').AsString:=edit4.Text; IBStoredProc1.ParamByName('ADRES_A').AsString:=edit5.Text; IBStoredProc1.ParamByName('TELEFON_A').AsString:=edit6.Text; IBStoredProc1.ExecProc; Form1.IBTransaction1.Commit; IBDataset1.Open; Form1.IBDataset1.Open; Form2.IBDataset1.Open; Form5.IBDataset1.Open; Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:=''; end; end; procedure TForm8.Button2Click(Sender: TObject); begin form1.show; form8.Close; end;
end.
unit Unit9;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, IBCustomDataSet, Grids, DBGrids, StdCtrls;
type TForm9 = class(TForm) DBGrid1: TDBGrid; DataSource2: TDataSource; IBDataSet2: TIBDataSet; IBDataSet1: TIBDataSet; DataSource1: TDataSource; Button1: TButton; DBGrid3: TDBGrid; private { Private declarations } public { Public declarations } end;
var Form9: TForm9;
implementation
uses Unit1;
{$R *.dfm}
end.
unit Unit10;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, IBCustomDataSet, Grids, DBGrids, IBStoredProc, DBCtrls, ComCtrls, IBSQL, jpeg, ExtCtrls;
type TForm10 = class(TForm) IBDataSet1: TIBDataSet; DataSource1: TDataSource; Label1: TLabel; Label3: TLabel; Label4: TLabel; DBGrid2: TDBGrid; DataSource2: TDataSource; IBDataSet2: TIBDataSet; Label5: TLabel; Edit5: TEdit; Button1: TButton; IBStoredProc1: TIBStoredProc; DBGrid1: TDBGrid; DateTimePicker1: TDateTimePicker; DBLookupComboBox1: TDBLookupComboBox; Button2: TButton; IBSQL1: TIBSQL; фон: TImage; Edit1: TEdit; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form10: TForm10;
implementation
uses Unit1, Unit7;
{$R *.dfm}
procedure TForm10.Button1Click(Sender: TObject); begin if (edit5.text='') then showmessage('Введите информацию') else begin ibdataset1.Close; IBDataset1.Open; IBStoredProc1.ParamByName('ID_PLAT_A').AsInteger:=STRTOINT('6'); IBStoredProc1.ParamByName('ID_VIDACHI_A').AsInteger:=strtoint(DBLookupComboBox1.Text); IBStoredProc1.ParamByName('ID_A').AsInteger:=strtoint(edit1.Text)+1; IBStoredProc1.ParamByName('DATA_PLAT_A').AsDATE:=DateTimePicker1.DATE; IBStoredProc1.ParamByName('SYM_PLAT_A').Asfloat:=strtofloat(edit5.Text); IBStoredProc1.ParamByName('OSTATOK_A').Asfloat:=STRTOfloat('0'); IBStoredProc1.ParamByName('SHTRAFI_A').AsInteger:=STRTOINT('0'); IBStoredProc1.ParamByName('ITOG_A').Asfloat:=STRTOfloat('0'); IBStoredProc1.ExecProc; Form1.IBTransaction1.Commit; IBDataset1.Close; IBDataset1.Open; Form10.IBDataset1.close; Form10.IBDataset1.Open; Form7.IBDataset1.close; Form7.IBDataset1.Open; Edit5.Text:=''; end; end;
procedure TForm10.Button2Click(Sender: TObject); begin Ibdataset1.Open; Ibdataset1.SelectSQL.text:='select * from PLAT('''+DBLookupComboBox1.text+''')'; Ibdataset1.Open; end; end.
|