public static bool DeleteGroup(String groupName)
 {
     try
     {
         IControl groupsTable = DL_DeleteGroupsPage.GroupsTable;
         WebTable_SearchCriteriaItem     searchCreteriaItem = new WebTable_SearchCriteriaItem(0, groupName, TableColumnContentType.CheckboxAndText);
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(searchCreteriaItem);
         IControl tableRow = WebTableUtilities.Table_FindRow(groupsTable, list);
         if (tableRow != null)
         {
             IControl checkbox = WebTableUtilities.GetElement(tableRow, String.Empty, 0, TableColumnContentType.CheckboxAndText);
             Control_ActionUtilities.Click(checkbox, String.Empty);
             return(Control_ActionUtilities.Click_PerssEnterKey(DL_DeleteGroupsPage.DeleteButton, String.Empty));
         }
         else
         {
             return(Control_ActionUtilities.Click_PerssEnterKey(DL_DeleteGroupsPage.CancelButton, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 static bool AreJobsFinished(List <String> subjectList)
 {
     try
     {
         ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(Pages.DataLabs.Inbox.DL_InboxPage.InboxTable);
         if (rows.Count > subjectList.Count)
         {
             int i = 1;
             foreach (String subjectText in subjectList)
             {
                 IControl c = WebTableUtilities.GetElement(rows[i], subjectText, 3, TableColumnContentType.Link_Partial);
                 if (Control_PropertyUtilities.IsControlNull(c))
                 {
                     return(false);
                 }
                 ++i;
             }
             return(true);
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool OpenLab(ManageReferenceLabGridRowData labGridRowData)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(0, labGridRowData.labId, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(1, labGridRowData.laboratoryName, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(2, labGridRowData.Company, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(3, labGridRowData.Department, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(4, labGridRowData.Address, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(5, labGridRowData.City, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(6, labGridRowData.State, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(7, labGridRowData.Country, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(8, labGridRowData.Lab_Status, TableColumnContentType.Text));
         IControl labRow = WebTableUtilities.Table_FindRow(DL_Lab_ManageReferenceRanges.LabsTable, list);
         if (labRow != null)
         {
             IControl labIdLink = WebTableUtilities.GetElement(labRow, labGridRowData.labId, 0, TableColumnContentType.Link);
             return(Control_ActionUtilities.Click(labIdLink, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ExpandEvent(String eventName, out String identifier)
 {
     identifier = String.Empty;
     try
     {
         ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(DL_CRF_PDEP_EventsPage.EventsTable);
         foreach (IControl row in rows)
         {
             if (Control_PropertyUtilities.IsControlVisible(row))
             {
                 IControl cell = WebTableUtilities.GetCell(row, 0);
                 if (Control_PropertyUtilities.GetText(cell).Equals(eventName, StringComparison.InvariantCultureIgnoreCase))
                 {
                     IControl expandCollapseImage = WebTableUtilities.GetElement(row, String.Empty, 0, TableColumnContentType.Image);
                     bool     found       = false;
                     String   imageSource = Control_PropertyUtilities.GetAttributeValue(expandCollapseImage, "src", out found);
                     if (found)
                     {
                         identifier = Control_PropertyUtilities.GetAttributeValue(row, "identifier", out found);
                         if (imageSource.Contains("menu_expand.gif"))
                         {
                             return(Control_ActionUtilities.Click(expandCollapseImage, String.Empty));
                         }
                         return(imageSource.Contains("menu_collapse.gif"));
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Пример #5
0
 static bool VerifyPrintCheckboxValue(IControl row, DCFPrintWizardStep1Data data)
 {
     try
     {
         if (!String.IsNullOrEmpty(data.IsPrintEnabled))
         {
             if (!Control_PropertyUtilities.IsControlNull(row))
             {
                 IControl printCheckbox = WebTableUtilities.GetElement(row, String.Empty, 5, TableColumnContentType.Checkbox);
                 if (!Control_PropertyUtilities.IsControlNull(printCheckbox))
                 {
                     bool   found        = false;
                     String checkedValue = Control_PropertyUtilities.GetAttributeValue(printCheckbox, "checked", out found);
                     return(found);
                 }
             }
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ClickInboxItem(String folderName, String subject)
 {
     try
     {
         int i = 0;
         while (i < 25)
         {
             if (BP_Inbox_ActionPaletteUtilities.InvokeActionPaletteItem(folderName))
             {
                 ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(Pages.DataLabs.Inbox.DL_InboxPage.InboxTable);
                 foreach (IControl row in rows)
                 {
                     IControl c = WebTableUtilities.GetElement(row, subject, 3, TableColumnContentType.Link_Partial);
                     if (!Control_PropertyUtilities.IsControlNull(c))
                     {
                         return(Control_ActionUtilities.Click(c, "Unbale to click inbox item for subject " + subject));
                     }
                 }
             }
             ++i;
             Thread.Sleep(5000);
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
Пример #7
0
        static bool IsNewPatientsValueMatched(IControl row, String value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return(true);
            }
            IControl dropdown = WebTableUtilities.GetElement(row, String.Empty, 1, TableColumnContentType.Dropdown);

            return(Control_ActionUtilities.Dropdown_VerifySelectedItem(dropdown, value, String.Empty));
        }
Пример #8
0
        static bool IsDefaultValueMatched(IControl row, String value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return(true);
            }
            IControl radioButton = WebTableUtilities.GetElement(row, String.Empty, 2, TableColumnContentType.RadioButton);

            return(Control_PropertyUtilities.VerifyAttributeValue(radioButton, "checked", "true"));
        }
        static IControl GetSiteLink(String siteId, String siteName)
        {
            IControl labRow = GetSiteRow(siteId, siteName);

            if (labRow != null)
            {
                return(WebTableUtilities.GetElement(labRow, siteId + "-" + siteName, 0, TableColumnContentType.Link));
            }
            return(null);
        }
Пример #10
0
        public static IControl GetLabLink(String labId)
        {
            IControl labRow = GetLabRow(labId);

            if (labRow != null)
            {
                return(WebTableUtilities.GetElement(labRow, labId, 0, TableColumnContentType.Link));
            }
            return(null);
        }
Пример #11
0
 static bool SetStudyFieldData_Dropdown(IControl StudyTable, String searchText, String valueToSet)
 {
     if (valueToSet != null)
     {
         IControl row      = WebTableUtilities.Table_FindRow(StudyTable, GetSearchItemList(searchText));
         IControl dropdown = WebTableUtilities.GetElement(row, String.Empty, 1, TableColumnContentType.Dropdown);
         return(Control_ActionUtilities.Dropdown_SelectItem(dropdown, valueToSet, String.Empty));
     }
     return(false);
 }
Пример #12
0
 static bool SetStudyFieldData_Text(IControl StudyTable, String searchText, String valueToSet)
 {
     if (valueToSet != null)
     {
         IControl row     = WebTableUtilities.Table_FindRow(StudyTable, GetSearchItemList(searchText));
         IControl textbox = WebTableUtilities.GetElement(row, String.Empty, 1, TableColumnContentType.Textbox);
         return(Control_ActionUtilities.Textbox_SetText(textbox, valueToSet, String.Empty));
     }
     return(false);
 }
Пример #13
0
        public void WhenIClickGroupNameInGroupManagementPage(string groupName)
        {
            WebTable_SearchCriteriaItemList searchCreteriaList = new WebTable_SearchCriteriaItemList();

            searchCreteriaList.AddSearchItem(new WebTable_SearchCriteriaItem(0, groupName, TableColumnContentType.Link));
            IControl tableRow      = WebTableUtilities.Table_FindRow(DL_GroupManagementPage.GroupsTable, searchCreteriaList);
            IControl groupNameLink = WebTableUtilities.GetElement(tableRow, groupName, 0, TableColumnContentType.Link);

            Control_ActionUtilities.Click_PerssEnterKey(groupNameLink, string.Empty);
        }
        public static String GetErrorString(String columnName)
        {
            IControl statusRow = WebTableUtilities.Table_FindRow(DL_AddLabPage.AddLabTable, GetSearchItemList(columnName));
            IControl span      = WebTableUtilities.GetElement(statusRow, String.Empty, 1, TableColumnContentType.Span);

            if (Control_PropertyUtilities.IsControlVisible(span))
            {
                return(Control_PropertyUtilities.GetText(span));
            }
            return(String.Empty);
        }
Пример #15
0
        public static bool SelectPatientFromPatientsTable(string PatientID)
        {
            bool     isPatientSelected = false;
            IControl PatientRow        = GetPatientRowFromPatientsTable(PatientID);

            if (PatientID != null)
            {
                IControl Link = WebTableUtilities.GetElement(PatientRow, PatientID, 0, TableColumnContentType.Link);
                if (Link != null)
                {
                    isPatientSelected = Control_ActionUtilities.Click(Link, "Unable to select patient " + PatientID + " as patient link is not clicked.");
                }
            }
            return(isPatientSelected);
        }
Пример #16
0
 public static bool OpenPatient(String patient)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(0, patient, TableColumnContentType.Text));
         IControl row         = WebTableUtilities.Table_FindRow(DL_CRF_MainPage.PatientsTable, list, 2);
         IControl patientLink = WebTableUtilities.GetElement(row, patient, 0, TableColumnContentType.Link);
         return(Control_ActionUtilities.Click(patientLink, String.Empty));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Пример #17
0
 public static bool OpenDCF(int dcfId)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(1, dcfId.ToString(), TableColumnContentType.Text));
         IControl dcfsTable = DL_DCF_SearchResultsPage.DCFSearchResultsTable;
         IControl row       = WebTableUtilities.Table_FindRow(dcfsTable, list, 1);
         IControl dcfIdLink = WebTableUtilities.GetElement(row, dcfId.ToString(), 1, TableColumnContentType.Link);
         return(Control_ActionUtilities.Click(dcfIdLink, String.Empty));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool OpenLab(String labId)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(0, labId, TableColumnContentType.Text));
         IControl labRow = WebTableUtilities.Table_FindRow(DL_AddSitePage.ActiveSubTabTable, list, 1);
         if (labRow != null)
         {
             IControl labIdLink = WebTableUtilities.GetElement(labRow, labId, 0, TableColumnContentType.Link);
             return(Control_ActionUtilities.Click(labIdLink, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
        public static bool SelectQueryOnRunWizardPage(string QueryName, string Version)
        {
            bool isQuerySelected = false;

            try
            {
                IControl QueryRow = GetQueryRowFromQueryRunQizard(QueryName, Version);
                if (!Control_PropertyUtilities.IsControlNull(QueryRow))
                {
                    IControl ChkBox = WebTableUtilities.GetElement(QueryRow, string.Empty, 1, TableColumnContentType.Checkbox);
                    if (!Control_PropertyUtilities.IsControlNull(ChkBox))
                    {
                        isQuerySelected = Control_ActionUtilities.Click(ChkBox, "Unable to select query " + QueryName + " as the checkbox is not found.");
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(isQuerySelected);
        }
Пример #20
0
 public static bool OpenDraftDCFs(String patient, int draftDCFsCount)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(0, patient, TableColumnContentType.Text));
         IControl row = WebTableUtilities.Table_FindRow(DL_DCF_PatientsPage.PatientsTable, list, 1);
         if (!Control_PropertyUtilities.IsControlNull(row))
         {
             IControl link = WebTableUtilities.GetElement(row, draftDCFsCount.ToString(), 2, TableColumnContentType.Link);
             if (!Control_PropertyUtilities.IsControlNull(link))
             {
                 return(Control_ActionUtilities.Click(link, String.Empty));
             }
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }