static IControl GetFormRow(String eventName, String formName, out IControl formCell)
        {
            formCell = null;
            String identifier = String.Empty;

            try
            {
                if (ExpandEvent(eventName, out identifier) && !String.IsNullOrEmpty(identifier))
                {
                    ReadOnlyCollection <IControl> rows = DL_CRF_PDEP_EventsPage.GetRowsEventRows(identifier);
                    foreach (IControl row in rows)
                    {
                        if (Control_PropertyUtilities.IsControlVisible(row))
                        {
                            formCell = WebTableUtilities.GetCell(row, 2);
                            String formText = Control_PropertyUtilities.GetText(formCell);
                            if (formName.Equals(formText, StringComparison.InvariantCultureIgnoreCase))
                            {
                                return(row);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(null);
        }
        public static bool VerifyFormRestrictionMessage(List <PDEP_FormAccesssRestrictionMessageData> dataList)
        {
            try
            {
                foreach (PDEP_FormAccesssRestrictionMessageData data in dataList)
                {
                    if (String.IsNullOrEmpty(data.Event) || String.IsNullOrEmpty(data.Form) || String.IsNullOrEmpty(data.RestrictionMessage))
                    {
                        return(false);
                    }

                    IControl formCell = null;
                    IControl formRow  = GetFormRow(data.Event, data.Form, out formCell);
                    if (!Control_PropertyUtilities.IsControlNull(formCell))
                    {
                        IControl formLink = DL_CRF_PDEP_EventsPage.GetFormLink(formCell);
                        bool     found    = false;
                        String   value    = Control_PropertyUtilities.GetAttributeValue(formLink, "rel", out found);
                        if (!found || !value.Equals(data.RestrictionMessage, StringComparison.InvariantCultureIgnoreCase))
                        {
                            return(false);
                        }
                    }
                }
                return(true);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
        public static bool VerifyFormStautsIcon(String eventName, String formName, String icon)
        {
            try
            {
                IControl formCell = null;
                IControl formRow  = GetFormRow(eventName, formName, out formCell);
                IControl formIcon = DL_CRF_PDEP_EventsPage.GetIcon(formCell);

                if (icon.Equals("Mismatch"))
                {
                    bool   found = false;
                    String src   = Control_PropertyUtilities.GetAttributeValue(formIcon, "src", out found);
                    if (found)
                    {
                        return(src.Contains("PDE_mismatch"));
                    }
                }
                if (icon.Equals("Submitted"))
                {
                    bool   found = false;
                    String src   = Control_PropertyUtilities.GetAttributeValue(formIcon, "src", out found);
                    if (found)
                    {
                        return(src.Contains("Doc_S"));
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
 public static bool OpenForm(String eventName, String formName)
 {
     try
     {
         IControl formCell = null;
         IControl formRow  = GetFormRow(eventName, formName, out formCell);
         if (!Control_PropertyUtilities.IsControlNull(formCell))
         {
             IControl formLink = DL_CRF_PDEP_EventsPage.GetFormLink(formCell);
             return(Control_ActionUtilities.Click(formLink, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }