Beispiel #1
0
        private void Tree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            currentArea = ResourceTreeView1.TopoTree.SelectedObject as AreaEntity;
            if (currentArea != null)
            {
                Bll bll         = new Bll();
                var switchAreas = bll.bus_anchor_switch_area.ToList();

                AreaCanvas1.ShowDev = true;
                AreaCanvas1.ShowArea(currentArea, switchAreas);

                AreaListBox1.LoadData(currentArea.Children);
                DeviceListBox1.LoadData(currentArea.LeafNodes);

                ShowPersons();

                ArchorListExportControl1.Clear();
                TabControl1.SelectionChanged -= TabControl1_OnSelectionChanged;
                TabControl1.SelectionChanged += TabControl1_OnSelectionChanged;

                if (TabControl1.SelectedIndex == 2)
                {
                    ArchorListExportControl1.LoadData(currentArea.Id);
                    TabControl1.SelectionChanged -= TabControl1_OnSelectionChanged;
                }
            }
            else
            {
                var dev = ResourceTreeView1.TopoTree.SelectedObject as DevEntity;
                if (dev != null)
                {
                    AreaCanvas1.SelectDevById(dev.Id);
                }
            }
        }
        private void TopoTreeView1_SelectedObjectChanged(object obj)
        {
            area = obj as PhysicalTopology;
            if (area == null)
            {
                return;
            }
            AreaCanvas1.ShowDev = true;
            AreaCanvas1.ShowArea(area);
            var service = new PersonService();
            var persons = service.GetListByArea(area.Id + "");

            if (persons == null)
            {
                persons = service.GetListByArea("");
            }
            AreaCanvas1.ShowPersons(persons);
        }