Esempio n. 1
0
        private static int?FindRoomIndex(List <HtmlNode> t3, string sigla)
        {
            if (t3 == null || t3.Count == 0)
            {
                return(null);
            }

            for (var i = 0; i < t3.Count; i++)
            {
                var t4 = t3[i];
                if (t4 == null || t4.ChildNodes == null || t4.ChildNodes.Count < 2)
                {
                    continue;
                }

                var t6 = HtmlUtil.GetElementsByTagAndClassName(t4, "td");

                ;

                if (t6 == null || t6.Count < 2)
                {
                    return(null);
                }

                var t7 = t6[1];

                ;

                var t8 = HtmlUtil.GetElementsByTagAndClassName(t7, "b");

                ;

                var t9 = t8[0].InnerHtml.Trim();

                ;

                if (t9 == sigla)
                {
                    return(i);
                }

                var found = StringUtil.CheckIfTheStringIsTheSameAndValidRoomNameInsideAText(sigla, t8[0]);
                if (found != null && found.Value)
                {
                    return(i);
                }
            }

            return(null);
        }
Esempio n. 2
0
        private static int?FindRoom(HtmlNode table, string roomName)
        {
            for (var i = 0; i < table.ChildNodes.Count; i++)
            {
                var child = table.ChildNodes[i];

                if (child.ChildNodes != null && child.GetClasses().Contains("normalRow"))
                {
                    foreach (var child2 in child.ChildNodes)
                    {
                        var found = StringUtil.CheckIfTheStringIsTheSameAndValidRoomNameInsideAText(roomName, child2);
                        if (found != null && found.Value)
                        {
                            return(i);
                        }
                    }
                }
            }

            return(null);
        }