📄 hrms00_01.pas.svn-base
字号:
unit HrmS00_01;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Bas100_01, ComCtrls, StdCtrls, ExtCtrls, Buttons, Db, Mask, DBCtrls,
ADODB, wwdbedit, Wwdbspin, Menus;
type
THrmS00_01Form = class(TBas100_01Form)
PageControl1: TPageControl;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
RadioGroup1: TRadioGroup;
RadioGroup3: TRadioGroup;
RadioGroup4: TRadioGroup;
RadioGroup5: TRadioGroup;
BitBtn1: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label6: TLabel;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label7: TLabel;
Label8: TLabel;
Edit6: TEdit;
Label9: TLabel;
Label10: TLabel;
Edit7: TEdit;
Label11: TLabel;
Edit8: TEdit;
Label12: TLabel;
bbtnOk: TBitBtn;
bbtnExit: TBitBtn;
CheckBox1: TCheckBox;
Bevel1: TBevel;
wwDBSpinEdit1: TwwDBSpinEdit;
GroupBox1: TGroupBox;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Edit2: TEdit;
MaskEdit1: TMaskEdit;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
ComboBox1: TComboBox;
Edit1: TEdit;
Label25: TLabel;
qrySys000: TADOQuery;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bbtnOkClick(Sender: TObject);
procedure bbtnExitClick(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Edit1Exit(Sender: TObject);
private
procedure SetSysParams(AKeyID,AValue:string);
function GetSysParams(AKeyID:string):string;
procedure SetInterface;
{ Private declarations }
public
{ Public declarations }
end;
var
HrmS00_01Form: THrmS00_01Form;
implementation
uses SYSDATA, CommFun;
{$R *.DFM}
//设置系统参数
procedure THrmS00_01Form.SetSysParams(AKeyID,AValue:string);
begin
if qrySys000.Locate('S000_001',AKeyID,[]) then
begin
qrySys000.Edit;
try
qrySys000.FieldByName('S000_002').AsString:=AValue;
qrySys000.Post;
except
ShowMsg(SYSDM.ADOC.Errors[0].Description,1);
Abort;
end;
end else
begin
qrySys000.Insert;
try
qrySys000.FieldByName('S000_001').AsString:=AKeyID;
qrySys000.FieldByName('S000_002').AsString:=AValue;
qrySys000.Post;
except
ShowMsg(SYSDM.ADOC.Errors[0].Description,1);
Abort;
end;
end;
end;
//取系统参数
function THrmS00_01Form.GetSysParams(AKeyID:string):string;
begin
if qrySys000.Locate('S000_001',AKeyID,[]) then
Result:=qrySys000.FieldByName('S000_002').AsString
else
Result:='';
end;
procedure THrmS00_01Form.SetInterface;
begin
Caption:=GetDBString('HRMS0001001'); //人力资源参数
bbtnOk.Caption:=GetDBString('HRMS0001002'); //确定(&O)
bbtnExit.Caption:=GetDBString('HRMS0001003'); //退出(&X)
TabSheet2.Caption:=GetDBString('HRMS0001004'); //薪资核算参数
TabSheet3.Caption:=GetDBString('HRMS0001005'); //考勤系统参数
RadioGroup1.Caption:=GetDBString('HRMS0001006'); //每月计薪天数:
RadioGroup1.Items.Add(GetDBString('HRMS0001007')); //按每月实际天数
RadioGroup1.Items.Add(GetDBString('HRMS0001008')); //按固定天数
RadioGroup3.Caption:=GetDBString('HRMS0001009'); //工资尾数舍入:
RadioGroup3.Items.Add(GetDBString('HRMS0001010')); //每个工资项目舍入
RadioGroup3.Items.Add(GetDBString('HRMS0001011')); //仅实发工资舍入
RadioGroup3.Items.Add(GetDBString('HRMS0001012')); //不舍入
RadioGroup4.Caption:=GetDBString('HRMS0001013'); //尾数舍入方法:
RadioGroup4.Items.Add(GetDBString('HRMS0001014')); //四舍五入
RadioGroup4.Items.Add(GetDBString('HRMS0001015')); //自定义
RadioGroup5.Caption:=GetDBString('HRMS0001016'); //全勤奖:
RadioGroup5.Items.Add(GetDBString('HRMS0001017')); //新进员工按比例发放全勤奖
RadioGroup5.Items.Add(GetDBString('HRMS0001018')); //新进员工不发放全勤奖
RadioGroup5.Items.Add(GetDBString('HRMS0001019')); //新进员工全额发放全勤奖
BitBtn1.Caption:=GetDBString('HRMS0001020'); //自定义...
Label25.Caption:=GetDBString('HRMS0001021'); //个人所得税免税额
Label1.Caption:=GetDBString('HRMS0001022'); //刷卡允许误差
Label2.Caption:=GetDBString('HRMS0001023'); //分钟
Label3.Caption:=GetDBString('HRMS0001024'); //迟到(早退)
Label4.Caption:=GetDBString('HRMS0001025'); //分钟以上算旷工半天
Label8.Caption:=GetDBString('HRMS0001026'); //迟到(早退)
Label9.Caption:=GetDBString('HRMS0001027'); //分钟以上算旷工一天
Label6.Caption:=GetDBString('HRMS0001028'); //允许提前
Label7.Caption:=GetDBString('HRMS0001029'); //分钟打上班卡
Label10.Caption:=GetDBString('HRMS0001030'); //全勤奖金金额
Label11.Caption:=GetDBString('HRMS0001031'); //每日开工时间
Label12.Caption:=GetDBString('HRMS0001032'); //小时
GroupBox1.Caption:=GetDBString('HRMS0001033'); //考勤数据
RadioButton1.Caption:=GetDBString('HRMS0001034'); //手工输入
RadioButton2.Caption:=GetDBString('HRMS0001035'); //刷卡钟
ComboBox1.Items.Clear;
ComboBox1.Items.Add(GetDBString('COM00004014')); //文本文件
ComboBox1.Items.Add(GetDBString('COM00004015')); //十六进制
ComboBox1.Items.Add(GetDBString('COM00004016')); //八进制
ComboBox1.ItemIndex:=0;
Label18.Caption:=GetDBString('HRMS0001036'); //读取长度
Label19.Caption:=GetDBString('HRMS0001037'); //读取格式
Label20.Caption:=GetDBString('HRMS0001038'); //卡号段
Label21.Caption:=GetDBString('HRMS0001039'); //日期段
Label22.Caption:=GetDBString('HRMS0001040'); //小时段
Label23.Caption:=GetDBString('HRMS0001041'); //分钟段
Label24.Caption:=GetDBString('HRMS0001042'); //进出段
CheckBox1.Caption:=GetDBString('HRMS0001043'); //事务处理数据是否必须审核
end;
procedure THrmS00_01Form.FormCreate(Sender: TObject);
begin
inherited;
RadioGroup1.Items.Clear;
RadioGroup3.Items.Clear;
RadioGroup4.Items.Clear;
RadioGroup5.Items.Clear;
//设置界面信息
SetInterface;
PageControl1.ActivePageIndex:=0;
qrySys000.Open;
wwDBSpinEdit1.Text:='0';
Edit1.Text:='0';
//每月计薪天数('1'=按每月实际天数,'2'=按固定天数(天数))
if copy(GetSysParams('PAY0001'),1,1)='1' then RadioGroup1.ItemIndex:=0;
if copy(GetSysParams('PAY0001'),1,1)='2' then
begin
RadioGroup1.ItemIndex:=1;
wwDBSpinEdit1.Text:=copy(GetSysParams('PAY0001'),2,2);
end;
//工资核算方法('1'=按实际出勤天数计算实发工资,'2'=按缺勤天数扣减计算实发工资)
// if copy(GetSysParams('PAY0002'),1,1)='1' then RadioGroup2.ItemIndex:=0;
// if copy(GetSysParams('PAY0002'),1,1)='2' then RadioGroup2.ItemIndex:=1;
//工资尾数舍入('1'=每个工资项目舍入,'2'=仅实发工资舍入,'3'=不舍入)
if copy(GetSysParams('PAY0003'),1,1)='1' then RadioGroup3.ItemIndex:=0;
if copy(GetSysParams('PAY0003'),1,1)='2' then RadioGroup3.ItemIndex:=1;
if copy(GetSysParams('PAY0003'),1,1)='3' then RadioGroup3.ItemIndex:=2;
//尾数舍入方法('1'=四舍五入,'2'=自定公式)
if copy(GetSysParams('PAY0004'),1,1)='1' then RadioGroup4.ItemIndex:=0;
if copy(GetSysParams('PAY0004'),1,1)='2' then RadioGroup4.ItemIndex:=1;
//全勤奖('1'=新进员工按比例发放全勤奖,'2'=新进员工不发放全勤奖,'3'=新进员工全额发放全勤奖)
if copy(GetSysParams('PAY0005'),1,1)='1' then RadioGroup5.ItemIndex:=0;
if copy(GetSysParams('PAY0005'),1,1)='2' then RadioGroup5.ItemIndex:=1;
if copy(GetSysParams('PAY0005'),1,1)='3' then RadioGroup5.ItemIndex:=2;
//个人所得税免税额
Edit1.Text:=GetSysParams('PAY0007');
if Edit1.Text='' then Edit1.Text:='0';
//新进员工('1'=新进员工当月工资发放,'2'=新进员工当月工资不发放,下月才发放)
// if copy(GetSysParams('HRM0001'),1,1)='1' then RadioGroup7.ItemIndex:=0;
// if copy(GetSysParams('HRM0001'),1,1)='2' then RadioGroup7.ItemIndex:=1;
Edit3.Text:=GetSysParams('CWA0001'); //刷卡允许误差时间
Edit4.Text:=GetSysParams('CWA0002'); //迟到(早退)多少分钟以内算旷工半天(超过算旷工一天)
Edit5.Text:=GetSysParams('CWA0003'); //允许提前时间(分钟)
Edit6.Text:=GetSysParams('CWA0004'); //允许推后时间(分钟)
Edit7.Text:=GetSysParams('CWA0005'); //全勤奖金金额
Edit8.Text:=GetSysParams('CWA0006'); //每日开工时间(小时)
//考勤数据来源('1'=手工输入,'2'=刷卡钟)
if copy(GetSysParams('CWA0007'),1,1)='1' then RadioButton1.Checked:=True;
if copy(GetSysParams('CWA0007'),1,1)='2' then RadioButton2.Checked:=True;
//手工输入
if RadioButton1.Checked then
begin
Edit2.Enabled:=False;
MaskEdit1.Enabled:=False;
Edit9.Enabled:=False;
Edit10.Enabled:=False;
Edit11.Enabled:=False;
Edit12.Enabled:=False;
Edit13.Enabled:=False;
Edit2.Color:=ADisableColor;
MaskEdit1.Color:=ADisableColor;
Edit9.Color:=ADisableColor;
Edit10.Color:=ADisableColor;
Edit11.Color:=ADisableColor;
Edit12.Color:=ADisableColor;
Edit13.Color:=ADisableColor;
//进制转换
ComboBox1.Color:=ADisableColor;
ComboBox1.Enabled:=False;
end;
//刷卡钟
if RadioButton2.Checked then
begin
Edit2.Text:=copy(GetSysParams('CWA0007'),2,2); //读取长度
MaskEdit1.Text:=copy(GetSysParams('CWA0007'),4,9); //读取格式
Edit9.Text:=copy(GetSysParams('CWA0007'),13,1); //卡号段
Edit10.Text:=copy(GetSysParams('CWA0007'),14,1); //日期段
Edit11.Text:=copy(GetSysParams('CWA0007'),15,1); //小时段
Edit12.Text:=copy(GetSysParams('CWA0007'),16,1); //分钟段
Edit13.Text:=copy(GetSysParams('CWA0007'),17,1); //进出段
if copy(GetSysParams('CWA0007'),18,1)<>'' then
begin
try
ComboBox1.ItemIndex:=StrToInt(copy(GetSysParams('CWA0007'),18,1)); //进制转换
except
end;
end;
Edit2.Enabled:=True;
MaskEdit1.Enabled:=True;
Edit9.Enabled:=True;
Edit10.Enabled:=True;
Edit11.Enabled:=True;
Edit12.Enabled:=True;
Edit13.Enabled:=True;
Edit2.Color:=AEnableColor;
MaskEdit1.Color:=AEnableColor;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -