In my CheckExamButtonEnabled method, it always checks the exam button which is listed in the first item in the list box. But i want to check which exam button is enabled in the list of items.
Please help me.
Code: Select all
public ListItem [b]GetPatientListItem[/b](string patientName)
{
//RepoOrganizerFolders.OrganizerViewFolder repoPatientList = RepoOrganizer.Instance.OrganizerView;
RepoOrganizer repo = RepoOrganizer.Instance;
//In the TextPatientListItemName element has variable called patientName and which we are setting at runtime taking from csv file
repo.patientName = "Frank, Horacio";
if (repo.OrganizerView.OrganizerListBox.Items.Count <= 0)
{
return null;
}
//return repo.OrganizerView.OrganizerListBox.FindSingle<ListItem>(@"listitem[@name~'" + patientName + "']");
//var listItem = repo.OrganizerView.OrganizerListBox;
[b]return repo.OrganizerView.OrganizerListBox.FindSingle<ListItem>(repo.OrganizerView.TextPatientListItemName.GetPath());[/b]
}
-------------------------------------------------------
public Button [b]GetExamButton[/b](string patientName)
{
RepoOrganizerFolders.OrganizerViewFolder repo = RepoOrganizer.Instance.OrganizerView;
var listItem = GetPatientListItem(patientName);
[b]return listItem.FindSingle<Button>(repo.ButtonExam.GetPath());[/b]
//return listItem.FindSingle<Button>(@"button[@automationid='PatientListItemExam']");
}
--------------------------------------------------------
public Button [b]CheckExamButtonEnabled[/b]()
{
RepoOrganizerFolders.OrganizerViewFolder repoPatientList = RepoOrganizer.Instance.OrganizerView;
int patientListCnt = repoPatientList.OrganizerListBox.Items.Count;
for (int cnt=0; cnt<patientListCnt;cnt++ )
{
//if (repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(@"button[@automationid='PatientListItemExam']").Enabled)
[b]if (repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(repoPatientList.ButtonExam.GetPath()).Enabled)[/b]
{
//return repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(@"button[@automationid='PatientListItemExam']");
[b]return repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(repoPatientList.ButtonExam.GetPath());[/b]
}
}
return null;
}