📄 nozdzzd.pas
字号:
unit nozdzzd;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Db, DBTables;
type
Tnozdform = class(TForm)
Label1: TLabel;
nozdrmno: TEdit;
Bevel1: TBevel;
Button1: TButton;
Button2: TButton;
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 nozdrmnoDblClick(Sender: TObject);
procedure nozdrmnoExit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
nozdform: Tnozdform;
implementation
uses dataproc, xgft;
{$R *.DFM}
procedure Tnozdform.FormCreate(Sender: TObject);
begin
nozdrmno.text:='';
end;
procedure Tnozdform.Button1Click(Sender: TObject);
begin
if length(trim(nozdrmno.text))>0 then
begin
q1.Active :=false;
q1.sql.Clear ;
q1.sql.add('select handno from nowin where (handno=:phdno) and (isbj=:pbj) and (istime=:ptime)');
q1.ParamByName ('phdno').asstring:=trim(nozdrmno.text);
q1.ParamByName ('pbj').asboolean:=true;
q1.ParamByName ('ptime').asboolean:=false;
q1.Prepare;
q1.open;
// q1.Active :=true;
if q1.RecordCount >0 then
begin
q1.Active :=false;
q1.sql.clear;
q1.sql.add('update nowin set istime=:ptm,roomprice=(select max(zdprice) from room where roomno=:phdno),truntime=3 where ((handno=:phdno) and (isbj=:ppbj) and (istime=:pptm))');
q1.ParamByName ('ptm').asboolean:=true;
q1.ParamByName ('phdno').asstring:=trim(nozdrmno.text);
q1.ParamByName ('ppbj').asboolean:=true;
q1.ParamByName ('pptm').asboolean:=false;
q1.Prepare;
q1.execsql;
q1.Active :=false;
addlogo(curper.code,datetimetostr(now),trim(nozdrmno.text)+'转钟点');
showmessage('非钟点房间转钟点房间成功');
nozdrmno.text:='';
nozdrmno.SetFocus ;
end;
end;
end;
procedure Tnozdform.FormClose(Sender: TObject; var Action: TCloseAction);
begin
q1.Free;
end;
procedure Tnozdform.Button2Click(Sender: TObject);
begin
nozdform.close;
end;
procedure Tnozdform.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=112 then
begin
if xt=0 then help(17);
end;
if key=13 then
selectnext(activecontrol,true,true);
if key=27 then
nozdform.close;
end;
procedure Tnozdform.nozdrmnoDblClick(Sender: TObject);
begin
Application.CreateForm(Txgftform, xgftform);
xgftform.Caption:='';
xgftform.Button2.Visible:=false;
xgftform.Timer1.Free;
xgftform.showmodal;
nozdrmno.text:=xgftform.xgrmno.Text;
xgftform.Free;
activecontrol:=Button1;
end;
procedure Tnozdform.nozdrmnoExit(Sender: TObject);
var aa:array[0..1] of string;
begin
if trim(nozdrmno.text)<>'' then
begin
getvalue(aa,'select IsTime,truntime from nowin where roomno='''+nozdrmno.text+'''');
if trim(aa[1])='24' then
begin
showmessage(nozdrmno.text+'房间是商务房不能转为钟点房');
nozdrmno.text:='';
exit;
end;
if trim(aa[0])='True' then
begin
showmessage(nozdrmno.text+'房间就是钟点房');
nozdrmno.text:='';
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -