p align="left">public { Public declarations } end; var Form3: TForm3; index,max: Integer; implementation uses Unit1; {$R *. dfm} procedure TForm3. GiveIndex; begin if DataModule1. IBTable2. RecNo<>0 then begin DataModule1. IBTable2. First; max: =DataModule1. IBTable2. FieldByName ('id_zapchastun'). AsInteger; while not DataModule1. IBTable2. Eof do begin if max<DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger then max: =DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger; DataModule1. IBTable2. Next; end; index: =max+1; end else index: =1; end; procedure TForm3. Button1Click (Sender: TObject); begin GiveIndex; DataModule1. IBTable2. Insert; DBEdit1. Text: =IntToStr (index); Button1. Enabled: =false; end; procedure TForm3. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; procedure TForm3. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; end. unit UClientu; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids; type TForm4 = class (TForm) GroupBox1: TGroupBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; DBEdit5: TDBEdit; GroupBox2: TGroupBox; DBEdit12: TDBEdit; DBEdit13: TDBEdit; DBEdit14: TDBEdit; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; DBEdit15: TDBEdit; DBNavigator2: TDBNavigator; Button1: TButton; DBNavigator1: TDBNavigator; DBNavigator3: TDBNavigator; procedure GiveIndex; procedure Button1Click (Sender: TObject); procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn); procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end; var Form4: TForm4; index,max: Integer; implementation uses Unit1; {$R *. dfm} procedure TForm4. GiveIndex; begin if DataModule1. IBTable3. RecNo<>0 then begin DataModule1. IBTable3. First; max: =DataModule1. IBTable3. FieldByName ('id_clienta'). AsInteger; while not DataModule1. IBTable3. Eof do begin if max<DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger then max: =DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger; DataModule1. IBTable3. Next; end; index: =max+1; end else index: =1; end; procedure TForm4. Button1Click (Sender: TObject); begin GiveIndex; DataModule1. IBTable3. Insert; DBEdit1. Text: =IntToStr (index); Button1. Enabled: =false; end; procedure TForm4. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; procedure TForm4. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; end. unit UZakaz; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids; type TForm5 = class (TForm) GroupBox1: TGroupBox; DBEdit1: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit7: TDBEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; DBLookupComboBox1: TDBLookupComboBox; DBEdit2: TDBEdit; Label8: TLabel; DBLookupComboBox2: TDBLookupComboBox; DBLookupComboBox3: TDBLookupComboBox; Label9: TLabel; Label10: TLabel; DBGrid1: TDBGrid; DBNavigator2: TDBNavigator; Button1: TButton; DBNavigator3: TDBNavigator; Label11: TLabel; procedure GiveIndex; procedure Button1Click (Sender: TObject); procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn); procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn); private { Private declarations } public { Public declarations } end; var Form5: TForm5; index,max: Integer; implementation uses Unit1; {$R *. dfm} procedure TForm5. GiveIndex; begin if DataModule1. IBTable5. RecNo<>0 then begin DataModule1. IBTable5. First; max: =DataModule1. IBTable5. FieldByName ('id_zakazy'). AsInteger; while not DataModule1. IBTable5. Eof do begin if max<DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger then max: =DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger; DataModule1. IBTable5. Next; end; index: =max+1; end else index: =1; end; procedure TForm5. Button1Click (Sender: TObject); begin GiveIndex; DataModule1. IBTable5. Insert; DBEdit1. Text: =IntToStr (index); Button1. Enabled: =false; end; procedure TForm5. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; procedure TForm5. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn); begin Button1. Enabled: =true; end; end. unit UShow; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, Mask; type TForm6 = class (TForm) GroupBox1: TGroupBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; DBGrid2: TDBGrid; DBNavigator2: TDBNavigator; GroupBox2: TGroupBox; GroupBox3: TGroupBox; private { Private declarations } public { Public declarations } end; var Form6: TForm6; implementation uses Unit1; {$R *. dfm} end. unit UZaputPoslyg; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, ComCtrls; type TForm7 = class (TForm) DBGrid1: TDBGrid; Button1: TButton; GroupBox1: TGroupBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Picker1: TDateTimePicker; Picker2: TDateTimePicker; GroupBox2: TGroupBox; Edit1: TEdit; Label5: TLabel; procedure Button1Click (Sender: TObject); procedure FormClose (Sender: TObject; var Action: TCloseAction); private { Private declarations } public { Public declarations } end; var Form7: TForm7; sum: real; i: integer; implementation uses Unit1; {$R *. dfm} procedure TForm7. Button1Click (Sender: TObject); var dat1,dat2: TDate; begin dat1: =Picker1. Date; dat2: =Picker2. Date; DataModule1. IBQuery1. Close; DataModule1. IBQuery1. SQL. Clear; DataModule1. IBQuery1. SQL. Add ('select poslyga, price_poslygu'); DataModule1. IBQuery1. SQL. Add ('from zakaz, poslygu'); DataModule1. IBQuery1. SQL. Add ('where poslygu. id_poslygu=zakaz. id_poslygu'); DataModule1. IBQuery1. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption); DataModule1. IBQuery1. Open; sum: =0; for i: =1 to DataModule1. IBQuery1. RecordCount do begin sum: =sum+DataModule1. IBQuery1. fieldbyname ('price_poslygu'). AsFloat; DataModule1. IBQuery1. Next; end; Edit1. Text: =FloatToStr (sum); end; procedure TForm7. FormClose (Sender: TObject; var Action: TCloseAction); begin DataModule1. IBQuery1. Close; end; end. unit UZaputZapchastun; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, ComCtrls; type TForm8 = class (TForm) GroupBox1: TGroupBox; Label2: TLabel; Label3: TLabel; Label4: TLabel; DBGrid1: TDBGrid; Button1: TButton; Label1: TLabel; Picker1: TDateTimePicker; Picker2: TDateTimePicker; GroupBox2: TGroupBox; Edit1: TEdit; Label5: TLabel; procedure Button1Click (Sender: TObject); procedure FormClose (Sender: TObject; var Action: TCloseAction); private { Private declarations } public { Public declarations } end; var Form8: TForm8; sum: real; i: integer; implementation uses Unit1, UPrint; {$R *. dfm} procedure TForm8. Button1Click (Sender: TObject); var dat1,dat2: TDate; begin dat1: =Picker1. Date; dat2: =Picker2. Date; DataModule1. IBQuery1. Close; DataModule1. IBQuery1. SQL. Clear; // поле F_1 DataModule1. IBQuery1. SQL. Add ('select name_zapchastun as name, price_zapchastun as price, count_zapchastun as kount, price_zapchastun*count_zapchastun');
Страницы: 1, 2, 3, 4, 5, 6, 7
|