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

📄 checkinfo_unit.~pas

📁 本系统是结合行业管理中实际的人力资源、工资制度
💻 ~PAS
字号:
unit checkinfo_unit;

interface
uses
  Windows,Messages,SysUtils,Variants,DBclient,Graphics,Classes,persondatamod_unit;
  type
   Tcheckinfo=class(TObject)
   private
    Datamod:TPerson_datamod;
   public
   function  CheckInfoRec(Id,month:string):Boolean;
   function  GetWorkerName(Id,month:string):string;
   function  GetMonthDays(Id,month:string):string;
   function  GetHolidays(Id,month:string):string;
   function  GetReWorkDays(Id,month:string):string;
   function  GetWorkDays(Id,month:string):string;
   function  GetBusinessDays(Id,month:string):string;
   function  GetAbsentDays(Id,month:string):string;
   function  GetLeaveTimes(Id,month:string):string;
   function  GetLateTimes(Id,month:string):string;
   function  GetLeaEarTimes(Id,month:string):string;
   function  GetHOliOverTimes(Id,month:string):string;
   function  GetOtherOverTimes(Id,month:string):string;
   function  GetRemark(Id,month:string):string;
   function  CheckInfoRecs(SQL:string):OLEVariant;
   procedure RecInsert(InsertSQl:string);
   procedure RecUpdate(UpdateSQl:string);
   procedure RecDel(Id,month:string);
   constructor create;
   destructor Destroy;override;
  end;
implementation

constructor Tcheckinfo.create ;
begin
Datamod:=TPerson_datamod.Create(nil);
end;

destructor Tcheckinfo.Destroy ;
begin
 freeandnil(Datamod);
 inherited;
end;



 function Tcheckinfo.CheckInfoRec(Id,month:string):Boolean;
 begin
  Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if Datamod.Person_adoq2.Eof then result:=false
  else result:=true;
 end;

 function Tcheckinfo.GetWorkerName(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
 result:=Datamod.Person_adoq2.fieldbyname('worker_name').AsString;
 end;

  function Tcheckinfo.GetMonthDays(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
 result:=Datamod.Person_adoq2.FieldValues['month_days'];
 end;

  function Tcheckinfo.GetHolidays(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  result:=Datamod.Person_adoq2.FieldValues['holidays'];
 end;

  function Tcheckinfo.GetReWorkDays(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
 result:=Datamod.Person_adoq2.FieldValues['real_work_days'];
 end;

  function Tcheckinfo.GetWorkDays(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
 result:=Datamod.Person_adoq2.FieldValues['work_days'];
 end;

  function Tcheckinfo.GetBusinessDays (Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if  (Datamod.Person_adoq2.FieldValues['business_days']=null)  or
  (Datamod.Person_adoq2.FieldValues['business_days']='') then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['business_days'];
 end;

  function Tcheckinfo.GetAbsentDays(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if (Datamod.Person_adoq2.FieldValues['absent_days']=null) or
  (Datamod.Person_adoq2.FieldValues['absent_days']='') then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['absent_days'];
 end;

  function Tcheckinfo.GetLeaveTimes(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if (Datamod.Person_adoq2.FieldValues['leave_times']='') or
  (Datamod.Person_adoq2.FieldValues['leave_times']=null) then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['leave_times'];
 end;

  function Tcheckinfo.GetLateTimes(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if  (Datamod.Person_adoq2.FieldValues['late_times']='') or
  (Datamod.Person_adoq2.FieldValues['late_times']=null) then result:='0'
 else result:=Datamod.Person_adoq2.FieldValues['late_times'];
 end;

  function Tcheckinfo.GetLeaEarTimes(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if  (Datamod.Person_adoq2.FieldValues['leave_early_times']='') or
  (Datamod.Person_adoq2.FieldValues['leave_early_times']=null) then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['leave_early_times'];
 end;

  function Tcheckinfo.GetHOliOverTimes(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if    (Datamod.Person_adoq2.FieldValues['holiday_overtime']='') or
  (Datamod.Person_adoq2.FieldValues['holiday_overtime']=null) then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['holiday_overtime'];
 end;

  function Tcheckinfo.GetOtherOverTimes(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
  if  (Datamod.Person_adoq2.FieldValues['other_overtime']='') or
  (Datamod.Person_adoq2.FieldValues['other_overtime']=null) then result:='0'
  else result:=Datamod.Person_adoq2.FieldValues['other_overtime'];
 end;

  function Tcheckinfo.GetRemark(Id,month:string):string;
 begin
 Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(' select * from check_info where worker_id='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.Open ;
 result:=Datamod.Person_adoq2.fieldbyname('remark').AsString;
 end;

  function Tcheckinfo.CheckInfoRecs(SQL:string):OLEVariant;
 begin
 Datamod.Person_adoq1.Close ;
  Datamod.Person_adoq1.SQL.Clear;
  Datamod.Person_adoq1.SQL.Add(SQL);
  Datamod.Person_adoq1.Open ;
 result:=Datamod.Person_dsp1.Data ;
 end;

 procedure Tcheckinfo.RecInsert(InsertSQL:string);
 begin
  Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(InsertSQL);
  Datamod.Person_adoq2.ExecSQL;
 end;

  procedure Tcheckinfo.RecUpdate(UpdateSQL:string);
begin
  Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add(UpdateSQL);
  Datamod.Person_adoq2.ExecSQL;
end;

  procedure Tcheckinfo.RecDel(Id,month:string);
begin
  Datamod.Person_adoq2.Close ;
  Datamod.Person_adoq2.SQL.Clear;
  Datamod.Person_adoq2.SQL.Add('delete from  check_info where WORKER_ID='''+Id+''' '
  +' and months='''+month+'''');
  Datamod.Person_adoq2.ExecSQL;
 end;

end.

⌨️ 快捷键说明

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