private void DoLoadArea() { CtrlWaiting ctrlWaiting = new CtrlWaiting(() => { var areas = AreaDataHelper.GetAreas(); if (areas.Count > 0) { this.Invoke(new Action(() => { var nodes = AreaDataHelper.ToTree(areas); nodes.Insert(0, new DevComponents.AdvTree.Node("--无--")); cboTreeArea.Nodes.AddRange(nodes.ToArray()); foreach (var item in nodes) { item.Expand(); } if (_dev != null && _dev.AREA_ID >= 0) { DevComponents.AdvTree.Node node = FindNode((decimal)_dev.AREA_ID); if (node != null) { cboTreeArea.SelectedNode = node; } } })); } }); ctrlWaiting.Show(this, 300); }
private void FaceDevPriMgr_Load(object sender, EventArgs e) { if (!UserInfoHelper.HasPrivate(SYS_FUN_POINT.STAFF_MGR)) { biRegister.Visible = false; dgvStaffs.Columns[6].Visible = false; } CtrlWaiting waiting = new CtrlWaiting(() => { try { Maticsoft.BLL.SMT_FACERECG_DEVICE faceBll = new Maticsoft.BLL.SMT_FACERECG_DEVICE(); string strWhere = ""; if (!UserInfoHelper.IsManager) { strWhere = "ID IN (SELECT RF.FUN_ID FROM SMT_ROLE_FUN RF,SMT_USER_INFO UI WHERE RF.ROLE_TYPE=4 AND RF.ROLE_ID=UI.ROLE_ID AND UI.ID=" + UserInfoHelper.UserID + ")"; } _faceDevices = faceBll.GetModelList(strWhere); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var nodes = AreaDataHelper.ToTree(areas); var faceDevs = _faceDevices.ToList(); foreach (var item in nodes) { DoCreateAreaDevice(item, faceDevs); } for (int i = faceDevs.Count - 1; i >= 0; i--) { var item = faceDevs[i]; Node devNode = new Node("<font color='blue'>" + item.FACEDEV_NAME + "</font>"); devNode.Image = Properties.Resources.editor; devNode.Tag = item; nodes.Insert(0, devNode); } Node root = new Node("所有人脸识别设备"); root.Image = Properties.Resources.house1818; root.Nodes.AddRange(nodes.ToArray()); nodes.Clear(); nodes.Add(root); advTree.Nodes.Clear(); advTree.Nodes.AddRange(nodes.ToArray()); advTree.ExpandAll(); })); DoSearch(null, null, null); } catch (Exception ex) { WinInfoHelper.ShowInfoWindow(this, "加载人脸设备列表异常!" + ex.Message); log.Error("加载人脸设备列表异常:", ex); } }); waiting.Show(this); }
private void ShowAreas(List <Maticsoft.Model.SMT_CONTROLLER_ZONE> areas) { var tree = AreaDataHelper.ToTree(areas); advTreeArea.Nodes[0].Nodes.Clear(); advTreeArea.Nodes[0].Nodes.AddRange(tree.ToArray()); advTreeArea.ExpandAll(); }
private void FrmAddModifyStaffFaceDevPrivate_Load(object sender, EventArgs e) { if (_staffInfo != null) { this.TitleText = "开始添加“" + _staffInfo.REAL_NAME + "”人脸设备权限"; this.dtpStart.Value = _staffInfo.VALID_STARTTIME; this.dtpEnd.Value = _staffInfo.VALID_ENDTIME; } CtrlWaiting waiting = new CtrlWaiting(() => { try { Maticsoft.BLL.SMT_FACERECG_DEVICE faceBll = new Maticsoft.BLL.SMT_FACERECG_DEVICE(); _faceDevices = faceBll.GetModelList(""); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var nodes = AreaDataHelper.ToTree(areas); var faceDevs = _faceDevices.ToList(); foreach (var item in nodes) { DoCreateAreaDevice(item, faceDevs); } for (int i = faceDevs.Count - 1; i >= 0; i--) { var item = faceDevs[i]; Node devNode = new Node("<font color='blue'>" + item.FACEDEV_NAME + "</font>"); devNode.Image = Properties.Resources.editor; devNode.Tag = item; nodes.Insert(0, devNode); } Node root = new Node("所有人脸识别设备"); root.Image = Properties.Resources.house1818; root.Nodes.AddRange(nodes.ToArray()); nodes.Clear(); nodes.Add(root); advTree.Nodes.Clear(); advTree.Nodes.AddRange(nodes.ToArray()); advTree.ExpandAll(); })); } catch (Exception ex) { WinInfoHelper.ShowInfoWindow(this, "加载人脸设备列表异常!" + ex.Message); log.Error("加载人脸设备列表异常:", ex); } }); waiting.Show(this); }