{ ============================================================================== 方法名稱:Node2DocNo 引用相依: 方法描述:從樹狀結構節點 2(文件層)的文字中解析並提取文件編號(DocNo)。 ============================================================================== } Function TCB_IMGPSScanX.Node2DocNo(Node2:TTreeNode):String; //MyTreeNode2取DocNo出來 var v,v1,v2 : Integer; begin v := Posend('{',Node2.Text); v1 := Posend('}',Node2.Text); v2 := Posend('-',Node2.Text); Result := Copy(Node2.Text,v+1,v1-v-1); IF v1 = 0 Then begin Result := ''; end; end; { ============================================================================== 方法名稱:Node3DocNo 引用相依: 方法描述:從樹狀結構節點 3(表單層)的父節點文字中提取文件編號(DocNo)。 ============================================================================== } Function TCB_IMGPSScanX.Node3DocNo(Node3:TTreeNode):String; //MyTreeNode3取DocNo出來 var v,v1,v2 : Integer; begin v := Posend('{',Node3.Parent.Text); v1 := Posend('}',Node3.Parent.Text); v2 := Posend('-',Node3.Parent.Text); Result := Copy(Node3.Parent.Text,v+1,v1-v-1); IF v1 = 0 Then begin Result := ''; end; end; { ============================================================================== 方法名稱:CaseDelete_Enable 引用相依:FileExists, LoadFromFile 方法描述:判斷案件是否允許刪除。若案件下有任何文件目錄已被其他程序引用,則禁止刪 除。 ============================================================================== } Function TCB_IMGPSScanX.CaseDelete_Enable(CaseID:String):Boolean; //案件可否被刪除 var i : Integer; CaseDocNoList : TStringlist; begin Result := True; CaseDocNoList := TStringlist.Create; try if FileExists(ImageSavePath+CaseID+'\CaseDocNo.dat') then CaseDocNoList.LoadFromFile(ImageSavePath+CaseID+'\CaseDocNo.dat'); for i := 0 to CaseDocNoList.Count - 1 do begin if GetUseCase('T',DisplayPath,CaseDocNoList.Strings[i]) <> '' then //有被引用走的 Result := False; end; finally CaseDocNoList.Free; end; end; { ============================================================================== 方法名稱:DocNoExistsinTree 引用相依: 方法描述:檢查指定的案件節點下,是否已經存在具備該文件代號(DocNo)的子節點。 ============================================================================== } Function TCB_IMGPSScanX.DocNoExistsinTree(CaseNode:TTreeNode;DocNo:String):Boolean; //是否己存在樹裡 var i : Integer; begin Result := False; for I := 0 to CaseNode.Count - 1 do begin if DocNo = DocNode2Info(CaseNode.Item[i],'I') Then begin Result := True; Break; end; end; end; { ============================================================================== 方法名稱:DocnoNeedGroup 引用相依: 方法描述:查詢 Doc_Inf_List 判斷傳入的文件代號是否需要進行文件分組(IS_DOC_DIV = "Y")。 ============================================================================== } Function TCB_IMGPSScanX.DocnoNeedGroup(DocNo:String):Boolean; //傳入的DocNo是否需分組 begin Result := False; If FindSQLData(Doc_Inf_List,'IS_DOC_DIV','DOC_NO',DocNo,0,FindResult) Then begin if GetFindResult('IS_DOC_DIV') = 'Y' Then Result := True; end; end;