⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctmenu.pas

📁 集成酒店桑拿食管管理的完整程序
💻 PAS
字号:
unit ctmenu;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, StdCtrls, Grids, DBGrids, ExtCtrls, Db, DBTables, ImgList,
  ComCtrls, ToolWin;

type
  Tmenu = class(TForm)
    MainMenu1: TMainMenu;
    y0: TMenuItem;
    c0: TMenuItem;
    c1: TMenuItem;
    z0: TMenuItem;
    s0: TMenuItem;
    y1: TMenuItem;
    N13: TMenuItem;
    z1: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    d0: TMenuItem;
    h0: TMenuItem;
    h1: TMenuItem;
    h2: TMenuItem;
    y6: TMenuItem;
    y7: TMenuItem;
    c3: TMenuItem;
    j0: TMenuItem;
    j1: TMenuItem;
    y2: TMenuItem;
    s1: TMenuItem;
    N10: TMenuItem;
    Timer1: TTimer;
    N9: TMenuItem;
    y4: TMenuItem;
    y5: TMenuItem;
    c4: TMenuItem;
    c2: TMenuItem;
    y3: TMenuItem;
    t0: TMenuItem;
    t1: TMenuItem;
    t2: TMenuItem;
    q0: TMenuItem;
    Panel1: TPanel;
    ImageList1: TImageList;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton4: TToolButton;
    ToolButton8: TToolButton;
    ToolButton9: TToolButton;
    ToolButton10: TToolButton;
    ToolButton11: TToolButton;
    ToolButton12: TToolButton;
    ToolButton13: TToolButton;
    ToolButton14: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    Panel2: TPanel;
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    ListView2: TListView;
    t3: TMenuItem;
    procedure N15Click(Sender: TObject);
    procedure d0Click(Sender: TObject);
    procedure y6Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Image1Click(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure h2Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure y1Click(Sender: TObject);
    procedure y4Click(Sender: TObject);
    procedure y5Click(Sender: TObject);
    procedure c1Click(Sender: TObject);
    procedure c2Click(Sender: TObject);
    procedure c3Click(Sender: TObject);
    procedure y2Click(Sender: TObject);
    procedure y3Click(Sender: TObject);
    procedure z1Click(Sender: TObject);
    procedure s1Click(Sender: TObject);
    procedure t1Click(Sender: TObject);
    procedure j1Click(Sender: TObject);
    procedure t2Click(Sender: TObject);
    procedure q0Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure ListView2Click(Sender: TObject);
    procedure t3Click(Sender: TObject);
    procedure y7Click(Sender: TObject);
    procedure h1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  menu: Tmenu;

implementation

uses dataproc, login, ctdj, ctdjcx, ctlscx, ctcdlr, scqr, ctcdcx,
  ctdjqx, ctexitz, ctjz, cdwh, ctbtj, ctjk, ctxstj, ctxsbtj, ctrtj, ctqt,
  ctcbhs,seerz,about;

{$R *.DFM}

procedure Tmenu.N15Click(Sender: TObject);
begin
   close;
end;

procedure Tmenu.d0Click(Sender: TObject);
begin
     n10.enabled:=false;
     y0.enabled:=false;
     y1.enabled:=false;
     y2.enabled:=false;
     y3.enabled:=false;
     y4.enabled:=false;
     y5.enabled:=false;
     c0.enabled:=false;
     c1.enabled:=false;
     c2.enabled:=false;
     c3.enabled:=false;
     c4.enabled:=false;
     z0.enabled:=false;
     z1.enabled:=false;
     q0.Enabled :=false;
     t0.Enabled :=false;
     t1.Enabled :=false;
     t2.Enabled :=false;
     t3.Enabled :=false;
     j0.Enabled :=false;
     s0.Enabled :=false;
     ListView2.Enabled:=false;
     ToolButton1.Enabled:=false;
     ToolButton2.Enabled:=false;
     ToolButton4.Enabled:=false;
     ToolButton8.Enabled:=false;
     ToolButton9.Enabled:=false;
     ToolButton10.Enabled:=false;
     ToolButton11.Enabled:=false;
     ToolButton12.Enabled:=false;
     ToolButton13.Enabled:=false;
     ToolButton14.Enabled:=false;
  if curper.code<>'' then
    addlogo(curper.code,datetimetostr(now),'退出系统');
  curper.code:='';
  curper.dept:='';
  Application.CreateForm(Tlog, log);
  log.showmodal;
  if trim(curper.dept)='餐饮部' then
  begin
    addlogo(curper.code,datetimetostr(now),'登录系统');
    lc:=copy(curper.Headship,1,1);
     n10.enabled:=true;
     y0.enabled:=true;
     y1.enabled:=true;
     y2.enabled:=true;
     y3.enabled:=true;
     y4.enabled:=true;
     y5.enabled:=true;
     c0.enabled:=true;
     c1.enabled:=true;
     c2.enabled:=true;
     c3.enabled:=true;
     c4.enabled:=true;
     z0.enabled:=true;
     z1.enabled:=true;
     q0.Enabled :=true;
     t0.Enabled :=true;
     t1.Enabled :=true;
     t2.Enabled :=true;
     t3.Enabled :=true;
     j0.Enabled :=true;
     s0.Enabled :=true;
     ListView2.Enabled:=true;
     ToolButton1.Enabled:=true;
     ToolButton2.Enabled:=true;
     ToolButton4.Enabled:=true;
     ToolButton8.Enabled:=true;
     ToolButton9.Enabled:=true;
     ToolButton10.Enabled:=true;
     ToolButton11.Enabled:=true;
     ToolButton12.Enabled:=true;
     ToolButton13.Enabled:=true;
     ToolButton14.Enabled:=true;
  end
  else
    n10.Enabled :=false;

  log.free;
end;

procedure Tmenu.y6Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅解锁');

  allunlock('餐厅');
end;

procedure Tmenu.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if curper.code<>'' then
     addlogo(curper.code,datetimetostr(now),'退出系统');
//  exitwindowsex(EWX_shutdown,0);
    Halt;
end;

procedure Tmenu.Image1Click(Sender: TObject);
begin
  if length(trim(curper.code))>0 then
     begin
     addlogo(curper.code,datetimetostr(now),'来客登记');
//     Application.CreateForm(Tdjform, djform);
 //    djform.showmodal;
     end;
end;

procedure Tmenu.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key=112 then
      h2Click(nil);
  if key=13 then
     if length(trim(curper.code))>0 then
        begin
        end;
end;

procedure Tmenu.FormCreate(Sender: TObject);
begin
   if not FileExists('c:\windows\system\Dpnodemx.DLL') then
   begin
//     close;
   end;
   xt:=0;
   fm.query1.close;
   fm.query1.sql.clear;
   fm.query1.sql.add('Select UnitName from syssetup');
   fm.query1.open;
   Label1.Caption:=trim(unpassname(fm.query1.Fields[0].asstring))+'餐厅管理系统';
   Label1.Left:=strtoint(floattostr(int((Width-Label1.Width)/2)));
   fm.query1.close;
   fm.Query1.UnPrepare;
   fm.query1.RequestLive:=false;
   Timer1Timer(nil);

end;

procedure Tmenu.h2Click(Sender: TObject);
begin
    winhelp(0,Pchar('前台帮助.hlp'),HELP_FINDER,0);

end;

procedure Tmenu.Timer1Timer(Sender: TObject);
var ls:string;
begin
   Label2.Caption:=formatdatetime('yyyy''年''mm''月''dd''日'' hh:mm:ss',now);
   if (copy(Label2.Caption,19,5)<>'30:00') and (Timer1.Enabled) then
     exit;
   fm.query1.close;
   fm.query1.sql.clear;
   fm.query1.sql.add('Select MoneyTime from syssetup');
   fm.query1.open;
   if trim(fm.query1.Fields[0].asstring)<>passzh('199908191918') then
   begin
     ls:=trim(unpassname(fm.query1.Fields[0].asstring));
     fm.query1.close;
     fm.Query1.UnPrepare;
     fm.query1.RequestLive:=false;
     if ls='' then
     begin
        showmessage('请先在系统维护中设定试用时间');
        close;
        exit;
     end;
     try
       if strtodatetime(ls)-now>100 then
       begin
         showmessage('试用期设定不对,请重新设定');
         close;
         exit;
       end;
       if strtodatetime(ls)<now then
       begin
         showmessage('试用期已过,请与供应商联系');
         close;
         exit;
       end;
       if strtodatetime(ls)-now<3 then
       begin
          showmessage('试用期已剩'+floattostr(int((strtodatetime(ls)-now)+0.9))+'天了,请尽快与供应商联系');
       end;
     except
     begin
         showmessage('试用期已过,请与供应商联系');
         close;
         exit;
     end;
     end;
   end
   else
   begin
     fm.query1.close;
     fm.Query1.UnPrepare;
     fm.query1.RequestLive:=false;
   end;
end;

procedure Tmenu.y1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'用餐登记');
  Application.CreateForm(Tycdjform, ycdjform);
  ycdjform.showmodal;
  ycdjform.free;

end;

procedure Tmenu.y4Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'用餐查询');
  Application.CreateForm(Tctdjcxform, ctdjcxform);
  ctdjcxform.showmodal;
  ctdjcxform.free;

end;

procedure Tmenu.y5Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'用餐历史查询');
  Application.CreateForm(Tctlscxform, ctlscxform);
  ctlscxform.showmodal;
  ctlscxform.free;

end;

procedure Tmenu.c1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'菜单录入');
  Application.CreateForm(Tctdcform, ctdcform);
  ctdcform.showmodal;
  ctdcform.free;

end;

procedure Tmenu.c2Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'上菜确认');
  Application.CreateForm(TscqrForm, scqrForm);
  scqrForm.showmodal;
  scqrForm.free;

end;

procedure Tmenu.c3Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'菜单查询');
  Application.CreateForm(TcdcxForm, cdcxForm);
  cdcxForm.showmodal;
  cdcxForm.free;

end;

procedure Tmenu.y2Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅登记撤消');
  Application.CreateForm(Tctdjqxform, ctdjqxform);
  ctdjqxform.showmodal;
  ctdjqxform.free;

end;

procedure Tmenu.y3Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅退桌');
  Application.CreateForm(Ttzform, tzform);
  tzform.showmodal;
  tzform.free;

end;

procedure Tmenu.z1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅结帐');
  Application.CreateForm(TctjzForm, ctjzForm);
  ctjzForm.showmodal;
  ctjzForm.free;

end;

procedure Tmenu.s1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'菜谱维护');
  Application.CreateForm(TcdwhForm, cdwhForm);
  cdwhForm.showmodal;
  cdwhForm.free;

end;

procedure Tmenu.t1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'收入统计');
  Application.CreateForm(TdbsrtjForm, dbsrtjForm);
  dbsrtjForm.showmodal;
  dbsrtjForm.free;

end;

procedure Tmenu.j1Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅交款');
  Application.CreateForm(Tctjkform, ctjkform);
  ctjkform.showmodal;
  ctjkform.free;

end;

procedure Tmenu.t2Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐厅销售统计');
  Application.CreateForm(TctxsbtjForm, ctxsbtjForm);
  ctxsbtjForm.showmodal;
  ctxsbtjForm.free;

end;

procedure Tmenu.q0Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐台维护');
  Application.CreateForm(TctqtForm, ctqtForm);
  ctqtForm.showmodal;
  ctqtForm.free;

end;

procedure Tmenu.FormShow(Sender: TObject);
begin
       ListView2.Items.Add;
       ListView2.Items[0].ImageIndex:=y1.ImageIndex;
       ListView2.Items[0].Caption:=y1.Caption;
       ListView2.Items.Add;
       ListView2.Items[1].ImageIndex:=y2.ImageIndex;
       ListView2.Items[1].Caption:=y2.Caption;
       ListView2.Items.Add;
       ListView2.Items[2].ImageIndex:=y3.ImageIndex;
       ListView2.Items[2].Caption:=y3.Caption;
       ListView2.Items.Add;
       ListView2.Items[3].ImageIndex:=y4.ImageIndex;
       ListView2.Items[3].Caption:=y4.Caption;
       ListView2.Items.Add;
       ListView2.Items[4].ImageIndex:=y5.ImageIndex;
       ListView2.Items[4].Caption:=y5.Caption;
       ListView2.Items.Add;
       ListView2.Items[5].ImageIndex:=y6.ImageIndex;
       ListView2.Items[5].Caption:=y6.Caption;
       ListView2.Items.Add;
       ListView2.Items[6].ImageIndex:=y7.ImageIndex;
       ListView2.Items[6].Caption:=y7.Caption;
       ListView2.Items.Add;
       ListView2.Items[7].ImageIndex:=c1.ImageIndex;
       ListView2.Items[7].Caption:=c1.Caption;
       ListView2.Items.Add;
       ListView2.Items[8].ImageIndex:=c2.ImageIndex;
       ListView2.Items[8].Caption:=c2.Caption;
       ListView2.Items.Add;
       ListView2.Items[9].ImageIndex:=c3.ImageIndex;
       ListView2.Items[9].Caption:=c3.Caption;
{       ListView2.Items.Add;
       ListView2.Items[10].ImageIndex:=c4.ImageIndex;
       ListView2.Items[10].Caption:=c4.Caption; }
       ListView2.Items.Add;
       ListView2.Items[10].ImageIndex:=z1.ImageIndex;
       ListView2.Items[10].Caption:=z1.Caption;
       ListView2.Items.Add;
       ListView2.Items[11].ImageIndex:=q0.ImageIndex;
       ListView2.Items[11].Caption:=q0.Caption;
       ListView2.Items.Add;
       ListView2.Items[12].ImageIndex:=t1.ImageIndex;
       ListView2.Items[12].Caption:=t1.Caption;
       ListView2.Items.Add;
       ListView2.Items[13].ImageIndex:=t2.ImageIndex;
       ListView2.Items[13].Caption:=t2.Caption;
       ListView2.Items.Add;
       ListView2.Items[14].ImageIndex:=j1.ImageIndex;
       ListView2.Items[14].Caption:=j1.Caption;
       ListView2.Items.Add;
       ListView2.Items[15].ImageIndex:=s1.ImageIndex;
       ListView2.Items[15].Caption:=s1.Caption;
       ListView2.Items.Add;
       ListView2.Items[16].ImageIndex:=d0.ImageIndex;
       ListView2.Items[16].Caption:=d0.Caption;
       ListView2.Items.Add;
       ListView2.Items[17].ImageIndex:=h1.ImageIndex;
       ListView2.Items[17].Caption:=h1.Caption;
       ListView2.Items.Add;
       ListView2.Items[18].ImageIndex:=h2.ImageIndex;
       ListView2.Items[18].Caption:=h2.Caption;
       ListView2.Items.Add;
       ListView2.Items[19].ImageIndex:=t3.ImageIndex;
       ListView2.Items[19].Caption:=t3.Caption;

end;

procedure Tmenu.ListView2Click(Sender: TObject);
begin
  if (ListView2.Selected=nil) then exit;
     case ListView2.Selected.Index of
     0:y1Click(nil);
     1:y2Click(nil);
     2:y3Click(nil);
     3:y4Click(nil);
     4:y5Click(nil);
     5:y6Click(nil);
     6:y7Click(nil);
     7:c1Click(nil);
     8:c2Click(nil);
     9:c3Click(nil);
//     10:c4Click(nil);
     10:Z1Click(nil);
     11:q0Click(nil);
     12:t1Click(nil);
     13:t2Click(nil);
     14:j1Click(nil);
     15:s1Click(nil);
     16:d0Click(nil);
     17:h1Click(nil);
     18:h2Click(nil);
     19:t3Click(nil);
     end;

end;

procedure Tmenu.t3Click(Sender: TObject);
begin
  addlogo(curper.code,datetimetostr(now),'餐台维护');
  Application.CreateForm(TctcbhsForm, ctcbhsForm);
  ctcbhsForm.showmodal;
  ctcbhsForm.free;

end;

procedure Tmenu.y7Click(Sender: TObject);
begin
 { Application.CreateForm(TForm1, Form1);
  form1.showmodal;
  form1.free;     }
end;

procedure Tmenu.h1Click(Sender: TObject);
begin
  Application.CreateForm(TAboutBox,AboutBox);
  AboutBox.showmodal;
  AboutBox.free;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -