| | |
| | | function GetSampleInf: Boolean; |
| | | procedure InitExistImgList(casepath:String); |
| | | function LoadFileGetMD5(const filename:string):string; //20170809 取的檔案的MD5 |
| | | function ISExistImg(const filename:string):boolean; //20170809 確認是否存在原有影像 |
| | | function ISExistImg(const filename:string):boolean; //20170809 確認是否存在原有影像 |
| | | procedure _DelTreeForExistImg(ASourceDir:String); //2017 刪除前確認 有舊影像嗎 |
| | | function DocNoIsExistImg(DocNopath: String): boolean; //2017 刪除前確認 有舊影像嗎 |
| | | protected |
| | | { Protected declarations } |
| | | procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override; |
| | |
| | | iISB := TImageScrollBox(FindComponent(iISBName)); |
| | | //ShowMessage('iISB.FileName='+iISB.FileName); |
| | | //ShowMessage(ExtractFilePath(iISB.FileName)+','+ExtractFileName(iISB.FileName)+','+NowCaseNo); |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | begin |
| | | if ISExistImg(iISB.FileName) then |
| | | begin |
| | | ShowMessage(_Msg('此圖為非當次掃瞄,不可刪除')); |
| | | Exit; |
| | | end; |
| | | end; |
| | | |
| | | DeleteImageFile(ExtractFilePath(iISB.FileName),ExtractFileName(iISB.FileName),NowCaseNo); |
| | | end; |
| | | end; |
| | |
| | | begin |
| | | if TreeView1.Selected = NewTreeNode then //全刪 //新掃描件 |
| | | begin |
| | | if (FMode = 'ESCAN') then |
| | | begin |
| | | ShowMessage(_Msg('補件不可刪除全案影像')); |
| | | Exit; |
| | | end; |
| | | |
| | | If Messagedlg(_Msg('是否刪除所有案件?'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | | _DelTree(ImageSavePath); |
| | | if (FMode = 'ESCAN') then |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | begin |
| | | MkDir(ImageSavePath+FCaseID); |
| | | CreateEmptyCase(ImageSavePath,FCaseID); |
| | |
| | | end |
| | | Else if TreeView1.Selected = MyTreeNode1 then //案件編號 |
| | | begin |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | begin |
| | | ShowMessage(_Msg('補件不可刪除全案影像')); |
| | | Exit; |
| | | end; |
| | | If Messagedlg(Format(_Msg('編號(%s)是否刪除?'),[NowCaseno]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | |
| | | If Messagedlg(Format(_Msg('文件(%s)是否刪除?'),[DocNo2DocName(NowCaseno,NowDocNo)]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | ClearView(1); |
| | | Application.ProcessMessages; |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | begin |
| | | if not DocNoIsExistImg(ImageSavePath+NowCaseno+'\'+NowDocDir+'\') then |
| | | begin |
| | | ShowMessage(_Msg('有圖為非當次掃瞄,不可刪除')); |
| | | Exit; |
| | | end; |
| | | end; |
| | | |
| | | _DelTree(ImageSavePath+NowCaseno+'\'+NowDocDir); |
| | | SetUseCase('D',ImageSavePath+NowCaseno+'\',NowDocDir,'',''); |
| | | SetDocNoList('D',-1,NowCaseNo,NowDocDir,''); |
| | |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | NewTreeNodeRefresh; |
| | | |
| | | {if (FMode <>'ESCAN') and (ContextList.Count = NowShowFileList.Count) then |
| | | begin |
| | | if Messagedlg(_Msg('刪除後將無影像,案件將刪除,是否確定?'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | _DelTree(DisplayPath); |
| | | SetCaseList('D',NewTreeNode.IndexOf(MyTreeNode1),''); |
| | | if (FMode = 'ESCAN') then |
| | | begin |
| | | MkDir(ImageSavePath+FCaseID); |
| | | CreateEmptyCase(ImageSavePath,FCaseID); |
| | | end; |
| | | LoadImgFile; |
| | | end |
| | | Else |
| | | begin |
| | | DeleteShowFile(DisplayPath); |
| | | DrawDocItem1(MytreeNode1,Doc_Inf_List,NowCaseno); |
| | | P := ContextList.Count; |
| | | MytreeNode1.Text := Format(_Msg('%s-%d頁'),[NowCaseno,p]); |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | NewTreeNodeRefresh; |
| | | end; |
| | | Showmessage(_Msg('刪除完成')); } |
| | | |
| | | //Showmessage(_Msg('刪除完成')); //20101102 User要求拿掉 |
| | | end |
| | | Else if TreeView1.Selected = MyTreeNode3 then //FormID層 |
| | | begin |
| | | If Messagedlg(Format(_Msg('文件(%s)是否刪除?'),[NowFormName]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | |
| | | |
| | | DeleteFormCodeFile(NowCaseNo,NowDocDir,NowFormCode); |
| | | SetRecordEditedDocDir('A',NowCaseNo,NowDocDir); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | NewTreeNodeRefresh; |
| | | |
| | | {if (FMode <>'ESCAN') and (ContextList.Count = NowShowFileList.Count) then |
| | | begin |
| | | if Messagedlg(_Msg('刪除後將無影像,案件將刪除,是否確定?'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | _DelTree(DisplayPath); |
| | | SetCaseList('D',NewTreeNode.IndexOf(MyTreeNode1),''); |
| | | if (FMode = 'ESCAN') then |
| | | begin |
| | | MkDir(ImageSavePath+FCaseID); |
| | | CreateEmptyCase(ImageSavePath,FCaseID); |
| | | end; |
| | | LoadImgFile; |
| | | end |
| | | Else |
| | | begin |
| | | DeleteShowFile(DisplayPath); |
| | | DrawDocItem1(MytreeNode1,Doc_Inf_List,NowCaseno); |
| | | P := ContextList.Count; |
| | | MytreeNode1.Text := Format(_Msg('%s-%d頁'),[NowCaseno,p]); |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | NewTreeNodeRefresh; |
| | | end; |
| | | Showmessage(_Msg('刪除完成')); |
| | | //Showmessage(_Msg('刪除完成')); //20101102 User要求拿掉 } |
| | | end; |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.DocNoIsExistImg(DocNopath:String):boolean; |
| | | var |
| | | i:integer; |
| | | ST:TStringList; |
| | | begin |
| | | Result:=False; |
| | | ST:=TStringList.Create; |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | //ShowMessage(ST.Text); |
| | | for I := 0 to ST.Count - 1 do |
| | | begin |
| | | if ISExistImg(DocNopath+ST.Strings[i]) then |
| | | begin |
| | | |
| | | Result:=False; |
| | | Exit; |
| | | Break; |
| | | end; |
| | | end; |
| | | Result:=True; |
| | | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX._DelTreeForExistImg(ASourceDir:String); |
| | | var |
| | | i:integer; |
| | | ST:TStringList; |
| | | begin |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.PM102Click(Sender: TObject); |
| | |
| | | 'FImgDelete='+ FImgDelete+#10#13+ |
| | | 'FIsExternal='+ FIsExternal+#10#13+ |
| | | 'FCheck_main_form='+ FCheck_main_form); |
| | | |
| | | //FImgDelete:='Y'; |
| | | { ShowMessage('UpLPoint='+IntToStr(UpLPoint.X)+','+IntToStr(UpLPoint.Y)+#10#13+ |
| | | 'UpRPoint='+IntToStr(UpRPoint.X)+','+IntToStr(UpRPoint.Y)+#10#13+ |
| | | 'DownLPoint='+IntToStr(DownLPoint.X)+','+IntToStr(DownLPoint.Y)+#10#13+ |
| | |
| | | FileList:TStringlist; |
| | | DocDir : String; |
| | | begin |
| | | |
| | | |
| | | DeleteFile(Path+FileName); |
| | | DocDir := Path2DocDir(Path,CaseID); |
| | | SetContextList('D',-1,CaseID,DocDir,FileName); |
| | |
| | | begin |
| | | if FileName2FormCode(FileList.Strings[i]) = FormID then |
| | | begin |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\'+DocDir+'\'+FileList.Strings[i]) then |
| | | begin |
| | | ShowMessage('有圖為非當次掃瞄,不可刪除'); |
| | | Exit; |
| | | end; |
| | | end; |
| | | DeleteImageFile(ImageSavePath+CaseID+'\'+DocDir+'\',FileList.Strings[i],CaseID); |
| | | end; |
| | | end; |
| | |
| | | //有填就ok |
| | | //Showmessage(ColCName +','+ inttostr(OMRMpsV1.GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site))+','+inttostr(Pixel + SafePixel)); |
| | | //SafePixel:=90000; |
| | | //ShowMessage(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | //Showmessage('oh'); |
| | |
| | | else |
| | | SiteRec := SiteRec+'@'+Site; |
| | | Pixel := XT.Node['/form/settype3/'+ColEName+'/'].Attributes['pixel']; |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | ////有填寫//// |
| | |
| | | RelaSiteRec := RelaSiteRec+'@'+RelaSite; |
| | | if FileExists(ImageSavePath+CaseID+'\upload\'+RelaFile) then |
| | | begin |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+RelaFile,RelaSite,Bt) > (RelaPixel + SafePixel) then |
| | | begin |
| | | OMROK := True; |
| | |
| | | else |
| | | SiteRec := SiteRec+'@'+Site; |
| | | Pixel := XT.Node['/form/settype8/'+ColEName+'/'].Attributes['pixel']; |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | |
| | | RelaSiteRec := RelaSiteRec+'@'+RelaSite; |
| | | if FileExists(ImageSavePath+CaseID+'\upload\'+RelaFile) then |
| | | begin |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+RelaFile,RelaSite,Bt) > (RelaPixel + SafePixel) then |
| | | begin |
| | | inc(OMROkCount); |
| | |
| | | else |
| | | SiteRec := SiteRec+'@'+Site; |
| | | Pixel := XT.Node['/form/settype4/'+ColEName+'/'].Attributes['pixel']; |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | ////有填寫//// |
| | |
| | | else |
| | | SiteRec := SiteRec+'@'+Site; |
| | | Pixel := XT.Node['/form/settype5/'+ColEName+'/'].Attributes['pixel']; |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | ////有填寫//// |
| | |
| | | SiteRec := Site |
| | | else |
| | | SiteRec := SiteRec+'@'+Site; |
| | | |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | ////有填寫//// |
| | |
| | | OMRValue := XT.Node['/form/settype7/'+ColEName+'/'+nodename+'/'].Attributes['getvalue']; |
| | | |
| | | //有填就ok |
| | | Display1.Lines.Add(ColEName+' '+ColCName+' 圖像實際點數='+IntToStr(GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt))+' 設定點數='+IntToStr( (Pixel + SafePixel))); |
| | | |
| | | if GetSiteOMR(ImageSavePath+CaseID+'\upload\'+OMRFile,Site,Bt) > (Pixel + SafePixel) then |
| | | begin |
| | | ValueXT['/content/'+ColEName+'/@savevalue'] := OMRValue; //有填就換成設定的值 |