curtis
9小時前 0756bf12d10cf1b7f78c571de0a9ad69cbaeb7ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{ ==============================================================================
  方法名稱: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;