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

📄 queryattendanceinformation.pas

📁 本系统是一个基于delphi7环境开发的人事管理系统
💻 PAS
📖 第 1 页 / 共 2 页
字号:

procedure TForm16.Button5Click(Sender: TObject);
begin
with Form1.adoquery1 do
begin
   close;
   sql.clear;
   sql.add('select * from Checkin');
   if form1.ADOQuery1.Active=false  then
       form1.ADOQuery1.Active:=true;
   open;  //
end;
 statusbar1.Panels[0].Text:='所有人员考勤信息!';
end;

procedure TForm16.Button6Click(Sender: TObject);
begin
form16.Close;
end;

procedure TForm16.FormClose(Sender: TObject; var Action: TCloseAction);
begin
form1.ADOQuery1.SQL.Clear;
form3.Enabled:=true;
end;

procedure TForm16.FormShow(Sender: TObject);
begin
form1.ADOQuery1.SQL.Clear;
 self.ComboBox2.Text:='(请选择)';

self.Button4.Enabled:=false;
form3.Enabled:=false;
////////////不是管理员
if  form2.user_name<>'adm' then
begin
statusbar1.Panels[0].Text:='欢迎使用查询考勤操作!     ***以上信息为你的个人信息';
self.Button4.Enabled:=false;
self.Button5.Enabled:=false;
self.ComboBox2.Enabled:=false;

 with form1.adoquery1 do
   begin
     close;
      sql.Clear;
       sql.add('select * from Checkin where 员工编号=:员工编号');
      parameters[0].Value:=form2.worker_no;
      // sql.add('select * from employees where 员工编号 :='+inputString);
     form1.ADOQuery1.Active:=true;
    execsql;
    end;

exit;
end;
////////////////////////////////////下面是管理员的
 statusbar1.Panels[0].Text:='欢迎使用考勤管理操作!';
with Form1.adoquery1 do
begin
   close;
   sql.clear;
   sql.add('select * from Checkin');
   if form1.ADOQuery1.Active=false  then
       form1.ADOQuery1.Active:=true;
   open;  //
end;
{ self.Label5.Caption:='';
 self.ComboBox2.Text:='(请选择)';
 statusbar1.Panels[0].Text:='欢迎使用考勤管理操作!';
self.Button4.Enabled:=false;
form3.Enabled:=false; }
end;

procedure TForm16.Button4Click(Sender: TObject);
begin
if combobox2.Text='员工编号'  then
   begin
      // inputString:=inputbox('查询数据','请输入员工的编号','');
       //zxcv('员工编号',inputString);
       with form1.adoquery1 do
           begin
           close;
           sql.Clear;
           sql.add('select * from Checkin where 员工编号=:员工编号');
           parameters[0].Value:=FindData;
           // sql.add('select * from employees where 员工编号 :='+inputString);
           form1.ADOQuery1.Active:=true;
           execsql;
         statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
       end;
   end
   else  if combobox2.Text='全勤天数'  then
            begin
           // inputString:=inputbox('查询数据','请输入全勤天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                    //order by 全勤天数 asc
                sql.add('select * from Checkin where 全勤天数=:全勤天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
       statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
    else   if combobox2.Text='事假天数'  then
              begin
          //  inputString:=inputbox('查询数据','请输入事假天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                    // order by 事假天数 asc
                sql.add('select * from Checkin where 事假天数=:事假天数 ');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
         statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
    else    if combobox2.Text='旷工天数'  then
              begin
           // inputString:=inputbox('查询数据','请输入旷工天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 旷工天数 asc
                sql.add('select * from Checkin  where 旷工天数=:旷工天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
            statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
    else    if combobox2.Text='迟到天数'  then
              begin
            //inputString:=inputbox('查询数据','请输入迟到天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 迟到天数 asc
                sql.add('select * from Checkin  where 迟到天数=:迟到天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
     statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
     else    if combobox2.Text='早退天数'  then
              begin
         //   inputString:=inputbox('查询数据','请输入早退天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 早退天数 asc
                sql.add('select * from Checkin   where 早退天数=:早退天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
     else     if combobox2.Text='休假天数'  then
              begin
          //  inputString:=inputbox('查询数据','请输入休假天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 休假天数 asc
                sql.add('select * from Checkin  where 休假天数=:休假天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
              statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
     else     if combobox2.Text='日常加班天数'  then
              begin
          //  inputString:=inputbox('查询数据','请输入日常加班天数','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 日常加班天数 asc
                sql.add('select * from Checkin where 日常加班天数=:日常加班天数');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
         statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
     else     if combobox2.Text='法定节假日加班天数'  then
              begin
          //  inputString:=inputbox('查询数据','请输入法定节假日加班','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                    //order by 法定节假日加班 asc
                sql.add('select * from Checkin where 法定节假日加班=:法定节假日加班');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
         statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end
     else      if combobox2.Text='周末加班天数'  then
              begin
           // inputString:=inputbox('查询数据','请输入周末加班','');
            with form1.adoquery1 do
                begin
                close;
                sql.Clear;                     //order by 周末加班加班 asc
                sql.add('select * from Checkin  where 周末加班=:周末加班');
                parameters[0].Value:=finddata;
                form1.ADOQuery1.Active:=true;
                execsql;
         statusbar1.Panels[0].Text:='以上为你所查询的结果!';
         exit;
                end;
            end;
end;

end.

⌨️ 快捷键说明

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