begin
case key of
'0'..'9',#8: ;
#13 :edit6.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit5.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit6KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit7.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit6.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit7KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit8.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit7.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit8KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit9.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit8.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit9KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit10.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit9.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit10KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit11.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit10.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit11KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit12.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit11.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit12KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit13.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit12.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit13KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit14.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit13.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit14KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit15.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit14.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmIPN.Edit15KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :BitBtn1.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit15.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
end.
unit UnitModul;
interface
uses
SysUtils, Classes, DB, DBTables, RpCon, RpConDS, RpDefine, RpRave;
type
TDataModule1 = class(TDataModule)
TabAbout: TTable;
DataSource1: TDataSource;
TabAboutRNN: TStringField;
TabAboutKbartal: TSmallintField;
TabAboutGod: TIntegerField;
TabAboutFam: TStringField;
TabAboutName: TStringField;
TabAboutPar: TStringField;
TabAboutOKEDA: TStringField;
TabAboutOKEDB: TStringField;
TabAboutOKEDC: TStringField;
TabAboutUDBec1: TFloatField;
TabAboutUDBec2: TFloatField;
TabAboutUDBec3: TFloatField;
TabAboutBidRas1: TBooleanField;
TabAboutBidRas2: TBooleanField;
TabAboutBidRas3: TBooleanField;
TabAboutBidRas4: TBooleanField;
TabAboutBidRas5: TBooleanField;
TabAboutNomerUbed: TStringField;
TabAboutDataUbed: TDateField;
TabAboutNomerKontr: TStringField;
TabAboutDataZakKontr: TDateField;
TabAboutNalogRej: TStringField;
RvProject1: TRvProject;
RvDataSetConnection1: TRvDataSetConnection;
RvDataSetConnection2: TRvDataSetConnection;
TabIPN: TTable;
DataSource2: TDataSource;
TabIPNRNN: TStringField;
TabIPNR1A1: TFloatField;
TabIPNR1B1: TFloatField;
TabIPNR1C1: TFloatField;
TabIPNR1D1: TFloatField;
TabIPNR1E1: TFloatField;
TabIPNR1A2: TFloatField;
TabIPNR1B2: TFloatField;
TabIPNR1C2: TFloatField;
TabIPNR1A3: TFloatField;
TabIPNR1B3: TFloatField;
TabIPNR1C3: TFloatField;
TabIPNR1A4: TFloatField;
TabIPNR1B4: TFloatField;
TabIPNR1C4: TFloatField;
TabIPNR1A5: TFloatField;
TabIPNR1B5: TFloatField;
TabIPNR1C5: TFloatField;
TabIPNR1D2: TFloatField;
TabIPNR1E2: TFloatField;
TabIPNR1D3: TFloatField;
TabIPNR1E3: TFloatField;
TabIPNR1D4: TFloatField;
TabIPNR1E4: TFloatField;
TabIPNR1D5: TFloatField;
TabIPNR1E5: TFloatField;
TabOPB: TTable;
DataSource3: TDataSource;
TabOPBRNN: TStringField;
TabOPBR1A1: TFloatField;
TabOPBR1B1: TFloatField;
TabOPBR1C1: TFloatField;
TabOPBR1A2: TFloatField;
TabOPBR1B2: TFloatField;
TabOPBR1C2: TFloatField;
TabOPBR1D1: TFloatField;
TabOPBR1E1: TFloatField;
TabOPBR1D2: TFloatField;
TabOPBR1E2: TFloatField;
TabCO: TTable;
DataSource4: TDataSource;
TabCOR1D1: TFloatField;
TabCOR1E1: TFloatField;
TabCOR1D2: TFloatField;
TabCOR1E2: TFloatField;
TabCORNN: TStringField;
TabCOR1A1: TFloatField;
TabCOR1B1: TFloatField;
TabCOR1C1: TFloatField;
TabCOR1A2: TFloatField;
TabCOR1B2: TFloatField;
TabCOR1C2: TFloatField;
RvDataSetConnection3: TRvDataSetConnection;
RvDataSetConnection4: TRvDataSetConnection;
RvProject2: TRvProject;
RvDataSetConnection5: TRvDataSetConnection;
procedure TabIPNCalcFields(DataSet: TDataSet);
procedure TabOPBCalcFields(DataSet: TDataSet);
procedure TabCOCalcFields(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DataModule1: TDataModule1;
implementation
uses UnitMain, UnitObch, UnitIPN, UnitOPB, UnitCO;
{$R *.dfm}
procedure TDataModule1.TabIPNCalcFields(DataSet: TDataSet);
begin
TabIPNR1D1.Value:=TabIPNR1A1.Value+TabIPNR1B1.Value+TabIPNR1C1.Value;
TabIPNR1e1.Value:=TabIPNR1D1.Value;
TabIPNR1D2.Value:=TabIPNR1A2.Value+TabIPNR1B2.Value+TabIPNR1C2.Value;
TabIPNR1e2.Value:=TabIPNR1D2.Value;
TabIPNR1D3.Value:=TabIPNR1A3.Value+TabIPNR1B3.Value+TabIPNR1C3.Value;
TabIPNR1e3.Value:=TabIPNR1D3.Value;
TabIPNR1D4.Value:=TabIPNR1A4.Value+TabIPNR1B4.Value+TabIPNR1C4.Value;
TabIPNR1e4.Value:=TabIPNR1D4.Value;
TabIPNR1D5.Value:=TabIPNR1A5.Value+TabIPNR1B5.Value+TabIPNR1C5.Value;
TabIPNR1e5.Value:=TabIPNR1D5.Value;
end;
procedure TDataModule1.TabOPBCalcFields(DataSet: TDataSet);
begin
TabOPBR1D1.Value:=TabOPBR1A1.Value+TabOPBR1B1.Value+TabOPBR1C1.Value;
TabOPBR1e1.Value:=TabOPBR1D1.Value;
TabOPBR1D2.Value:=TabOPBR1A2.Value+TabOPBR1B2.Value+TabOPBR1C2.Value;
TabOPBR1e2.Value:=TabOPBR1D2.Value;
end;
procedure TDataModule1.TabCOCalcFields(DataSet: TDataSet);
begin
TabCOR1D1.Value:=TabCOR1A1.Value+TabCOR1B1.Value+TabCOR1C1.Value;
TabCOR1e1.Value:=TabCOR1D1.Value;
TabCOR1D2.Value:=TabCOR1A2.Value+TabCOR1B2.Value+TabCOR1C2.Value;
TabCOR1e2.Value:=TabCOR1D2.Value;
end;
end.
unit UnitObch;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, Buttons, ExtCtrls;
type
TFrmObch = class(TForm)
Label1: TLabel;
DBEdit1: TDBEdit;
Label4: TLabel;
Label2: TLabel;
DBEdit2: TDBEdit;
Label5: TLabel;
Label3: TLabel;
DBEdit3: TDBEdit;
GroupBox1: TGroupBox;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
GroupBox2: TGroupBox;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit9: TDBEdit;
GroupBox3: TGroupBox;
DBCheckBox1: TDBCheckBox;
DBCheckBox2: TDBCheckBox;
DBCheckBox3: TDBCheckBox;
DBCheckBox4: TDBCheckBox;
DBCheckBox5: TDBCheckBox;
GroupBox4: TGroupBox;
Label12: TLabel;
Label13: TLabel;
DBEdit10: TDBEdit;
DBEdit11: TDBEdit;
Label14: TLabel;
DBEdit12: TDBEdit;
Label15: TLabel;
DBEdit13: TDBEdit;
Label16: TLabel;
DBEdit14: TDBEdit;
Panel2: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmObch: TFrmObch;
implementation
uses UnitMain, UnitModul;
{$R *.dfm}
procedure TFrmObch.SpeedButton1Click(Sender: TObject);
begin
DataModule1.TabAbout.Append;
end;
procedure TFrmObch.SpeedButton2Click(Sender: TObject);
begin
DataModule1.TabAbout.First;
end;
procedure TFrmObch.SpeedButton3Click(Sender: TObject);
begin
DataModule1.TabAbout.Prior;
end;
procedure TFrmObch.SpeedButton4Click(Sender: TObject);
begin
DataModule1.TabAbout.Next;
end;
procedure TFrmObch.SpeedButton6Click(Sender: TObject);
begin
DataModule1.TabAbout.last;
end;
procedure TFrmObch.SpeedButton7Click(Sender: TObject);
begin
DataModule1.TabAbout.Edit;
DataModule1.TabAbout.Post;
end;
procedure TFrmObch.SpeedButton5Click(Sender: TObject);
begin
DataModule1.TabAbout.Delete;
end;
procedure TFrmObch.FormCreate(Sender: TObject);
begin
DataModule1.TabAbout.Active:=true;
end;
procedure TFrmObch.FormDestroy(Sender: TObject);
begin
DataModule1.TabAbout.Close;
FrmObch:=nil;
end;
procedure TFrmObch.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
end.
unit UnitOPB;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, ExtCtrls, StdCtrls, Buttons;
type
TFrmOPB = class(TForm)
Panel1: TPanel;
DBGrid1: TDBGrid;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Label13: TLabel;
ComboBox1: TComboBox;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Edit2KeyPress(Sender: TObject; var Key: Char);
procedure Edit3KeyPress(Sender: TObject; var Key: Char);
procedure Edit4KeyPress(Sender: TObject; var Key: Char);
procedure Edit5KeyPress(Sender: TObject; var Key: Char);
procedure Edit6KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmOPB: TFrmOPB;
implementation
uses UnitMain, UnitModul;
{$R *.dfm}
procedure TFrmOPB.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;
end;
procedure TFrmOPB.FormCreate(Sender: TObject);
begin
DataModule1.TabAbout.Open;
DataModule1.TabAbout.First;
ComboBox1.Clear;
while not (DataModule1.TabAbout.Eof) do
begin
ComboBox1.Items.Add(DataModule1.TabAboutRNN.Value);
DataModule1.TabAbout.Next;
end;
DataModule1.TabAbout.close;
DataModule1.TabOPB.Open;
end;
procedure TFrmOPB.FormDestroy(Sender: TObject);
begin
DataModule1.TabOPB.close;
FrmOPB:=nil;
end;
procedure TFrmOPB.BitBtn1Click(Sender: TObject);
begin
DataModule1.TabOPB.Append;
DataModule1.TabOPB.FieldByName('RNN').AsString:=ComboBox1.Text;
DataModule1.Tabopb.FieldByName('r1a1').AsString:=Edit1.Text;
DataModule1.TabOPB.FieldByName('r1b1').AsString:=Edit2.Text;
DataModule1.TabOPB.FieldByName('r1c1').AsString:=Edit3.Text;
DataModule1.TabOPB.FieldByName('r1a2').AsString:=Edit4.Text;
DataModule1.TabOPB.FieldByName('r1b2').AsString:=Edit5.Text;
DataModule1.TabOPB.FieldByName('r1c2').AsString:=Edit6.Text;
DataModule1.TabOPB.Post;
end;
procedure TFrmOPB.BitBtn2Click(Sender: TObject);
begin
DataModule1.TabOPB.Delete;
end;
procedure TFrmOPB.BitBtn3Click(Sender: TObject);
begin
DataModule1.TabOPB.Edit;
DataModule1.TabOPB.Post;
end;
procedure TFrmOPB.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit2.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit1.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmOPB.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit3.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit2.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmOPB.Edit3KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit4.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit3.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmOPB.Edit4KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit5.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit4.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmOPB.Edit5KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :edit6.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit5.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
procedure TFrmOPB.Edit6KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8: ;
#13 :BitBtn1.SetFocus;
'.',',': begin
key:=DecimalSeparator;
if pos(DecimalSeparator,Edit6.Text)<>0 then key:=char(0);
end;
else key:=char(0);
end;
end;
end.
unit UnitPass;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons;
type
TPasswordDlg = class(TForm)
Label1: TLabel;
Password: TEdit;
OKBtn: TButton;
CancelBtn: TButton;
procedure OKBtnClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PasswordDlg: TPasswordDlg;
implementation
uses UnitMain;
{$R *.dfm}
procedure TPasswordDlg.OKBtnClick(Sender: TObject);
begin
if Password.Text='111' then begin
FrmMain.N5.Visible:=true;
FrmMain.N10.Visible:=true;
FrmMain.N2.Visible:=false;
FrmMain.SpeedButton1.Enabled:=true;
FrmMain.SpeedButton2.Enabled:=true;
FrmMain.SpeedButton3.Enabled:=true;
FrmMain.SpeedButton4.Enabled:=true;
FrmMain.SpeedButton5.Enabled:=true;
FrmMain.SpeedButton6.Enabled:=true;
end;
end;
end.
Қосымша 2
Достарыңызбен бөлісу: |