Автоматизированная обработка информации с использованием средств связи и оргтехники

Обзор и анализ существующих информационных систем. Особенность проектирования программного обеспечения. Изучение основного назначения автоматизированного рабочего места "Гражданско-правовые сделки". Логическая и физическая структура файловой системы.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 18.09.2018
Размер файла 2,3 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

end;

procedure TFrmNSI.Edit8KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit8.Text='' then

begin

ShowMessage('Пустое поле');

Edit8.SetFocus;

end

else Edit9.SetFocus;

end;

end;

procedure TFrmNSI.Edit9KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit9.Text='' then

begin

ShowMessage('Пустое поле');

Edit9.SetFocus;

end

else Edit10.SetFocus;

end;

end;

procedure TFrmNSI.Edit10KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit10.Text='' then

begin

ShowMessage('Пустое поле');

Edit10.SetFocus;

end else Edit11.SetFocus;

end;

end;

procedure TFrmNSI.Edit11KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit11.Text='' then

begin

ShowMessage('Пустое поле');

Edit11.SetFocus;

end

else Edit12.SetFocus;

end;

end;

procedure TFrmNSI.Edit12KeyPress(Sender: TObject; var Key: Char);

begin

If Key=#13 then

begin

Key:=#0;

If Edit12.Text='' then

begin

ShowMessage('Пустое поле');

Edit12.SetFocus;

end else Edit13.SetFocus;

end;

end;

procedure TFrmNSI.Edit13KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit13.Text='' then

begin

ShowMessage('Пустое поле');

Edit13.SetFocus;

end else Edit14.SetFocus;

end;

end;

procedure TFrmNSI.Edit14KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit14.Text='' then

begin

ShowMessage('Пустое поле');

Edit14.SetFocus;

end else P2.SetFocus;

end;

end;

procedure TFrmNSI.BtnEdPrClick(Sender: TObject);

begin

PSPr.Show; Edit23.Text:=''; Edit24.Text:='';

Edit25.Text:=''; Edit26.Text:=''; Edit27.Text:='';

Edit23.SetFocus;

end;

procedure TFrmNSI.Edit23KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit24.SetFocus;

end;

end;

procedure TFrmNSI.Edit24KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit25.SetFocus;

end;

end;

procedure TFrmNSI.Edit25KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit26.SetFocus;

end;

end;

procedure TFrmNSI.Edit26KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit27.SetFocus;

end;

end;

procedure TFrmNSI.Edit27KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

PSPr.SetFocus;

end;

end;

procedure TFrmNSI.BtnSPrClick(Sender: TObject);

begin

Edit1.Enabled:=true; Edit2.Enabled:=true; Edit3.Enabled:=true;

Edit4.Enabled:=true; Edit5.Enabled:=true; Edit6.Enabled:=true;

Edit7.Enabled:=true; Edit8.Enabled:=true; Edit9.Enabled:=true;

Edit10.Enabled:=true; Edit11.Enabled:=true; Edit12.Enabled:=true;

Edit13.Enabled:=true; Edit14.Enabled:=true; Edit28.Enabled:=true;

Edit28.Show;

DMTable.DMRGP.TabPredpr.Open;

DMTable.DMRGP.TabPredpr.Edit;

If Edit23.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Text:='Select * from TblPredpr where KodPr="'+Edit23.Text+'"';

DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такое предприятие отсутствует')

else

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Edit8.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:='';

Edit1.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit2.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit3.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit4.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit5.Text:=DMRGP.QData.Fields.Fields[4].AsString;

Edit6.Text:=DMRGP.QData.Fields.Fields[5].AsString;

Edit7.Text:=DMRGP.QData.Fields.Fields[6].AsString;

Edit8.Text:=DMRGP.QData.Fields.Fields[7].AsString;

Edit9.Text:=DMRGP.QData.Fields.Fields[8].AsString;

Edit10.Text:=DMRGP.QData.Fields.Fields[9].AsString;

Edit11.Text:=DMRGP.QData.Fields.Fields[10].AsString;

Edit12.Text:=DMRGP.QData.Fields.Fields[11].AsString;

Edit13.Text:=DMRGP.QData.Fields.Fields[12].AsString;

Edit14.Text:=DMRGP.QData.Fields.Fields[13].AsString;

Edit28.Text:=DMRGP.QData.Fields.Fields[14].AsString;

DE1.Date:=StrToDate(DMRGP.QData.Fields.Fields[14].AsString;

PSPr.Hide; Exit;

DE1.Text:='!!!!';

end;

end

else

if Edit24.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Text:='Select * FROM TblPredpr WHERE KNPr="'+Edit24.Text+'"';

DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такое предприятие отсутствует')

else

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Edit8.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:='';

Edit1.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit2.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit3.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit4.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit5.Text:=DMRGP.QData.Fields.Fields[4].AsString;

Edit6.Text:=DMRGP.QData.Fields.Fields[5].AsString;

Edit7.Text:=DMRGP.QData.Fields.Fields[6].AsString;

Edit8.Text:=DMRGP.QData.Fields.Fields[7].AsString;

Edit9.Text:=DMRGP.QData.Fields.Fields[8].AsString;

Edit10.Text:=DMRGP.QData.Fields.Fields[9].AsString;

Edit11.Text:=DMRGP.QData.Fields.Fields[10].AsString;

Edit12.Text:=DMRGP.QData.Fields.Fields[11].AsString

Edit13.Text:=DMRGP.QData.Fields.Fields[12].AsString;

Edit14.Text:=DMRGP.QData.Fields.Fields[13].AsString;

Edit28.Text:=DMRGP.QData.Fields.Fields[14].AsString;

PSPr.Hide;

end;

end

else

if Edit25.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Text:='Select * from TblPredpr where PNPr="'+Edit25.Text+'"';

DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такое предприятие отсутствует')

else

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Edit8.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:='';

Edit1.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit2.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit3.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit4.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit5.Text:=DMRGP.QData.Fields.Fields[4].AsString;

Edit6.Text:=DMRGP.QData.Fields.Fields[5].AsString;

Edit7.Text:=DMRGP.QData.Fields.Fields[6].AsString;

Edit8.Text:=DMRGP.QData.Fields.Fields[7].AsString;

Edit9.Text:=DMRGP.QData.Fields.Fields[8].AsString;

Edit10.Text:=DMRGP.QData.Fields.Fields[9].AsString;

Edit11.Text:=DMRGP.QData.Fields.Fields[10].AsString;

Edit12.Text:=DMRGP.QData.Fields.Fields[11].AsString;

Edit13.Text:=DMRGP.QData.Fields.Fields[12].AsString;

Edit14.Text:=DMRGP.QData.Fields.Fields[13].AsString;

Edit28.Text:=DMRGP.QData.Fields.Fields[14].AsString;

PSPr.Hide;

end;

end

else

if Edit26.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Text:='Select * from TblPredpr where RNNPr="'+Edit26.Text+'"';

DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такое предприятие отсутствует')

else

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Edit8.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:='';

Edit1.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit2.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit3.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit4.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit5.Text:=DMRGP.QData.Fields.Fields[4].AsString;

Edit6.Text:=DMRGP.QData.Fields.Fields[5].AsString;

Edit7.Text:=DMRGP.QData.Fields.Fields[6].AsString;

Edit8.Text:=DMRGP.QData.Fields.Fields[7].AsString;

Edit9.Text:=DMRGP.QData.Fields.Fields[8].AsString;

Edit10.Text:=DMRGP.QData.Fields.Fields[9].AsString;

Edit11.Text:=DMRGP.QData.Fields.Fields[10].AsString;

Edit12.Text:=DMRGP.QData.Fields.Fields[11].AsString;

Edit13.Text:=DMRGP.QData.Fields.Fields[12].AsString;

Edit14.Text:=DMRGP.QData.Fields.Fields[13].AsString;

Edit28.Text:=DMRGP.QData.Fields.Fields[14].AsString;

PSPr.Hide;

end;

end else

if Edit27.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Clear;

DMRGP.QData.SQL.Text:='Select * from TblPredpr where RSPr="'+Edit27.Text+'"';

DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такое предприятие отсутствует')

else

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Edit8.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:='';

Edit1.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit2.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit3.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit4.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit5.Text:=DMRGP.QData.Fields.Fields[4].AsString;

Edit6.Text:=DMRGP.QData.Fields.Fields[5].AsString;

Edit7.Text:=DMRGP.QData.Fields.Fields[6].AsString;

Edit8.Text:=DMRGP.QData.Fields.Fields[7].AsString;

Edit9.Text:=DMRGP.QData.Fields.Fields[8].AsString;

Edit10.Text:=DMRGP.QData.Fields.Fields[9].AsString;

Edit11.Text:=DMRGP.QData.Fields.Fields[10].AsString;

Edit12.Text:=DMRGP.QData.Fields.Fields[11].AsString;

Edit13.Text:=DMRGP.QData.Fields.Fields[12].AsString;

Edit14.Text:=DMRGP.QData.Fields.Fields[13].AsString;

Edit28.Text:=DMRGP.QData.Fields.Fields[14].AsString;

PSPr.Hide;

end;

end;

end;

procedure TFrmNSI.BtnPClick(Sender: TObject);

begin

PSPr.Hide;

end;

procedure TFrmNSI.BtnSavePrClick(Sender: TObject);

begin

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

DMRGP.TabPredpr.Append;

DMRGP.TabPredpr.FieldByName('KodPr').AsString:=Edit1.Text;

DMRGP.TabPredpr.FieldByName('KodGPr').AsString:=Edit2.Text;

DMRGP.TabPredpr.FieldByName('KodOblast').AsString:=Edit3.Text;

DMRGP.TabPredpr.FieldByName('KodOblastF').AsString:=Edit4.Text;

DMRGP.TabPredpr.FieldByName('KodRaon').AsString:=Edit5.Text;

DMRGP.TabPredpr.FieldByName('KNPr').AsString:=Edit6.Text;

DMRGP.TabPredpr.FieldByName('PNPr').AsString:=Edit7.Text;

DMRGP.TabPredpr.FieldByName('RNNPr').AsString:=Edit8.Text;

DMRGP.TabPredpr.FieldByName('AdrPr').AsString:=Edit9.Text;

DMRGP.TabPredpr.FieldByName('BankPr').AsString:=Edit10.Text;

DMRGP.TabPredpr.FieldByName('RSPr').AsString:=Edit11.Text;

DMRGP.TabPredpr.FieldByName('KodBank').AsString:=Edit12.Text;

DMRGP.TabPredpr.FieldByName('FIORukPr').AsString:=Edit13.Text;

DMRGP.TabPredpr.FieldByName('FIOGBux').AsString:=Edit14.Text;

DMRGP.TabPredpr.FieldByName('DataR').AsString:=DE1.Text;

DMRGP.TabPredpr.Post; //DMRGP.TabPredpr.Close;

end;

procedure TFrmNSI.Edit18KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit19.SetFocus;

end;

end;

procedure TFrmNSI.Edit19KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit20.SetFocus;

end;

end;

procedure TFrmNSI.Edit20KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit21.SetFocus;

end;

end;

procedure TFrmNSI.Edit21KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit22.SetFocus;

end;

end;

procedure TFrmNSI.Edit22KeyPress(Sender: TObject; var Key: Char);

begin

If Key=#13 then

begin

Key:=#0;

P2.SetFocus;

end;

end;

procedure TFrmNSI.TSBankShow(Sender: TObject);

begin

Edit18.Text:=''; Edit19.Text:=''; Edit20.Text:='';

Edit21.Text:=''; Edit22.Text:='';

end;

procedure TFrmNSI.BtnNBClick(Sender: TObject);

begin

Edit18.Text:=''; Edit19.Text:=''; Edit20.Text:='';

Edit21.Text:=''; Edit22.Text:=''; Edit18.SetFocus;

end;

procedure TFrmNSI.LbSpeedButton5Click(Sender: TObject);

begin

PB.Hide;

end;

procedure TFrmNSI.BtnPBClick(Sender: TObject);

begin

PB.Show; Edit29.Text:=''; Edit30.Text:=''; Edit29.SetFocus;

end;

procedure TFrmNSI.Edit29KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit30.SetFocus;

end;

end;

procedure TFrmNSI.BtnSPBClick(Sender: TObject);

begin

DMRGP.TabBank.Open;

If Edit29.Text<>'' then

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Clear; DMRGP.QData.SQL.Text:='Select * from TblBank where KodB="'+Edit29.Text+'"';

DMRGP.QData.ExecSQL; DMRGP.QData.Open;

If DMRGP.QData.RecordCount>0 then

begin

Edit18.Text:=''; Edit19.Text:=''; Edit20.Text:=''; Edit21.Text:=''; Edit22.Text:='';

Edit18.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit19.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit20.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit21.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit22.Text:=DMRGP.QData.Fields.Fields[4].AsString;

PB.Hide;

end else ShowMessage('Такой банк отсутствует');

end else

If Edit30.Text<>'' then

begin

DMRGP.QData.Close; DMRGP.QData.SQL.Text:='Select * from TblBank where NameB="'+Edit30.Text+'"';

DMRGP.QData.ExecSQL; DMRGP.QData.Open;

If DMRGP.QData.RecordCount=0 then

ShowMessage('Такой банк отсутствует')

else begin

Edit18.Text:=''; Edit19.Text:=''; Edit20.Text:=''; Edit21.Text:=''; Edit22.Text:='';

Edit18.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit19.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit20.Text:=DMRGP.QData.Fields.Fields[2].AsString;

Edit21.Text:=DMRGP.QData.Fields.Fields[3].AsString;

Edit22.Text:=DMRGP.QData.Fields.Fields[4].AsString;

PB.Hide;

end;

end;

end;

procedure TFrmNSI.Edit30KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0;

P2.SetFocus; end; end;

procedure TFrmNSI.BtnSBClick(Sender: TObject);

begin

DMRGP.TabBank.Open;

DMRGP.TabBank.Last;

DMRGP.TabBank.Append;

DMRGP.TabBank.FieldByName('KodB').AsString:=Edit18.Text;

DMRGP.TabBank.FieldByName('PindB').AsString:=Edit19.Text;

DMRGP.TabBank.FieldByName('NameB').AsString:=Edit20.Text;

DMRGP.TabBank.FieldByName('AdresB').AsString:=Edit21.Text;

DMRGP.TabBank.FieldByName('FIORukB').AsString:=Edit22.Text;

DMRGP.TabBank.Post; //DMRGP.TabPredpr.Close;

end;

procedure TFrmNSI.TSRegionShow(Sender: TObject);

begin

Edit15.Text:=''; Edit16.Text:=''; Edit17.Text:=''; Edit15.SetFocus;

CBR.Clear;

end;

procedure TFrmNSI.Edit15KeyPress(Sender: TObject; var Key: Char);

begin

If Key=#13 then

begin

Key:=#0;

Edit16.SetFocus;

end;

end;

procedure TFrmNSI.Edit16KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

Edit17.SetFocus;

end; end;

procedure TFrmNSI.Edit17KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

P2.SetFocus;

end; end;

procedure TFrmNSI.BtnERClick(Sender: TObject);

begin

DMRGP.TabRegion.Open; DMRGP.TabRegion.First;

For i:=0 to DMRGP.TabRegion.RecordCount-1 do

begin

CBR.Items.Add(DMRGP.TabRegion.FieldByName('NameRaon').AsString);

DMRGP.TabRegion.Next;

end;

CBR.SetFocus; CBR.DroppedDown:=true;

end;

procedure TFrmNSI.CBRClick(Sender: TObject);

begin

DMRGP.QData.Close;

DMRGP.QData.SQL.Text:='Select * FROM TblRegion WHERE NameRaon="'+CBR.Text+'"';

DMRGP.QData.ExecSQL; DMRGP.QData.Open;

Edit15.Text:=''; Edit16.Text:=''; Edit17.Text:='';

Edit15.Text:=DMRGP.QData.Fields.Fields[0].AsString;

Edit16.Text:=DMRGP.QData.Fields.Fields[1].AsString;

Edit17.Text:=DMRGP.QData.Fields.Fields[2].AsString;

end;

procedure TFrmNSI.BtnSRClick(Sender: TObject);

begin

DMRGP.TabRegion.Open;

DMRGP.TabRegion.Append;

DMRGP.TabRegion.FieldByName('KodObl').AsString:=Edit15.Text;

DMRGP.TabRegion.FieldByName('KodRaon').AsString:=Edit16.Text;

DMRGP.TabRegion.FieldByName('NameRaon').AsString:=Edit17.Text;

DMRGP.TabRegion.Post; //DMRGP.TabPredpr.Close;

end;

procedure TFrmNSI.BtnNRClick(Sender: TObject);

begin

Edit15.Text:=''; Edit16.Text:=''; Edit17.Text:='';

Edit15.SetFocus;

end;

procedure TFrmNSI.BtnCloseClick(Sender: TObject);

begin

FrmNSI.Close;

FrmStart.Show;

end;

procedure TFrmNSI.BtnPrPrClick(Sender: TObject);

begin

TRY

FormPrintPr.NRepPr.PreviewModal;

finally

FormPrintPr.Free;end;

end;

procedure TFrmNSI.DE1Change(Sender: TObject);

begin Edit3.SetFocus;

end; end.

Модуль ProgSmeta

unit ProgSmeta;

interface

uses

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

Dialogs, StdCtrls, dxCntner, dxEditor, dxExEdtr, dxEdLib, LbSpeedButton,

CHAdvancedLabel, ExtCtrls;

type

TFrmSmeta = class(TForm)

Panel3: TPanel;

Label3: TCHAdvancedLabel;

BtnClose: TLbSpeedButton;

P2: TPanel;

CHAdvancedLabel1: TCHAdvancedLabel;

Panel1: TPanel;

Label1: TLabel;

BtnNS: TLbSpeedButton;

BtnES: TLbSpeedButton;

Label2: TLabel;

Label4: TLabel;

Label7: TLabel;

Label9: TLabel;

Label15: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Edit4: TEdit;

Edit6: TEdit;

Edit7: TEdit;

CBKPr: TComboBox;

Edit3: TEdit;

Label11: TLabel;

Edit5: TEdit;

Label13: TLabel;

Panel2: TPanel;

Label12: TLabel;

Label14: TLabel;

Label16: TLabel;

Label6: TLabel;

CBAdm: TComboBox;

CBProg: TComboBox;

CBPProg: TComboBox;

CBSpec: TComboBox;

Edit9: TEdit;

Edit10: TEdit;

Edit11: TEdit;

Edit12: TEdit;

Panel4: TPanel;

Label20: TLabel;

CBNumStr: TComboBox;

Edit13: TEdit;

Edit14: TEdit;

Edit15: TEdit;

Edit16: TEdit;

Label5: TLabel;

Label8: TLabel;

Label10: TLabel;

BtnPrintSm: TLbSpeedButton;

BtnSSm: TLbSpeedButton;

procedure BtnCloseClick(Sender: TObject);

procedure FormShow(Sender: TObject);

procedure CBKPrClick(Sender: TObject);

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);

procedure Edit7KeyPress(Sender: TObject; var Key: Char);

procedure CBAdmClick(Sender: TObject);

procedure CBProgClick(Sender: TObject);

procedure CBPProgClick(Sender: TObject);

procedure CBSpecClick(Sender: TObject);

procedure Edit13KeyPress(Sender: TObject; var Key: Char);

procedure Edit14KeyPress(Sender: TObject; var Key: Char);

procedure Edit15KeyPress(Sender: TObject; var Key: Char);

procedure CBNumStrClick(Sender: TObject);

procedure BtnNSClick(Sender: TObject);

procedure BtnESClick(Sender: TObject);

procedure BtnPrintSmClick(Sender: TObject);

procedure BtnSSmClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var FrmSmeta: TFrmSmeta; i,ISmeta, US:integer;

implementation

uses ProgStart, DMTable, ProgPrintSm;

{$R *.dfm}

procedure TFrmSmeta.BtnCloseClick(Sender: TObject);

begin

FrmSmeta.Hide;

FrmStart.Show;

end;

procedure TFrmSmeta.FormShow(Sender: TObject);

begin

ISmeta:=0;

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:='';

Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:='';

Edit9.Text:=''; Edit10.Text:=''; Edit11.Text:=''; Edit12.Text:='';

Edit13.Text:=''; Edit14.Text:=''; Edit15.Text:=''; Edit16.Text:='';

CBAdm.ItemIndex:=-1; CBProg.ItemIndex:=-1; CBPProg.ItemIndex:=-1;

CBSpec.ItemIndex:=-1; CBNumStr.ItemIndex:=-1; CBKPr.ItemIndex:=-1;

CBKPr.SetFocus;

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

For i:=0 TO DMRGP.TabPredpr.RecordCount-1 do

begin

CBKPr.Items.Add(DMRGP.TabPredpr.FieldByName('KodPr').AsString);

DMRGP.TabPredpr.Next;

end;

end;

procedure TFrmSmeta.CBKPrClick(Sender: TObject);

begin

IF ISmeta<>0 then

US:=0;

If ISmeta=0 then

begin

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

If DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]) then

begin

ShowMessage('Смета у этого предприятия уже существует.');

Edit1.Text:=''; CBKPr.ItemIndex:=-1; Panel1.SetFocus; exit;

end else

begin

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

DMRGP.TabPredpr.Locate('KodPr',CBKPr.Text,[]);

Edit1.Text:=DMRGP.TabPredpr.FieldByName('PNPr').AsString;

Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:='';

Edit6.Text:=''; Edit7.Text:=''; Edit9.Text:=''; Edit10.Text:='';

Edit11.Text:=''; Edit12.Text:=''; Edit13.Text:=''; Edit14.Text:='';

Edit15.Text:=''; Edit16.Text:=''; CBAdm.ItemIndex:=-1;

CBProg.ItemIndex:=-1; CBPProg.ItemIndex:=-1; CBSpec.ItemIndex:=-1;

CBNumStr.ItemIndex:=-1; Edit2.Text:=''; Edit2.SetFocus;

end; end else

begin

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]);

If DMRGP.TabSmeta.FieldByName('US').AsInteger=1 then

begin

ShowMessage('Смета у этого предприятия уже утверждена. Исправление невозможно.');

Edit1.Text:=''; CBKPr.ItemIndex:=-1;

Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:='';

Edit6.Text:=''; Edit7.Text:=''; Edit9.Text:=''; Edit10.Text:='';

Edit11.Text:=''; Edit12.Text:=''; Edit13.Text:=''; Edit14.Text:='';

Edit15.Text:=''; Edit16.Text:=''; CBAdm.ItemIndex:=-1;

CBProg.ItemIndex:=-1; CBPProg.ItemIndex:=-1; CBSpec.ItemIndex:=-1;

CBNumStr.ItemIndex:=-1; Edit2.Text:=''; Edit2.SetFocus;

Panel1.SetFocus;

end else

begin

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

DMRGP.TabPredpr.Locate('KodPr',CBKPr.Text,[]);

Edit1.Text:=DMRGP.TabPredpr.FieldByName('PNPr').AsString;

Edit2.Text:=DMRGP.TabSmeta.FieldByName('VGZ1').AsString;

Edit3.Text:=DMRGP.TabSmeta.FieldByName('VGZ1V').AsString;

Edit4.Text:=DMRGP.TabSmeta.FieldByName('V140_260').AsString;

Edit5.Text:=DMRGP.TabSmeta.FieldByName('V140_260V').AsString;

Edit6.Text:=DMRGP.TabSmeta.FieldByName('GZGR5').AsString;

Edit7.Text:=DMRGP.TabSmeta.FieldByName('GZGR5V').AsString;

CBAdm.Text:=DMRGP.TabSmeta.FieldByName('KAdmin').AsString;

Edit9.Text:=DMRGP.TabSmeta.FieldByName('Admin').AsString;

CBProg.Text:=DMRGP.TabSmeta.FieldByName('KProg').AsString;

Edit10.Text:=DMRGP.TabSmeta.FieldByName('Prog').AsString;

CBPProg.Text:=DMRGP.TabSmeta.FieldByName('KPProg').AsString;

Edit11.Text:=DMRGP.TabSmeta.FieldByName('PProg').AsString;

Edit12.Text:=DMRGP.TabSmeta.FieldByName('Spec').AsString;

Edit13.Text:=DMRGP.TabSmeta.FieldByName('VGZKBK').AsString;

Edit14.Text:=DMRGP.TabSmeta.FieldByName('VGZKBK140_260').AsString;

Edit15.Text:=DMRGP.TabSmeta.FieldByName('VGZKBKV').AsString;

CBNumStr.Text:=DMRGP.TabSmeta.FieldByName('KNumStr').AsString;

Edit16.Text:=DMRGP.TabSmeta.FieldByName('NumStr').AsString;

Edit2.SetFocus; Exit;

end; end;

ISmeta:=0;

end;

procedure TFrmSmeta.Edit2KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0;

If Edit2.Text='' then begin

ShowMessage('Пустое поле');

Edit2.SetFocus;

end else Edit3.SetFocus;

end; end;

procedure TFrmSmeta.Edit3KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0;

If Edit3.Text='' then

begin ShowMessage('Пустое поле');

Edit3.SetFocus;

end else Edit4.SetFocus;

end; end;

procedure TFrmSmeta.Edit4KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit4.Text='' then

begin

ShowMessage('Пустое поле'); Edit4.SetFocus;

end else

begin

if StrToFloat(Edit4.Text)>StrToFloat(Edit2.Text) then

begin

ShowMessage('Сумма введена неправильно'); Edit4.Text:=''; Edit4.SetFocus;

end else

Edit5.SetFocus; end; end; end;

procedure TFrmSmeta.Edit5KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0;

If Edit5.Text='' then begin

ShowMessage('Пустое поле');

Edit5.SetFocus;

end else Edit6.SetFocus; end;

end;

procedure TFrmSmeta.Edit6KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit6.Text='' then

begin

ShowMessage('Пустое поле');

Edit6.SetFocus;

end else

begin

if StrToFloat(Edit6.Text)>StrToFloat(Edit4.Text) then

begin

ShowMessage('Сумма введена неправильно'); Edit6.Text:=''; Edit6.SetFocus;

end else

Edit7.SetFocus;

end; end; end;

procedure TFrmSmeta.Edit7KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin Key:=#0;

if Edit7.Text='' then

begin

ShowMessage('Пустое поле');

Edit7.SetFocus;

end else begin

DMRGP.TabAdmin.Open; DMRGP.TabAdmin.First;

For i:=0 to DMRGP.TabAdmin.RecordCount-1 do

begin

CBAdm.Items.Add(DMRGP.TabAdmin.FieldByName('KodDep').AsString);

DMRGP.TabAdmin.Next;

end;

CBAdm.SetFocus; //CBAdm.DroppedDown:=True;

end; end; end;

procedure TFrmSmeta.CBAdmClick(Sender: TObject);

begin

DMRGP.TabAdmin.Open; DMRGP.TabAdmin.First;

DMRGP.TabAdmin.Locate('KodDep',CBAdm.Text,[]);

Edit9.Text:=DMRGP.TabAdmin.FieldByName('NameDep').AsString;

DMRGP.TabProg.Open; DMRGP.TabProg.First;

For i:=0 to DMRGP.TabProg.RecordCount-1 do

begin

CBProg.Items.Add(DMRGP.TabProg.FieldByName('KodProg').AsString);

DMRGP.TabProg.Next;

end;

CBProg.SetFocus;

end;

procedure TFrmSmeta.CBProgClick(Sender: TObject);

begin

DMRGP.TabProg.Open; DMRGP.TabProg.First;

DMRGP.TabProg.Locate('KodProg',CBProg.Text,[]);

Edit10.Text:=DMRGP.TabProg.FieldByName('NameProg').AsString;

DMRGP.TabSubProg.Open; DMRGP.TabSubProg.First;

For i:=0 to DMRGP.TabSubProg.RecordCount-1 do

begin

CBPProg.Items.Add(DMRGP.TabSubProg.FieldByName('KodSubP').AsString);

DMRGP.TabSubProg.Next;

end; CBPProg.SetFocus;

end;

procedure TFrmSmeta.CBPProgClick(Sender: TObject);

begin

DMRGP.TabSubProg.Open; DMRGP.TabSubProg.First;

DMRGP.TabSubProg.Locate('KodSubP',CBPProg.Text,[]);

Edit11.Text:=DMRGP.TabSubProg.FieldByName('NameSubPr').AsString;

Edit13.SetFocus;

end;

{ procedure TFrmSmeta.CBSpecClick(Sender: TObject);

begin

Edit13.SetFocus;

end; }

procedure TFrmSmeta.Edit13KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0;

If Edit13.Text='' then

begin

ShowMessage('Пустое поле');

Edit13.SetFocus;

End else Edit14.SetFocus; end; end;

procedure TFrmSmeta.Edit14KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit14.Text='' then

begin

ShowMessage('Пустое поле');

Edit14.SetFocus;

end else Edit15.SetFocus; end; end;

procedure TFrmSmeta.Edit15KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0;

If Edit15.Text='' then

begin

ShowMessage('Пустое поле');

Edit15.SetFocus;

end else

begin

DMRGP.TabNumStr.Open; DMRGP.TabNumStr.First;

For i:=0 to DMRGP.TabNumStr.RecordCount-1 do

begin CBNumStr.Items.Add(DMRGP.TabNumStr.FieldByName('KNumStr').AsString);

DMRGP.TabNumStr.Next;

end;

CBNumStr.SetFocus; end;

end; end;

procedure TFrmSmeta.CBNumStrClick(Sender: TObject);

begin

DMRGP.TabNumStr.Open; DMRGP.TabNumStr.First;

DMRGP.TabNumStr.Locate('KNumStr',CBNumStr.Text,[]);

Edit16.Text:=DMRGP.TabNumStr.FieldByName('NumStr').AsString;

Panel4.SetFocus;

end;

procedure TFrmSmeta.BtnNSClick(Sender: TObject);

begin

US:=1;

{ DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

If DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]) then

begin

If DMRGP.TabSmeta.FieldByName('US').AsInteger=0 then

begin

DMRGP.TabSmeta.Edit;

DMRGP.TabSmeta.FieldByName('VGZ1').AsString:=Edit2.Text;

DMRGP.TabSmeta.FieldByName('VGZ1V').AsString:=Edit3.Text;

DMRGP.TabSmeta.FieldByName('V140_260').AsString:=Edit4.Text;

DMRGP.TabSmeta.FieldByName('V140_260V').AsString:=Edit5.Text;

DMRGP.TabSmeta.FieldByName('GZGR5').AsString:=Edit6.Text;

DMRGP.TabSmeta.FieldByName('GZGR5V').AsString:=Edit7.Text;

DMRGP.TabSmeta.FieldByName('Admin').AsString:=Edit9.Text;

DMRGP.TabSmeta.FieldByName('Prog').AsString:=Edit10.Text;

DMRGP.TabSmeta.FieldByName('PProg').AsString:=Edit11.Text;

DMRGP.TabSmeta.FieldByName('Spec').AsString:=Edit12.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK').AsString:=Edit13.Text; DMRGP.TabSmeta.FieldByName('VGZKBK140_260').AsString:=Edit14.Text;

DMRGP.TabSmeta.FieldByName('VGZKBKV').AsString:=Edit15.Text;

DMRGP.TabSmeta.FieldByName('NumStr').AsString:=Edit16.Text;

DMRGP.TabSmeta.FieldByName('US').AsInteger:=1;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.Post;

end;

end else

begin

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.Last;

DMRGP.TabSmeta.Append;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.FieldByName('VGZ1').AsString:=Edit2.Text;

DMRGP.TabSmeta.FieldByName('VGZ1V').AsString:=Edit3.Text;

DMRGP.TabSmeta.FieldByName('V140_260').AsString:=Edit4.Text;

DMRGP.TabSmeta.FieldByName('V140_260V').AsString:=Edit5.Text;

DMRGP.TabSmeta.FieldByName('GZGR5').AsString:=Edit6.Text;

DMRGP.TabSmeta.FieldByName('GZGR5V').AsString:=Edit7.Text;

DMRGP.TabSmeta.FieldByName('Admin').AsString:=Edit9.Text;

DMRGP.TabSmeta.FieldByName('Prog').AsString:=Edit10.Text;

DMRGP.TabSmeta.FieldByName('PProg').AsString:=Edit11.Text;

DMRGP.TabSmeta.FieldByName('Spec').AsString:=Edit12.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK').AsString:=Edit13.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK140_260').AsString:=Edit14.Text;

DMRGP.TabSmeta.FieldByName('VGZKBKV').AsString:=Edit15.Text;

DMRGP.TabSmeta.FieldByName('NumStr').AsString:=Edit16.Text;

DMRGP.TabSmeta.FieldByName('US').AsInteger:=1;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.Post;

end; end;

procedure TFrmSmeta.BtnESClick(Sender: TObject);

begin ISmeta:=1;

CBKPr.SetFocus;

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:='';

Edit6.Text:=''; Edit7.Text:=''; Edit9.Text:=''; Edit10.Text:='';

Edit11.Text:=''; Edit12.Text:=''; Edit13.Text:=''; Edit14.Text:='';

Edit15.Text:=''; Edit16.Text:=''; CBAdm.ItemIndex:=-1;

CBProg.ItemIndex:=-1; CBPProg.ItemIndex:=-1;

CBSpec.ItemIndex:=-1; CBNumStr.ItemIndex:=-1;

end;

procedure TFrmSmeta.BtnPrintSmClick(Sender: TObject);

begin

try FormPrintSm.NRepSm.PreviewModal;

finally

FormPrintSm.Free; end; end;

procedure TFrmSmeta.BtnSSmClick(Sender: TObject);

begin

if CBKPr.ItemIndex=-1 then

begin

ShowMessage('Не выбрано предприятие'); exit;

end;

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

If not DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]) then

begin

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.Last;

DMRGP.TabSmeta.Append;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.FieldByName('VGZ1').AsString:=Edit2.Text;

DMRGP.TabSmeta.FieldByName('VGZ1V').AsString:=Edit3.Text;

DMRGP.TabSmeta.FieldByName('V140_260').AsString:=Edit4.Text;

DMRGP.TabSmeta.FieldByName('V140_260V').AsString:=Edit5.Text;

DMRGP.TabSmeta.FieldByName('GZGR5').AsString:=Edit6.Text;

DMRGP.TabSmeta.FieldByName('GZGR5V').AsString:=Edit7.Text;

DMRGP.TabSmeta.FieldByName('KAdmin').AsString:=CBAdm.Text;

DMRGP.TabSmeta.FieldByName('Admin').AsString:=Edit9.Text;

DMRGP.TabSmeta.FieldByName('KProg').AsString:=CBProg.Text;

DMRGP.TabSmeta.FieldByName('Prog').AsString:=Edit10.Text;

DMRGP.TabSmeta.FieldByName('KPProg').AsString:=CBPProg.Text;

DMRGP.TabSmeta.FieldByName('PProg').AsString:=Edit11.Text;

DMRGP.TabSmeta.FieldByName('Spec').AsString:=Edit12.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK').AsString:=Edit13.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK140_260').AsString:=Edit14.Text;

DMRGP.TabSmeta.FieldByName('VGZKBKV').AsString:=Edit15.Text;

DMRGP.TabSmeta.FieldByName('KNumStr').AsString:=CBNumStr.Text;

DMRGP.TabSmeta.FieldByName('NumStr').AsString:=Edit16.Text;

DMRGP.TabSmeta.FieldByName('US').AsInteger:=US;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.Post;

end else

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

If DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]) then

begin

DMRGP.TabSmeta.Edit;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.FieldByName('VGZ1').AsString:=Edit2.Text;

DMRGP.TabSmeta.FieldByName('VGZ1V').AsString:=Edit3.Text;

DMRGP.TabSmeta.FieldByName('V140_260').AsString:=Edit4.Text;

DMRGP.TabSmeta.FieldByName('V140_260V').AsString:=Edit5.Text;

DMRGP.TabSmeta.FieldByName('GZGR5').AsString:=Edit6.Text;

DMRGP.TabSmeta.FieldByName('GZGR5V').AsString:=Edit7.Text;

DMRGP.TabSmeta.FieldByName('KAdmin').AsString:=CBAdm.Text;

DMRGP.TabSmeta.FieldByName('Admin').AsString:=Edit9.Text;

DMRGP.TabSmeta.FieldByName('KProg').AsString:=CBProg.Text;

DMRGP.TabSmeta.FieldByName('Prog').AsString:=Edit10.Text;

DMRGP.TabSmeta.FieldByName('KPProg').AsString:=CBPProg.Text;

DMRGP.TabSmeta.FieldByName('PProg').AsString:=Edit11.Text;

DMRGP.TabSmeta.FieldByName('Spec').AsString:=Edit12.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK').AsString:=Edit13.Text;

DMRGP.TabSmeta.FieldByName('VGZKBK140_260').AsString:=Edit14.Text;

DMRGP.TabSmeta.FieldByName('VGZKBKV').AsString:=Edit15.Text;

DMRGP.TabSmeta.FieldByName('KNumStr').AsString:=CBNumStr.Text;

DMRGP.TabSmeta.FieldByName('NumStr').AsString:=Edit16.Text;

DMRGP.TabSmeta.FieldByName('US').AsInteger:=US;

DMRGP.TabSmeta.FieldByName('KodPr').AsString:=CBKPr.Text;

DMRGP.TabSmeta.Post; end;

Edit1.Text:='';

Edit2.Text:=''; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:='';

Edit6.Text:=''; Edit7.Text:=''; Edit9.Text:=''; Edit10.Text:='';

Edit11.Text:=''; Edit12.Text:=''; Edit13.Text:=''; Edit14.Text:='';

Edit15.Text:=''; Edit16.Text:=''; CBAdm.ItemIndex:=-1; CBAdm.Text:='';

CBProg.Text:=''; CBPProg.Text:=''; CBSpec.Text:='';

CBNumStr.Text:=''; CBProg.ItemIndex:=-1; CBPProg.ItemIndex:=-1;

CBSpec.ItemIndex:=-1; CBNumStr.ItemIndex:=-1; Panel1.SetFocus;

end; end.

Модуль ProgZayav

unit ProgZayav;

interface

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

Dialogs, LbSpeedButton, CHAdvancedLabel, ExtCtrls, ComCtrls, StdCtrls,

Mask, dxCntner, dxEditor, dxExEdtr, dxEdLib;

type

TFrmZayav = class(TForm)

Panel3: TPanel;

Label3: TCHAdvancedLabel;

BtnClose: TLbSpeedButton;

P2: TPanel;

CHAdvancedLabel1: TCHAdvancedLabel;

Panel1: TPanel;

Edit1: TEdit;

Label1: TLabel;

BtnNZ: TLbSpeedButton;

BtnEZ: TLbSpeedButton;

BtnDZ: TLbSpeedButton;

BtnCZ: TLbSpeedButton;

BtnRZ: TLbSpeedButton;

BtnSZ: TLbSpeedButton;

Label2: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Edit2: TEdit;

Edit3: TEdit;

Edit4: TEdit;

Label7: TLabel;

Edit6: TEdit;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

Edit5: TEdit;

DE1: TdxDateEdit;

DE2: TdxDateEdit;

DE3: TdxDateEdit;

Panel2: TPanel;

CHAdvancedLabel2: TCHAdvancedLabel;

Label12: TLabel;

DE4: TdxDateEdit;

CheckBox1: TCheckBox;

PB: TPanel;

Label32: TLabel;

BtnSPB: TLbSpeedButton;

LbSpeedButton5: TLbSpeedButton;

Edit7: TEdit;

Edit8: TEdit;

Label11: TLabel;

Label13: TLabel;

PDel: TPanel;

Label14: TLabel;

BtnDN: TLbSpeedButton;

BtnDY: TLbSpeedButton;

Label15: TLabel;

CBKPr: TComboBox;

BtnPrZ: TLbSpeedButton;

CBKPrP: TComboBox;

procedure BtnCloseClick(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 Edit6KeyPress(Sender: TObject; var Key: Char);

procedure DE1Click(Sender: TObject);

procedure DE2Click(Sender: TObject);

procedure DE3Click(Sender: TObject);

procedure DE4Click(Sender: TObject);

procedure CheckBox1Click(Sender: TObject);

procedure Edit5KeyPress(Sender: TObject; var Key: Char);

procedure BtnNZClick(Sender: TObject);

procedure BtnSZClick(Sender: TObject);

procedure LbSpeedButton5Click(Sender: TObject);

procedure Edit7KeyPress(Sender: TObject; var Key: Char);

procedure Edit8KeyPress(Sender: TObject; var Key: Char);

procedure BtnSPBClick(Sender: TObject);

procedure BtnEZClick(Sender: TObject);

procedure BtnDZClick(Sender: TObject);

procedure BtnDNClick(Sender: TObject);

procedure BtnDYClick(Sender: TObject);

procedure BtnCZClick(Sender: TObject);

procedure BtnRZClick(Sender: TObject);

procedure CBKPrClick(Sender: TObject);

procedure FormShow(Sender: TObject);

procedure BtnPrZClick(Sender: TObject);

procedure CBKPrPClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations } end;

var

FrmZayav: TFrmZayav;

NumP,i,k:integer;

implementation

uses ProgStart, DMTable, ProgPrintPr, ProgPrintZ;

{$R *.dfm}

procedure TFrmZayav.BtnCloseClick(Sender: TObject);

begin

FrmZayav.Close;

FrmStart.Show; end;

procedure TFrmZayav.Edit1KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

Key:=#0; if Edit1.Text='' then begin

ShowMessage('Пустое поле');

Edit1.SetFocus;

end else Edit2.SetFocus; end; end;

procedure TFrmZayav.Edit2KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

Key:=#0; If Edit2.Text='' then begin

ShowMessage('Пустое поле');

Edit2.SetFocus; end else Edit3.SetFocus;
end; end;
procedure TFrmZayav.Edit3KeyPress(Sender: TObject; var Key: Char);
begin if Key=#13 then begin
Key:=#0; if Edit3.Text='' then
begin ShowMessage('Пустое поле');
Edit3.SetFocus;
end else Edit4.SetFocus; end; end;
procedure TFrmZayav.Edit4KeyPress(Sender: TObject; var Key: Char);
begin if Key=#13 then begin
Key:=#0; if Edit4.Text='' then begin
ShowMessage('Пустое поле');
Edit4.SetFocus;
end else begin DE1.SetFocus;
DE1.DroppedDown:=true;
end; end; end;
procedure TFrmZayav.Edit6KeyPress(Sender: TObject; var Key: Char);
begin if Key=#13 then begin Key:=#0;
if Edit6.Text='' then
begin ShowMessage('Пустое поле'); Edit6.SetFocus;
end else begin DE3.SetFocus;
DE3.DroppedDown:=true; end; end; end;
procedure TFrmZayav.DE1Click(Sender: TObject);
begin DE2.SetFocus; DE2.DroppedDown:=true; end;
procedure TFrmZayav.DE2Click(Sender: TObject);
begin Edit6.SetFocus; end;
procedure TFrmZayav.DE3Click(Sender: TObject);
begin DE4.SetFocus; DE4.DroppedDown:=true; end;
procedure TFrmZayav.DE4Click(Sender: TObject);
begin CheckBox1.Checked:=false; CheckBox1.SetFocus; end;
procedure TFrmZayav.CheckBox1Click(Sender: TObject);
begin Edit5.SetFocus; end;
procedure TFrmZayav.Edit5KeyPress(Sender: TObject; var Key: Char);
begin if Key=#13 then begin
Key:=#0; if Edit5.Text='' then begin
ShowMessage('Пустое поле');
Edit5.SetFocus; end else Panel1.SetFocus; end; end;
procedure TFrmZayav.BtnNZClick(Sender: TObject);
begin
Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:='';
Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:='';
DE1.Text:=''; DE2.Text:=''; DE3.Text:=''; DE4.Text:='';
CBKPr.ItemIndex:=-1; CBKPr.SetFocus;
DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

For i:=0 to DMRGP.TabPredpr.RecordCount-1 do begin

CBKPr.Items.Add(DMRGP.TabPredpr.FieldByName('KodPr').AsString);

DMRGP.TabPredpr.Next; end; end;

procedure TFrmZayav.BtnSZClick(Sender: TObject);

begin

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]);

If DMRGP.TabSmeta.FieldByName('US').AsInteger=0 then begin

ShowMessage('Смета данного предприятия не утвеждена');

CBKPr.SetFocus; exit; end;

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

If DMRGP.TabZayav.Locate('KodPr',CBKpr.Text,[]) then begin

ShowMessage('У данного предприятия такой № заявки уже есть');

Edit2.Text:=''; Edit2.SetFocus; end else begin

DMTable.DMRGP.TabZayav.Last; DMTable.DMRGP.TabZayav.Append;

DMTable.DMRGP.TabZayav.FieldByName('KodPr').AsString:=CBKPr.Text;

DMTable.DMRGP.TabZayav.FieldByName('BudgPrepr').AsString:=Edit1.Text;

DMTable.DMRGP.TabZayav.FieldByName('NumZayav').AsString:=Edit2.Text;

DMTable.DMRGP.TabZayav.FieldByName('NumDog').AsString:=Edit3.Text;

DMTable.DMRGP.TabZayav.FieldByName('SumDog').AsString:=Edit4.Text;

DMTable.DMRGP.TabZayav.FieldByName('DataZayav').AsString:=DE1.Text;

DMTable.DMRGP.TabZayav.FieldByName('DataDog').AsString:=DE2.Text;

DMTable.DMRGP.TabZayav.FieldByName('GosZakaz').AsString:=Edit6.Text;

DMTable.DMRGP.TabZayav.FieldByName('DataUtver').AsString:=DE4.Text;

If CheckBox1.Checked=true then

DMTable.DMRGP.TabZayav.FieldByName('RegDog').AsInteger:=1 ELSE

DMTable.DMRGP.TabZayav.FieldByName('RegDog').AsInteger:=0;

DMTable.DMRGP.TabZayav.FieldByName('Naimen').AsString:=Edit6.Text;

DMTable.DMRGP.TabZayav.FieldByName('Otmena').AsInteger:=0;

DMTable.DMRGP.TabZayav.Post; end; end;

procedure TFrmZayav.LbSpeedButton5Click(Sender: TObject);

begin

PB.Hide; CBKPrP.ItemIndex:=-1; CBKPrP.Text:='';Edit8.Text:=''; end;

procedure TFrmZayav.Edit7KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin Key:=#0; if Edit7.Text='' then begin

ShowMessage('Пустое поле');

Edit7.SetFocus; end else Edit8.SetFocus; end; end;

procedure TFrmZayav.Edit8KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin Key:=#0;

if Edit8.Text='' then begin ShowMessage('Пустое поле');

Edit8.SetFocus; end else PB.SetFocus; end; end;

procedure TFrmZayav.BtnSPBClick(Sender: TObject);

begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('KodPr;NumZayav',VarArrayOf([CBKPrP.Text,Edit8.Text]),[]) then begin ShowMessage('У данного предприятия такой заявки не существует');

Edit8.Text:=''; CBKPrP.ItemIndex:=-1; CBKPrP.SetFocus; end else beginif

If NumP=1 then begin

CBKPr.ItemIndex:=CBKPrP.ItemIndex;

Edit1.Text:=DMTable.DMRGP.TabZayav.FieldByName('BudgPrepr').AsString;

Edit2.Text:=DMTable.DMRGP.TabZayav.FieldByName('NumZayav').AsString;

Edit3.Text:=DMTable.DMRGP.TabZayav.FieldByName('NumDog').AsString;

Edit4.Text:=DMTable.DMRGP.TabZayav.FieldByName('SumDog').AsString;

DE1.Text:=DMTable.DMRGP.TabZayav.FieldByName('DataZayav').AsString;

DE2.Text:=DMTable.DMRGP.TabZayav.FieldByName('DataDog').AsString;

Edit6.Text:=DMTable.DMRGP.TabZayav.FieldByName('GosZakaz').AsString;

DE3.Text:=DMTable.DMRGP.TabZayav.FieldByName('DataDopSogl').AsString;

DE4.Text:=DMTable.DMRGP.TabZayav.FieldByName('DataUtver').AsString;

If DMTable.DMRGP.TabZayav.FieldByName('RegDog').AsInteger=1 then

CheckBox1.Checked:=true ELSE CheckBox1.Checked:=false;

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

DMRGP.TabSmeta.Locate('KodPr',CBKPrP.Text,[]);

Edit5.Text:=DMRGP.TabSmeta.FieldByName('NumStr').AsString; end;

If NumP=2 then begin PDel.Show;

PB.Hide; end;

If NumP=3 then begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('KodPr;NumZayav',VarArrayOf([CBKPrP.Text,Edit8.Text]),[]);

DMRGP.TabZayav.Delete; DMRGP.TabZayav.Post;

ShowMessage('Заявка отменена'); end;

if NumP=4 then begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('KodPr;NumZayav',VarArrayOf([CBKPrP.Text,Edit8.Text]),[]);

If DMTable.DMRGP.TabZayav.FieldByName('RegDog').AsInteger=1 then

ShowMessage('Регистрация уже проведена') else begin

DMRGP.TabZayav.Edit;

DMTable.DMRGP.TabZayav.FieldByName('RegDog').AsInteger:=1;

DMRGP.TabZayav.Post;

end; end;

PB.Hide; end; end;

procedure TFrmZayav.BtnEZClick(Sender: TObject);

begin

NumP:=1; PB.Show; Edit8.Text:='';

CBKPrP.ItemIndex:=-1; CBKPrP.SetFocus;

end;

procedure TFrmZayav.BtnDZClick(Sender: TObject);

begin

NumP:=2;

PB.Show; Edit7.Text:=''; Edit8.Text:=''; Edit7.SetFocus; end;

procedure TFrmZayav.BtnDNClick(Sender: TObject);

begin

PDel.Hide;

end;

procedure TFrmZayav.BtnDYClick(Sender: TObject);

begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Edit;

DMRGP.TabZayav.Locate('BudgPrepr;NumZayav',VarArrayOf([Edit7.Text,Edit8.

Text]),[]);

DMRGP.TabZayav.Edit; DMRGP.TabZayav.Delete;

PDel.Hide; ShowMessage('Заявка удалена');

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:='';

Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:='';

DE1.Text:=''; DE2.Text:=''; DE3.Text:=''; DE4.DroppedDown:=false;

CBKPr.ItemIndex:=-1; Panel1.SetFocus;

end;

procedure TFrmZayav.BtnCZClick(Sender: TObject);

begin

NumP:=3; PB.Show; Edit7.Text:=''; Edit8.Text:=''; Edit7.SetFocus

end;

procedure TFrmZayav.BtnRZClick(Sender: TObject);

begin

NumP:=4; PB.Show; Edit7.Text:=''; Edit8.Text:=''; Edit7.SetFocus

end;

procedure TFrmZayav.CBKPrClick(Sender: TObject);

begin

DMRGP.TabPredpr.Open; DMRGP.TabZayav.First;

DMRGP.TabPredpr.Locate('KodPr',CBKPr.Text,[]);

Edit1.Text:=DMRGP.TabPredpr.FieldByName('PNPr').AsString;

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

If not DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]) then begin

ShowMessage('Смета у данного предприятия отсутствует');

CBKPr.SetFocus; exit; end;

DMRGP.TabSmeta.Open; DMRGP.TabSmeta.First;

DMRGP.TabSmeta.Locate('KodPr',CBKPr.Text,[]);

If DMRGP.TabSmeta.FieldByName('US').AsInteger=0 then

begin

ShowMessage('Смета данного предприятия не утвеждена'); CBKPr.SetFocus;

end else

begin

Edit5.Text:=DMRGP.TabSmeta.FieldByName('NumStr').AsString;

Edit2.SetFocus; end; end;

procedure TFrmZayav.FormShow(Sender: TObject);

begin

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:='';

Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:='';

DE1.Text:=''; DE2.Text:=''; DE3.Text:=''; DE4.Text:='';

CBKPr.ItemIndex:=-1; CBKPr.SetFocus;

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

For i:=0 to DMRGP.TabPredpr.RecordCount-1 do begin

CBKPr.Items.Add(DMRGP.TabPredpr.FieldByName('KodPr').AsString);

CBKPrP.Items.Add(DMRGP.TabPredpr.FieldByName('KodPr').AsString);

DMRGP.TabPredpr.Next; end;

end;

procedure TFrmZayav.BtnPrZClick(Sender: TObject);

begin

try FormPrintZ.NRepZ.PreviewModal; finally

FormPrintZ.Free; end; end;

procedure TFrmZayav.CBKPrPClick(Sender: TObject);

begin

Edit8.SetFocus;

end; end.

Модуль ProgOpl

unit ProgOpl;

interface

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

Dialogs, StdCtrls, dxCntner, dxEditor, dxExEdtr, dxEdLib, LbSpeedButton,

CHAdvancedLabel, ExtCtrls;

type

TFrmOpl = class(TForm)

Panel3: TPanel;

Label3: TCHAdvancedLabel;

BtnClose: TLbSpeedButton;

P2: TPanel;

CHAdvancedLabel1: TCHAdvancedLabel;

Panel1: TPanel;

Label1: TLabel;

BtnNPP: TLbSpeedButton;

BtnPPP: TLbSpeedButton;

BtnSPP: TLbSpeedButton;

Label4: TLabel;

Label5: TLabel;

Label9: TLabel;

Label15: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Edit3: TEdit;

Edit4: TEdit;

Edit6: TEdit;

Edit5: TEdit;

Panel2: TPanel;

CHAdvancedLabel2: TCHAdvancedLabel;

Label12: TLabel;

DE1: TdxDateEdit;

CBKPr: TComboBox;

Label11: TLabel;

CBGod: TComboBox;

Label13: TLabel;

Label14: TLabel;

Label16: TLabel;

Edit7: TEdit;

Label17: TLabel;

Edit8: TEdit;

Label18: TLabel;

Edit9: TEdit;

procedure BtnCloseClick(Sender: TObject);

procedure BtnNPPClick(Sender: TObject);

procedure CBGodClick(Sender: TObject);

procedure CBKPrClick(Sender: TObject);

procedure Edit2KeyPress(Sender: TObject; var Key: Char);

procedure Edit5KeyPress(Sender: TObject; var Key: Char);

procedure Edit6KeyPress(Sender: TObject; var Key: Char);

procedure Edit7KeyPress(Sender: TObject; var Key: Char);

procedure DE1Click(Sender: TObject);

procedure Edit8KeyPress(Sender: TObject; var Key: Char);

procedure Edit9KeyPress(Sender: TObject; var Key: Char);

procedure BtnPPPClick(Sender: TObject);

procedure BtnSPPClick(Sender: TObject);

procedure FormShow(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

FrmOpl: TFrmOpl;

i:integer;

implementation

uses ProgStart, DMTable, ProgPrintPlPor;

{$R *.dfm}

procedure TFrmOpl.BtnCloseClick(Sender: TObject);

begin

FrmOpl.Close;

FrmStart.Show; end;

procedure TFrmOpl.BtnNPPClick(Sender: TObject);

begin

CBGod.ItemIndex:=-1; CBKPr.ItemIndex:=-1;

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:='';

Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:='';

Edit7.Text:=''; Edit8.Text:=''; Edit9.Text:='';

CBGod.SetFocus; CBGod.DroppedDown:=true; end;

procedure TFrmOpl.CBGodClick(Sender: TObject);

begin

CBKPr.Items.Clear;

CBKPr.SetFocus;

For i:=0 to DMRGP.TabZayav.RecordCount-1 do begin

CBKpr.Items.Add(DMRGP.TabZayav.FieldByName('KodPr').AsString);

DMRGP.TabZayav.Next; end;

CBKPr.SetFocus; CBKPr.DroppedDown:=true; end;

procedure TFrmOpl.CBKPrClick(Sender: TObject);

begin

DMRGP.TabPredpr.Open; DMRGP.TabPredpr.First;

DMRGP.TabPredpr.Locate('KodPr',CBKPr.Text,[]);

Edit1.Text:=DMRGP.TabPredpr.FieldByName('PNPr').AsString;

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('KodPr',CBKPr.Text,[]);

Edit2.Text:=DMRGP.TabZayav.FieldByName('NumDog').AsString;

Edit3.Text:=DMRGP.TabZayav.FieldByName('SumDog').AsString;

Edit4.Text:=DMRGP.TabZayav.FieldByName('GosZakaz').AsString;

IF DMRGP.TabZayav.FieldByName('OplDog').AsString<>'' THEN

Edit5.Text:=DMRGP.TabZayav.FieldByName('OplDog').AsString;

IF DMRGP.TabZayav.FieldByName('OplGosZak').AsString<>'' THEN

Edit6.Text:=DMRGP.TabZayav.FieldByName('OplGosZak').AsString;

Edit7.Text:=DMRGP.TabZayav.FieldByName('NumPlPor').AsString;

DE1.Text:=DMRGP.TabZayav.FieldByName('DataRegPlPor').AsString;

Edit8.Text:=DMRGP.TabZayav.FieldByName('SummaOpl').AsString;

Edit9.Text:=DMRGP.TabZayav.FieldByName('SummaOplGosZak').AsString;

Edit2.SetFocus; end;

procedure TFrmOpl.Edit2KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin if Edit2.Text='' then begin

ShowMessage('Пустое поле');

Edit2.SetFocus; end else begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('NumDog',Edit2.Text,[]);

Edit3.Text:=DMRGP.TabZayav.FieldByName('SumDog').AsString;

Edit4.Text:=DMRGP.TabZayav.FieldByName('GosZakaz').AsString;

Edit5.SetFocus; end; end; end;

procedure TFrmOpl.Edit5KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

if Edit5.Text='' then

begin ShowMessage('Пустое поле');

Edit5.SetFocus; end else Edit6.SetFocus; end; end;

procedure TFrmOpl.Edit6KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin if Edit6.Text='' then begin

ShowMessage('Пустое поле');

Edit6.SetFocus; end else Edit7.SetFocus; end; end;

procedure TFrmOpl.Edit7KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

if Edit7.Text='' then begin

ShowMessage('Пустое поле');

Edit7.SetFocus;

end else begin

DE1.SetFocus;

DE1.DroppedDown:=true; end; end; end;

procedure TFrmOpl.DE1Click(Sender: TObject);

begin

Edit8.SetFocus; end;

procedure TFrmOpl.Edit8KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then

begin

if Edit8.Text='' then begin

ShowMessage('Пустое поле');

Edit8.SetFocus;

end else Edit9.SetFocus; end; end;

procedure TFrmOpl.Edit9KeyPress(Sender: TObject; var Key: Char);

begin

if Key=#13 then begin

if Edit9.Text='' then begin ShowMessage('Пустое поле');

Edit9.SetFocus;

end else Panel1.SetFocus; end; end;

procedure TFrmOpl.BtnSPPClick(Sender: TObject);

begin

DMRGP.TabZayav.Open; DMRGP.TabZayav.First;

DMRGP.TabZayav.Locate('KodPr',CBKPr.Text,[]);

DMRGP.TabZayav.Edit;

DMRGP.TabZayav.FieldByName('FinGod').AsString:=CBGod.Text;

DMRGP.TabZayav.FieldByName('NumDog').AsString:=Edit2.Text;

DMRGP.TabZayav.FieldByName('SumDog').AsString:=Edit3.Text;

DMRGP.TabZayav.FieldByName('GosZakaz').AsString:=Edit4.Text;

DMRGP.TabZayav.FieldByName('OplDog').AsString:=Edit5.Text;

DMRGP.TabZayav.FieldByName('OplGosZak').AsString:=Edit6.Text;

DMRGP.TabZayav.FieldByName('NumPlPor').AsString:=Edit7.Text;

DMRGP.TabZayav.FieldByName('DataRegPlPor').AsString:=DE1.Text;

DMRGP.TabZayav.FieldByName('SummaOpl').AsString:=Edit8.Text;

DMRGP.TabZayav.FieldByName('SummaOplGosZak').AsString:=Edit9.Text;

DMRGP.TabZayav.Post;

Panel1.SetFocus; end;

procedure TFrmOpl.BtnPPPClick(Sender: TObject);

begin

try FormPrintPP.NRepPP.PreviewModal; finally

FormPrintPP.Free; end; end;

procedure TFrmOpl.FormShow(Sender: TObject);

begin

CBGod.ItemIndex:=-1; CBKPr.ItemIndex:=-1; DE1.Text:='';

Edit1.Text:=''; Edit2.Text:=''; Edit3.Text:='';

Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:='';

Edit7.Text:=''; Edit8.Text:=''; Edit9.Text:='';

Panel1.SetFocus; end; end.

Модуль ProgStat

unit ProgStat;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, LbSpeedButton, CHAdvancedLabel, ExtCtrls, Grids,

DBGrids;

type

TFrmStat = class(TForm)

Panel3: TPanel;

Label3: TCHAdvancedLabel;

BtnClose: TLbSpeedButton;

P2: TPanel;

CHAdvancedLabel1: TCHAdvancedLabel;

Panel1: TPanel;

BtnUZ: TLbSpeedButton;

BtnFP: TLbSpeedButton;

Panel4: TPanel;

LUZ: TLabel;

DBGUZ: TDBGrid;

LFP: TLabel;

DBGFP: TDBGrid;

procedure BtnCloseClick(Sender: TObject);

procedure BtnUZClick(Sender: TObject);

procedure BtnFPClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var FrmStat: TFrmStat;

i:integer;

implementation

uses ProgStart, DMTable;

{$R *.dfm}

procedure TFrmStat.BtnCloseClick(Sender: TObject);

begin

FrmStat.Hide;

FrmStart.Show; end;

procedure TFrmStat.BtnUZClick(Sender: TObject);

begin

LUZ.Show;

LFP.Hide;

DMRGP.QData.Close; DMRGP.QData.SQL.Text:='Select * from TblZayav where DataUtver<>"'+'''"';

DMRGP.QData.Open;

DBGFP.DataSource.DataSet.Active:=False;

DBGFP.Hide;

DBGUZ.DataSource.DataSet.Active:=True;

DBGUZ.Show; end;

procedure TFrmStat.BtnFPClick(Sender: TObject);

begin

Luz.Hide;

Lfp.Show;

Dmrgr.QData.close;

Dmrgr.Qdata.sql.text:='Select * from TblZayav where Opldog<>"'+'''"';

Dmrgr.Qdata.open;

Dbguz.DataSource.DataSet.active:=false;

Dbguz.Hide;

Dbgpf.DataSource.DataSet.active:=true;

Dbgfp.Show;

end;

end.

Приложение В

Формы программы

Рисунок 7.1 - Главная форма программы

Рисунок 7.2 - Регистрация пользователя

Рисунок 7.3 - Форма НСИ

Рисунок 7.4 - Ввод данных предприятия

Рисунок 7.5 - Печать данных предприятия

Рисунок 7.6 - Ввод данных банков


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.