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

📄 saleout.~pas

📁 网吧商品销售平台
💻 ~PAS
字号:
unit saleout;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls, IdBaseComponent, IdComponent,
  IdTCPConnection, IdTCPClient;

type
  TSaleListForm = class(TForm)
    Bevel1: TBevel;
    Panel1: TPanel;
    SaleListView: TListView;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label1: TLabel;
    PriceLabel: TLabel;
    Label2: TLabel;
    IdTCPClient1: TIdTCPClient;
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    clientIP:string;
    checkok:BOOL;
    { Public declarations }
  end;

var
  SaleListForm: TSaleListForm;
implementation

{$R *.dfm}

procedure TSaleListForm.Button1Click(Sender: TObject);
begin
close;
end;

procedure TSaleListForm.Button3Click(Sender: TObject);
begin
close;
end;

procedure TSaleListForm.Button2Click(Sender: TObject);
begin
try
  IdTCPClient1.Host:=ClientIP;
  IdTCPClient1.Port:=2301;
if IdTCPClient1.Connected then IdTCPClient1.Disconnect;
  IdTCPClient1.Connect; //连接
  try
IdTCPClient1.WriteLn('RECEIVED_SUCESS'); //发送确认
except
close;
end;
IdTCPClient1.Disconnect;
checkok:=True;
hide;
application.MessageBox('已成功结帐!','提示',MB_ICONINFORMATION);
close;
except
hide;
application.MessageBox('结帐失败!','错误',MB_ICONERROR);
end;
end;

procedure TSaleListForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
Action:=canone;
if checkok=false then
begin
if application.MessageBox('客户要求的商品还没有确认,您要关闭吗?','提示',MB_ICONQUESTION+MB_YESNO)=IDYES then
begin
Action:=cafree;
end;
end
else
Action:=cafree;
end;

end.

⌨️ 快捷键说明

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