Главная Случайная страница



Полезное:

Как сделать разговор полезным и приятным Как сделать объемную звезду своими руками Как сделать то, что делать не хочется? Как сделать погремушку Как сделать неотразимый комплимент Как сделать так чтобы женщины сами знакомились с вами Как сделать идею коммерческой Как сделать хорошую растяжку ног? Как сделать наш разум здоровым? Как сделать, чтобы люди обманывали меньше Вопрос 4. Как сделать так, чтобы вас уважали и ценили? Как сделать лучше себе и другим людям Как сделать свидание интересным?


Категории:

АрхитектураАстрономияБиологияГеографияГеологияИнформатикаИскусствоИсторияКулинарияКультураМаркетингМатематикаМедицинаМенеджментОхрана трудаПравоПроизводствоПсихологияРелигияСоциологияСпортТехникаФизикаФилософияХимияЭкологияЭкономикаЭлектроника







Приложение. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,





 

unit Unit1;

 

interface

 

uses

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

Dialogs, DB, ADODB, Menus, StdCtrls;

 

type

TForm1 = class(TForm)

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

ADOConnection1: TADOConnection;

ADOQuery1: TADOQuery;

ADOQuery1code: TIntegerField;

ADOQuery1fio: TWideStringField;

ADOQuery1adr: TWideStringField;

ADOQuery1paspser: TWideStringField;

ADOQuery1paspnum: TWideStringField;

ADOQuery1paspvid: TWideStringField;

ADOQuery2: TADOQuery;

ADOQuery2Expr1000: TIntegerField;

Label1: TLabel;

N7: TMenuItem;

ADOQuery3: TADOQuery;

ADOQuery3code: TIntegerField;

ADOQuery3nam: TWideStringField;

ADOQuery3tar_fix: TBCDField;

ADOQuery3tar_min: TBCDField;

ADOQuery3limit: TIntegerField;

ADOQuery4: TADOQuery;

ADOQuery4Expr1000: TIntegerField;

N8: TMenuItem;

ADOQuery5: TADOQuery;

ADOQuery5num: TWideStringField;

ADOQuery5tarpl: TIntegerField;

ADOQuery5abon: TIntegerField;

ADOQuery6: TADOQuery;

ADOQuery6fio: TWideStringField;

ADOQuery6nam: TWideStringField;

ADOQuery6num: TWideStringField;

ADOQuery6adr: TWideStringField;

N9: TMenuItem;

ADOQuery7: TADOQuery;

ADOQuery7code_oper: TIntegerField;

ADOQuery7telnum: TWideStringField;

ADOQuery7typ: TWideStringField;

ADOQuery7abon: TIntegerField;

ADOQuery7day: TDateTimeField;

ADOQuery5actual: TIntegerField;

ADOQuery8: TADOQuery;

ADOQuery8Expr1000: TIntegerField;

N10: TMenuItem;

ADOQuery9: TADOQuery;

ADOQuery9code_oper: TIntegerField;

ADOQuery9telnum: TWideStringField;

ADOQuery9day: TDateTimeField;

ADOQuery9nach: TBCDField;

ADOQuery9post: TBCDField;

ADOQuery9korr: TBCDField;

ADOQuery9komment: TWideStringField;

ADOQuery10: TADOQuery;

ADOQuery11: TADOQuery;

ADOQuery11Expr1000: TIntegerField;

ADOQuery10num: TWideStringField;



ADOQuery10tar_fix: TBCDField;

ADOQuery12: TADOQuery;

ADOQuery12num: TWideStringField;

ADOQuery12tar_min: TBCDField;

N11: TMenuItem;

ADOQuery13: TADOQuery;

ADOQuery13bik: TWideStringField;

ADOQuery13nam: TWideStringField;

ADOQuery13kch: TWideStringField;

N12: TMenuItem;

ADOQuery14: TADOQuery;

ADOQuery14code: TIntegerField;

ADOQuery14fio: TWideStringField;

ADOQuery14rol: TWideStringField;

ADOQuery14login: TWideStringField;

ADOQuery14passw: TWideStringField;

ADOQuery14day_passw: TDateTimeField;

ADOQuery15: TADOQuery;

ADOQuery15Expr1000: TIntegerField;

N13: TMenuItem;

N14: TMenuItem;

ADOQuery16: TADOQuery;

ADOQuery16nam: TWideStringField;

ADOQuery16adr: TWideStringField;

ADOQuery16dir: TWideStringField;

ADOQuery16inn: TWideStringField;

ADOQuery16rch: TWideStringField;

ADOQuery16kch: TWideStringField;

ADOQuery16bank: TWideStringField;

ADOQuery16bik: TWideStringField;

ADOQuery16tel: TWideStringField;

N15: TMenuItem;

ADOQuery17: TADOQuery;

ADOQuery17Expr1000: TBCDField;

ADOQuery17Expr1001: TBCDField;

ADOQuery17Expr1002: TBCDField;

ADOQuery18: TADOQuery;

ADOQuery18code: TIntegerField;

ADOQuery18nam: TWideStringField;

ADOQuery18tar: TBCDField;

N16: TMenuItem;

ADOQuery19: TADOQuery;

ADOQuery19Expr1000: TIntegerField;

N17: TMenuItem;

ADOQuery20: TADOQuery;

ADOQuery20telnum: TWideStringField;

ADOQuery20code_usl: TIntegerField;

ADOQuery21: TADOQuery;

ADOQuery21tar: TBCDField;

ADOQuery21telnum: TWideStringField;

ADOQuery21nam: TWideStringField;

N18: TMenuItem;

N19: TMenuItem;

N20: TMenuItem;

ADOQuery22: TADOQuery;

ADOQuery22Expr1000: TBCDField;

N21: TMenuItem;

N22: TMenuItem;

ADOQuery23: TADOQuery;

ADOQuery23fio: TWideStringField;

ADOQuery23Expr1001: TBCDField;

N23: TMenuItem;

procedure N5Click(Sender: TObject);

procedure N6Click(Sender: TObject);

procedure N7Click(Sender: TObject);

procedure N8Click(Sender: TObject);

procedure N9Click(Sender: TObject);

procedure N10Click(Sender: TObject);

procedure N11Click(Sender: TObject);

procedure N12Click(Sender: TObject);

procedure N1Click(Sender: TObject);

procedure N13Click(Sender: TObject);

procedure N14Click(Sender: TObject);

procedure N15Click(Sender: TObject);

procedure N16Click(Sender: TObject);

procedure N17Click(Sender: TObject);

procedure N18Click(Sender: TObject);

procedure N19Click(Sender: TObject);

procedure N20Click(Sender: TObject);

procedure N22Click(Sender: TObject);

procedure N21Click(Sender: TObject);

procedure N23Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form1: TForm1;

 

implementation

 

uses Unit2, Unit5, Unit8, Unit9, Unit10, Unit11, Unit14, Unit18, Unit19,

Unit20, Unit21, Unit23, Unit26, Unit27, Unit28, Unit29, Unit30, Unit12,



Unit31, UOOcalc;

 

{$R *.dfm}

 

procedure TForm1.N5Click(Sender: TObject);

begin

form1.close;

end;

 

procedure TForm1.N6Click(Sender: TObject);

begin

with form1.adoquery1 do

begin

close;

sql.Clear;

sql.Add('select * from abonent');

active:=true;

end;

form2.RzDBGrid1.Columns[0].Title.caption:='Код абонента';

form2.RzDBGrid1.Columns[1].Title.caption:='ФИО';

form2.RzDBGrid1.Columns[2].Title.caption:='Адрес';

form2.RzDBGrid1.Columns[3].Title.caption:='Серия паспорта';

form2.RzDBGrid1.Columns[4].Title.caption:='Номер паспорта';

form2.RzDBGrid1.Columns[5].Title.caption:='Паспорт выдан';

form2.Show;

end;

 

procedure TForm1.N7Click(Sender: TObject);

begin

with form1.adoquery3 do

begin

close;

sql.Clear;

sql.Add('select * from tarplan');

active:=true;

end;

form5.RzDBGrid1.Columns[0].Title.caption:='Код';

form5.RzDBGrid1.Columns[1].Title.caption:='Наименование';

form5.RzDBGrid1.Columns[2].Title.caption:='Фикс.тариф';

form5.RzDBGrid1.Columns[3].Title.caption:='Тариф за 1 мин.';

form5.RzDBGrid1.Columns[4].Title.caption:='Лимит';

form5.Show;

end;

 

procedure TForm1.N8Click(Sender: TObject);

begin

with form1.adoquery6 do

begin

close;

sql.Clear;

sql.Add('SELECT abonent.fio, tarplan.nam, telnum.num, abonent.adr FROM tarplan INNER JOIN (abonent INNER JOIN telnum ON abonent.code = telnum.abon) ON tarplan.code = telnum.tarpl');

active:=true;

end;

form8.RzDBGrid1.Columns[0].Title.caption:='ФИО';

form8.RzDBGrid1.Columns[1].Title.caption:='Тариф';

form8.RzDBGrid1.Columns[2].Title.caption:='Номер телефона';

form8.RzDBGrid1.Columns[3].Title.caption:='Адрес';

form8.Show;

end;

 

procedure TForm1.N9Click(Sender: TObject);

var i:integer;

begin

with form1.ADOQuery1 do

begin

close;

sql.Clear;

sql.Add('select * from abonent');

open;

end;

form9.ComboBox1.clear;

for i:=1 to form1.adoquery1.RecordCount do

begin

form9.ComboBox1.Items.Add(trim(form1.ADOQuery1fio.AsString));

form1.ADOQuery1.Next;

end;

with form1.ADOQuery3 do

begin

close;

sql.Clear;

sql.Add('select * from TARPLAN');

open;

end;

 

form9.ComboBox2.clear;

for i:=1 to form1.adoquery3.RecordCount do

begin

form9.ComboBox2.Items.Add(trim(form1.ADOQuery3nam.AsString));

form1.ADOQuery3.Next;

end;

form9.Edit1.Text:='';

form9.Show;

end;

 

procedure TForm1.N10Click(Sender: TObject);

var i:integer;

begin

form10.DateTimePicker1.Date:=now;

form10.ProgressBar1.Position:=0;

form10.ComboBox1.Clear;

with form1.adoquery12 do

begin

close;

sql.clear;

sql.add('SELECT telnum.num, tarplan.tar_min FROM tarplan INNER JOIN telnum ON tarplan.code = telnum.tarpl where tarplan.tar_min>0');

open;

end;

for i:=1 to form1.adoquery12.RecordCount do

begin

form10.ComboBox1.Items.Add(trim(form1.ADOQuery12num.AsString));

form1.ADOQuery12.Next;

end;

form10.Label5.Caption:='';

form10.show;

end;

 

procedure TForm1.N11Click(Sender: TObject);

begin

with form1.ADOQuery13 do

begin

close;

sql.Clear;

sql.Add('select * from banks');

active:=true;

end;

form11.RzDBGrid1.Columns[0].Title.caption:='БИК';

form11.RzDBGrid1.Columns[1].Title.caption:='Наименование';

form11.RzDBGrid1.Columns[2].Title.caption:='Коррсчет';

form11.Show;

end;

 

procedure TForm1.N12Click(Sender: TObject);

begin

with form1.ADOQuery14 do

begin

close;

sql.Clear;

sql.Add('select * from users');

active:=true;

end;

form14.RzDBGrid1.Columns[0].Title.caption:='Код';

form14.RzDBGrid1.Columns[1].Title.caption:='ФИО';

form14.RzDBGrid1.Columns[2].Title.caption:='Роль';

form14.RzDBGrid1.Columns[3].Title.caption:='Логин в системе';

form14.RzDBGrid1.Columns[4].Title.caption:='Дата установки пароля';

form14.show;

end;

 

procedure TForm1.N1Click(Sender: TObject);

begin

form18.Show;

end;

 

procedure TForm1.N13Click(Sender: TObject);

var i:integer;

begin

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum where actual=1');

open;

end;

form19.ComboBox1.clear;

for i:=1 to form1.ADOQuery5.RecordCount do

begin

form19.ComboBox1.Items.Add(trim(form1.ADOQuery5num.AsString));

form1.adoquery5.Next;

end;

form19.DateTimePicker1.Date:=now;

form19.Show;

end;

 

procedure TForm1.N14Click(Sender: TObject);

begin

with form1.adoquery16 do

begin

close;

sql.Clear;

sql.Add('select * from cnst');

open;

end;

form20.Edit1.Text:=form1.ADOQuery16nam.AsString;

form20.Edit2.Text:=form1.ADOQuery16adr.AsString;

form20.Edit3.Text:=form1.ADOQuery16dir.AsString;

form20.Edit4.Text:=form1.ADOQuery16inn.AsString;

form20.Edit5.Text:=form1.ADOQuery16nam.AsString;

form20.Edit6.Text:=form1.ADOQuery16bik.AsString;

form20.Edit7.Text:=form1.ADOQuery16kch.AsString;

form20.Edit8.Text:=form1.ADOQuery16rch.AsString;

form20.Edit9.Text:=form1.ADOQuery16tel.AsString;

form20.Show;

end;

 

procedure TForm1.N15Click(Sender: TObject);

var i:integer;

begin

form21.ComboBox1.Clear;

with form1.adoquery13 do

begin

close;

sql.Clear;

sql.Add('select * from banks ');

open;

end;

for i:=1 to form1.ADOQuery13.RecordCount do

begin

form21.ComboBox1.Items.Add(trim(form1.ADOQuery13nam.AsString));

form1.adoquery13.Next;

end;

form21.Edit2.clear;

with form1.ADOQuery11 do

begin

close;

sql.Clear;

sql.Add('select max(code_oper) from paydoc');

open;

end;

form21.Edit1.Text:=inttostr(1+form1.ADOQuery11Expr1000.AsInteger);

form21.DateTimePicker1.Date:=now;

form21.ComboBox2.Clear;

with form1.ADOQuery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum');

open;

end;

for i:=1 to form1.ADOQuery5.RecordCount do

begin

form21.ComboBox2.Items.add(trim(form1.ADOQuery5num.AsString));

form1.ADOQuery5.Next;

end;

form21.Show;

end;

 

procedure TForm1.N16Click(Sender: TObject);

begin

with form1.ADOQuery18 do

begin

close;

sql.clear;

sql.Add('select * from uslugi');

active:=true;

end;

form23.DBGrid1.Columns[0].Title.caption:='Код';

form23.DBGrid1.Columns[1].Title.caption:='Наименование услуги';

form23.DBGrid1.Columns[2].Title.caption:='Тариф';

form23.Show;

end;

 

procedure TForm1.N17Click(Sender: TObject);

var i:integer;

begin

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum');

open;

end;

form26.ComboBox1.clear;

for i:=1 to form1.ADOQuery5.RecordCount do

begin

form26.ComboBox1.Items.Add(trim(form1.ADOQuery5num.AsString));

form1.adoquery5.Next;

end;

with form1.ADOQuery18 do

begin

close;

sql.Clear;

sql.Add('select * from uslugi');

open;

end;

form26.ComboBox2.clear;

for i:=1 to form1.ADOQuery18.RecordCount do

begin

form26.ComboBox2.Items.Add(trim(form1.ADOQuery18nam.AsString));

form1.adoquery18.Next;

end;

form26.Show;

end;

 

procedure TForm1.N18Click(Sender: TObject);

var i:integer;

begin

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum');

open;

end;

form27.ComboBox1.clear;

for i:=1 to form1.ADOQuery5.RecordCount do

begin

form27.ComboBox1.Items.Add(trim(form1.ADOQuery5num.AsString));

form1.adoquery5.Next;

end;

form27.Show;

end;

 

procedure TForm1.N19Click(Sender: TObject);

var i:integer;

begin

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum');

open;

end;

form28.ComboBox1.clear;

form28.ComboBox2.Clear;

for i:=1 to form1.ADOQuery5.RecordCount do

begin

form28.ComboBox1.Items.Add(trim(form1.ADOQuery5num.AsString));

form28.ComboBox2.Items.Add(trim(form1.ADOQuery5num.AsString));

form1.adoquery5.Next;

end;

form28.Edit2.Clear;

form28.Edit1.clear;

form28.Show;

end;

 

procedure TForm1.N20Click(Sender: TObject);

begin

form29.DateTimePicker1.Date:=now;

form29.DateTimePicker2.Date:=now;

form29.Show;

end;

 

procedure TForm1.N22Click(Sender: TObject);

begin

form30.DateTimePicker1.Date:=now;

form30.DateTimePicker2.Date:=now;

form30.Show;

end;

 

procedure TForm1.N21Click(Sender: TObject);

begin

form31.Show;

end;

 

procedure TForm1.N23Click(Sender: TObject);

var calc:toocalc; i:integer;

begin

calc:=toocalc.Create('c:\telekom\xlt\prosr.xlt');

with form1.ADOQuery14 do

begin

close;

sql.Clear;

sql.Add('select * from users ');

open;

end;

for i:=1 to form1.ADOQuery14.RecordCount do

begin

if form1.ADOQuery14day_passw.AsDateTime<now-365 then

begin

calc.Cell[4,1]:=trim(form1.ADOQuery14login.AsString);

calc.Cell[4,2]:=trim(form1.ADOQuery14fio.AsString);

calc.Cell[4,3]:=form1.ADOQuery14day_passw.AsString;

calc.InsertRow(4,true);

end;

form1.adoquery14.Next;

end;

 

calc.Visible:=true;

end;

 

end.

unit Unit10;

 

interface

 

uses

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

Dialogs, RzTabs, RzPrgres, RzButton, ComCtrls, StdCtrls;

 

type

TForm10 = class(TForm)

RzPageControl1: TRzPageControl;

TabSheet1: TRzTabSheet;

TabSheet2: TRzTabSheet;

TabSheet3: TRzTabSheet;

Label1: TLabel;

DateTimePicker1: TDateTimePicker;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

ProgressBar1: TProgressBar;

DateTimePicker2: TDateTimePicker;

Label2: TLabel;

Label3: TLabel;

ComboBox1: TComboBox;

Label4: TLabel;

Edit1: TEdit;

Label5: TLabel;

RzBitBtn3: TRzBitBtn;

Label6: TLabel;

Edit2: TEdit;

RzBitBtn4: TRzBitBtn;

RzBitBtn5: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn5Click(Sender: TObject);

procedure ComboBox1Select(Sender: TObject);

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn4Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form10: TForm10;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm10.RzBitBtn2Click(Sender: TObject);

begin

form10.close;

end;

 

procedure TForm10.RzBitBtn1Click(Sender: TObject);

var i,code,j:integer;

begin

with form1.adoquery10 do

begin

close;

sql.clear;

sql.add('SELECT telnum.num, tarplan.tar_fix FROM tarplan INNER JOIN telnum ON tarplan.code = telnum.tarpl where tarplan.tar_fix>0');

open;

end;

 

form1.adoquery9.Open;

form10.ProgressBar1.Position:=0;

progressbar1.Max:=form1.ADOQuery10.RecordCount;

for i:=1 to form1.ADOQuery10.RecordCount do

begin

with form1.ADOQuery11 do

begin

close;

sql.Clear;

sql.add('select max(code_oper) from paydoc' );

open;

end;

if form1.ADOQuery11.RecordCount=0 then code:=1 else code:=form1.ADOQuery11Expr1000.AsInteger+1;

form1.ADOQuery9.AppendRecord([code,form1.ADOQuery10num.AsString,datetimepicker1.Date,form1.ADOQuery10tar_fix.AsCurrency,0,0,'Начисление безлимит '+datetostr(datetimepicker1.date)]);

with form1.ADOQuery21 do

begin

close;

sql.Clear;

sql.Add('SELECT uslugi.tar, gur_usl.telnum, uslugi.nam FROM uslugi INNER JOIN gur_usl ON uslugi.code = gur_usl.code_usl where gur_usl.telnum='+form1.Label1.Caption+trim(form1.ADOQuery10num.AsString)+form1.Label1.Caption);

open;

end;

if form1.ADOQuery21.RecordCount>0 then

begin

for j:=1 to form1.ADOQuery21.RecordCount do

begin

form1.ADOQuery9.AppendRecord([code+j,form1.ADOQuery10num.AsString,datetimepicker1.Date,form1.ADOQuery21tar.AsCurrency,0,0,'Начисление услуги '+trim(form1.ADOQuery21nam.AsString)+' '+datetostr(datetimepicker1.date)]);

form1.ADOQuery21.Next;

end;

end;

form1.ADOQuery10.Next;

progressbar1.StepBy(1);

application.ProcessMessages;

end;

showmessage('Начисление выполнено');

end;

 

procedure TForm10.RzBitBtn5Click(Sender: TObject);

begin

form10.Close;

end;

 

procedure TForm10.ComboBox1Select(Sender: TObject);

begin

with form1.adoquery12 do

begin

close;

sql.clear;

sql.add('SELECT telnum.num, tarplan.tar_min FROM tarplan INNER JOIN telnum ON tarplan.code = telnum.tarpl where telnum.num='+form1.Label1.Caption+trim(combobox1.Text)+form1.Label1.Caption);

open;

end;

label5.Caption:=form1.ADOQuery12tar_min.AsString;

end;

 

procedure TForm10.RzBitBtn3Click(Sender: TObject);

begin

edit2.Text:=currtostr(strtoint(edit1.Text)*strtocurr(label5.Caption));

end;

 

procedure TForm10.RzBitBtn4Click(Sender: TObject);

var code:integer;

begin

with form1.ADOQuery11 do

begin

close;

sql.Clear;

sql.add('select max(code_oper) from paydoc' );

open;

end;

with form1.adoquery12 do

begin

close;

sql.clear;

sql.add('SELECT telnum.num, tarplan.tar_min FROM tarplan INNER JOIN telnum ON tarplan.code = telnum.tarpl where telnum.num='+form1.Label1.Caption+trim(combobox1.Text)+form1.Label1.Caption);

open;

end;

if form1.ADOQuery11.RecordCount=0 then code:=1 else code:=form1.ADOQuery11Expr1000.AsInteger+1;

form1.ADOQuery9.open;

form1.ADOQuery9.AppendRecord([code,form1.ADOQuery12num.AsString,datetimepicker1.Date,edit2.Text,0,0,'Начисление за минуты разговора '+datetostr(datetimepicker1.date)]);

showmessage('Готово');

end;

 

end.

unit Unit11;

 

interface

 

uses

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

Dialogs, ExtCtrls, RzPanel, RzDBNav, DB, Grids, DBGrids, RzDBGrid,

RzButton, DBCtrls, StdCtrls;

 

type

TForm11 = class(TForm)

RzDBGrid1: TRzDBGrid;

DataSource1: TDataSource;

RzDBNavigator1: TRzDBNavigator;

Label1: TLabel;

DBText1: TDBText;

Label2: TLabel;

DBText2: TDBText;

Label3: TLabel;

DBText3: TDBText;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

RzBitBtn4: TRzBitBtn;

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn4Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form11: TForm11;

 

implementation

 

uses Unit1, Unit12, Unit13;

 

{$R *.dfm}

 

procedure TForm11.RzBitBtn3Click(Sender: TObject);

begin

form11.Close;

end;

 

procedure TForm11.RzBitBtn1Click(Sender: TObject);

begin

with form12 do

begin

rzedit1.clear;

rzedit2.clear;

rzedit3.clear;

show;

end;

end;

 

procedure TForm11.RzBitBtn4Click(Sender: TObject);

begin

with form1.ADOQuery9 do

begin

close;

sql.Clear;

sql.Add('select * from paydoc where komment='+form1.Label1.Caption+trim(dbtext2.Caption)+form1.Label1.Caption);

open;

end;

if form1.adoquery9.RecordCount>0 then showmessage('На этом банке есть введенные операции. Удаление невозможно') else

begin

form1.ADOQuery13.Delete;

showmessage('Удалено');

end;

end;

 

procedure TForm11.RzBitBtn2Click(Sender: TObject);

begin

form13.RzEdit1.Text:=dbtext2.Caption;

form13.RzEdit2.Text:=dbtext1.Caption;

form13.RzEdit3.Text:=dbtext3.Caption;

form13.show;

end;

 

end.

unit Unit12;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm12 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

RzEdit1: TRzEdit;

RzEdit2: TRzEdit;

RzEdit3: TRzEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form12: TForm12;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm12.RzBitBtn2Click(Sender: TObject);

begin

form12.close;

end;

 

procedure TForm12.RzBitBtn1Click(Sender: TObject);

begin

form1.ADOQuery13.AppendRecord([rzedit2.Text,rzedit1.Text,rzedit3.Text]);

showmessage('Записано');

rzedit1.clear;

rzedit2.Clear;

rzedit3.Clear;

end;

 

end.

unit Unit13;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm13 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

RzEdit1: TRzEdit;

RzEdit2: TRzEdit;

RzEdit3: TRzEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form13: TForm13;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm13.RzBitBtn2Click(Sender: TObject);

begin

form13.close;

end;

 

procedure TForm13.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery13 do

begin

close;

sql.Clear;

sql.add('update banks set nam='+form1.Label1.Caption+trim(rzedit1.Text)+form1.Label1.Caption+' where bik='+form1.Label1.Caption+trim(rzedit2.Text)+form1.Label1.Caption);

execsql;

close;

sql.Clear;

sql.add('update banks set kch='+form1.Label1.Caption+trim(rzedit3.Text)+form1.Label1.Caption+' where bik='+form1.Label1.Caption+trim(rzedit2.Text)+form1.Label1.Caption);

execsql;

close;

sql.Clear;

sql.Add('select * from banks');

active:=true;

end;

form1.ADOQuery13.Locate('bik',rzedit2.Text,[]);

showmessage('Записано');

end;

 

end.

unit Unit14;

 

interface

 

uses

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

Dialogs, Grids, DBGrids, RzDBGrid, DB, DBCtrls, StdCtrls, ExtCtrls,

RzPanel, RzDBNav, RzButton;

 

type

TForm14 = class(TForm)

DataSource1: TDataSource;

RzDBGrid1: TRzDBGrid;

Label1: TLabel;

DBText1: TDBText;

Label2: TLabel;

DBText2: TDBText;

Label3: TLabel;

DBText3: TDBText;

Label4: TLabel;

DBText4: TDBText;

Label5: TLabel;

DBText5: TDBText;

RzBitBtn1: TRzBitBtn;

RzDBNavigator1: TRzDBNavigator;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

RzBitBtn4: TRzBitBtn;

RzBitBtn5: TRzBitBtn;

procedure RzBitBtn4Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn5Click(Sender: TObject);

procedure RzBitBtn3Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form14: TForm14;

 

implementation

 

uses Unit1, Unit15, Unit16, Unit17;

 

{$R *.dfm}

 

procedure TForm14.RzBitBtn4Click(Sender: TObject);

begin

form14.close;

end;

 

procedure TForm14.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery15 do

begin

close;

sql.Clear;

sql.Add('select max(code) from users');

open;

end;

if form1.adoquery15.RecordCount=0 then form15.RzEdit1.Text:='1' else form15.RzEdit1.Text:=inttostr(1+form1.ADOQuery15Expr1000.AsInteger);

form15.RzEdit2.Clear;

form15.RzEdit3.Clear;

form15.Show;

end;

 

procedure TForm14.RzBitBtn2Click(Sender: TObject);

begin

form16.Label1.Caption:=form1.ADOQuery14login.AsString;

form16.Edit1.clear;

form16.Edit2.clear;

form16.Show;

end;

 

procedure TForm14.RzBitBtn5Click(Sender: TObject);

begin

form1.adoquery14.Delete;

end;

 

procedure TForm14.RzBitBtn3Click(Sender: TObject);

begin

form17.RzEdit1.Text:=form1.ADOQuery14code.asstring;

form17.RzEdit2.Text:=form1.ADOQuery14fio.asstring;

form17.RzEdit3.Text:=form1.ADOQuery14login.asstring;

if dbtext3.Caption='Администратор' then form17.RadioButton1.Checked:=true;

if dbtext3.Caption='Специалист' then form17.RadioButton2.Checked:=true;

if dbtext3.Caption='Руководитель' then form17.RadioButton3.Checked:=true;

form17.Show;

end;

 

end.

unit Unit15;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm15 = class(TForm)

Label4: TLabel;

Label3: TLabel;

Label2: TLabel;

Label1: TLabel;

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

RadioButton3: TRadioButton;

RzEdit1: TRzEdit;

RzEdit2: TRzEdit;

RzEdit3: TRzEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form15: TForm15;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm15.RzBitBtn2Click(Sender: TObject);

begin

form15.close;

end;

 

procedure TForm15.RzBitBtn1Click(Sender: TObject);

var rol:string;

begin

if radiobutton1.Checked=true then rol:=radiobutton1.Caption;

if radiobutton2.Checked=true then rol:=radiobutton2.Caption;

if radiobutton3.Checked=true then rol:=radiobutton3.Caption;

with form1.ADOQuery14 do

begin

close;

sql.Clear;

sql.Add('select * from users where login='+form1.Label1.Caption+trim(rzedit3.Text)+form1.Label1.Caption);

open;

end;

if form1.ADOQuery14.RecordCount>0 then showmessage('Такой логин в системе уже используется') else

begin

 

form1.ADOQuery14.AppendRecord([rzedit1.Text,rzedit2.text,rol,rzedit3.Text]);

rzedit1.Text:=inttostr(1+strtoint(rzedit1.Text));

rzedit2.Clear;

rzedit3.clear;

showmessage('Записано');

end;

with form1.ADOQuery14 do

begin

close;

sql.Clear;

sql.Add('select * from users');

active:=true;

end;

end;

 

end.

unit Unit16;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls;

 

type

TForm16 = class(TForm)

Label4: TLabel;

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Label3: TLabel;

Edit2: TEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form16: TForm16;

 

implementation

 

uses Unit1, UOOCalc;

 

{$R *.dfm}

 

procedure TForm16.RzBitBtn3Click(Sender: TObject);

begin

form16.close;

end;

 

procedure TForm16.RzBitBtn1Click(Sender: TObject);

var year1,mon1,dt1:word ; m1,d1:string[2]; day1:string[20];

label q;

begin

 

decodedate(now,year1,mon1,dt1);

if mon1<10 then m1:='0'+inttostr(mon1) else m1:=inttostr(mon1);

if dt1<10 then d1:='0'+inttostr(dt1) else d1:=inttostr(dt1);

day1:=inttostr(year1)+'/'+m1+'/'+d1;

with form1.adoquery14 do

begin

close;

sql.clear;

sql.Add('select * from users where (login='+form1.Label1.Caption+label1.Caption+form1.Label1.Caption+')');

open;

end;

if (trim(edit1.Text)='') and (trim(form1.ADOQuery14passw.AsString)='') then goto q;

with form1.adoquery14 do

begin

close;

sql.clear;

sql.Add('select * from users where (passw='+form1.Label1.Caption+trim(edit1.Text)+form1.Label1.Caption+') and (login='+form1.Label1.Caption+label1.Caption+form1.Label1.Caption+')');

open;

end;

if form1.ADOQuery14.RecordCount=0 then showmessage('Старый пароль указан неверно') else

begin

q: with form1.adoquery14 do

begin

close;

sql.clear;

sql.Add('update users set passw='+form1.Label1.Caption+trim(edit2.text)+form1.Label1.Caption+' where login='+form1.Label1.Caption+label1.Caption+form1.Label1.Caption);

execsql;

close;

sql.clear;

sql.Add('update users set day_passw=#'+day1+'# where login='+form1.Label1.Caption+label1.Caption+form1.Label1.Caption);

execsql;

 

end;

showmessage('Записано');

end;

with form1.adoquery14 do

begin

close;

sql.Clear;

sql.Add('select * from users ');

active:=true;

end;

form1.adoquery14.Locate('login',label1.Caption,[]);

end;

 

procedure TForm16.RzBitBtn2Click(Sender: TObject);

var calc:toocalc;

begin

calc:=toocalc.Create('c:\telekom\xlt\parol.xlt');

with form1.ADOQuery14 do

begin

close;

sql.clear;

sql.Add('select * from users where (login='+form1.Label1.Caption+label1.Caption+form1.Label1.Caption+')');

open;

end;

calc.Cell[4,1]:=form1.ADOQuery14fio.AsString;

calc.Cell[5,2]:=edit1.Text;

calc.Cell[6,3]:=edit2.Text;

calc.Cell[7,3]:=datetostr(now);

calc.Cell[8,3]:=datetostr(now+365);

with form1.adoquery14 do

begin

close;

sql.Clear;

sql.Add('select * from users ');

active:=true;

end;

form1.adoquery14.Locate('login',label1.Caption,[]);

calc.Visible:=true;

end;

 

end.

unit Unit17;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm17 = class(TForm)

Label4: TLabel;

Label3: TLabel;

Label2: TLabel;

Label1: TLabel;

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

RadioButton3: TRadioButton;

RzEdit1: TRzEdit;

RzEdit2: TRzEdit;

RzEdit3: TRzEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form17: TForm17;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm17.RzBitBtn2Click(Sender: TObject);

begin

form17.close;

end;

 

procedure TForm17.RzBitBtn1Click(Sender: TObject);

var rol:string;

begin

if radiobutton1.Checked=true then rol:=radiobutton1.Caption;

if radiobutton2.Checked=true then rol:=radiobutton2.Caption;

if radiobutton3.Checked=true then rol:=radiobutton3.Caption;

with form1.adoquery14 do

begin

close;

sql.Clear;

sql.Add('update users set rol='+form1.Label1.Caption+rol+form1.Label1.Caption+' where code='+rzedit1.Text);

execsql;

close;

sql.Clear;

sql.Add('update users set fio='+form1.Label1.Caption+trim(rzedit2.Text)+form1.Label1.Caption+' where code='+rzedit1.Text);

execsql;

close;

sql.Clear;

sql.Add('update users set login='+form1.Label1.Caption+trim(rzedit3.Text)+form1.Label1.Caption+' where code='+rzedit1.Text);

execsql;

close;

sql.Clear;

sql.Add('select * from users');

active:=true;

end;

form1.ADOQuery14.Locate('code',rzedit1.Text,[]);

showmessage('Записано');

 

end;

 

end.

unit Unit18;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm18 = class(TForm)

Label1: TLabel;

RzEdit1: TRzEdit;

Label2: TLabel;

RzEdit2: TRzEdit;

RzBitBtn1: TRzBitBtn;

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form18: TForm18;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm18.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery14 do

begin

close;

sql.Clear;

sql.Add('select * from users where (login='+form1.Label1.Caption+trim(rzedit1.Text)+form1.Label1.Caption+') and (passw='+form1.Label1.Caption+trim(rzedit2.Text)+form1.Label1.Caption+')');

open;

end;

if form1.ADOQuery14.RecordCount=0 then showmessage('Неверный логин/пароль') else

begin

with form1 do

begin

n2.Enabled:=true;

n3.Enabled:=true;

n4.Enabled:=true;

n1.Enabled:=false;

if form1.ADOQuery14rol.AsString='Администратор' then

begin

n14.Enabled:=true;

n6.Enabled:=true;

n7.Enabled:=true;

n16.Enabled:=true;

n8.Enabled:=true;

n11.Enabled:=true;

n12.Enabled:=true;

n23.Enabled:=true;

end;

if form1.ADOQuery14rol.AsString='Специалист' then

begin

n11.Enabled:=true;

n10.Enabled:=true;

n6.Enabled:=true;

n7.Enabled:=true;

n15.Enabled:=true;

n8.Enabled:=true;

n9.Enabled:=true;

n13.Enabled:=true;

n17.Enabled:=true;

n18.Enabled:=true;

n19.Enabled:=true;

n20.Enabled:=true;

n21.Enabled:=true;

n22.Enabled:=true;

end;

if form1.ADOQuery14rol.AsString='Руководитель' then

begin

n20.Enabled:=true;

n21.Enabled:=true;

n22.Enabled:=true;

 

end;

 

end;

 

 

form18.Close;

end;

end;

 

end.

unit Unit19;

 

interface

 

uses

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

Dialogs, StdCtrls, Buttons, ComCtrls, RzButton;

 

type

TForm19 = class(TForm)

Label1: TLabel;

ComboBox1: TComboBox;

Label2: TLabel;

ComboBox2: TComboBox;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

Label3: TLabel;

DateTimePicker1: TDateTimePicker;

RzBitBtn1: TRzBitBtn;

procedure BitBtn1Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form19: TForm19;

 

implementation

 

uses Unit1, UOOcalc;

 

{$R *.dfm}

 

procedure TForm19.BitBtn1Click(Sender: TObject);

begin

form1.ADOQuery7.Open;

with form1.ADOQuery8 do

begin

close;

sql.Clear;

sql.Add('select max(code_oper) from gur_doc');

open;

end;

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum where num='+form1.Label1.Caption+trim(combobox1.Text)+form1.Label1.Caption);

open;

end;

if form1.adoquery5.RecordCount=0 then showmessage('Проверьте выбор номера телефона') else

begin

form1.ADOQuery7.AppendRecord([form1.ADOQuery8Expr1000.AsInteger+1,combobox1.Text,'отключение',form1.ADOQuery5abon.AsInteger,datetimepicker1.Date]);

with form1.ADOQuery5 do

begin

close;

sql.Clear;

sql.Add('update telnum set actual=0 where num='+form1.Label1.Caption+trim(combobox1.Text)+form1.Label1.Caption);

execsql;

end;

showmessage('Записано');

end;

end;

 

procedure TForm19.RzBitBtn1Click(Sender: TObject);

var calc:toocalc;

begin

calc:=toocalc.Create('c:\telekom\xlt\z_otkl.xlt');

form1.ADOQuery16.Open;

calc.Cell[2,4]:=form1.ADOQuery16nam.AsString;

calc.Cell[13,1]:=datetostr(datetimepicker1.Date);

with form1.ADOQuery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum where num='+form1.Label1.Caption+trim(combobox1.Text)+form1.Label1.Caption);

open;

end;

 

with form1.ADOQuery1 do

begin

close;

sql.Clear;

sql.Add('select * from abonent where code='+form1.ADOQuery5abon.AsString);

open;

end;

if form1.adoquery1.RecordCount>0 then

begin

calc.Cell[3,5]:=form1.ADOQuery1fio.AsString;

calc.Cell[5,4]:=form1.ADOQuery1adr.AsString;

end;

calc.Cell[8,4]:=combobox1.Text;

calc.Cell[8,6]:=datetostr(datetimepicker1.Date);

calc.Visible:=true;

end;

 

end.

unit Unit2;

 

interface

 

uses

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

Dialogs, Grids, DBGrids, RzDBGrid, ExtCtrls, DBCtrls, DB, RzPanel,

RzDBNav, StdCtrls, RzButton, Mask, RzEdit;

 

type

TForm2 = class(TForm)

DataSource1: TDataSource;

RzDBGrid1: TRzDBGrid;

RzPanel1: TRzPanel;

RzPanel2: TRzPanel;

Label1: TLabel;

DBText1: TDBText;

Label2: TLabel;

DBText2: TDBText;

Label3: TLabel;

DBText3: TDBText;

Label4: TLabel;

Label5: TLabel;

DBText4: TDBText;

Label6: TLabel;

DBText5: TDBText;

Label7: TLabel;

DBText6: TDBText;

RzDBNavigator1: TRzDBNavigator;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

Label8: TLabel;

Label9: TLabel;

RzEdit5: TRzEdit;

RzBitBtn4: TRzBitBtn;

Label10: TLabel;

RzEdit1: TRzEdit;

RzBitBtn5: TRzBitBtn;

RzBitBtn6: TRzBitBtn;

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn4Click(Sender: TObject);

procedure RzBitBtn5Click(Sender: TObject);

procedure RzBitBtn6Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form2: TForm2;

 

implementation

 

uses Unit1, Unit3, Unit4;

 

{$R *.dfm}

 

procedure TForm2.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery1 do

begin

close;

sql.Clear;

sql.Add('select * from abonent');

active:=true;

end;

if form1.ADOQuery1.RecordCount=0 then form3.RzEdit1.Text:='1' else

begin

with form1.ADOQuery2 do

begin

close;

sql.Clear;

sql.Add('select max(code) from abonent');

open;

end;

form3.RzEdit1.Text:=inttostr(1+form1.ADOQuery2Expr1000.AsInteger);

end;

form3.RzEdit2.Clear;

form3.RzEdit3.Clear;

form3.RzEdit4.Clear;

form3.RzEdit5.Clear;

form3.RzEdit6.Clear;

form3.Show;

end;

 

procedure TForm2.RzBitBtn2Click(Sender: TObject);

begin

form4.RzEdit1.Text:=dbtext1.Caption;

form4.RzEdit2.Text:=dbtext2.Caption;

form4.RzEdit3.Text:=dbtext3.Caption;

form4.RzEdit4.Text:=dbtext4.Caption;

form4.RzEdit5.Text:=dbtext5.Caption;

form4.RzEdit6.Text:=dbtext6.Caption;

form4.Show;

end;

 

procedure TForm2.RzBitBtn3Click(Sender: TObject);

begin

form2.close;

end;

 

procedure TForm2.RzBitBtn4Click(Sender: TObject);

begin

with form1.ADOQuery1 do

begin

close;

sql.Clear;

sql.add('select * from abonent where fio like '+form1.Label1.Caption+'%'+trim(rzedit5.text)+'%'+form1.Label1.Caption);

active:=true;

end;

end;

 

procedure TForm2.RzBitBtn5Click(Sender: TObject);

begin

with form1.ADOQuery1 do

begin

close;

sql.Clear;

sql.add('select * from abonent where adr like '+form1.Label1.Caption+'%'+trim(rzedit1.text)+'%'+form1.Label1.Caption);

active:=true;

end;

end;

 

procedure TForm2.RzBitBtn6Click(Sender: TObject);

begin

with form1.adoquery5 do

begin

close;

sql.Clear;

sql.Add('select * from telnum where abon='+dbtext1.Caption);

open;

end;

if form1.ADOQuery5.RecordCount>0 then showmessage('Удаление невозможно - на данном пользователе зарегистрирован телефонный номер') else

begin

 

with form1.adoquery7 do

begin

close;

sql.Clear;

sql.Add('select * from gur_doc where abon='+dbtext1.Caption);

open;

end;

if (form1.ADOQuery7.RecordCount>0) then showmessage('Удаление невозможно, т.к. по данному абоненту есть проведенные операции') else

begin

form1.adoquery1.Delete;

showmessage('Удалено');

end;

end;

end;

 

end.

unit Unit20;

 

interface

 

uses

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

Dialogs, StdCtrls, Buttons;

 

type

TForm20 = class(TForm)

Label1: TLabel;

Edit1: TEdit;

Label2: TLabel;

Edit2: TEdit;

Label3: TLabel;

Edit3: TEdit;

Label4: TLabel;

Edit4: TEdit;

Label5: TLabel;

Edit5: TEdit;

Label6: TLabel;

Label7: TLabel;

Edit6: TEdit;

Label8: TLabel;

Edit7: TEdit;

Label9: TLabel;

Edit8: TEdit;

Label10: TLabel;

Edit9: TEdit;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form20: TForm20;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm20.BitBtn1Click(Sender: TObject);

begin

form1.adoquery16.delete;

form1.adoquery16.AppendRecord([edit1.Text,edit2.Text,edit3.Text,edit4.Text,edit8.Text,edit7.text,edit5.text,edit6.text,edit9.text]);

showmessage('Записано');

end;

 

end.

unit Unit21;

 

interface

 

uses

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

Dialogs, StdCtrls, Buttons, ComCtrls;

 

type

TForm21 = class(TForm)

Label1: TLabel;

Edit1: TEdit;

Label2: TLabel;

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

ComboBox1: TComboBox;

Label3: TLabel;

DateTimePicker1: TDateTimePicker;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

Label4: TLabel;

Edit2: TEdit;

Label5: TLabel;

ComboBox2: TComboBox;

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form21: TForm21;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm21.BitBtn1Click(Sender: TObject);

var komment:string;

begin

form1.adoquery9.Open;

if radiobutton1.Checked=true then komment:='Поступление касса' else komment:='Поступление банк '+trim(combobox1.Text);

form1.ADOQuery9.AppendRecord([edit1.Text,combobox2.Text,datetimepicker1.Date,0,strtocurr(edit2.Text),0,komment]);

edit2.clear;

combobox1.Text:='';

edit1.Text:=inttostr(1+strtoint(edit1.Text));

showmessage('Записано');

end;

 

end.

unit Unit22;

 

interface

 

uses

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

Dialogs, RzButton, ComCtrls, StdCtrls;

 

type

TForm22 = class(TForm)

Label1: TLabel;

DateTimePicker1: TDateTimePicker;

Label2: TLabel;

DateTimePicker2: TDateTimePicker;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form22: TForm22;

 

implementation

 

uses Unit1, Unit8, Uoocalc;

 

{$R *.dfm}

 

procedure TForm22.RzBitBtn2Click(Sender: TObject);

begin

form22.close;

end;

 

procedure TForm22.RzBitBtn1Click(Sender: TObject);

var year1,mon1,dt1:word ; m1,d1:string[2]; day1,day2:string[20]; calc:toocalc; i:integer;

begin

decodedate(datetimepicker1.Date,year1,mon1,dt1);

if mon1<10 then m1:='0'+inttostr(mon1) else m1:=inttostr(mon1);

if dt1<10 then d1:='0'+inttostr(dt1) else d1:=inttostr(dt1);

day1:=inttostr(year1)+'/'+m1+'/'+d1;

decodedate(datetimepicker2.Date,year1,mon1,dt1);

if mon1<10 then m1:='0'+inttostr(mon1) else m1:=inttostr(mon1);

if dt1<10 then d1:='0'+inttostr(dt1) else d1:=inttostr(dt1);

day2:=inttostr(year1)+'/'+m1+'/'+d1;

with form1.ADOQuery17 do

begin

close;

sql.Clear;

sql.Add('select sum(nach), sum(post), sum(korr) from paydoc where (day<#'+day1+'#) and (telnum='+form1.Label1.Caption+form8.DBText4.Caption+form1.Label1.Caption+')');

open;

end;

calc:=toocalc.Create('c:\telekom\xlt\saldo.xlt');

calc.Cell[3,2]:=datetostr(datetimepicker1.Date)+' составляет '+ currtostr(form1.ADOQuery17Expr1000.AsCurrency+form1.ADOQuery17Expr1002.AsCurrency-form1.ADOQuery17Expr1001.AsCurrency)+'p.';

calc.Cell[2,3]:=form8.DBText4.Caption;

with form1.ADOQuery9 do

begin

close;

sql.Clear;

sql.Add('select * from paydoc where (telnum='+form1.Label1.Caption+trim(form8.DBText4.Caption)+form1.Label1.caption+') and (day>=#'+day1+'#) and (day<=#'+day2+'#)');

open;

last;

end;

for i:=1 to form1.ADOQuery9.RecordCount do

begin

calc.Cell[8,1]:=form1.ADOQuery9day.AsString;

calc.Cell[8,2]:=form1.ADOQuery9nach.AsString;

calc.Cell[8,3]:=form1.ADOQuery9post.AsCurrency;

calc.Cell[8,4]:=form1.adoquery9korr.AsCurrency;

if i<form1.ADOQuery9.RecordCount then calc.InsertRow(8,true);

form1.ADOQuery9.prior;

end;

with form1.ADOQuery17 do

begin

close;

sql.Clear;

sql.Add('select sum(nach), sum(post), sum(korr) from paydoc where (day<=#'+day2+'#) and (telnum='+form1.Label1.Caption+form8.DBText4.Caption+form1.Label1.Caption+')');

open;

end;

calc.Cell[9+form1.ADOQuery9.RecordCount,1]:='Сальдо на '+' '+datetostr(datetimepicker2.Date)+' составляет '+ currtostr(form1.ADOQuery17Expr1000.AsCurrency+form1.ADOQuery17Expr1002.AsCurrency-form1.ADOQuery17Expr1001.AsCurrency)+'p.';

 

calc.Visible:=true;

end;

 

end.

unit Unit23;

 

interface

 

uses

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

Dialogs, RzButton, DBCtrls, StdCtrls, DB, ExtCtrls, Grids, DBGrids;

 

type

TForm23 = class(TForm)

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

DataSource1: TDataSource;

Label1: TLabel;

DBText1: TDBText;

Label2: TLabel;

DBText2: TDBText;

Label3: TLabel;

DBText3: TDBText;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form23: TForm23;

 

implementation

 

uses Unit1, Unit24, Unit25;

 

{$R *.dfm}

 

procedure TForm23.RzBitBtn3Click(Sender: TObject);

begin

form23.close;

end;

 

procedure TForm23.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery19 do

begin

close;

sql.Clear;

sql.Add('select max(code) from uslugi');

open;

end;

if form1.ADOQuery19.RecordCount>0 then form24.Edit1.Text:=inttostr(1+form1.ADOQuery19Expr1000.AsInteger) else form24.edit1.Text:='1';

with form24 do

begin

edit2.clear;

edit3.clear;

show;

end;

end;

 

procedure TForm23.RzBitBtn2Click(Sender: TObject);

begin

form25.RzEdit1.Text:=dbtext1.Caption;

form25.RzEdit2.Text:=dbtext2.Caption;

form25.RzEdit3.Text:=dbtext3.Caption;

form25.Show;

end;

 

end.

unit Unit24;

 

interface

 

uses

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

Dialogs, StdCtrls, Buttons;

 

type

TForm24 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Edit3: TEdit;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form24: TForm24;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm24.BitBtn1Click(Sender: TObject);

begin

form1.adoquery18.AppendRecord([edit1.Text,edit2.Text,edit3.Text]);

edit1.Text:=inttostr(1+strtoint(edit1.Text));

edit2.clear;

edit3.Clear;

showmessage('Записано');

end;

 

end.

unit Unit25;

 

interface

 

uses

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

Dialogs, RzButton, StdCtrls, Mask, RzEdit;

 

type

TForm25 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

RzEdit1: TRzEdit;

RzEdit2: TRzEdit;

RzEdit3: TRzEdit;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

procedure RzBitBtn2Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form25: TForm25;

 

implementation

 

uses Unit1;

 

{$R *.dfm}

 

procedure TForm25.RzBitBtn2Click(Sender: TObject);

begin

form25.close;

end;

 

procedure TForm25.RzBitBtn1Click(Sender: TObject);

begin

with form1.ADOQuery18 do

begin

close;

sql.Clear;

sql.Add('update uslugi set nam='+form1.Label1.Caption+trim(rzedit2.Text)+form1.Label1.Caption+' where code='+rzedit1.Text);

execsql;

close;

sql.Clear;

sql.Add('update uslugi set tar='+trim(rzedit3.Text)+' where code='+rzedit1.Text);

execsql;

close;

sql.Clear;

sql.Add('select * from uslugi');

active:=true;

end;

form1.ADOQuery18.Locate('code',rzedit1.Text,[]);

showmessage('Записано');

end;

 

end.

unit Unit26;

 

interface

 

uses

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

Dialogs, RzButton, ComCtrls, StdCtrls;

 

type

TForm26 = class(TForm)

Label1: TLabel;

ComboBox1: TComboBox;

Label2: TLabel;

ComboBox2: TComboBox;

Label3: TLabel;

DateTimePicker1: TDateTimePicker;

RzBitBtn1: TRzBitBtn;

RzBitBtn2: TRzBitBtn;

RzBitBtn3: TRzBitBtn;

procedure RzBitBtn3Click(Sender: TObject);

procedure RzBitBtn1Click(Sender: TObject);

procedure RzBitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form26: TForm26;

 

implementation

 

uses Unit1, UOOcalc;

 

{$R *.dfm}

 

procedure TForm26.RzBitBtn3Click(Sender: TObject);

begin

form26.close;

end;

 








Date: 2015-10-21; view: 2319; Нарушение авторских прав



mydocx.ru - 2015-2021 year. (0.558 sec.) Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав - Пожаловаться на публикацию