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

📄 u_empworktime.~pas

📁 小型劳资管理系统,用visual basic+access编写
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
    Maskedit2.SetFocus;
end;

procedure TF_empworktime.DataSource1DataChange(Sender: TObject;
  Field: TField);
begin
  if GS_DM.V_empworktime.State in [dsedit] then
    begin
      StatusBar1.Panels[3].Text:='修改';
      DBGrid1.ReadOnly:=false;
      bitbtn1.Enabled:=false;
      bitbtn2.Enabled:=true;
      bitbtn3.Enabled:=true;
    end
  else
    begin
      StatusBar1.Panels[3].Text:='浏览';
      DBGrid1.ReadOnly:=true;
      bitbtn1.Enabled:=true;
      bitbtn2.Enabled:=false;
      bitbtn3.Enabled:=false;
    end;
end;

procedure TF_empworktime.BitBtn1Click(Sender: TObject);//修改
begin
  DBGrid1.ReadOnly:=false;
  GS_DM.V_empworktime.Edit;
end;

procedure TF_empworktime.BitBtn2Click(Sender: TObject); //保存
begin
  if GS_DM.V_empworktime.State in [dsedit] then
  GS_DM.V_empworktime.Post;
end;

procedure TF_empworktime.BitBtn3Click(Sender: TObject); //取消
begin
  GS_DM.V_empworktime.cancel;
end;

procedure TF_empworktime.ComboBox3KeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then
    name:=combobox3.Text;
end;

procedure TF_empworktime.SpeedButton5Click(Sender: TObject);
begin
  if empordep='emp' then
  begin
  if RP_empworktime=nil then
    RP_empworktime:=TRP_empworktime.Create(self);
    RP_empworktime.RP_worktime.ReportTitle:='(员工考勤报表明细)';
    RP_empworktime.QRLabel4.Caption:=RPstr;
    RP_empworktime.QRLabel5.Caption:=Maskedit1.Text;
    RP_empworktime.QRLabel7.Caption:=Maskedit2.Text;
    RP_empworktime.QRLabel34.Caption:=inttostr(GS_DM.V_empworktime.RecordCount)+'ぱ';
    RP_empworktime.RP_worktime.Preview;
  end
 { else if empordep='yjdep' then
    begin
      if RP_yjdep_worktime=nil then
        RP_yjdep_worktime:=TRP_yjdep_worktime.Create(self);
        RP_yjdep_worktime.RP_yjdep_worktime.ReportTitle:='(部门考勤报表明细)';
        RP_yjdep_worktime.QRLabel4.Caption:=RPstr;
        RP_yjdep_worktime.QRLabel5.Caption:=Maskedit1.Text;
        RP_yjdep_worktime.QRLabel7.Caption:=Maskedit2.Text;
        RP_yjdep_worktime.QRLabel34.Caption:=inttostr(GS_DM.V_empworktime.RecordCount)+'ぱ';
        RP_yjdep_worktime.RP_yjdep_worktime.Preview;
    end
    else if empordep='ejdep' then
      begin
      if RP_ejdep_worktime=nil then
        RP_ejdep_worktime:=TRP_ejdep_worktime.Create(self);
        RP_ejdep_worktime.RP_worktime.ReportTitle:='(部门考勤报表明细)';
        RP_ejdep_worktime.QRLabel4.Caption:=RPstr;
        RP_ejdep_worktime.QRLabel5.Caption:=Maskedit1.Text;
        RP_ejdep_worktime.QRLabel7.Caption:=Maskedit2.Text;
        RP_ejdep_worktime.QRLabel34.Caption:=inttostr(GS_DM.V_empworktime.RecordCount)+'ぱ';
        RP_ejdep_worktime.RP_worktime.Preview;
      end    }
end;

procedure TF_empworktime.SpeedButton6Click(Sender: TObject);
begin
  if (Length(Trim(Maskedit1.Text))<>10)or(Length(Trim(Maskedit2.Text))<>10) then
    begin
      Application.MessageBox('请输入正确的时间段!','系统提示',MB_iconstop+MB_OK);
      exit;
    end;

    GS_DM.fromdate:=Maskedit1.Text;
    GS_DM.todate:=Maskedit2.Text;
 if (sender=Speedbutton6)or(sender=button1) then
 if combobox1.Text='' then begin showmessage('请选择一个部门');exit;end else
  with GS_DM.Q_master do
    begin
      close;
      sql.Clear;
      sql.Add('select * from V_yj_ej_emp where yjbm_name='+''''+Combobox1.Text+'''');
      open;
    end
  else if (sender=speedbutton7)or(sender=button2) then
    if combobox2.Text='' then begin showmessage('请选择一个部门');exit;end else  with GS_DM.Q_master do
    begin
      close;
      sql.Clear;
      sql.Add('select * from V_yj_ej_emp where ejbm_name='+''''+Combobox2.Text+'''');
      open;
    end;
  if QRmdform=nil then
      QRmdform:=TQRmdform.Create(self);
  if checkbox1.Checked then
    QRMDform.DetailBand1.ForceNewColumn:=true;
      QRmdform.QRLabel9.Caption:=Maskedit1.Text;
      QRmdform.QRLabel11.Caption:=Maskedit2.Text;
//=======
  if (sender=button1)or(sender=button2) then
     begin
        QRmdform.QRLabel42.Caption:=Maskedit1.Text;
        QRmdform.QRLabel44.Caption:=Maskedit2.Text;
       QRmdform.QuickRep2.ReportTitle:='(部门员工工时报表)';
       QRmdform.QuickRep2.Preview;
       exit;
     end;
//=======
      QRmdform.QuickRep1.ReportTitle:='(部门员工明细报表)';
  QRmdform.QuickRep1.Preview;
end;

procedure TF_empworktime.DBGrid2DblClick(Sender: TObject);
begin
  ShowMessage(DataSource1.DataSet.Fields[0].AsString);
end;

procedure TF_empworktime.DateTimePicker1Change(Sender: TObject);
begin
maskedit1.Text:=datetostr(datetimepicker1.Date);
end;

procedure TF_empworktime.DateTimePicker2Change(Sender: TObject);
begin
maskedit2.Text:=datetostr(datetimepicker2.Date);
end;

procedure TF_empworktime.SpeedButton2Click(Sender: TObject);
begin
 GS_DM.V_empworktime.Close;
  if (Length(Trim(Maskedit1.Text))<>10)or(Length(Trim(Maskedit2.Text))<>10) then
    begin
      Application.MessageBox('请输入正确的时间段!','系统提示',MB_iconstop+MB_OK);
      exit;
    end;
  if (Combobox1.Text='')and(Combobox2.Text='')and(Combobox3.Text='')and(Combobox4.Text='') then
    begin
     GS_DM.openall_everydaytime(MaskEdit1.Text,MaskEdit2.Text);
     RPstr:='全部部门';
     StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);
     exit;
     empordep:='全部部门';
    end;
  if Sender=Speedbutton1 then
    begin
     if combobox1.Text='' then exit;
       GS_DM.open_everydaytime('yjbm_name',combobox1.Text,MaskEdit1.Text,MaskEdit2.Text);
       RPstr:=combobox1.Text;
       empordep:='yjdep';
    end
     else if sender=Speedbutton2 then
       begin
       if combobox2.Text='' then exit;
         GS_DM.open_everydaytime('ejbm_name',combobox2.Text,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox2.Text;
         empordep:='ejdep';
       end
       else if sender=speedbutton3 then
         begin
         if combobox3.Text='' then exit;
         GS_DM.open_everydaytime('name',name,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox3.Text;
         empordep:='emp';
         end
         else
           begin
             if combobox4.Text='' then exit;
              worknum:=combobox4.Text;
              GS_DM.open_everydaytime('work_num',Worknum,MaskEdit1.Text,MaskEdit2.Text);
              RPstr:=combobox4.Text;
              empordep:='emp';
           end;
        if GS_DM.V_empworktime.RecordCount=0 then
          begin
            showmessage('没有这个类型的统计数据!');
            exit;
          end;
         StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);

end;

procedure TF_empworktime.SpeedButton3Click(Sender: TObject);
begin
  GS_DM.V_empworktime.Close;
  if (Length(Trim(Maskedit1.Text))<>10)or(Length(Trim(Maskedit2.Text))<>10) then
    begin
      Application.MessageBox('请输入正确的日期!','系统提示',MB_iconstop+MB_OK);
      exit;
    end;
  if (Combobox1.Text='')and(Combobox2.Text='')and(Combobox3.Text='')and(Combobox4.Text='') then
    begin
     GS_DM.openall_everydaytime(MaskEdit1.Text,MaskEdit2.Text);
     RPstr:='全部部门';
     StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);
     exit;
     empordep:='全部部门';
    end;
  if Sender=Speedbutton1 then
    begin
     if combobox1.Text='' then exit;
       GS_DM.open_everydaytime('yjbm_name',combobox1.Text,MaskEdit1.Text,MaskEdit2.Text);
       RPstr:=combobox1.Text;
       empordep:='yjdep';
    end
     else if sender=Speedbutton2 then
       begin
       if combobox2.Text='' then exit;
         GS_DM.open_everydaytime('ejbm_name',combobox2.Text,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox2.Text;
         empordep:='ejdep';
       end
       else if sender=speedbutton3 then
         begin
         if combobox3.Text='' then exit;
         GS_DM.open_everydaytime('name',name,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox3.Text;
         empordep:='emp';
         end
         else
           begin
             if combobox4.Text='' then exit;
              worknum:=combobox4.Text;
              GS_DM.open_everydaytime('work_num',Worknum,MaskEdit1.Text,MaskEdit2.Text);
              RPstr:=combobox4.Text;
              empordep:='emp';
           end;
        if GS_DM.V_empworktime.RecordCount=0 then
          begin
            showmessage('没有这个类型的统计!!');
            exit;
          end;
         StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);

end;

procedure TF_empworktime.SpeedButton4Click(Sender: TObject);
begin
 GS_DM.V_empworktime.Close;
  if (Length(Trim(Maskedit1.Text))<>10)or(Length(Trim(Maskedit2.Text))<>10) then
    begin
      Application.MessageBox('请输入正确的时间段!','系统提示',MB_iconstop+MB_OK);
      exit;
    end;
  if (Combobox1.Text='')and(Combobox2.Text='')and(Combobox3.Text='')and(Combobox4.Text='') then
    begin
     GS_DM.openall_everydaytime(MaskEdit1.Text,MaskEdit2.Text);
     RPstr:='全部部门';
     StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);
     exit;
     empordep:='全部部门';
    end;
  if Sender=Speedbutton1 then
    begin
     if combobox1.Text='' then exit;
       GS_DM.open_everydaytime('yjbm_name',combobox1.Text,MaskEdit1.Text,MaskEdit2.Text);
       RPstr:=combobox1.Text;
       empordep:='yjdep';
    end
     else if sender=Speedbutton2 then
       begin
       if combobox2.Text='' then exit;
         GS_DM.open_everydaytime('ejbm_name',combobox2.Text,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox2.Text;
         empordep:='ejdep';
       end
       else if sender=speedbutton3 then
         begin
         if combobox3.Text='' then exit;
         GS_DM.open_everydaytime('name',name,MaskEdit1.Text,MaskEdit2.Text);
         RPstr:=combobox3.Text;
         empordep:='emp';
         end
         else
           begin
             if combobox4.Text='' then exit;
              worknum:=combobox4.Text;
              GS_DM.open_everydaytime('work_num',Worknum,MaskEdit1.Text,MaskEdit2.Text);
              RPstr:=combobox4.Text;
              empordep:='emp';
           end;
        if GS_DM.V_empworktime.RecordCount=0 then
          begin
            showmessage('没有这个类型的统计数据!');
            exit;
          end;
         StatusBar1.Panels[1].Text:=inttostr(GS_DM.V_empworktime.RecordCount);

end;

end.

⌨️ 快捷键说明

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