?? 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 + -