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

📄 unit7.pas

📁 软件课程设计
💻 PAS
字号:
unit Unit7;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, jpeg, ExtCtrls;

type
  TForm7 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    StatusBar1: TStatusBar;
    Button1: TButton;
    GroupBox1: TGroupBox;
    Button2: TButton;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Label4: TLabel;
    Edit4: TEdit;
    Label5: TLabel;
    Edit5: TEdit;
    Label6: TLabel;
    Edit6: TEdit;
    Label7: TLabel;
    Edit7: TEdit;
    Label8: TLabel;
    Edit8: TEdit;
    Button3: TButton;
    Label9: TLabel;
    Edit9: TEdit;
    Label10: TLabel;
    Edit10: TEdit;
    Edit11: TEdit;
    Edit12: TEdit;
    Edit13: TEdit;
    Edit14: TEdit;
    Edit15: TEdit;
    Edit16: TEdit;
    Edit17: TEdit;
    Edit18: TEdit;
    Edit19: TEdit;
    Edit20: TEdit;
    Image1: TImage;
    procedure Label2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form7: TForm7;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm7.Label2Click(Sender: TObject);
begin
GroupBox1.Visible:=false;
edit1.Text:='';
close;
end;

procedure TForm7.Button1Click(Sender: TObject);
begin
GroupBox1.Visible:=true;
Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select * from 房间信息 where 包房号='''+Edit1.Text+''' ');
Form1.ADOQuery1.Open;
Edit2.Text:=Form1.ADOQuery1.FieldValues['房主id'];
Edit3.Text:=Form1.ADOQuery1.FieldValues['单价'];
Edit7.Text:=Form1.ADOQuery1.FieldValues['附加费用'];
Edit8.Text:=Form1.ADOQuery1.FieldValues['附加费用内容'];
Edit10.Text:=Form1.ADOQuery1.FieldValues['预付'];
//Edit13.Text:=Form1.ADOQuery1.FieldValues['进入时间'];
//edit4.text:=datediff(h,Form1.ADOQuery1.FieldValues['进入时间'],now());


Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select * from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
if Form1.ADOQuery1.FieldValues['是否vip']=1then
begin
edit5.Text:='75%';
edit17.Text:='0.75';
end
else
begin
edit5.Text:='0';
edit17.Text:='1';
end;

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select datediff(hh,进入时间,getdate()) as 娱乐时间 from 房间信息 where 包房号='''+Edit1.Text+''' ');
Form1.ADOQuery1.Open;
Edit4.Text:=Form1.ADOQuery1.FieldValues['娱乐时间'];

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select datename(month,生日)as 月 from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
Edit12.Text:=Form1.ADOQuery1.FieldValues['月'];

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select datename(day,生日)as 日 from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
Edit14.Text:=Form1.ADOQuery1.FieldValues['日'];

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select datename(month,getdate())as 当月 from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
Edit15.Text:=Form1.ADOQuery1.FieldValues['当月'];

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select datename(day,getdate())as 当日 from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
Edit16.Text:=Form1.ADOQuery1.FieldValues['当日'];
if (edit12.Text=edit15.Text) and (edit14.Text=edit16.Text)  then
begin
edit6.Text:='80%';
edit18.Text:='0.8';
end
else
begin
 edit6.Text:='0';
 edit18.Text:='1';
 end;

edit9.Text:=floattostr((strtoint(edit3.Text)*strtoint(edit4.Text)+strtoint(edit7.Text))*strtofloat(edit17.Text)*strtofloat(edit18.Text)-strtoint(edit10.Text));
edit19.Text:=floattostr((strtoint(edit3.Text)*strtoint(edit4.Text)+strtoint(edit7.Text))*strtofloat(edit17.Text)*strtofloat(edit18.Text))


end;

procedure TForm7.Button2Click(Sender: TObject);
begin
GroupBox1.Visible:=false;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';

close;
end;

procedure TForm7.Button3Click(Sender: TObject);
begin
Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select * from 会员信息 where id='''+Edit2.Text+''' ');
Form1.ADOQuery1.Open;
Edit11.Text:=Form1.ADOQuery1.FieldValues['光临次数'];

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('update 房间信息 set 是否服务中=0,是否预定=0,预定日期=NULL,进入日期=NULL,进入时间=NULL,附加费用=0,房主类型=0,附加费用内容=NULL,预付=0 where 包房号='''+Edit1.Text+'''');
Form1.ADOQuery1.SQL.Add('select 是否服务中,进入日期,进入时间 from 房间信息 where 包房号='''+Edit1.Text+'''  ');

Form1.ADOQuery1.SQL.Add('update 会员信息 set 是否服务中=0,光临次数=:a where id='''+Edit2.Text+'''');
form1.AdoQuery1.Parameters.ParamByName('a').value:= strtoint(Edit11.Text)+1;
Form1.ADOQuery1.SQL.Add('select 是否服务中 from 会员信息 where id='''+Edit2.Text+'''  ');

Form1.ADOQuery1.Open;

Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;
Form1.ADOQuery1.SQL.Add('select * from 连锁店 where 连锁店编号='''+form1.Edit3.Text+''' ');
Form1.ADOQuery1.Open;
Edit20.Text:=Form1.ADOQuery1.FieldValues['销售金额'];



Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.Clear;

Form1.ADOQuery1.SQL.Add('update 连锁店 set 销售金额=:a where 连锁店编号='''+form1.Edit3.Text+'''');
form1.AdoQuery1.Parameters.ParamByName('a').value:= strtoint(Edit19.Text)+strtoint(Edit20.Text);
Form1.ADOQuery1.SQL.Add('select 销售金额 from 连锁店 where 连锁店编号='''+form1.Edit3.Text+'''  ');

Form1.ADOQuery1.Open;


edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';
showmessage('谢谢光临');
end;

end.

⌨️ 快捷键说明

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