?? u_form_mainmenu.~pas
字號(hào):
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('確定是否退出系統(tǒng)?','系統(tǒng)提示',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('確定是否生成下月標(biāo)準(zhǔn)分值?','系統(tǒng)提示',MB_YesNo+MB_IconInformation)=id_yes then
begin
/////首先刪除臨時(shí)表中的數(shù)據(jù)/////////////////////
DecodeDate(now,_Currentyear,_CurrentMonth,_CurrentDay);
/////轉(zhuǎn)換當(dāng)月份為字符串/////////////////////////
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);
////將上個(gè)月的數(shù)據(jù)拷貝到臨時(shí)表(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);
//////更改臨時(shí)表(HRCheckStandard_Tmp)中的月份////////////////////////
param.Clear;
setDbFlag('HRManage');
param.Add(trim(_PrevMonth));
strSql:='Update HRCheckStandard_Tmp Set CHK_Month=:s1';
UpdateRecord(AdoQuery1,strSql,param);
////將本個(gè)月的數(shù)據(jù)拷貝到臨時(shí)表(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.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -