Смекни!
smekni.com

Автоматизация заказа блюд в ресторане (стр. 4 из 4)

begin

MKeyvalue:=0;

repeat

MKeyvalue:=MKeyvalue+1;

until varType(T_typeB.lookup('IdTB',MKeyvalue,'IdTB'))=varnull;

end;

procedure TMainForm.T_typeBAfterInsert(DataSet: TDataSet);

begin

T_typeB.edit;

T_typeBIdTB.Value:=MKeyvalue;

T_typeBNameTB.Value:=' ';

T_typeB.Post;

InformForm.DBGrid4.Refresh;

end;

procedure TMainForm.BitBtn2Click(Sender: TObject);

begin

AboutBox.showmodal;

end;

procedure TMainForm.FormShow(Sender: TObject);

begin

memo1.Text:='Добро пожаловать в программу "Ресторан"';

end;

{-------------------------------------------------}

procedure TMainForm.TreeView1Click(Sender: TObject);

var F:integer;

begin

{определение текущей выделеннки}

for f:=0 to 15 do if TreeView1.Items[f].Selected then break;

memo1.Clear;

case f of

0:begin

ZakazForm.Show;

InformForm.Hide;

Aboutbox.Hide;

memo1.Text:='Ведение заказов';

end;

1:begin

InformForm.Show;Aboutbox.Hide;

InformForm.PageControl1.ActivePageIndex:=0;

InformForm.SetFocus;

memo1.Text:='Ведение справочников';

end;

2:begin

InformForm.PageControl1.ActivePageIndex:=0;

memo1.Text:='Определение меню, заполение списка блюд';

end;

3:begin //InformFrame1.PageControl1.ActivePageIndex:=1;

InformForm.PageControl1.ActivePageIndex:=1;

memo1.Text:='Ведениесостоянияпродуктов';

end;

4:begin

InformForm.PageControl1.ActivePageIndex:=2;

memo1.Text:='Дополнительные справочники, типы ед. измерения, типы блюд';

end;

{Reports}

5:begin

InformForm.Hide;

Aboutbox.Hide;

ZakazForm.Hide;

memo1.Text:='Отчеты';

end;

{Menu} 6:begin

MenuForm.QuickRep1.Refresh;

memo1.Text:='Просмотр меню, печать';

end;

{Preview}7:begin

memo1.Text:='Просмотрменю';

MenuForm.Query1.Close;

MenuForm.Query1.Open;

MenuForm.QuickRep1.Preview;

end;

{Print}8:begin

memo1.Text:='Печатьменю';

MenuForm.Query1.Close;

MenuForm.Query1.Open;

MenuForm.QuickRep1.Print;

end;

{Zakaz} 9:FRepZakaz.QuickRep1.Preview;

10: begin

memo1.Text:='Настройкашрифтаменю';

FontDialog1.Font := MainForm.Font;

if FontDialog1.Execute then TreeView1.font:=FontDialog1.Font

end;

end;

end;

procedure TMainForm.FormActivate(Sender: TObject);

begin

T_EI.open;

T_Prodinrec.open;

T_products.open;

T_spisokB.open;

T_zakaz.open;

T_typeB.open;

end;

procedure TMainForm.T_zakazCalcFields(DataSet: TDataSet);

begin

T_zakazCalc_stoim.AsCurrency:=T_zakazKol_voZ.AsCurrency + T_zakazLU_CEnaB.AsCurrency

end;

end.

unit RepMenu;

interface

uses

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

Dialogs, StdCtrls, QuickRpt, QRCtrls, ExtCtrls, DB, DBTables;

type

TMenuForm = class(TForm)

QuickRep1: TQuickRep;

QRBand1: TQRBand;

QRLabel1: TQRLabel;

Query1: TQuery;

DataSource1: TDataSource;

QRDBText1: TQRDBText;

QRDBText2: TQRDBText;

QRBand2: TQRBand;

QRDBText3: TQRDBText;

QRDBText4: TQRDBText;

QRDBText5: TQRDBText;

QRDBText6: TQRDBText;

QRBand3: TQRBand;

QRExpr1: TQRExpr;

QRDBText7: TQRDBText;

QRLabel2: TQRLabel;

QRLabel3: TQRLabel;

QRLabel4: TQRLabel;

QRExpr2: TQRExpr;

QRLabel5: TQRLabel;

QRLabel6: TQRLabel;

QRShape2: TQRShape;

QRShape3: TQRShape;

QRShape4: TQRShape;

QRLabel7: TQRLabel;

QRShape5: TQRShape;

QRShape1: TQRShape;

QRShape6: TQRShape;

private

{ Private declarations }

public

{ Public declarations }

end;

var

MenuForm: TMenuForm;

implementation

{$R *.dfm}

end.

unit RepZakaz;

interface

uses

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

Dialogs, QuickRpt, QRCtrls, ExtCtrls;

type

TFRepZakaz = class(TForm)

QuickRep1: TQuickRep;

QRBand1: TQRBand;

QRBand2: TQRBand;

QRDBText1: TQRDBText;

QRDBText2: TQRDBText;

QRLabel1: TQRLabel;

QRBand3: TQRBand;

QRLabel2: TQRLabel;

QRLabel3: TQRLabel;

QRShape1: TQRShape;

private

{ Private declarations }

public

{ Public declarations }

end;

var

FRepZakaz: TFRepZakaz;

implementation

uses Main;

{$R *.dfm}

end.

unit ZakazUnit;

interface

uses

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

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

type

TZakazForm = class(TForm)

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

BitBtn1: TBitBtn;

Clear: TBitBtn;

Panel1: TPanel;

Preview: TBitBtn;

Print: TBitBtn;

Memo1: TMemo;

MaskEdit1: TEdit;

procedure ClearClick(Sender: TObject);

procedure PreviewClick(Sender: TObject);

procedure PrintClick(Sender: TObject);

procedure FormActivate(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

ZakazForm: TZakazForm;

implementation

uses Main, RepZakaz;

{$R *.dfm}

procedure TZakazForm.ClearClick(Sender: TObject);

begin

MainForm.T_zakaz.close;

MainForm.T_zakaz.EmptyTable;

MainForm.T_zakaz.Open;

end;

procedure TZakazForm.PreviewClick(Sender: TObject);

begin

FRepZakaz.QuickRep1.Preview;

end;

procedure TZakazForm.PrintClick(Sender: TObject);

begin

FRepZakaz.QuickRep1.Print;

end;

procedure TZakazForm.FormActivate(Sender: TObject);

begin

if not(MainForm.T_zakaz.Active) then MainForm.T_zakaz.Open;

end;

procedure TZakazForm.BitBtn1Click(Sender: TObject);

begin

ZakazForm.Hide;

end;

end.