Example Title |
Copy Code
|
---|---|
public void LinkDefects() { LinkFactory BugLinkF; Link bugLink; ILinkable bgLinkable; Bug bug1, bug2; BugFactory bugF = (BugFactory)tdConnection.BugFactory; bug1 = bugF.AddItem(DBNull.Value); bug1.Summary = "Lydia Bennet is 15 years old."; bug1.Status = "New"; bug1.Priority = "3-High"; bug1["BG_SEVERITY"] = "3-High"; bug1.DetectedBy = "sa"; bug1["BG_DETECTION_DATE"] = DateTime.Now.ToString(); bug1.Post(); bug2 = bugF.AddItem(DBNull.Value); bug2.Summary = "Mr. Bennet hides in library."; bug2.Status = "New"; bug2.Priority = "3-High"; bug2["BG_SEVERITY"] = "3-High"; bug2.DetectedBy = "sa"; bug2["BG_DETECTION_DATE"] = DateTime.Now.ToString(); bug2.Post(); //Link the new defects. bgLinkable = (ILinkable)bug1; BugLinkF = bgLinkable.BugLinkFactory; bugLink = BugLinkF.AddItem(bug2); bugLink.LinkType = "Related"; bugLink.Post(); Bug anObj = bugLink.SourceEntity; Debug.Print(anObj.Summary); anObj = bugLink.TargetEntity; Debug.Print(anObj.Summary); } |