void AddGtObject(GeniticTestStatusContainer gtsc) { if (objectListView1.InvokeRequired) { SetSelectedObjectCallback aoc = new SetSelectedObjectCallback(AddGtObject); object[] args = new object[1]; args[0] = gtsc; this.Invoke(aoc, args); } else { bool found = false; foreach (object o in objectListView1.Objects) { if (((GeniticTestStatusContainer)o).owner == gtsc.owner && ((GeniticTestStatusContainer)o).Panel == gtsc.Panel) { found = true; } } if (found == false) { objectListView1.AddObject(gtsc); if (string.Compare("Pending", gtsc.Status, true) == 0) { objectListView1.SelectObject(gtsc); } } } }
void AddGtObject(GeniticTestStatusContainer gtsc) { if (objectListView1.InvokeRequired) { SetSelectedObjectCallback aoc = new SetSelectedObjectCallback(AddGtObject); object[] args = new object[1]; args[0] = gtsc; this.Invoke(aoc, args); } else { bool found = false; foreach (object o in objectListView1.Objects) { if (((GeniticTestStatusContainer)o).owner == gtsc.owner && ((GeniticTestStatusContainer)o).Panel == gtsc.Panel) { found = true; } } if (found ==false) { objectListView1.AddObject(gtsc); if (string.Compare("Pending", gtsc.Status, true) == 0) objectListView1.SelectObject(gtsc); } } }
private void objectListView1_SelectedIndexChanged(object sender, EventArgs e) { GeniticTestStatusContainer gtsc = (GeniticTestStatusContainer)(objectListView1.SelectedObject); if (gtsc != null) { if (gtsc.owner != null) { SessionManager.Instance.SetActiveRelative(this, gtsc.owner); } } }
private void GtLoaded(HraListLoadedEventArgs e) { lock (e.sender) { foreach (GeneticTest gt in (GeneticTestList)e.sender) { GeniticTestStatusContainer gtsc = new GeniticTestStatusContainer(); gtsc.Relative = gt.owningPMH.RelativeOwningPMH.relationship.Replace("Self", "Patient"); gtsc.Panel = gt.panelName; gtsc.Status = gt.status; gtsc.owner = gt.owningPMH.RelativeOwningPMH; if (string.IsNullOrEmpty(gt.GeneticTest_testDay)) { gtsc.Date = (gt.GeneticTest_testMonth + "/" + gt.GeneticTest_testYear).Trim(trimChars); } else { gtsc.Date = (gt.GeneticTest_testMonth + "/" + gt.GeneticTest_testDay + "/" + gt.GeneticTest_testYear).Trim(trimChars); } AddGtObject(gtsc); } } }