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

📄 gongzi.pas

📁 在Dephi中可执行 多多支持
💻 PAS
字号:
unit GongZi;

interface

uses
  Windows, Messages, Classes, SysUtils, Graphics, Controls, StdCtrls, Forms,
  Dialogs, DBCtrls, DB, DBGrids, Grids, ExtCtrls, Menus;

type
  TFormGongZi = class(TForm)
    DBGridGongZi: TDBGrid;
    DBNavigatorGongZi: TDBNavigator;
    PanelNavigator: TPanel;
    PanelGrid: TPanel;
    PopupMenuGongZi: TPopupMenu;
    NRead: TMenuItem;
    procedure FormActivate(Sender: TObject);
    procedure NReadClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  FormGongZi: TFormGongZi;

implementation

{$R *.DFM}

uses DataModule, Login;

procedure TFormGongZi.FormActivate(Sender: TObject);
begin
   If Login.QuanXian='geren' Then
      Begin
      DataModuleKaoQin.TableGongZi.Close;
      DataModuleKaoQin.TableGongZi.Filtered:=True;
      DataModuleKaoQin.TableGongZi.Filter:='GongXuHao='+FormLogin.EditUser.Text;
      DataModuleKaoQin.TableGongZi.ReadOnly:=True;
      DataModuleKaoQin.TableGongZi.Open;
      End
   Else If Login.QuanXian='caiwu' Then
      Begin
      DataModuleKaoQin.TableGongZi.Close;
      DataModuleKaoQin.TableGongZi.Filtered:=False;
      DataModuleKaoQin.TableGongZi.ReadOnly:=False;
      DataModuleKaoQin.TableGongZi.Open;
      End
   Else
       Application.Terminate;
end;

procedure TFormGongZi.NReadClick(Sender: TObject);
begin
If Login.QuanXian='caiwu' Then
   Begin
      DataModuleKaoQin.TableKaoQin.Open;
      DataModuleKaoQin.TableKaoQin.First;
      While Not DataModuleKaoQin.TableKaoQin.Eof Do
      Begin
      DataModuleKaoQin.TableGongZi.Insert;
      DataModuleKaoQin.TableGongZi.FieldByName('GongXuHao').AsString:=DataModuleKaoQin.TableKaoQin.FieldByName('GongXuHao').AsString;
      DataModuleKaoQin.TableGongZi.FieldByName('YueFen').AsString:=DataModuleKaoQin.TableKaoQin.FieldByName('YueFen').AsString;
      DataModuleKaoQin.TableGongZi.Post;
      DataModuleKaoQin.TableKaoQin.Next;
      End;
   End;
end;

end.

⌨️ 快捷键说明

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