unit OldCaseInfo;
|
|
interface
|
|
uses
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Dialogs, ExtCtrls, StdCtrls, CheckLst, Buttons, ComCtrls,IISUnit,IIS_File2Web,IIS_ImageProcess,
|
HTTPApp, SBWinCertStorage, SBX509, SBCustomCertStorage, SBSimpleSSL,
|
SBHTTPSClient, EnImgScr,inifiles, SBSocket;
|
|
Const
|
ISBName = 'PreViewISB';
|
|
type
|
TOldCaseInfoForm = class(TForm)
|
Notebook1: TNotebook;
|
Panel2: TPanel;
|
OldCaseLV: TListView;
|
Panel1: TPanel;
|
Panel3: TPanel;
|
ImportBt: TBitBtn;
|
ExitBt: TBitBtn;
|
Panel4: TPanel;
|
CaseListGB: TGroupBox;
|
CheckListBox1: TCheckListBox;
|
Panel5: TPanel;
|
Panel6: TPanel;
|
Panel7: TPanel;
|
Splitter1: TSplitter;
|
LoadBt: TBitBtn;
|
OldExitBt: TBitBtn;
|
ElMemoryCertStorage: TElMemoryCertStorage;
|
ElWinCertStorage: TElWinCertStorage;
|
Memo1: TMemo;
|
Panel22: TPanel;
|
Timer1: TTimer;
|
ISB1: TImageScrollBox;
|
ScrollBox1: TScrollBox;
|
Edit1: TEdit;
|
HTTPSClient: TElHTTPSClient;
|
procedure OldExitBtClick(Sender: TObject);
|
procedure ImportBtClick(Sender: TObject);
|
procedure LoadBtClick(Sender: TObject);
|
procedure ExitBtClick(Sender: TObject);
|
procedure Panel1DblClick(Sender: TObject);
|
procedure HTTPSClientCertificateValidate(Sender: TObject;
|
X509Certificate: TElX509Certificate; var Validate: Boolean);
|
procedure Timer1Timer(Sender: TObject);
|
procedure CheckListBox1Click(Sender: TObject);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormCreate(Sender: TObject);
|
procedure HTTPSClientRedirection(Sender: TObject; const OldURL: string;
|
var NewURL: string; var AllowRedirection: Boolean);
|
private
|
{ Private declarations }
|
OldCaseID:String;
|
HttpErrStr : String;
|
DownImgStatus : String;
|
SelectISB : TImageScrollBox;
|
|
|
Function Down_Img(Path,CaseID:String):Boolean;
|
Procedure DataLoading(Loading:Boolean;Msg:String); //¸ê®Æ¸ü¤J¤¤n°±¤îÂI¿ïªº°Ê§@
|
Procedure LoadImg(Path:String);
|
Function DocNoDir2DocNo(DocNoDir:String):String;
|
Function DocNo2DocName(DocNo:String):String;
|
Function Docdir2Pages(DocDir:String):Integer;
|
Function DocNoIs_In_WH(DocNo:String):Boolean; //DocNo¬O§_¬°¤J®w¤å¥ó
|
Function DocNoAppear(DocNo:String):Boolean; //DocNo¬O§_¥i¥X²{
|
Procedure ShowImage(DocDir:String);
|
Function GetUseCase(Mode:Char;Path,DocDir:String):String; //F:¨ú³Q¤Þ¥Î To:¤Þ¥Î
|
|
Procedure ErrFormtoCurrentForm(UseCaseID,EFormID,CFormID:String);//±N®תº¿ù»~FormID§ï¥¿½TªºFormID
|
Function FormCode2DocNo(FormCode:String):String; //FormCodeÂàDocno
|
Function FileName2FormCode(FileName:String):String; //±qÀɦW¨ú¥XFormCode
|
|
Procedure CreatePreViewISB(Count:Integer);
|
Procedure FreePreViewISB;
|
Procedure FitPreViewISB;
|
Procedure ISBClick(Sender : TObject);
|
Procedure ISBMouseMove(Sender: TObject; Shift: TShiftState;
|
X, Y: Integer);
|
Procedure PaintShape(FromImg,ToImg:TImageScrollBox); //µe¦³³Q¿ï¨úªº¼v¹³
|
Procedure FreeShapeobj(SelectISB : TImageScrollBox);
|
procedure WMMOUSEWHEEL(var message: TWMMouseWheel); message WM_MOUSEWHEEL;
|
public
|
{ Public declarations }
|
ImageSavePath,CaseID,Fdata,FVerify,Furl,FReWrite,FOldCaseInfo:String;
|
OldDocDirList,OldCopiesList,OldDocNameList,IN_WH_DocNoList : TStringlist;
|
UseCaseID : String;
|
FIs_In_Wh : String;
|
end;
|
|
var
|
OldCaseInfoForm: TOldCaseInfoForm;
|
|
implementation
|
|
{$R *.dfm}
|
|
Function TOldCaseInfoForm.Down_Img(Path,CaseID:String):Boolean;
|
var
|
EnCodeDateTime : String;
|
SendData : String;
|
AttPath : String;
|
begin
|
Result := True;
|
//EnCodeDateTime := En_DecryptionStr_Base64('E',ServerDate+GetBalance2Time(Balance),Mpskey);
|
///service/slic/SLIC04/case?data=&verify=&case_no=&file=
|
|
SendData := 'data='+HTTPEncode(UTF8Encode(FData))+'&verify='+FVerify+'&case_no='+CaseID+'&file=';
|
|
if not dnFile_Get(HTTPSClient,Furl,'service/slic/SLIC04/case',SendData,Path+CaseID+'.zip',FReWrite,Memo1,False,DownImgStatus) then
|
begin
|
HttpErrStr := _Msg('¿ù»~¥N½X:')+Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason;
|
Result := False;
|
Exit;
|
end;
|
if Memo1.Lines.Strings[0] = '1' then
|
begin
|
HttpErrStr :=_Msg('¿ù»~ì¦]:')+memo1.Lines.Strings[1];
|
Result := False;
|
Exit;
|
end
|
Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then
|
begin
|
HttpErrStr := _Msg('¿ù»~ì¦]:')+_Msg('¶¢¸m¹L¤[©Î³Qµn¥X,½Ð«·sµn¤J');
|
Result := False;
|
Exit;
|
end;
|
if FileExists(Path+CaseID+'.zip') then
|
begin
|
ExecuteUnZip(Path+CaseID+'.zip',Path,True);
|
if FileExists(Path+'img.zip') then
|
begin
|
ExecuteUnZip(Path+'img.zip',Path,False);
|
end;
|
end
|
Else
|
begin
|
HttpErrStr := _Msg('§ä¤£¨ì¼v¹³');
|
Result := True;
|
Exit;
|
end;
|
|
end;
|
|
Procedure TOldCaseInfoForm.DataLoading(Loading:Boolean;Msg:String); //¸ê®Æ¸ü¤J¤¤n°±¤îÂI¿ïªº°Ê§@
|
begin
|
If Loading Then
|
begin
|
Screen.Cursor := -11;
|
Panel22.Caption := Msg;
|
Panel22.Left := (Panel2.Width div 2) - (Panel22.Width div 2);
|
Panel22.Top := (Panel2.Height div 2) - (Panel22.Height div 2);
|
Panel22.Visible := True;
|
Timer1.Enabled := True;
|
Application.ProcessMessages;
|
Panel1.Enabled := False;
|
Panel2.Enabled := False;
|
end
|
Else
|
begin
|
//Timer3.Enabled := True;
|
Panel22.Visible := False;
|
Timer1.Enabled := False;
|
Panel1.Enabled := True;
|
Panel2.Enabled := True;
|
Screen.Cursor := 0;
|
end;
|
|
end;
|
|
Procedure TOldCaseInfoForm.LoadImg(Path:String);
|
var
|
i : Integer;
|
DocDirList : TStringlist;
|
iDocNo,iDocName,iDocDir :String;
|
iDocPage : Integer;
|
begin
|
CaseListGB.Caption :=Format(_Msg('½s¸¹%s¥i¤Þ¥Î¤å¥ó'),[UseCaseID]);
|
CheckListBox1.Items.Clear;
|
DocDirList := TStringlist.Create;
|
try
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\CaseDocNo.dat') then
|
DocDirList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\CaseDocNo.dat');
|
for i := 0 to DocDirList.Count - 1 do
|
begin
|
iDocDir := DocDirList.Strings[i];
|
iDocNo := DocNoDir2DocNo(iDocDir);
|
iDocName := DocNo2DocName(iDocNo);
|
iDocPage := Docdir2Pages(iDocDir);
|
if iDocPage > 0 then
|
begin
|
if not DocNoAppear(iDocNo) then Continue;
|
if GetUseCase('T',ImageSavePath+CaseID+'\'+UseCaseID+'\',iDocDir) = '' then
|
CheckListBox1.Items.Add(Format('%s{%s}-%d',[iDocDir,iDocName,iDocPage]));
|
end;
|
end;
|
|
finally
|
DocDirList.Free;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.DocNoDir2DocNo(DocNoDir:String):String;
|
var
|
v,ln : Integer;
|
begin
|
if DocNoDir <> 'Attach' then
|
begin
|
v := Pos('(',DocNoDir);
|
if v > 0 then
|
Result := Copy(DocNoDir,1,v-1)
|
else
|
Result := DocNoDir;
|
end
|
Else
|
Result := DocNoDir
|
end;
|
|
Function TOldCaseInfoForm.DocNo2DocName(DocNo:String):String;
|
var
|
i : Integer;
|
v,ln : Integer;
|
iDocNo,iDocName:String;
|
iDoc_DocName : String;
|
DocNo_DocNameList:TStringlist;
|
begin
|
Result := '';
|
DocNo_DocNameList := TStringlist.Create;
|
try
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\DocNo_Name.dat') then
|
DocNo_DocNameList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\DocNo_Name.dat',TEnCoding.UTF8);
|
for i := 0 to DocNo_DocNameList.Count - 1 do
|
begin
|
iDoc_DocName := StringReplace(DocNo_DocNameList.Strings[i],'*','',[rfReplaceAll]);
|
v := Pos('_',iDoc_DocName);
|
ln := length(iDoc_DocName);
|
iDocNo := Copy(iDoc_DocName,1,v-1);
|
iDocName := Copy(iDoc_DocName,v+1,ln-v);
|
if DocNo = iDocNo then
|
Result := iDocName;
|
end;
|
|
finally
|
DocNo_DocNameList.Free;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.Docdir2Pages(DocDir:String):Integer;
|
var
|
i,Count : Integer;
|
FileList : TStringlist;
|
DocDirList : TStringlist;
|
begin
|
Count := 0;
|
FileList := TStringlist.Create;
|
DocDirList := TStringlist.Create;
|
try
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\Context.dat') then
|
FileList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\Context.dat');
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\DocDir.dat') then
|
DocDirList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\DocDir.dat');
|
for i := 0 to DocDirList.Count - 1 do
|
begin
|
if DocDir = DocDirList.Strings[i] then
|
inc(Count);
|
end;
|
Result := Count;
|
|
finally
|
FileList.Free;
|
DocDirList.Free;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.DocNoIs_In_WH(DocNo:String):Boolean; //DocNo¬O§_¬°¤J®w¤å¥ó
|
var
|
i : Integer;
|
begin
|
Result := False;
|
if (Copy(DocNo,1,5)='ZZZZZ') then //20140728 yuu »¡¦Ûq¤å¥ó¤]¬O¤J®w¤å¥ó
|
begin
|
Result := True;
|
Exit;
|
end;
|
for i := 0 to IN_WH_DocNoList.Count -1 do
|
begin
|
if DocNo = IN_WH_DocNoList.Strings[i] then
|
begin
|
Result := True;
|
Break;
|
end;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.DocNoAppear(DocNo:String):Boolean; //DocNo¬O§_¥i¥X²{
|
begin
|
Result := True;
|
if (((FIs_In_Wh = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or //¤J®w±½´y¤£¬Ý«D¤J®w¤å¥ó
|
((FIs_In_Wh = 'N') and (DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') )) {and //«D¤J®w±½´y¤£¬Ý¤J®w¤å¥ó
|
(Copy(DocNo,1,5)<>'ZZZZZ')} then
|
Result := False;
|
end;
|
|
Procedure TOldCaseInfoForm.ShowImage(DocDir:String);
|
var
|
i,ct : Integer;
|
FileList : TStringlist;
|
DocDirList : TStringlist;
|
ISB : TImageScrollBox;
|
begin
|
FileList := TStringlist.Create;
|
DocDirList := TStringlist.Create;
|
try
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\Context.dat') then
|
FileList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\Context.dat');
|
if FileExists(ImageSavePath+CaseID+'\'+UseCaseID+'\DocDir.dat') then
|
DocDirList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\DocDir.dat');
|
Ct := 0;
|
for i := 0 to DocDirList.Count - 1 do
|
begin
|
if DocDirList.Strings[i] = DocDir then
|
begin
|
inc(Ct);
|
ISB := TImageScrollBox(FindComponent(ISBName+intToStr(Ct)));
|
ISB.AntiAliased := True;
|
if ISB.ZoomPercent > 100 then
|
ISB.AntiAliased := False;
|
|
ISB.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\'+FileList.Strings[i],1);
|
DpiResize(ISB.Graphic,36,False);
|
end;
|
end;
|
|
|
finally
|
FileList.Free;
|
DocDirList.Free;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.GetUseCase(Mode:Char;Path,DocDir:String):String; //F:¨ú³Q¤Þ¥Î To:¤Þ¥Î
|
var
|
ini : Tinifile;
|
begin
|
ini := Tinifile.Create(Path+'UseCase.ini');
|
try
|
case Mode of
|
'F':begin
|
Result := ini.ReadString(DocDir,'FORM_CASEID','');
|
end;
|
'T':begin
|
Result := ini.ReadString(DocDir,'TO_CASEID','');
|
end;
|
end;
|
finally
|
ini.Free;
|
end;
|
|
end;
|
|
|
Procedure TOldCaseInfoForm.ErrFormtoCurrentForm(UseCaseID,EFormID,CFormID:String);//±N®תº¿ù»~FormID§ï¥¿½TªºFormID
|
var
|
DocNoList,FileList,DocDirList,FormCode_NameList,DocNo_NameList :TStringlist;
|
EDocNo,CDocNo,iDocNo,iFormID :String;
|
EDocDir,CDocDir:String;
|
OldFile,NewFile :String;
|
iPath,iiPath : String;
|
i,n : Integer;
|
begin
|
EDocNo := FormCode2DocNo(EFormID);
|
CDocNo := FormCode2DocNo(CFormID);
|
DocNoList :=TStringlist.Create;
|
FileList := TStringlist.Create;
|
DocDirList := TStringlist.Create;
|
FormCode_NameList := TStringlist.Create;
|
DocNo_NameList := TStringlist.Create;
|
try
|
DocNoList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\CaseDocNo.dat',Tencoding.UTF8);
|
DocNo_NameList.LoadFromFile(ImageSavePath+CaseID+'\'+UseCaseID+'\DocNo_Name.dat',Tencoding.UTF8);
|
for i := 0 to DocNoList.Count - 1 do
|
begin
|
EDocDir := DocNoList.Strings[i];
|
iDocNo := DocNoDir2DocNo(DocNoList.Strings[i]);
|
iPath := ImageSavePath+CaseID+'\'+UseCaseID+'\';
|
FileList.LoadFromFile(iPath+'Context.dat',Tencoding.UTF8);
|
DocDirList.LoadFromFile(iPath+'DocDir.dat',Tencoding.UTF8);
|
FormCode_NameList.LoadFromFile(iPath+'FormCode_Name.dat',Tencoding.UTF8);
|
for n := 0 to FileList.Count - 1 do
|
begin
|
iFormID := FileName2FormCode(FileList.Strings[n]);
|
if iFormID = EFormID then
|
begin
|
OldFile := FileList.Strings[n];
|
NewFile := StringReplace(FileList.Strings[n],iFormID,CFormID,[rfReplaceAll]);
|
FileList.Strings[n] := NewFile;
|
RenameFile(iPath+OldFile,iPath+NewFile);
|
FileList.SaveToFile(iPath+'Context.dat',Tencoding.UTF8);
|
DocDirList.Strings[n] := CDocNo;
|
DocDirList.SaveToFile(iPath+'DocDir.dat',Tencoding.UTF8);
|
FormCode_NameList.Strings[n] := CFormID+'_'+_Msg('±ÂÅvÂà±b¬ù©w®Ñ');
|
FormCode_NameList.SaveToFile(iPath+'FormCode_Name.dat',Tencoding.UTF8);
|
end;
|
end;
|
if iDocNo = EDocNo then
|
begin
|
CDocDir := StringReplace(EDocDir,EDocNo,CDocNo,[rfReplaceAll]);
|
//iiPath := ImageSavePath+CaseID+'\'+UseCaseID+'\'+CDocDir+'\';
|
//MoveFile(PWideChar(iPath),PWideChar(iiPath));
|
DocNoList.Strings[i] := StringReplace(DocNoList.Strings[i],iDocNo,CDocNo,[rfReplaceAll]);
|
DocNoList.SaveToFile(ImageSavePath+CaseID+'\'+UseCaseID+'\CaseDocNo.dat',Tencoding.UTF8);
|
DocNo_NameList.Strings[i]:= CDocDir+'_'+_Msg('±ÂÅvÂà±b¬ù©w®Ñ');
|
DocNo_NameList.SaveToFile(ImageSavePath+CaseID+'\'+UseCaseID+'\DocNo_Name.dat',Tencoding.UTF8);
|
//SetRecordEditedDocDir('A',CaseID,CDocNo);
|
end;
|
end;
|
finally
|
DocNoList.Free;
|
FileList.Free;
|
DocDirList.Free;
|
FormCode_NameList.Free;
|
DocNo_NameList.Free;
|
end;
|
end;
|
|
Function TOldCaseInfoForm.FormCode2DocNo(FormCode:String):String; //FormCodeÂàDocno
|
begin
|
Result := Copy(FormCode,1,8);
|
end;
|
|
Function TOldCaseInfoForm.FileName2FormCode(FileName:String):String; //±qÀɦW¨ú¥XFormCode
|
var
|
v,v1 : Integer;
|
begin
|
FileName := ExtractFileName(FileName);
|
v := Pos('_',FileName);
|
v1 := Pos('.',FileName);
|
if v > 0 then
|
begin
|
Result := Copy(FileName,v+1,v1-v-1);
|
end
|
Else //ªþ¥ó
|
begin
|
Result := '';
|
end;
|
end;
|
|
|
procedure TOldCaseInfoForm.CheckListBox1Click(Sender: TObject);
|
var
|
v,i : Integer;
|
DocDir,iDocDir : String;
|
begin
|
DocDir := CheckListBox1.Items.Strings[CheckListBox1.ItemIndex];
|
v := Pos('{',DocDir);
|
DocDir := Copy(DocDir,1,v-1);
|
for i := 0 to CheckListBox1.Items.Count - 1 do
|
begin
|
iDocDir := CheckListBox1.Items.Strings[i];
|
v := Pos('{',iDocDir);
|
iDocDir := Copy(iDocDir,1,v-1);
|
if (DocNoDir2DocNo(iDocDir) = DocNoDir2DocNo(DocDir)) and (i <> CheckListBox1.ItemIndex) then
|
CheckListBox1.Checked[i] := CheckListBox1.Checked[CheckListBox1.ItemIndex];
|
end;
|
|
|
|
CreatePreViewISB(Docdir2Pages(DocDir));
|
ShowImage(DocDir);
|
FitPreViewISB;
|
end;
|
|
Procedure TOldCaseInfoForm.CreatePreViewISB(Count:Integer);
|
var
|
ISB : TImageScrollBox;
|
Panel : TPanel;
|
i,W,H : Integer;
|
begin
|
FreePreViewISB;
|
ScrollBox1.HorzScrollBar.Visible := False;
|
W := 150;
|
H := 250;
|
for I := 1 to Count do
|
begin
|
Panel := TPanel.Create(Self);
|
Panel.Name := 'M_Pl'+inttostr(i);
|
Panel.Left := 4;
|
Panel.Top := (i-1)*H+(6*i);
|
Panel.Height := H;
|
Panel.Width := W;
|
Panel.Parent := ScrollBox1;
|
Panel.Caption :='';
|
ISB := TImageScrollBox.Create(Self);
|
ISB.Name := ISBName+inttostr(i);
|
ISB.Parent := Panel;
|
ISB.Align := alClient;
|
ISB.ZoomMode := zmFullPage;
|
ISB.DragMode := dmAutomatic;
|
ISB.MouseMode := mmuser;
|
ISB.OnImageClick := ISBClick;
|
ISB.OnImageMouseMove := ISBMouseMove;
|
end;
|
|
end;
|
|
Procedure TOldCaseInfoForm.FreePreViewISB;
|
var
|
i : Integer;
|
begin
|
For i:= ComponentCount -1 downto 0 do
|
begin
|
IF Components[i] is TImageScrollBox Then
|
begin
|
IF Pos(ISBName,Components[i].Name) > 0 Then
|
Components[i].Free;
|
end
|
Else If Components[i] is TPanel Then
|
begin
|
IF Pos('M_Pl',Components[i].Name) > 0 Then
|
Components[i].Free;
|
end
|
Else If Components[i] is TShape Then
|
begin
|
IF Pos('SP',Components[i].Name) > 0 Then
|
Components[i].Free;
|
end;
|
end;
|
Application.ProcessMessages;
|
//showmessage(inttostr(Count));
|
end;
|
|
Procedure TOldCaseInfoForm.FitPreViewISB;
|
var
|
i : Integer;
|
iISB : TImageScrollBox;
|
iPanel : TPanel;
|
T,H : Integer;
|
begin
|
T := 0;
|
i := 1;
|
|
while FindComponent(ISBName+inttostr(i)) <> nil do
|
begin
|
iISB := TImageScrollBox(FindComponent(ISBName+inttostr(i)));
|
iISB.Parent.Height := 250;
|
iISB.Parent.Top := T+4;
|
iISB.Parent.Height := iISB.DisplayedGraphic.Height;
|
H := iISB.Parent.Height;
|
T := iISB.Parent.Top+H;
|
inc(i);
|
end;
|
|
|
{For i:= 1 to Count do
|
begin
|
if TImageScrollBox(FindComponent(ISBName+inttostr(i))) = nil then Break;
|
|
|
iISB := TImageScrollBox(FindComponent(ISBName+inttostr(i)));
|
iISB.Parent.Height := H;
|
iISB.Parent.Top := T+4;
|
iISB.Parent.Height := iISB.DisplayedGraphic.Height;
|
H := iISB.Parent.Height;
|
T := iISB.Parent.Top+H;
|
end;}
|
|
end;
|
|
procedure TOldCaseInfoForm.FormClose(Sender: TObject; var Action: TCloseAction);
|
begin
|
FreePreViewISB;
|
FreeShapeobj(nil);
|
//OldDocDirList.Free;
|
end;
|
|
procedure TOldCaseInfoForm.FormCreate(Sender: TObject);
|
begin
|
//OldDocDirList := TStringlist.Create;
|
end;
|
|
Procedure TOldCaseInfoForm.ISBClick(Sender : TObject);
|
var
|
v,ln:Integer;
|
begin
|
FreeShapeobj(nil);
|
SelectISB := TImageScrollBox(Sender);
|
PaintShape(SelectISB,nil);
|
|
v := length(ISBName);
|
ln := length(SelectISB.Name);
|
ISB1.ZoomMode := zmFittoPage;
|
ISB1.LoadFromFile(SelectISB.FileName,1);
|
end;
|
|
Procedure TOldCaseInfoForm.ISBMouseMove(Sender: TObject; Shift: TShiftState;
|
X, Y: Integer);
|
begin
|
Edit1.SetFocus;
|
end;
|
|
Procedure TOldCaseInfoForm.PaintShape(FromImg,ToImg:TImageScrollBox); //µe¦³³Q¿ï¨úªº¼v¹³
|
var
|
i,F_No,T_No : Integer;
|
SP : TShape;
|
ISB : TImageScrollBox;
|
Function GetImgNo(iISB:TImageScrollBox):Integer;
|
begin
|
Result := strtoint(Copy(iISB.Name,length(ISBName)+1,length(iISB.Name)-length(ISBName))); //'PreViewISB'
|
end;
|
begin
|
IF ToImg = nil Then //¥uµe³æ¤@Ó
|
begin
|
ISB := TImageScrollBox(FindComponent(ISBName+inttostr(GetImgNo(FromImg))));
|
if TShape(FindComponent('SP'+inttostr(GetImgNo(FromImg)))) = nil then
|
begin
|
|
SP := TShape.Create(self);
|
SP.Pen.Color := clblue;
|
SP.Pen.Width := 3;
|
SP.Parent := ScrollBox1;
|
SP.Name := 'SP'+inttostr(GetImgNo(FromImg));
|
SP.Left := ISB.Parent.Left-4;
|
SP.Top := ISB.Parent.Top -4;
|
SP.Width := ISB.Parent.Width + 8;
|
SP.Height := ISB.Parent.Height + 8;
|
end;
|
end
|
Else
|
begin
|
FreeShapeobj(nil);
|
IF GetImgNo(FromImg) <= GetImgNo(ToImg) Then
|
begin
|
F_No := GetImgNo(FromImg);
|
T_No := GetImgNo(ToImg);
|
end
|
Else
|
begin
|
F_No := GetImgNo(ToImg);
|
T_No := GetImgNo(FromImg);
|
end;
|
For i := F_No to T_No do
|
begin
|
ISB := TImageScrollBox(FindComponent(ISBName+inttostr(i)));
|
SP := TShape.Create(self);
|
SP.Pen.Color := clblue;
|
SP.Pen.Width := 3;
|
SP.Parent := ScrollBox1;
|
SP.Name := 'SP'+inttostr(i);
|
SP.Left := ISB.Parent.Left-4;
|
SP.Top := ISB.Parent.Top -4;
|
SP.Width := ISB.Parent.Width + 8;
|
SP.Height := ISB.Parent.Height + 8;
|
end;
|
end;
|
end;
|
|
Procedure TOldCaseInfoForm.FreeShapeobj(SelectISB : TImageScrollBox);
|
var
|
i : Integer;
|
begin
|
IF SelectISB = nil then //¥þFree;
|
begin
|
For i:= ComponentCount -1 downto 0 do
|
begin
|
IF Components[i] is TShape Then
|
begin
|
IF Pos('SP',Components[i].Name) > 0 Then
|
Components[i].Free;
|
end;
|
end;
|
end
|
Else //¥uFree«ü©wªº
|
begin
|
TShape(FindComponent('SP'+Copy(SelectISB.Name,length(ISBName)+1,length(SelectISB.Name)-length(ISBName)))).Free;
|
end;
|
end;
|
|
procedure TOldCaseInfoForm.WMMOUSEWHEEL(var message: TWMMouseWheel);
|
begin
|
inherited;
|
|
if (message.WheelDelta = WHEEL_DELTA) Then begin
|
if Edit1.Focused then
|
begin
|
ScrollBox1.VertScrollBar.Increment := 50;
|
ScrollBox1.Perform(WM_VSCROLL, SB_LINEUP, 0);
|
end;
|
{else if DisplayISB.Focused then
|
begin
|
DisplayISB.VertScrollBar.Increment := 50;
|
DisplayISB.Perform(WM_VSCROLL, SB_LINEUP, 0);
|
end;}
|
end else if (message.WheelDelta = -WHEEL_DELTA) then begin
|
if Edit1.Focused then
|
begin
|
ScrollBox1.VertScrollBar.Increment := 50;
|
ScrollBox1.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
|
end
|
{else if DisplayISB.Focused then
|
begin
|
DisplayISB.VertScrollBar.Increment := 50;
|
DisplayISB.Perform(WM_VSCROLL, SB_LINEDOWN, 0);
|
end;}
|
end;
|
end;
|
|
procedure TOldCaseInfoForm.HTTPSClientCertificateValidate(Sender: TObject;
|
X509Certificate: TElX509Certificate; var Validate: Boolean);
|
begin
|
Validate := True;
|
end;
|
|
procedure TOldCaseInfoForm.HTTPSClientRedirection(Sender: TObject;
|
const OldURL: string; var NewURL: string; var AllowRedirection: Boolean);
|
begin
|
AllowRedirection := True;
|
end;
|
|
procedure TOldCaseInfoForm.Panel1DblClick(Sender: TObject);
|
begin
|
Memo1.Visible := not Memo1.Visible;
|
end;
|
|
procedure TOldCaseInfoForm.Timer1Timer(Sender: TObject);
|
begin
|
if Copy(Panel22.Caption,length(Panel22.Caption)-6+1,6) = '......' then
|
Panel22.Caption := Copy(Panel22.Caption,1,length(Panel22.Caption)-6);
|
Panel22.Caption := Panel22.Caption+'.';
|
|
end;
|
|
procedure TOldCaseInfoForm.ImportBtClick(Sender: TObject);
|
var
|
i,v,v1 : Integer;
|
DocDir,DocName : String;
|
HaveCase : Boolean;
|
begin
|
OldDocDirList.Clear;
|
OldDocNameList.Clear;
|
HaveCase := False;
|
for i := 0 to CheckListBox1.Count - 1 do
|
begin
|
if CheckListBox1.Checked[i] then
|
begin
|
DocDir := CheckListBox1.Items.Strings[i];
|
v := pos('{',DocDir);
|
v1 := PosEnd('}',DocDir);
|
DocName := Copy(DocDir,v+1,v1-v-1);
|
DocDir := Copy(DocDir,1,v-1);
|
OldDocNameList.Add(DocName);
|
OldDocDirList.Add(DocDir);
|
HaveCase := True;
|
end;
|
end;
|
if not HaveCase then
|
begin
|
Showmessage(_Msg('©|¥¼¿ï¾Ün¤Þ¤Jªº¤å¥ó'));
|
Exit;
|
end;
|
//Showmessage(OldDocDirList.Text);
|
ModalResult := MrOk;
|
end;
|
|
procedure TOldCaseInfoForm.ExitBtClick(Sender: TObject);
|
begin
|
Notebook1.ActivePage := 'CaseInfo';
|
end;
|
|
procedure TOldCaseInfoForm.LoadBtClick(Sender: TObject);
|
var
|
i : Integer;
|
OldCaseInfoList,Caseinfolist : TStringlist;
|
iCaseID,UseBS_No,UseIS_Old : String;
|
begin
|
if OldCaseLV.ItemIndex = -1 then
|
begin
|
Showmessage(_msg('©|¥¼¿ï¾Üñ³ø®Ñ½s¸¹'));
|
Exit;
|
end;
|
CaseListGB.Caption :=Format(_Msg('½s¸¹%s¥i¤Þ¥Î¤å¥ó'),[UseCaseID]);
|
CheckListBox1.Items.Clear;
|
Notebook1.ActivePage := 'View';
|
UseCaseID := OldCaseLV.Selected.Caption;
|
UseBS_No := OldCaseLV.Selected.SubItems.Strings[1];
|
UseIS_Old := UpperCase(OldCaseLV.Selected.SubItems.Strings[2]);
|
OldCaseInfoList := TStringlist.Create;
|
Caseinfolist := TStringlist.Create;
|
try
|
OldCaseInfoList.StrictDelimiter := True;
|
OldCaseInfoList.Delimiter := #9;
|
OldCaseInfoList.DelimitedText := FOldCaseInfo;
|
for i := 0 to OldCaseInfoList.Count - 1 do
|
begin
|
Caseinfolist:=SplitString('@#,',OldCaseInfoList.Strings[i]);
|
//Caseinfolist.Delimiter := '_';
|
//Caseinfolist.DelimitedText := OldCaseInfoList.Strings[i];
|
iCaseID := Caseinfolist.Strings[0];
|
if iCaseID = UseCaseID then
|
begin
|
Fdata := Caseinfolist.Strings[4];
|
FVerify := Caseinfolist.Strings[5];
|
end;
|
end;
|
finally
|
OldCaseInfoList.Free;
|
Caseinfolist.Free;
|
end;
|
|
if not FileExists(imageSavePath+CaseID+'\'+UseCaseID+'\Context.dat') then
|
begin
|
if DirectoryExists(ImageSavePath+CaseID+'\'+UseCaseID) then
|
_Deltree(ImageSavePath+CaseID+'\'+UseCaseID);
|
MkDir(ImageSavePath+CaseID+'\'+UseCaseID);
|
DataLoading(True,_msg('¼v¹³¤U¸ü¤¤'));
|
If not Down_Img(ImageSavePath+CaseID+'\'+UseCaseID+'\',UseCaseID) then
|
begin
|
Showmessage(UseCaseID+_msg('¸ü¤J²§°Ê¼v¹³®É,ºô¸ôµo¥Í¿ù»~')+HttpErrStr);
|
Exit;
|
end;
|
end;
|
if (UseIS_Old = 'Y') and (UseBS_No='HLN') then
|
begin
|
|
ErrFormtoCurrentForm(UseCaseID,'10000001011112A','11000001011112A'); //´«±¼¿ùªºFormID
|
// OldCasetoNewCase(FCaseID);
|
|
end;
|
|
|
LoadImg(ImageSavePath+CaseID+'\'+UseCaseID+'\');
|
|
//Download2Case(ImageSavePath+FCaseID+'\Download\',ImageSavePath+FCaseID+'\');
|
DataLoading(False,'');
|
|
end;
|
|
procedure TOldCaseInfoForm.OldExitBtClick(Sender: TObject);
|
begin
|
ModalResult := MrCancel;
|
end;
|
|
end.
|