unit13.~pas

来自「作者针对当前酒店客房管理的现状」· ~PAS 代码 · 共 60 行

~PAS
60
字号
unit Unit13;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables;

type
  TForm13 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label4: TLabel;
    Edit3: TEdit;
    Label5: TLabel;
    Edit4: TEdit;
    Label6: TLabel;
    Edit5: TEdit;
    Label7: TLabel;
    Edit6: TEdit;
    Button1: TButton;
    Button2: TButton;
    Query1: TQuery;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form13: TForm13;

implementation

{$R *.dfm}

procedure TForm13.Button1Click(Sender: TObject);
begin
  with Query1 do
  begin
    Close;
    Sql.Clear;
    Sql.Add('insert into book (code,bookname,author,concern,outdate,jg)');
    Sql.Add('Values(:code,:bookname,:author,:concern,:outdate,:jg)');
    Params.ParamByName('code').asstring:=edit1.Text;
    Params.ParamByName('bookname').asstring:=edit1.Text;
    Params.ParamByName('author').asstring:=edit1.Text;
    Params.ParamByName('concern').asstring:=edit1.Text;
    Params.ParamByName('outdate').asstring:=edit1.Text;
    Params.ParamByName('jg').asstring:=edit1.Text;
    ExecSql;
    ShowMessage('成功入库');
  end;
end;

end.

⌨️ 快捷键说明

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