Exemplo n.º 1
0
        public void TreeViewSelectedItemHandle(NodeEntry selectedNode)
        {
            if (selectedNode == null)
            {
                return;
            }
            switch (selectedNode.Type)
            {
            case NodeType.School:
                ShowSchoolDetail(selectedNode);
                break;

            case NodeType.Campus:
                CampusInfoDetail.Visibility = System.Windows.Visibility.Visible;
                SchoolInfoDetail.Visibility = System.Windows.Visibility.Collapsed;
                this.SchoolInfo.Visibility  = System.Windows.Visibility.Collapsed;
                AMS.Model.AMS_Campus campusModel = null;
                //获取当前选中节点的Model信息
                foreach (AMS_ProvinceSchoolInfo p in ModelSchoolList)
                {
                    bool isStop = false;
                    foreach (AMS_School s in p.Schools)
                    {
                        foreach (AMS_Campus campus in s.Campus)
                        {
                            if (selectedNode.Id == campus.Id)
                            {
                                campusModel = campus;
                                isStop      = true;
                                break;
                            }
                        }
                        if (isStop)
                        {
                            break;
                        }
                    }
                    if (isStop)
                    {
                        break;
                    }
                }
                this.CampusInfoDetail.ShowDeviceList(campusModel);
                this.CampusInfoDetail.ShowCampusDetail(campusModel);
                break;

            case NodeType.Province:
                ShowProvinceSchools(selectedNode);
                break;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获取当前选中校区的Model
 /// </summary>
 /// <param name="selectedNode"></param>
 /// <returns></returns>
 private AMS_Campus GetCampusModelInfo(NodeEntry selectedNode)
 {
     AMS.Model.AMS_Campus campusModel = null;
     //获取当前选中节点的Model信息
     foreach (AMS_ProvinceSchoolInfo p in ModelSchoolList)
     {
         foreach (AMS_School s in p.Schools)
         {
             foreach (AMS_Campus campus in s.Campus)
             {
                 if (selectedNode.Id == campus.Id)
                 {
                     campusModel = campus;
                     return(campusModel);
                 }
             }
         }
     }
     return(null);
 }