Esempio n. 1
0
        public static Dictionary <string, Dictionary <string, string> > GetAll(PlanProvider provider)
        {
            var document = provider.GetList();

            var classSelect = document.All.Where(e => e.TagName.ToLower() == "select")
                              .Where(s => s.Attributes.Where(a => a.Name == "name" && a.Value == "oddzialy").Any()).First();
            var teacherSelect = document.All.Where(e => e.TagName.ToLower() == "select").Where(s =>
                                                                                               s.Attributes.Where(a => a.Name == "name" && a.Value == "nauczyciele").Any()).First();
            var roomSelect = document.All.Where(e => e.TagName.ToLower() == "select")
                             .Where(s => s.Attributes.Where(a => a.Name == "name" && a.Value == "sale").Any()).First();

            return(new Dictionary <string, Dictionary <string, string> >()
            {
                {
                    "classes",
                    classSelect.Children.Where(o => o.Attributes.Any())
                    .ToDictionary(o => o.InnerHtml, o => o.Attributes.First().Value)
                },
                {
                    "teachers",
                    teacherSelect.Children.Where(o => o.Attributes.Any())
                    .ToDictionary(o => o.InnerHtml, o => o.Attributes.First().Value)
                },
                {
                    "rooms",
                    roomSelect.Children.Where(o => o.Attributes.Any())
                    .ToDictionary(o => o.InnerHtml, o => o.Attributes.First().Value)
                }
            });
        }
Esempio n. 2
0
        public static Dictionary <string, string> GetRooms(PlanProvider provider)
        {
            var document = provider.GetList();

            var roomSelect = document.All.Where(e => e.TagName.ToLower() == "select")
                             .Where(s => s.Attributes.Where(a => a.Name == "name" && a.Value == "sale").Any()).First();

            return(roomSelect.Children.Where(o => o.Attributes.Any())
                   .ToDictionary(o => o.InnerHtml, o => o.Attributes.First().Value));
        }