Copy Code
|
|
---|---|
Private Function AddBugToBugLink(fromBug As Bug, ToBug As Bug, _ Optional LinkComment$ = "") As Link ' Link two defects On Error GoTo FUNC_ERR Dim linkF As LinkFactory Dim thelink As Link Dim linkableBug As ILinkable Set linkableBug = fromBug Set linkF = linkableBug.BugLinkFactory Set thelink = linkF.AddItem(ToBug) thelink.comment = LinkComment thelink.Post Set AddBugToBugLink = thelink Exit Function FUNC_ERR: Set AddBugToBugLink = Nothing End Function '######################################################### Private Function ModifyBugToBugLink(fromBug As Bug, _ ToBug As Bug, _ LinkComment As String) As Boolean ' Change link properties On Error GoTo FUNC_ERR Dim linkF As LinkFactory ' Dim theLink As Link Dim linkableBug As ILinkable Dim BugF As BugFactory Dim Bug As Bug Dim aFilter As TDFilter Dim oList As List Dim Bug1 As Bug Dim thelink As Link Set linkableBug = fromBug Set linkF = linkableBug.BugLinkFactory Set aFilter = linkF.Filter aFilter.Filter("LN_ENTITY_ID") = ToBug.ID aFilter.Filter("LN_ENTITY_TYPE") = "BUG" Set oList = linkF.NewList(aFilter.Text) Set thelink = oList.Item(1) thelink.comment = LinkComment thelink.Post ModifyBugToBugLink = SUCCESS Exit Function FUNC_ERR: ModifyBugToBugLink = FAILURE End Function '######################################################### Private Function RemoveBugToBugLink(fromBug As Bug, _ thelink As Link) As Boolean ' Delete a link On Error GoTo FUNC_ERR Dim linkF As LinkFactory ' Dim theLink As Link Dim linkableBug As ILinkable Dim BugF As BugFactory Set linkableBug = fromBug Set linkF = linkableBug.BugLinkFactory linkF.RemoveItem (thelink.ID) RemoveBugToBugLink = SUCCESS Exit Function FUNC_ERR: RemoveBugToBugLink = FAILURE End Function |