formyonghuguanli.~pas

来自「这是一个关于药品进销存的管理软件」· ~PAS 代码 · 共 77 行

~PAS
77
字号
unit FormYonghuguanli;

interface

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

type
  Tyonghuguanli = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Edit2: TEdit;
    Edit3: TEdit;
    Label4: TLabel;
    ComboBox1: TComboBox;
    ADOQuery1: TADOQuery;
    Button1: TButton;
    Button2: TButton;
    ADOCommand1: TADOCommand;
    Label5: TLabel;
    Edit4: TEdit;
    procedure FormCreate(sender: tobject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  yonghuguanli: Tyonghuguanli;

implementation

uses FormManage;

{$R *.dfm}
procedure tyonghuguanli.FormCreate(sender: tobject);
begin
adoquery1.Close;
adoquery1.sql.Clear;
adoquery1.SQL.Text:=('select * from 权限');
adoquery1.Open;
while not adoquery1.Eof do
begin
 combobox1.Items.Add(adoquery1.fieldbyname('权限').AsString);
 adoquery1.Next;
end;
end;

procedure Tyonghuguanli.Button1Click(Sender: TObject);
var
num:string;
user,pass1,pass2:string;
begin
num:=edit4.Text;
user:=edit1.Text;
pass1:=edit2.Text;
pass2:=combobox1.Text;
adocommand1.CommandText:='insert into 用户信息([用户编号],[用户名],[密码],[权限]) values('''+num+''','''+user+''','''+pass1+''','''+pass2+''')';
adocommand1.Execute;
showmessage('添加成功请返回');
end;

procedure Tyonghuguanli.Button2Click(Sender: TObject);
begin
yonghuguanli.Close;
manage.Visible:=true;
manage.Enabled:=true;
end;

end.

⌨️ 快捷键说明

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