Пример #1
0
 public static bool VerifySitesInAvailableSites(List <SiteInfo> siteInfoList)
 {
     try
     {
         List <String> sites = new List <String>();
         foreach (SiteInfo siteInfo in siteInfoList)
         {
             sites.Add(siteInfo.Site);
         }
         return(Control_ActionUtilities.Dropdown_VerifyItems(DL_Lab_AssociateSitesPage.AvailableSitesListBox, sites, String.Empty));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
        public static bool VerifyItemsInMultiseleableList(String listName, List <String> itemToVerify)
        {
            try
            {
                switch (listName.ToUpper().ToString())
                {
                case "COUNTRY":
                    if (!Control_ActionUtilities.Dropdown_VerifyItems(wf_Page_Frame.CountrySelect_dropdown, itemToVerify, true, "Item not available"))
                    {
                        return(false);
                    }
                    return(true);

                case "SITE":
                    if (!Control_ActionUtilities.Dropdown_VerifyItems(wf_Page_Frame.SiteSelect_dropdown, itemToVerify, true, "Item not available"))
                    {
                        return(false);
                    }
                    return(true);

                case "PATIENT":
                    if (!Control_ActionUtilities.Dropdown_VerifyItems(wf_Page_Frame.CountrySelect_dropdown, itemToVerify, true, "Item not available"))
                    {
                        return(false);
                    }
                    return(true);


                case "Default":
                    return(false);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }

            return(true);
        }
 public static bool DissociateLab(String labId, String labName)
 {
     try
     {
         String lab = labId + " - " + labName;
         if (IsLabInAssociatedLabsList(lab))
         {
             int count = 0;
             while (count < 5)
             {
                 if (Control_ActionUtilities.SelectItemInDualSelectDropdown(DL_Site_AssociateLabsPage.AssociatedLabsListBox, lab, String.Empty))
                 {
                     Control_ActionUtilities.Click(DL_Site_AssociateLabsPage.RemoveButton, String.Empty);
                     bool isItemExist = Control_ActionUtilities.Dropdown_VerifyItems(DL_Site_AssociateLabsPage.AssociatedLabsListBox, new List <String> {
                         lab
                     }, String.Empty);
                     if (!isItemExist)
                     {
                         break;
                     }
                 }
                 Thread.Sleep(1000);
             }
             return(Control_ActionUtilities.Click(DL_Site_AssociateLabsPage.SaveButton, String.Empty));
         }
         else
         {
             return(Control_ActionUtilities.Click(DL_Site_AssociateLabsPage.CancelButton, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Пример #4
0
 public static bool RemoveItemFromList1(string itemName)
 {
     try
     {
         List <String> itemList = new List <String>();
         itemList.Add(itemName);
         if (Control_ActionUtilities.Dropdown_VerifyItems(DL_Study_EditPreferences_DCFsPage.ItemListbox1, itemList, String.Empty))
         {
             if (Control_ActionUtilities.Dropdown_SelectItem(DL_Study_EditPreferences_DCFsPage.ItemListbox1, itemName, String.Empty))
             {
                 return(ClickRemove1Button());
             }
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }