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

📄 unit4.pas

📁 Of the password is: Server: "1." Client: + for the month of the date of the machine. Such as
💻 PAS
字号:
unit Unit4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Mask, DBCtrls, ExtCtrls, ADODB;

type
  Thydate = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Panel2: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel7: TPanel;
    Panel8: TPanel;
    Panel9: TPanel;
    Panel10: TPanel;
    Panel11: TPanel;
    cb1: TCheckBox;
    Panel12: TPanel;
    hy1: TADOTable;
    hy1a1: TWideStringField;
    hy1a2: TWideStringField;
    hy1a3: TWideStringField;
    hy1a4: TDateTimeField;
    hy1a5: TFloatField;
    hy1a7: TWideStringField;
    hy1a8: TWideStringField;
    hy1a9: TWideStringField;
    hy1a6: TFloatField;
    hy4: TADOTable;
    hy4a1: TWideStringField;
    hy4a2: TWideStringField;
    hy4a3: TDateTimeField;
    hy4a4: TDateTimeField;
    hy4a5: TFloatField;
    hy4a6: TWideStringField;
    hy4a7: TWideStringField;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  hydate: Thydate;

implementation

uses Unit1;

{$R *.dfm}

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

procedure Thydate.Button2Click(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
end;

procedure Thydate.Button1Click(Sender: TObject);

begin

if (edit1.Text<>'') and (edit4.Text<>'') then
  //帐号与计费标准不为空
   begin
    hy1.Filtered:=false;
    hy1.Filter:='帐号='+''''+edit1.Text+'''';
    hy1.Filtered:=true;
   if hy1.RecordCount=0 then
     //利用过虑判断有无重复记录
     begin
     hy1.Filtered:=false;
     hy1.Insert;
     hy1a1.Value:=edit1.Text;
     hy1a2.Value:=edit2.Text;
     hy1a3.Value:=edit5.Text;
     hy1a4.Value:=date;
     if edit3.Text<>'' then hy1a5.Value:=strtofloat(edit3.Text);
     hy1a6.Value:=strtofloat(edit4.Text);
     hy1a7.Value:=edit6.Text;
     hy1a8.Value:=edit7.Text;
     if cb1.Checked then hy1a9.Value:='临时' else hy1a9.Value:='正式'; 
     hy1.Post;

     hy4.Insert;
     hy4a1.Value:=edit1.Text;
     hy4a2.Value:=edit5.Text;
     hy4a3.Value:=now;
     hy4a4.Value:=date;
     if edit3.Text<>'' then hy4a5.Value:=strtofloat(edit3.Text);
     hy4a6.Value:='开户';
     hy4.Post;

     edit1.Text:='';
     edit2.Text:='';
     edit3.Text:='';
     edit4.Text:='';
     edit5.Text:='';
     edit6.Text:='';
     edit7.Text:='';
     end
     else
     begin
     hy1.Filtered:=false;
     showmessage('帐号已存在');
     end;
   end
   else
   showmessage('帐号 计费标准未填全')
end;

procedure Thydate.FormCreate(Sender: TObject);
begin
//会员数据库动态连接 设目录所在路径
// hy1.DatabaseName:=extractfiledir(application.ExeName);
// hy4.DatabaseName:=extractfiledir(application.ExeName);
//开库
 hy1.Active:=true;
 hy4.Active:=true;
 edit4.Text:=form1.Table4a1.Text; //导入预定的会员费率
end;

procedure Thydate.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;

end.

⌨️ 快捷键说明

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