unit24.pas
来自「以学习为目的,使用DIPH开发而成,功能强大,是我们的老师提供的!」· PAS 代码 · 共 91 行
PAS
91 行
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 + =
减小字号Ctrl + -
显示快捷键?