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

📄 u_zjkgl_zjkgl_grzj.pas

📁 这是一个非常使用的DELPHI源码的例子,用的是SQL数据库和DELPHI企业版
💻 PAS
字号:
unit U_Zjkgl_Zjkgl_Grzj;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, DBCtrls, Mask, Buttons,u_public_define,
  ActnList, XPStyleActnCtrls, ActnMan,StrUtils;

type
  TFrm_Zjkgl_zjkgl_Grzj = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit7: TDBEdit;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    Edt_zjje: TEdit;
    ActionManager1: TActionManager;
    Action1: TAction;
    Action2: TAction;
    Action3: TAction;
    Action4: TAction;
    Panel2: TPanel;
    Lbl_bmmc: TLabel;
    Panel3: TPanel;
    Lbl_Rybh: TLabel;
    Panel4: TPanel;
    Lbl_xm: TLabel;
    Panel5: TPanel;
    Lbl_Kh: TLabel;
    Panel6: TPanel;
    Lbl_ye: TLabel;
    Panel7: TPanel;
    Lbl_kzt: TLabel;
    Action5: TAction;
    Lbl_fs: TLabel;
    Action6: TAction;
    cmx_lb: TComboBox;
    procedure kh_xx();
    procedure Action4Execute(Sender: TObject);
    procedure Action2Execute(Sender: TObject);
    procedure Action5Execute(Sender: TObject);
    procedure Action3Execute(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Action6Execute(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Zjkgl_zjkgl_Grzj: TFrm_Zjkgl_zjkgl_Grzj;

implementation
 uses  U_DATA,u_card,u_ryb;
{$R *.dfm}

procedure Tfrm_zjkgl_zjkgl_grzj.kh_xx();
  var dd:string;
  begin
      dd:=trim(g_str_selectkh);
       with data do
         begin
            g_con.Open();
            g_Rst_temp.SQL.Clear;
            dd:='select * from mr_people where kh='+quotedstr(dd);
            g_rst_temp.SQL.Add(dd);
            g_rst_temp.ExecSQL;
            data.Mr_People_add.DataSet:=g_rst_temp;
            g_rst_temp.Open;
            //.Active:=true;
         end;
     end;
procedure TFrm_Zjkgl_zjkgl_Grzj.Action4Execute(Sender: TObject);
begin
  close;
end;

procedure TFrm_Zjkgl_zjkgl_Grzj.Action2Execute(Sender: TObject);
begin
If OPen_Card Then
    begin
    dbedit4.Text:= Read_Card;
    g_str_selectkh:=dbedit4.text;
     If Close_card Then
        begin
          kh_xx ;
          Action5Execute(Sender);
          Exit;
        end;
    end;
end;

procedure TFrm_Zjkgl_zjkgl_Grzj.Action5Execute(Sender: TObject);
begin
  lbl_bmmc.Caption:=dbedit1.Text;
  lbl_rybh.Caption:=dbedit2.Text;
  lbl_xm.Caption:=dbedit3.Text;
  lbl_kh.Caption:=dbedit4.Text;
  lbl_ye.Caption:=dbedit5.Text;
  lbl_kzt.Caption:=dbedit7.Text;
end;

procedure TFrm_Zjkgl_zjkgl_Grzj.Action3Execute(Sender: TObject);
var aa:string;
    bb:string;
begin
 if cmx_lb.Text='' then
   begin
     application.MessageBox('增减类别不能为空','明日科技有限公司');
     exit;
   end;
 if lbl_rybh.Caption='' then
   begin
     application.MessageBox('请选取择要增减款的人员','明日科技有限公司');
     exit;
   end;

  aa:='insert into mr_zjb(sj,bh,xm,kh,bmmc,ye,zjje,zjhye,zjfs,zjzl,sfy,fs) values(';
  aa:=aa+quotedstr(formatdatetime('yyyy年mm月dd日',now)) +',';
  aa:=aa+quotedstr(lbl_rybh.Caption)+',';
  aa:=aa+quotedstr(lbl_xm.Caption)+',';
  aa:=aa+quotedstr(lbl_kh.Caption)+',';
  aa:=aa+quotedstr(lbl_bmmc.Caption)+',';
  aa:=aa+quotedstr(lbl_ye.Caption)+',';
  aa:=aa+quotedstr(edt_zjje.Text)+',';
  if lbl_fs.Caption ='增款' then
    begin
     bb:= floattostr(strtofloat(lbl_ye.Caption)+strtofloat(edt_zjje.Text));
    end
  else
    begin
      bb:= floattostr(strtofloat(lbl_ye.Caption)-strtofloat(edt_zjje.Text));
  end;
    aa:=aa+quotedstr(bb)+',';
   aa:=aa+quotedstr(cmx_lb.Text)+',';
  aa:=aa+quotedstr(lbl_fs.Caption)+',';
  aa:=aa+quotedstr(g_str_name)+',';
  aa:=aa+quotedstr('个人')+')';
  data.G_con.Open();
  data.G_Rst.SQL.Clear;
  data.G_Rst.SQL.Add(aa);
  data.G_Rst.ExecSQL;
  aa:='update mr_people set ycje='+quotedstr(bb)+'where bh='+quotedstr(lbl_rybh.Caption);
  data.G_Rst.SQL.Clear;
  data.G_Rst.SQL.Add(aa);
  data.G_Rst.ExecSQL;
  close;


end;

procedure TFrm_Zjkgl_zjkgl_Grzj.FormShow(Sender: TObject);
begin
   data.G_con.Open();
   data.G_Rst.SQL.Clear;
   data.G_Rst.SQL.Add('select * from mr_jbb where m_lbbh=5');
   data.G_Rst.ExecSQL;
   data.G_Rst.Open;
   while not data.G_Rst.Eof do
      begin
         cmx_lb.Items.Add(data.G_Rst.FieldValues['m_name']);
         data.G_Rst.Next;
      end;
    data.G_Rst.Close; 
end;

procedure TFrm_Zjkgl_zjkgl_Grzj.Action6Execute(Sender: TObject);
begin
   data.G_con.Open();
   data.G_Rst.SQL.Clear;
  data.G_Rst.SQL.Add('select * from mr_jbb where m_lbbh=5 and m_name='+quotedstr(cmx_lb.Text));
   data.G_Rst.ExecSQL;
   data.G_Rst.Open;
   if not data.G_Rst.Eof then
     lbl_fs.Caption:=data.G_Rst.FieldValues['m_lb'];
end;

procedure TFrm_Zjkgl_zjkgl_Grzj.SpeedButton1Click(Sender: TObject);
begin
    frm_ryb:=Tfrm_ryb.Create(application);
    frm_ryb.ShowModal;
    if g_str_selectkh<>'' then
      begin
      kh_xx;
      Action5Execute(Sender);
      end;
end;

end.

⌨️ 快捷键说明

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