var
KJ: TSysFrame;
implementation
uses
Controls, PConst;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
{TRMFolderFieldNames}
function TSysFrame.SaveToReportFile(): Boolean;
//±£´æ±¨±íÎļþ
var
SQLs: string;
begin
result := False;
SQLs := 'select FILE_DATA From Sys_Print_Files WHERE FILE_ID = ' + Fun.SafetySQL(PrintTicketShow.GetMainTicket.ReportFileId);
with DM.CreateQry(SQLs)do
begin
try
if RecordCount <> 0 then
begin
Edit;
TBlobField(FieldByName('FILE_DATA')).SaveToFile(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile);
Post;
result := True;
end;
finally
Free;
end;
end;
//with
end;
function TSysFrame.DownLoadReportFile(): string;
//±£´æ±¨±íÎļþ
ZSP 2006-6-19 Ôö¼Ó
begin
result := '';
DM.SQL := 'select FILE_DATA From Sys_Print_Files WHERE FILE_ID = ' +
#39 + '2767E50010CE44ACA98C3A696E4F7580' + #39;
DM.OpenSQL;
if DM.RecordCount = 0 then
EXIT;
Result := ExtractFilepath(paramstr(0)) + 'temp/' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.FR3';
TBlobField(DM.Q1.FieldByName('FILE_DATA')).SaveToFile(Result);
end;
function TSysFrame.DownLoadReportFile(filename: string): string;
//±£´æ±¨±íÎļþ
ZSP 2006-6-19 Ôö¼Ó
begin
result := '';
DM.SQL := 'select FILE_DATA From Sys_Print_Files WHERE FILE_ID = ' +
#39 + '2767E50010CE44ACA98C3A696E4F7580' + #39;
DM.OpenSQL;
if DM.RecordCount = 0 then
EXIT;
TBlobField(DM.Q1.FieldByName('FILE_DATA')).SaveToFile(filename);
result := filename;
end;
function TSysFrame.ClearFile(): Boolean;
//ɾ³ýÎļþ
var
Attrs: integer;
//ÎļþÊôÐÔ
begin
Result := true;
// if FileExists(PrintReportPathFile) then
begin
Attrs := FileGetAttr(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile);
if ((Attrs and SysUtils.faReadOnly) = SysUtils.faReadOnly) then
FileSetAttr(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile, (Attrs - SysUtils.faReadOnly));
if ((Attrs and SysUtils.faHidden) = SysUtils.faHidden) then
FileSetAttr(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile, (Attrs - SysUtils.faHidden));
if ((Attrs and SysUtils.faSysFile) = SysUtils.faSysFile) then
FileSetAttr(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile, (Attrs - SysUtils.faSysFile));
try
Result := DeleteFile(PrintTicketShow.GetMainTicket.OpTicketFR3PathFile);
except
Result := False;
end;
end;
end;
procedure TSysFrame.CommWndProc(var msg: tmessage);
begin
//IF MSG.WParam= HotKeyId then
SHOWMESSAGE('AAAAAAA');
if (msg.Msg = WM_KEYDOWN) and (msg.WParam = VK_F1) then
begin
ExecHelpFile;
exit;
end;
if (Msg.LparamLo = 0) and (Msg.LParamHi = VK_F1) then
begin
ExecHelpFile;
// ¼ÙÉèÈȼüΪALT+F1
exit;
end;
end;
procedure TSysFrame.ExecHelpFile;
var H: HWND;
begin
H := FINDWINDOW(nil, 'µ÷¶È²Ù×÷Ö¸ÁîͼÐÎϵͳ°ïÖú');
if H > 0 then
begin
SetWindowPos(h, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);
FlashWindow(h, TRUE);
//FlashWindow(Application.handle, TRUE);
EXIT;
end;
shellExecute(Application.Handle, 'open', pchar(ExtractFilepath(paramstr(0))+'µ÷¶È²Ù×÷Ö¸ÁîͼÐÎϵͳ°ïÖú.chm'), nil, nil, SW_SHOW);
end;