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

📄 zdznozd.pas

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

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, ExtCtrls, StdCtrls;

type
  Tzdform = class(TForm)
    Label1: TLabel;
    zdrmno: TEdit;
    Button1: TButton;
    Button2: TButton;
    Bevel1: TBevel;
    q1: TQuery;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button2Click(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure zdrmnoDblClick(Sender: TObject);
    procedure zdrmnoExit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  zdform: Tzdform;

implementation

uses dataproc, xgft;

{$R *.DFM}

procedure Tzdform.FormCreate(Sender: TObject);
begin
   zdrmno.text:='';
end;

procedure Tzdform.Button1Click(Sender: TObject);
begin
  if length(trim(zdrmno.text))>0 then
     begin
     q1.Active :=false;
     q1.sql.clear;
     q1.sql.add('select handno from nowin where (handno=:phandno) and (istime=:pzd) and (isbj=:pbj)');
     q1.ParamByName ('phandno').asstring:=trim(zdrmno.text);
     q1.parambyname('pzd').asboolean:=true;
     q1.parambyname('pbj').asboolean:=true;
     q1.Prepare;
     q1.open;
     q1.active:=true;
     if q1.RecordCount =0 then
        begin
        showmessage('房间错误');
        zdrmno.setfocus;
        exit;
        end
     else
        begin
        q1.Active :=false;
        q1.sql.clear;
        q1.sql.add('update nowin set istime=:pnozd,roomprice=(select max(price) from room where roomno=:phd) ,truntime=12   where (handno=:phd) and (istime=:ppzd) and (isbj=:ppbj)');
        q1.parambyname('pnozd').asboolean:=false;
        q1.ParamByName ('phd').asstring:=trim(zdrmno.text);
        q1.ParamByName ('ppzd').asboolean:=true;
        q1.ParamByName ('ppbj').asboolean:=true;
        q1.Prepare;
        q1.ExecSQL;
        q1.Active :=false;
        addlogo(curper.code,datetimetostr(now),trim(zdrmno.text)+'转非钟点');
        showmessage('钟点房换非钟点房成功');
        zdrmno.text:='';
        zdrmno.setfocus;
        end;
     end;
end;

procedure Tzdform.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  q1.free;
end;

procedure Tzdform.Button2Click(Sender: TObject);
begin
  zdform.close;
end;

procedure Tzdform.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key=112 then
  begin
    if xt=0 then help(16);
  end;
  if key=13 then
     selectnext(activecontrol,true,true);
  if key=27 then
     zdform.close;   
end;

procedure Tzdform.zdrmnoDblClick(Sender: TObject);
begin
  Application.CreateForm(Txgftform, xgftform);
  xgftform.Caption:='';
  xgftform.Button2.Visible:=false;
  xgftform.Timer1.Free;
  xgftform.showmodal;
  zdrmno.text:=xgftform.xgrmno.Text;
  xgftform.Free;
  activecontrol:=Button1;

end;

procedure Tzdform.zdrmnoExit(Sender: TObject);
var aa:array[0..1] of string;
begin
  if trim(zdrmno.text)<>'' then
  begin
     getvalue(aa,'select IsTime from nowin where roomno='''+zdrmno.text+'''');
     if trim(aa[0])<>'True' then
     begin
       showmessage(zdrmno.text+'房间不是钟点房');
       zdrmno.text:='';
     end;
  end;

end;

end.

⌨️ 快捷键说明

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