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

📄 proom.pas

📁 省级集邮品管理ERP
💻 PAS
字号:
{*******************************************************}
{                                                       }
{                                                       }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{            编制:中软金马邮资票品项目开发组           }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在省级系统管理里面调用。

*)
{
有关表:
  人员组别表、组别表、人员表
  部门表
数据来源:
  用户:人员表
  隶属于:人员组别表
  不隶属于:组别表
功能:
算法:
更新有关表: 人员组别表、人员表
备注:口令、确定口令不使用数据感应控键
}
unit PRoom;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  FormBase, StdCtrls, Buttons, DBCtrls, Mask, UserList, BoxProcs;

type
  TfrmPRoom = class(TFFormBase)
    ListBox1: TListBox;
    Label7: TLabel;
    ListBox2: TListBox;
    Label8: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    BitBtn4: TBitBtn;
    Label3: TLabel;
    ComboBox1: TComboBox;
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
    procedure InitData;
  public
    { Public declarations }
  end;

function ShowPRoom: Boolean;
var
  frmPRoom: TfrmPRoom;

implementation

uses datas,Pub;

{$R *.DFM}

function ShowPRoom: Boolean;
begin
  Application.CreateForm(TfrmPRoom, frmPRoom);
  with frmPRoom do
  try
    result := ShowModal = MB_OK;
  finally
    Free;
  end;
end;

procedure TfrmPRoom.BitBtn3Click(Sender: TObject);
begin
  inherited;
  with frmUserList do
    if not SaveKFRYDZB(Copy(ComboBox1.Text, 1, pos(' ', combobox1.Text) - 1), ListBox1.Items) then
      CHQMsgBox('保存错误!');
end;

procedure TfrmPRoom.BitBtn4Click(Sender: TObject);
begin
  inherited;
  with frmUserList.qryUser do
    CancelUpdates;
  close;
end;

procedure TfrmPRoom.FormCreate(Sender: TObject);
const
  KFSQL = 'SELECT KFDM||'' ''||KFMC FROM TGS_KFB where KFDM not in(''-1'',''-2'') order by KFDM';
begin
  inherited;
  InitList(ComboBox1.Items, KFSQL);
  if ComboBox1.items.count > 0 then ComboBox1.ItemIndex := 0;
  InitData;
end;

procedure TfrmPRoom.BitBtn1Click(Sender: TObject);
begin
  if ListBox2.Items.Count = 0 then
    exit;
  BoxMoveSelectedItems(ListBox2, ListBox1);
end;


procedure TfrmPRoom.BitBtn2Click(Sender: TObject);
begin
  if ListBox1.Items.Count = 0 then
    exit;
  BoxMoveSelectedItems(ListBox1, ListBox2);
end;

procedure TfrmPRoom.InitData;
const
  NSQL = 'SELECT R.YGDM||'' ''||R.YGMC FROM TGS_RYB R Where R.YGDM not in (Select YGDM From tgs_KFRYDZB where KFDM = ''%s'') order by R.YGDM';
  ISQL = 'SELECT R.YGDM||'' ''||R.YGMC FROM TGS_RYB R, tgs_KFRYDZB M Where R.YGDM = M.YGDM AND M.KFDM = ''%s'' order by R.YGDM';
begin
  InitList(ListBox2.Items, Format(NSQL, [Copy(ComboBox1.Text, 1, pos(' ', combobox1.Text) - 1)]));
  InitList(ListBox1.Items, Format(ISQL, [Copy(ComboBox1.Text, 1, pos(' ', combobox1.Text) - 1)]));
end;

procedure TfrmPRoom.ComboBox1Change(Sender: TObject);
begin
  inherited;
  InitData;
end;

end.

⌨️ 快捷键说明

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