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

📄 u_form_mainmenu.pas

📁 这是delphi7.0开发的人力资源培训考核软件
💻 PAS
字号:
unit U_Form_MainMenu;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, WinSkinStore, WinSkinData, ComCtrls, jpeg, ExtCtrls, Menus,
  ButtonExCtl, ToolWin, DB, ADODB;

type
  TForm_MainMenu = class(TForm)
    SkinData1: TSkinData;
    SkinStore1: TSkinStore;
    StatusBar1: TStatusBar;
    CoolBar1: TCoolBar;
    Button1: TButtonExCtl;
    SampleBtn: TButtonExCtl;
    AccidentBtn: TButtonExCtl;
    ExitSys: TButtonExCtl;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    Image1: TImage;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    ADOQuery1: TADOQuery;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure ExitSysClick(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure SampleBtnClick(Sender: TObject);
    procedure AccidentBtnClick(Sender: TObject);
    procedure N10Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_MainMenu: TForm_MainMenu;

implementation

uses uAdoSet,uGlobal, U_Form_CheckStandard, U_Form_CheckMark,
  U_Form_CheckTotal,U_Form_Login;

{$R *.dfm}
////uses U_Form_CheckSetup,U_Form_CheckStandard,U_Form_CheckMark,U_Form_CheckTotal;
procedure TForm_MainMenu.FormCreate(Sender: TObject);
begin
       self.Top:=0;
       self.Left:=0;
       self.Width:=screen.Width;
       self.Height:=screen.Height;
end;

procedure TForm_MainMenu.Button1Click(Sender: TObject);
begin
    N2Click(Sender);
end;

procedure TForm_MainMenu.N2Click(Sender: TObject);
begin
    if  Form_CheckStandard=nil then
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckStandard:=TForm_CheckStandard.Create(Application);
         Form_CheckStandard.Show;
     end
     else
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckStandard.Show;
     end;////
end;

procedure TForm_MainMenu.ExitSysClick(Sender: TObject);
begin
     if Application.MessageBox('确定是否退出系统?','系统提示',MB_YesNo+MB_IconWarning)=id_yes then
     begin

        if Application.MainForm=self then
        begin
           Application.Terminate;
           Form_Login.Close;
        end
        else
        begin
           DefWindowProc(handle,WM_SysCommand,sc_close,0);
           Form_Login.Close;
        end;
     end;////
end;

procedure TForm_MainMenu.N3Click(Sender: TObject);
begin
     if  Form_CheckMark=nil then
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckMark:=TForm_CheckMark.Create(Application);
         Form_CheckMark.Show;
     end
     else
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckMark.Show;
     end;////
end;

procedure TForm_MainMenu.SampleBtnClick(Sender: TObject);
begin
     N3Click(Sender);
end;

procedure TForm_MainMenu.AccidentBtnClick(Sender: TObject);
begin
    if  Form_CheckTotal=nil then
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckTotal:=TForm_CheckTotal.Create(Application);
         Form_CheckTotal.Show;
     end
     else
     begin
         EnableWindow(Form_MainMenu.Handle,false);
         Form_CheckTotal.Show;
     end;////
end;

procedure TForm_MainMenu.N10Click(Sender: TObject);
var
    param:TStringList;
    strSql:string;
    _CurrentYear,_CurrentMonth,_CurrentDay:word;
    _PrevMonth:string;
    _CurrMonth:string;
begin
     param:=TStringList.create;
     if Application.MessageBox('确定是否生成下月标准分值?','系统提示',MB_YesNo+MB_IconInformation)=id_yes then
     begin
        /////首先删除临时表中的数据/////////////////////
        DecodeDate(now,_Currentyear,_CurrentMonth,_CurrentDay);
        /////转换当月份为字符串/////////////////////////
        if _CurrentMonth<10 then
        begin
           _CurrMonth:='0'+trim(inttostr(_CurrentMonth-1));
        end
        else
           _CurrMonth:=trim(inttostr(_CurrentMonth-1));
        if _CurrentMonth<10 then

        begin
           _PrevMonth:='0'+trim(inttostr(_CurrentMonth));
        end
        else
           _PrevMonth:=trim(inttostr(_CurrentMonth));
        ////showmessage(_Currmonth);
        setDbFlag('HRManage');
        param.clear;
        strSql:='delete  From  HRCheckStandard_Tmp';
        DelRecord(AdoQuery1,strSql,param);
        ////将上个月的数据拷贝到临时表(HRCheckStandard-->HRCheckStandard_Tmp)
        param.clear;
        param.Add(trim(inttostr(_CurrentYear)));
        param.Add(trim(_CurrMonth));
        strSql:='Insert Into  HRCheckStandard_Tmp';
        strSql:=strSql+'  Select *  ';
        strSql:=strSql+'  From  HRCheckStandard  where  CHK_Year=:s1  and  CHK_Month=:s2';
        DelRecord(AdoQuery1,strSql,param);
        //////更改临时表(HRCheckStandard_Tmp)中的月份////////////////////////
        param.Clear;
        setDbFlag('HRManage');
        param.Add(trim(_PrevMonth));
        strSql:='Update  HRCheckStandard_Tmp Set  CHK_Month=:s1';
        UpdateRecord(AdoQuery1,strSql,param);
        ////将本个月的数据拷贝到临时表(HRCheckStandard_Tmp-->HRCheckStandard)
        param.clear;

        strSql:='Insert Into  HRCheckStandard(CHK_Year,CHK_Month,CHK_OrderID,CHK_CheckDept,CHK_ByCheckDept,CHK_Standard)';
        strSql:=strSql+'  Select CHK_Year,CHK_Month,CHK_OrderID,CHK_CheckDept,CHK_ByCheckDept,CHK_Standard   ';
        strSql:=strSql+'  From  HRCheckStandard_Tmp';
        DelRecord(AdoQuery1,strSql,param);
     end;///
end;

end.

⌨️ 快捷键说明

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