Смекни!
smekni.com

Распределенные баз данных и распределенных СУБД (стр. 8 из 8)

FDobTov.Show; close; end;

procedure TFTovar.ToolButton1Click(Sender: TObject);

begin Fmain.Show; close; end;

end.

unit UTPoisk;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Buttons, StdCtrls, Mask, db,DBCtrls, ExtCtrls, ComCtrls;

Type TFTPoisk = class(TForm)

PageControl1: TPageControl; TabSheet1: TTabSheet;

TabSheet2: TTabSheet; TabSheet3: TTabSheet;

TabSheet4: TTabSheet; TabSheet5: TTabSheet;

LabeledEdit1: TLabeledEdit; DBEdit1: TDBEdit;

DBEdit2: TDBEdit; DBEdit3: TDBEdit;

DBEdit4: TDBEdit; DBEdit5: TDBEdit;

DBEdit6: TDBEdit; DBEdit7: TDBEdit;

DBEdit8: TDBEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel;

Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel;

Label8: TLabel; SpeedButton2: TSpeedButton;

Продолжение приложения 1

SpeedButton4: TSpeedButton; SpeedButton1: TSpeedButton;

SpeedButton3: TSpeedButton; DBEdit9: TDBEdit;

Label9: TLabel; DBEdit10: TDBEdit; Label10: TLabel;

DBEdit11: TDBEdit; Label11: TLabel; DBEdit12: TDBEdit;

Label12: TLabel; Label13: TLabel; DBEdit13: TDBEdit;

Label14: TLabel; DBEdit14: TDBEdit; Label15: TLabel;

DBEdit15: TDBEdit; DBEdit16: TDBEdit; Label16: TLabel;

LabeledEdit2: TLabeledEdit; SpeedButton5: TSpeedButton;

SpeedButton6: TSpeedButton; DBEdit17: TDBEdit;

Label17: TLabel; DBEdit18: TDBEdit; Label18: TLabel;

DBEdit19: TDBEdit; Label19: TLabel; DBEdit20: TDBEdit;

Label20: TLabel; Label21: TLabel; DBEdit21: TDBEdit;

Label22: TLabel; DBEdit22: TDBEdit; Label23: TLabel;

DBEdit23: TDBEdit; DBEdit24: TDBEdit; Label24: TLabel;

LabeledEdit3: TLabeledEdit; SpeedButton7: TSpeedButton;

SpeedButton8: TSpeedButton; DBEdit25: TDBEdit;

Label25: TLabel; DBEdit26: TDBEdit; Label26: TLabel;

DBEdit27: TDBEdit; Label27: TLabel; DBEdit28: TDBEdit;

Label28: TLabel; Label29: TLabel; DBEdit29: TDBEdit;

Label30: TLabel; DBEdit30: TDBEdit; Label31: TLabel;

DBEdit31: TDBEdit; DBEdit32: TDBEdit; Label32: TLabel;

LabeledEdit4: TLabeledEdit; SpeedButton9: TSpeedButton;

SpeedButton10: TSpeedButton; DBEdit33: TDBEdit;

Label33: TLabel; DBEdit34: TDBEdit; Label34: TLabel;

DBEdit35: TDBEdit; Label35: TLabel; DBEdit36: TDBEdit;

Label36: TLabel; Label37: TLabel; DBEdit37: TDBEdit;

Label38: TLabel; DBEdit38: TDBEdit; Label39: TLabel;

DBEdit39: TDBEdit; DBEdit40: TDBEdit; Label40: TLabel;

LabeledEdit5: TLabeledEdit;

Продолжение приложения 1

procedure SpeedButton2Click(Sender: TObject);

procedure SpeedButton3Click(Sender: TObject);

procedure SpeedButton6Click(Sender: TObject);

procedure SpeedButton8Click(Sender: TObject);

procedure SpeedButton10Click(Sender: TObject);

procedure SpeedButton4Click(Sender: TObject);

procedure SpeedButton1Click(Sender: TObject);

procedure SpeedButton5Click(Sender: TObject);

procedure SpeedButton7Click(Sender: TObject);

procedure SpeedButton9Click(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

var FTPoisk: TFTPoisk;

implementation

uses UDM;

{$R *.dfm}

procedure TFTPoisk.SpeedButton2Click(Sender: TObject);

begin DM.Ttov.Locate('naz_tov',LabeledEdit1.Text,[lopartialkey]); end;

procedure TFTPoisk.SpeedButton3Click(Sender: TObject);

begin DM.Ttov.Locate('bez_nds',strtoint(LabeledEdit2.Text),[]); end;

procedure TFTPoisk.SpeedButton6Click(Sender: TObject);

begin DM.Ttov.Locate('tmb',LabeledEdit3.Text,[lopartialkey]); end;

procedure TFTPoisk.SpeedButton8Click(Sender: TObject);

begin DM.Ttov.Locate('gost',LabeledEdit4.Text,[lopartialkey]); end;

procedure TFTPoisk.SpeedButton10Click(Sender: TObject);

begin DM.Ttov.Locate('marka',LabeledEdit5.Text,[lopartialkey]); end;

procedure TFTPoisk.SpeedButton4Click(Sender: TObject);

begin close; end;

Продолжение приложения 1

procedure TFTPoisk.SpeedButton1Click(Sender: TObject);

begin close; end;

procedure TFTPoisk.SpeedButton5Click(Sender: TObject);

begin close; end;

procedure TFTPoisk.SpeedButton7Click(Sender: TObject);

begin close; end;

procedure TFTPoisk.SpeedButton9Click(Sender: TObject);

begin close; end;

end.

unit UZakaz; interface uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ImgList, ComCtrls, ToolWin, Grids, DBGrids, ExtCtrls, StdCtrls,

DBCtrls;

Type TFZakaz = class(TForm)

DBGrid1: TDBGrid; ToolBar1: TToolBar; TBFirst: TToolButton;

ToolButton2: TToolButton; ToolButton3: TToolButton;

ToolButton4: TToolButton; ToolButton5: TToolButton;

ToolButton6: TToolButton; ToolButton7: TToolButton;

ToolButton1: TToolButton; ImageList1: TImageList;

Panel1: TPanel; ToolButton8: TToolButton;

DBText1: TDBText; Label1: TLabel;

DBText2: TDBText; DBText3: TDBText;

DBText4: TDBText; DBText5: TDBText;

DBText6: TDBText; DBText7: TDBText;

DBText8: TDBText; DBText9: TDBText;

DBText10: TDBText; Label2: TLabel; Label3: TLabel;

Label4: TLabel; Label5: TLabel; Label6: TLabel;

Label7: TLabel; Label8: TLabel; Label9: TLabel;

Shape1: TShape; Label10: TLabel; Shape2: TShape;

Продолжение приложения 1

Label11: TLabel; Shape3: TShape; Label12: TLabel;

Edit1: TEdit; procedure TBFirstClick(Sender: TObject);

procedure ToolButton2Click(Sender: TObject);

procedure ToolButton3Click(Sender: TObject);

procedure ToolButton4Click(Sender: TObject);

procedure ToolButton5Click(Sender: TObject);

procedure ToolButton6Click(Sender: TObject);

procedure ToolButton7Click(Sender: TObject);

procedure ToolButton1Click(Sender: TObject);

procedure ToolButton8Click(Sender: TObject);

procedure FormActivate(Sender: TObject);

procedure Edit1Change(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

var

FZakaz: TFZakaz; a:byte;

implementation

uses UDM, Umain, UDobZakaz;

{$R *.dfm}

procedure TFZakaz.TBFirstClick(Sender: TObject);

begin DM.Tzakaz.First; end;

procedure TFZakaz.ToolButton2Click(Sender: TObject);

begin DM.Tzakaz.Prior; end;

procedure TFZakaz.ToolButton3Click(Sender: TObject);

begin DM.Tzakaz.Next; end;

procedure TFZakaz.ToolButton4Click(Sender: TObject);

begin DM.Tzakaz.Last; end;

procedure TFZakaz.ToolButton5Click(Sender: TObject);

Продолжение приложения 1

begin DM.Tzakaz.post; end;

procedure TFZakaz.ToolButton6Click(Sender: TObject);

begin DM.Tzakaz.Delete; end;

procedure TFZakaz.ToolButton7Click(Sender: TObject);

var n:integer; begin DM.Tzakaz.Last; n:=DM.Tzakaz.FieldByName('nz').Value;

DM.Tzakaz.Append; DM.Tzakaz.FieldByName('nz').Value:=n+1;

FDobZakaz.show; end;

procedure TFZakaz.ToolButton1Click(Sender: TObject);

begin case a of 0:begin Height:=697; Panel1.Height:=201; Position:=poScreenCenter; a:=1; ToolButton1.ImageIndex:=9;

ToolButton1.hint:='Закрыть панель поиска' end;

1: begin DBGrid1.DataSource:= dm.DSZakaz; Height:=486; Panel1.Height:=0;

Position:=poScreenCenter; a:=0; ToolButton1.ImageIndex:=8;

ToolButton1.hint:='Открыть панель поиска'; Edit1.SetFocus; end; end;

end;

procedure TFZakaz.ToolButton8Click(Sender: TObject);

begin Fmain.Show; close; end;

procedure TFZakaz.FormActivate(Sender: TObject);

begin a:=0; end;

procedure TFZakaz.Edit1Change(Sender: TObject);

begin dm.QZakaz1.Close; dm.QZakaz1.Parameters[0].Value:=edit1.Text;

dm.QZakaz1.Open; DBGrid1.DataSource:= dm.DSQZakaz1; end; end.

unit UZapr;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Buttons, ExtCtrls, DBCtrls, Grids, DBGrids;

Type TForm1 = class(TForm)

DBGrid1: TDBGrid; DBNavigator1: TDBNavigator;

Продолжение приложения 1

SpeedButton2: TSpeedButton; SpeedButton4: TSpeedButton;

procedure SpeedButton4Click(Sender: TObject);

procedure SpeedButton2Click(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

var Form1: TForm1;

implementation

uses UDM;

{$R *.dfm}

procedure TForm1.SpeedButton4Click(Sender: TObject);

begin close; end;

procedure TForm1.SpeedButton2Click(Sender: TObject);

begin DM.QZapros.Close; DM.QZapros.Open; end;

end.

unit UDobTovar;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Buttons, ExtCtrls, StdCtrls, DBCtrls, Mask, BDE;

type

TFDobTov = class(TForm)

GroupBox1: TGroupBox; DBEdit3: TDBEdit; DBEdit5: TDBEdit;

DBEdit7: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit;

DBEdit1: TDBEdit; DBEdit2: TDBEdit; Label1: TLabel;

Label2: TLabel; Label3: TLabel; Label4: TLabel;

Edit1: TEdit; Label5: TLabel; Label6: TLabel;

Label7: TLabel; Label8: TLabel; Label9: TLabel;

DBComboBox1: TDBComboBox; Panel1: TPanel;

Продолжение приложения 1

Panel2: TPanel; SpeedButton1: TSpeedButton;

SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton;

SpeedButton4: TSpeedButton; DBEdit4: TDBEdit;

procedure SpeedButton1Click(Sender: TObject);

procedure SpeedButton2Click(Sender: TObject);

procedure SpeedButton3Click(Sender: TObject);

procedure SpeedButton4Click(Sender: TObject);

procedure FormActivate(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

var FDobTov: TFDobTov;

implementation

uses UDM, UTovar;

{$R *.dfm}

procedure TFDobTov.SpeedButton1Click(Sender: TObject);

begin

DBEdit4.Text:=floattostr(strtofloat(DBEdit3.Text)+(strtofloat(Edit1.text)/100)*strtofloat(DBEdit3.Text)); DM.Ttov.post; end;

procedure TFDobTov.SpeedButton2Click(Sender: TObject);

begin DM.Ttov.Append; end;

procedure TFDobTov.SpeedButton3Click(Sender: TObject);

begin DM.Ttov.Cancel; FTovar.Show; Close; end;

procedure TFDobTov.SpeedButton4Click(Sender: TObject);

begin FTovar.Show; Close; end;

procedure TFDobTov.FormActivate(Sender: TObject);

var n:integer; begin DM.Ttov.Last; n:=DM.Ttov.FieldByName('idn').Value;

DM.Ttov.Append; DM.Ttov.FieldByName('idn').Value:=n+1; end;

end.

Продолжение приложения 1

unit UInvVed1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Mask, DBCtrls, Buttons;

type

TFInvVed = class(TForm)

ComboBox1: TComboBox; Label1: TLabel; DBEdit1: TDBEdit;

SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton;

procedure FormActivate(Sender: TObject);

procedure ComboBox1Change(Sender: TObject);

procedure SpeedButton2Click(Sender: TObject);

procedure SpeedButton1Click(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

var FInvVed: TFInvVed;

implementation

uses UDM, URepIVed;

{$R *.dfm}

procedure TFInvVed.FormActivate(Sender: TObject);

begin DM.Tklad.First; while not DM.Tklad.Eof do begin

ComboBox1.Items.Add(DM.Tklad.FieldValues['fio']); DM.Tklad.next; end; end;

procedure TFInvVed.ComboBox1Change(Sender: TObject);

begin DM.Tklad.Locate('fio',ComboBox1.Text,[]); end;

procedure TFInvVed.SpeedButton2Click(Sender: TObject);

begin close; end;

procedure TFInvVed.SpeedButton1Click(Sender: TObject);

begin FRepIVed.QRLabel12.Caption:=DBEdit1.Text;

Продолжение приложения 1

FRepIVed.QRLabel13.Caption:=ComboBox1.Text;

FRepIVed.QuickRep1.Preview; end;

end.

ПРИЛОЖЕНИЕ 2

Образы экранов