procedure N2Click(Sender: TObject);
procedure AboutClick(Sender: TObject);
procedure ExitClick(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function Encrypt(Text:string):string;
end;
var
frmMain: TfrmMain;
implementation
uses UpublcBrower, UemployeeMgr, UpersonalChange, UarrangeOrders, Usalary,
  UdailyCost, Userver, Ucustom, UtodayWork, Usysmanadd, Upasschg,
  Udatecontrol, Ulogdaily, UlogIn, MyData, Userverchg, Userverchart,
  utotal, Uabout, UsendMsg;
{$R *.dfm}
procedure AddLogIn;
begin
   with dm.AQHistory do
 begin
   close;
   sql.Clear;
   sql.Add('INSERT INTO LogHistory(UserID,LogInTime,LogOutTime)');
   sql.Add('values (');
   sql.Add(''''+UserName+''',');
   sql.Add(''''+FormatDateTime('yyyy-mm-dd hh:mm:ss',LogInTime)+''',');
   sql.Add(''''+FormatDateTime('yyyy-mm-dd hh:mm:ss',Now)+'''');
   sql.Add(')');
   ExecSQL;
 end;
end;
//得到使用时间
function TimeGetStamp(T2:string):String;
var
  h1,m1,s1,n1,h2,m2,s2,n2:word;
  hh,mm,ss:Longint;
  strtime :Longint;
begin
   Decodetime(now,h1,m1,s1,n1);
   Decodetime(StrtoTime(T2),h2,m2,s2,n2);
   hh := h1*3600+m1*60+s1;
   mm := h2*3600+m2*60+s2;
  if hh > mm then
   strtime :=hh-mm
  else
   strtime :=hh-mm+24*3600;
   hh := Strtime div 3600;
   mm := Strtime mod 3600 div 60 ;
   ss := Strtime mod 60;
   Result := inttoStr(hh) +'小时'+ inttoStr( mm) +'分'+inttoStr(ss)+'秒';
end;
function TfrmMain.Encrypt(Text:string):string;//用户加密与解密
var
 Temp:string;
 CharStr:char;
 i,ASC:Integer;
begin
  Result:='';
  Temp:=Text;
  for i:=1 to Length(Temp)do
   begin
    CharStr:=Temp[i];
    ASC:=ord(CharStr) xor i;
    Result:=Result+chr(ASC);
   end;
end;
//自定义的函数--打开Child窗体。
procedure OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var
  i: integer;
  Child:TForm;
begin
  for i := 0 to Screen.FormCount -1 do
      if Screen.Forms[i].ClassType=FormClass then
      begin
        Child:=Screen.Forms[i];
        if Child.WindowState=wsMinimized then   
           ShowWindow(Child.handle,SW_SHOWNORMAL)
        else
           ShowWindow(Child.handle,SW_SHOWNA);
        if (not Child.Visible) then Child.Visible:=True;
  &nb
首页 上一页 10 11 12 13 14 15 下一页 尾页 13/15/15
delphi+sql办公自动化系统(+开题报告源程序+论文正文+外文翻译+答辩ppt)(十三)由免费论文网(www.jaoyuw.com)会员上传。

