u_dasjlr.pas

来自「人事管理程序源码」· PAS 代码 · 共 1,099 行 · 第 1/3 页

PAS
1,099
字号
                post;
              end;
           end;
     end;
end;

procedure TForm_dasjlr.BitBtn1Click(Sender: TObject);
var
  BookMk:Tbookmark;
begin
  with gzda_dm.ADODataSet1 do begin
    Bookmk:=GetBookmark;
    if not Locate('xm',cz_xm.Text,[loPartialKey]) then
       begin
         showmessage('没有要查找的姓名!!');
         GotoBookmark(Bookmk);
       end
    else
       begin
         displayToscreen;
       end;
    FreeBookmark(BookMk);
  end;
  panel11.Visible:=false;
  dbgrid1.SetFocus;
end;

procedure TForm_dasjlr.BitBtn9Click(Sender: TObject);
begin
  panel11.Visible:=true;
  cz_xm.Text:='';
  panel11.Refresh;
  cz_xm.SetFocus;
end;

procedure TForm_dasjlr.BitBtn8Click(Sender: TObject);
begin
   if RadioButton3.Checked then  SaveToDisk_append;  //存盘
   with gzda_dm.ADODataSet1 do begin
     if not active then abort;
     xd_zgbh:=fieldbyname('zgbh').AsInteger;
     xd_zgxm:=fieldbyname('xm').AsString;
   end;
   if xd_zgxm='' then abort;
   Form_qtxx:=TForm_qtxx.create(application); //建立
   Form_qtxx.showmodal; //以有模式方式显示
   Form_qtxx.free ;    //释放窗体
end;

procedure TForm_dasjlr.cx_bmChange(Sender: TObject);
begin
  bmChange(true);
  OpenDateSet('zgxh');
end;

procedure TForm_dasjlr.bmChange(bz:boolean);
begin
  panel7.Enabled:=bz;
  cx_pxfs.Enabled:=bz;
  dbgrid1.Enabled:=bz;
  bitbtn5.Enabled:=bz;
  bitbtn6.Enabled:=bz;
  bitbtn8.Enabled:=bz;
  bitbtn9.Enabled:=bz;
  dbimage1.Visible:=bz;
end;

procedure TForm_dasjlr.FormActivate(Sender: TObject);
begin
  cx_dw.SetFocus;
end;

procedure TForm_dasjlr.cx_dwExit(Sender: TObject);
var
  dwbm:string;
begin
end;

procedure TForm_dasjlr.cx_bmExit(Sender: TObject);
begin
  if cx_bm.Text='' then
     begin
       showmessage('请选定部门编码!!');
       cx_bm.SetFocus;
       abort;
     end;

end;

procedure TForm_dasjlr.cx_zzmmExit(Sender: TObject);
begin
  if pos('党',cx_zzmm.Text)=0 then
     cx_rdsj.Enabled:=false
  else
     cx_rdsj.Enabled:=true;
end;

procedure TForm_dasjlr.cx_dwChange(Sender: TObject);
var
 dwbm:string;
begin
  dwbm:=copy(cx_dw.Text,1,2);
  with gzda_dm.ADODataSet10 do begin
    if active then active:=false;
    commandtext:='select * from bmbmb where (dwbm=:dwbm) order by dwbm,bmbm';
    Parameters.ParamByName('dwbm').Value:=dwbm;
    open;
    first;
    cx_bm.Items.Clear;
    while not eof do begin
      cx_bm.Items.Add(fieldbyname('bmbm').AsString+'.'+fieldbyname('bmmc').AsString);
      next;
    end;
  end;
  cx_bm.ItemIndex:=-1;
  cx_bm.Refresh;
end;

procedure TForm_dasjlr.cx_gzzeKeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in ['0'..'9','.',#8,#13]) then key:=#0;
end;

procedure TForm_dasjlr.cx_gzzeExit(Sender: TObject);
begin
  if cx_gzze.Text='' then cx_gzze.Text:='0.00';
end;

procedure TForm_dasjlr.BitBtn6Click(Sender: TObject);
begin
  open_qtxx;
  form_dyjl.QR_dw.Caption:='单位:'+copy(cx_dw.Text,4,length(cx_dw.Text)-3);
  form_dyjl.QR_bm.Caption:='部门:'+copy(cx_bm.Text,4,length(cx_bm.Text)-3);
  form_dyjl.QuickRep1.Preview;
  if dybz[6] and (gzda_dm.ADODataSet9.RecordCount<>0) then form_dyjl.QuickRep2.Preview ;
  if dybz[7] and (gzda_dm.ADODataSet8.RecordCount<>0) then form_dyjl.QuickRep3.Preview
end;

procedure TForm_dasjlr.BitBtn5Click(Sender: TObject);
begin
  if form_dyjl.PrinterSetupDialog1.Execute then
     begin
        open_qtxx;
        form_dyjl.QR_dw.Caption:='单位:'+copy(cx_dw.Text,4,length(cx_dw.Text)-3);
        form_dyjl.QR_bm.Caption:='部门:'+copy(cx_bm.Text,4,length(cx_bm.Text)-3);
        form_dyjl.QuickRep1.Print;
        if dybz[6] and (gzda_dm.ADODataSet9.RecordCount<>0) then form_dyjl.QuickRep2.print ;
        if dybz[7] and (gzda_dm.ADODataSet8.RecordCount<>0) then form_dyjl.QuickRep3.print
     end;
end;

procedure TForm_dasjlr.open_qtxx;
var
  i:integer;
begin
  panel12.Visible:=true;
  panel12.Refresh;
  with gzda_dm.ADODataSet1 do begin
     xd_zgbh:=fieldbyname('zgbh').AsInteger;
     xd_zgxm:=fieldbyname('xm').AsString;
  end;

  with gzda_dm.ADODataSet_cx do begin
    if active then active:=false;
    commandtext:='select * from dyxm order by xh';
    open;
    first;
    i:=0;
    while not eof do begin
      dybz[i]:=fieldbyname('dybz').AsBoolean;
      i:=i+1;
      next;
    end;
  end;

  with gzda_dm.ADOCommand1 do begin
    commandtext:='delete from ls_zgjl';
    Execute;
  end;
  with gzda_dm.ADODataSet_cx do begin
    if active then active:=false;
    commandtext:='select * from ls_zgjl';
    open;
    first;
  end;
  if dybz[0] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开工作经历
          if active then active:=false;
          commandtext:='select * from gzjl where (zgbh=:bh) order by qssj';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','工作简历','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['开始时间','终止时间','工作单位','职务','证明人']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('qssj').asstring,fieldbyname('zzsj').asstring,fieldbyname('gzdw').asstring,fieldbyname('zw').asstring,fieldbyname('zmr').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
     end;
  if dybz[1] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开学习经历
          if active then active:=false;
          commandtext:='select * from xxjl where (zgbh=:bh) order by qssj';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','学习简历','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['开始时间','终止时间','毕业学校','专业','证明人']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('qssj').asstring,fieldbyname('zzsj').asstring,fieldbyname('byxx').asstring,fieldbyname('zy').asstring,fieldbyname('zmr').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
    end;
  if dybz[2] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开 职称评聘
          if active then active:=false;
          commandtext:='select * from zcprjl where (zgbh=:bh) ';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','职称评聘简历','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['职称(技术等级)','评审机关','评审时间及资格证书编号','聘任机关','聘任时间']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('zc').asstring,fieldbyname('psjg').asstring,fieldbyname('pssj').asstring+'/'+fieldbyname('zgzsbh').asstring,fieldbyname('prjg').asstring,fieldbyname('prsj').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
    end;
  if dybz[3] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开继续教育
          if active then active:=false;
          commandtext:='select * from jxjy where (zgbh=:bh) order by qssj';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','继续教育简历','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['起始时间','终止时间','主办单位','学习形式','学习内容']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('qssj').asstring,fieldbyname('zzsj').asstring,fieldbyname('zbdw').asstring,fieldbyname('xxxs').asstring,fieldbyname('xxnr').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
    end;
  if dybz[4] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开奖罚记录
          if active then active:=false;
          commandtext:='select * from jfjl where (zgbh=:bh) order by rq';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','奖罚简历','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['日期','原因','授予单位','名称','级别']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('rq').asstring,fieldbyname('yy').asstring,fieldbyname('sydw').asstring,fieldbyname('mc').asstring,fieldbyname('jb').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
    end;
//==
  if dybz[5] then
     begin
        with gzda_dm.ADODataSet2 do begin  //打开社会关系
          if active then active:=false;
          commandtext:='select * from shgx where (zgbh=:bh) ';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
        with gzda_dm.ADODataSet2 do begin  //把工作简历加到gzda_dm.ADODataSet_cx中
          first;
          gzda_dm.ADODataSet_cx.AppendRecord(['','','社会关系','','']);
          gzda_dm.ADODataSet_cx.AppendRecord(['社会关系','姓名','工作单位','出生日期','职务']);
          while not eof do begin
            gzda_dm.ADODataSet_cx.AppendRecord([fieldbyname('shgx').asstring,fieldbyname('xm').asstring,fieldbyname('gzdw').asstring,fieldbyname('csrq').asstring,fieldbyname('zw').asstring]);
            next;
          end;
          gzda_dm.ADODataSet_cx.UpdateBatch(arALL);
        end;
     end;
  //==
  with gzda_dm.ADODataSet_cx do begin
    if active then active:=false;
    commandtext:='select * from ls_zgjl';
    open;
    first;
  end;
  if dybz[6] then
     begin
        with gzda_dm.ADODataSet9 do begin  //打开工资调整
          if active then active:=false;
          commandtext:='select * from gztzqk where (zgbh=:bh) order by tzsj';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
     end;
  if dybz[7] then
     begin
        with gzda_dm.ADODataSet8 do begin  //打开工资调整
          if active then active:=false;
          commandtext:='select * from poqk where (zgbh=:bh)';
          Parameters.ParamByName('bh').Value:=Form_dasjlr.xd_zgbh;
          open;
          first;
        end;
     end;
  panel12.Visible:=false;
end;
procedure TForm_dasjlr.cx_gzsjExit(Sender: TObject);
begin
  if cx_gzsj.Text<=cx_csrq.Text then
     begin
       showmessage('工作时间不能早于出生日期!');
       cx_csrq.SetFocus;
     end;
end;

procedure TForm_dasjlr.cx_rdsjExit(Sender: TObject);
begin
  if cx_rdsj.Text<=cx_csrq.Text then
     begin
       showmessage('入党时间不能早于出生日期!');
       cx_csrq.SetFocus;
     end;
end;

procedure TForm_dasjlr.cx_bmEnter(Sender: TObject);
begin
  if length(trim(cx_dw.Text))=0 then
     begin
       showmessage('请首先选定单位名称!!');
       cx_dw.SetFocus;
       abort;
     end;
end;

end.

⌨️ 快捷键说明

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