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

📄 u_kl.pas

📁 个人财务记账.rar,简易的财务系统,以delphi 开发.
💻 PAS
字号:
unit U_KL;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Buttons, jpeg, StdCtrls,U_data;

type
  TF_KL = class(TForm)
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    Label4: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_KL: TF_KL;

implementation

uses U_main;
{$R *.dfm}

procedure TF_KL.SpeedButton2Click(Sender: TObject);
var
  i:integer;
  ss:array[0..79] of char;
  name1:tstringlist;
  ye,mo,da:word;
  gl_nd:integer;
  aa :string;
begin
try
     gl_nd:=strtoint(edit2.text);
     if (gl_nd<1960) or (gl_nd>2100) then begin
        application.messagebox('年度输入错误!','提示',mb_ok);
        edit2.setfocus;
        exit;
     end;
  except
        application.messagebox('年度输入错误!','提示',mb_ok);
        edit2.setfocus;
        exit;
  end;
       if  edit1.Text='' then  begin
           aa:='mm is null and ';
           end
         else begin
        aa:='mm in ('''+edit1.Text+''') and ' ;
           end;
  //
        try
                 with DataModule1.ADOQuery_KL1 do begin
                 //查找操做员与密码
                 close;
                 sql.clear;
                 sql.add('select top 1 * from use  where  ry in ('''+combobox1.Text+''') and '+aa+'   nd in ('''+edit2.Text+''') order by id');
                 open;
                 first;

                         if fieldbyname('ry').asstring=combobox1.Text then  begin
                         f_kl.Caption:=fieldbyname('mm').asstring+'00'+edit1.Text;
                         f_kl.visible:=false;
                         f_main.showmodal;
                         f_kl.Close;
                         end
                         else begin
                         f_kl.Caption:=combobox1.Text;
                         application.messagebox('密码不正确!','提示',mb_ok);
                        end;
                end;
         except
                  application.messagebox('密码不正确','提示',mb_ok);
                  edit1.setfocus;
                  exit;
          end;
             
//


end;

procedure TF_KL.SpeedButton1Click(Sender: TObject);
begin
F_KL.Close;
end;

procedure TF_KL.FormShow(Sender: TObject);
var
  aa:string;
begin
 with DataModule1.ADOQuery_KL1 do begin
 //初始化人
 try
 close;
 sql.clear;
 sql.add('select * from csh  order by bz');
 open;
 first;
 while not eof do begin
   combobox1.Text:=fieldbyname('ry').asstring;
   Edit2.Text:=fieldbyname('nd').asstring;
 next;
 end;
  except
 end;
 //加入操做人员的名子。
 close;
 sql.clear;
 sql.add('select * from use  order by id');
 open;
 first;
 while not eof do begin
   aa:=fieldbyname('ry').asstring;
   combobox1.items.Add(aa);
 next;
 end;
 close;
 sql.Clear;
 end;
end;

end.

⌨️ 快捷键说明

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