📄 unit24.pas
字号:
unit Unit24;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Db, DBTables;
type
TForm24 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Table1: TTable;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form24: TForm24;
implementation
uses Unit18;
{$R *.DFM}
procedure TForm24.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm24.Button1Click(Sender: TObject);
begin
with form18 do
begin
table1.First;
while not table1.Eof do
begin
if (combobox1.Text=table1.FieldByName('lb').asstring)
and (strtoint(combobox2.Text)=table1.FieldByName('mz').asinteger)
then break;
table1.Next;
end;
table1.Edit;
table1.FieldByName('sl').asfloat:=spinedit1.MaxValue-spinedit1.value;
table1.Post;
table2.append;
table2.Edit;
table2.FieldByName('lb').asstring:=combobox1.Text;
table2.FieldByName('rq').asdatetime:=now;
table2.FieldByName('sr').asfloat:=strtofloat(combobox2.Text)*spinedit1.Value;
table2.Post;
end;
table1.First;
while not table1.Eof do
begin
if table1.FieldByName('fh').asstring=edit1.Text then
break;
table1.Next;
end;
if table1.Eof then
begin
showmessage('房间号错误。');
exit;
end
else
if application.messagebox(pchar(table1.fieldbyname('yhm').asstring+'是这个用户么?'),'确认',mb_yesno+mb_iconinformation)=idyes
then
begin
table1.Edit;
table1.FieldByName('fw').asfloat:=strtofloat(form18.combobox2.text)*form18.spinedit1.value;
table1.FieldByName('bz').asstring:='购'+'面值'+form18.combobox2.text+'的'+form18.combobox1.text+floattostr(form18.spinedit1.value)+'张。';
{00}
table1.Post;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -