
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Var f:textfile;
- •Var f:Textfile;
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
ПРИЛОЖЕНИЕ А (обязательное)
Листинг программы
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, XPMan, Buttons;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Button1: TButton;
Button2: TButton;
Label2: TLabel;
LabeledEdit1: TLabeledEdit;
XPManifest1: TXPManifest;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
pass:string;
implementation
uses Unit2, Unit3, Unit12;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var F:Textfile;
begin
AssignFile(f, 'pass.txt');
reset(f);
Readln(f,pass);
if combobox1.ItemIndex=0 then
begin
if LabeledEdit1.text=pass then
begin form2.show; //form1.visible:=false;
Showmessage('Успешно');
closefile(f);
end;
end;
if combobox1.ItemIndex=1 then begin form3.show; //form1.Visible:=false;
Showmessage('Добро пожаловать пользователь');
closefile(f);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
application.Terminate;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if combobox1.ItemIndex=0 then LabeledEdit1.Visible:=true
else LabeledEdit1.Visible:=false;
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
case key of
#13:button1click(sender);
#27:button2click(sender);
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
form12.show;
end;
end.
unit Unit11;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, Grids, DBGrids, DBCtrls;
type
TForm11 = class(TForm)
DBGrid1: TDBGrid;
LabeledEdit1: TLabeledEdit;
DBNavigator1: TDBNavigator;
procedure LabeledEdit1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form11: TForm11;
Implementation
uses Unit5;
{$R *.dfm}
procedure TForm11.LabeledEdit1Change(Sender: TObject);
begin
if Length(LabeledEdit1.Text) > 0 then
begin
DataModule5.ADOQuery6.Filtered:=false;
DataModule5.ADOQuery6.Filter:='Наименование LIKE '+ #39 + LabeledEdit1.Text + '%' + #39;
DataModule5.ADOQuery6.Filtered:=true;
end
else DataModule5.ADOQuery6.Filtered:=false;
end;
end.
unit Unit12;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ShellApi, StdCtrls;
type
TForm12 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
Memo2: TMemo;
Label2: TLabel;
Label3: TLabel;
Memo3: TMemo;
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
Implementation
{$R *.dfm}
procedure TForm12.Label2Click(Sender: TObject);
begin
ShellExecute(0, 'open', 'http://www.moy-rebenok.kz/', nil, nil, SW_SHOW)
end;
end.
unit Unit13;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, DBGrids, Mask, ExtCtrls, DBCtrls;
type
TForm13 = class(TForm)
DBGrid1: TDBGrid;
LabeledEdit2: TLabeledEdit;
LabeledEdit4: TLabeledEdit;
Label1: TLabel;
MaskEdit1: TMaskEdit;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label2: TLabel;
DBMemo1: TDBMemo;
Button1: TButton;
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form13: TForm13;
Implementation
uses Unit5;
{$R *.dfm}
procedure TForm13.BitBtn3Click(Sender: TObject);
begin
DataModule5.ADOQuery6.Prior;
end;
procedure TForm13.BitBtn4Click(Sender: TObject);
begin
DataModule5.ADOQuery6.Next;
end;
procedure TForm13.BitBtn2Click(Sender: TObject);
begin
try
if (Trim(LabeledEdit2.Text)='') or (Trim(LabeledEdit4.Text)='') then
begin
exit; // LabeledEdit
end;
DataModule5.ADOQuery1.Insert;
DataModule5.ADOQuery1.FieldByName('Èìÿ').AsString:=LabeledEdit2.Text;
DataModule5.ADOQuery1.FieldByName('Телефон').AsString:=LabeledEdit4.Text;
DataModule5.ADOQuery1.FieldByName('Äàòà').AsString:=MaskEdit1.Text;
DataModule5.ADOQuery1.FieldByName('Товар').AsString :=DataModule5.ADOQuery6.FieldByName('Наименование').AsString;
DataModule5.ADOQuery1.FieldByName('Öåíà').AsString :=DataModule5.ADOQuery6.FieldByName('Öåíà').AsString;
DataModule5.ADOQuery1.Post;
except
on e:Exception do
end;
ShowMessage('Заказ принят! Ожидайте звонка оператора.');
end;
procedure TForm13.Button1Click(Sender: TObject);
begin
DataModule5.ADOquery6.Sort:='Наименование ASC';
end;
end.
unit Unit2;