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 Init() { dtpStart.Value = DateTime.Now.Date; dtpEnd.Value = DateTime.Now.Date; CtrlWaiting waiting = new CtrlWaiting(() => { var doors = DoorDataHelper.GetDoors(); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var doorNodes = DoorDataHelper.ToTree(areas, doors); //cboDoorTree.Nodes.Add(new Node("--所有门禁--")); cboDoorTree.Nodes.AddRange(doorNodes.ToArray()); if (cboDoorTree.Nodes.Count > 0) { cboDoorTree.SelectedNode = cboDoorTree.Nodes[0]; } foreach (Node item in cboDoorTree.Nodes) { item.ExpandAll(); } })); }); waiting.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 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); }
private void DoorTree_Load(object sender, EventArgs e) { if (!IsDesignMode()) { CtrlWaiting ctrlWaiting = new CtrlWaiting(() => { try { var doors = DoorDataHelper.GetDoors(); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var nodes = DoorDataHelper.ToTree(areas, doors); advDoorTree.Nodes.Clear(); advDoorTree.Nodes.AddRange(nodes.ToArray()); advDoorTree.ExpandAll(); lock (this) { _isloaded = true; if (_loadEnded != null) { _loadEnded(this, e); } } })); } catch (Exception ex) { WinInfoHelper.ShowInfoWindow(this, "门禁列表加载异常:" + ex.Message); this.Invoke(new Action(() => { lock (this) { _isloaded = true; if (_loadEnded != null) { _loadEnded(this, e); } } })); } }); ctrlWaiting.Show(this, 300); } }
private void Init(int time = 300) { CtrlWaiting waiting = new CtrlWaiting(() => { try { List <Maticsoft.Model.SMT_FACERECG_DEVICE> devs = FaceRecgHelper.GetList("1=1", true); //获取所有控制器 List <Maticsoft.Model.SMT_CONTROLLER_ZONE> areas = AreaDataHelper.GetAreas(true); //获取所有区域 this.Invoke(new Action(() => { ShowAreas(areas); ShowDevs(devs); })); } catch (System.Exception ex) { WinInfoHelper.ShowInfoWindow(this, "加载异常:" + ex.Message); log.Error("加载异常:", ex); } }); waiting.Show(this, time); }
private void Init() { dtpStart.Value = DateTime.Now.Date; CtrlWaiting waiting = new CtrlWaiting(() => { var depts = DeptDataHelper.GetDepts(false); var doors = DoorDataHelper.GetDoors(); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var deptNodes = DeptDataHelper.ToTree(depts); Node deptNone = new Node("--无--"); deptNodes.Insert(0, deptNone); cboDeptTree.Nodes.AddRange(deptNodes.ToArray()); cboDeptTree.SelectedNode = deptNone; foreach (Node item in cboDeptTree.Nodes) { item.Expand(); } var doorNodes = DoorDataHelper.ToTree(areas, doors); cboDoorTree.Nodes.AddRange(doorNodes.ToArray()); foreach (Node item in cboDoorTree.Nodes) { item.ExpandAll(); } })); }); waiting.Show(this, 300); }
private void InitDoors() { CtrlWaiting ctrlWaiting = new CtrlWaiting(() => { try { var doors = DoorDataHelper.GetDoors(); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var nodes = DoorDataHelper.ToTree(areas, doors); cboDoor.Nodes.Clear(); cboDoor.Nodes.AddRange(nodes.ToArray()); cboDoor.AdvTree.ExpandAll(); })); } catch (Exception ex) { WinInfoHelper.ShowInfoWindow(this, "门禁列表加载异常:" + ex.Message); } }); ctrlWaiting.Show(this, 300); }
private void Init() { dtpStart.Value = DateTime.Now.Date; CtrlWaiting waiting = new CtrlWaiting(() => { Maticsoft.BLL.SMT_FACERECG_DEVICE faceBll = new Maticsoft.BLL.SMT_FACERECG_DEVICE(); var depts = DeptDataHelper.GetDepts(false); var facedevs = faceBll.GetModelList(""); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var deptNodes = DeptDataHelper.ToTree(depts); Node deptNone = new Node("--无--"); deptNodes.Insert(0, deptNone); cboDeptTree.Nodes.AddRange(deptNodes.ToArray()); cboDeptTree.SelectedNode = deptNone; foreach (Node item in cboDeptTree.Nodes) { item.Expand(); } var devNodes = FaceRecgHelper.ToFaceTree(facedevs, areas); cboFaceTree.Nodes.AddRange(devNodes.ToArray()); foreach (Node item in cboFaceTree.Nodes) { item.ExpandAll(); } })); }); waiting.Show(this, 300); }
private void Init() { if (_task != null) { this.Text = "编辑定时任务"; tbTaskName.Text = _task.TASK_NAME; tbTaskDesc.Text = _task.TASK_DESC; tbTaskNum.Text = _task.TASK_NO; dtpStartDate.Value = _task.VALID_STARTDATE; dtpEndDate.Value = _task.VALID_ENDDATE; dtiTime.Value = DateTime.Now.Date + _task.ACTION_TIME; if (_task.CTRL_STYLE >= 0 && _task.CTRL_STYLE <= 12) { cboCtrlStyle.SelectedIndex = _task.CTRL_STYLE; } cbWeek1.Checked = _task.MON_STATE; cbWeek2.Checked = _task.TUE_STATE; cbWeek3.Checked = _task.THI_STATE; cbWeek4.Checked = _task.WES_STATE; cbWeek5.Checked = _task.FRI_STATE; cbWeek6.Checked = _task.SAT_STATE; cbWeek7.Checked = _task.SUN_STATE; if (_isview) { tbTaskName.ReadOnly = true; this.Text = "查看定时任务"; tbTaskDesc.ReadOnly = true; tbTaskNum.ReadOnly = true; dtpStartDate.Enabled = false; dtpEndDate.Enabled = false; dtiTime.Enabled = false; cboCtrlStyle.Enabled = false; cbWeek1.Enabled = false; cbWeek2.Enabled = false; cbWeek3.Enabled = false; cbWeek4.Enabled = false; cbWeek5.Enabled = false; cbWeek6.Enabled = false; cbWeek7.Enabled = false; btnOk.Visible = false; btnCancel.Text = "关闭"; } } else { this.Text = "添加定时任务"; cboCtrlStyle.SelectedIndex = 0; dtiTime.Value = DateTime.Now; } CtrlWaiting waiting = new CtrlWaiting(() => { var doors = DoorDataHelper.GetDoors(); var areas = AreaDataHelper.GetAreas(); this.Invoke(new Action(() => { var doorNodes = DoorDataHelper.ToTree(areas, doors); //cboDoorTree.Nodes.Add(new Node("--所有门禁--")); doorTree.Nodes.Clear(); doorTree.Nodes.AddRange(doorNodes.ToArray()); if (_task != null && doorTree.Nodes.Count > 0) { if (!string.IsNullOrWhiteSpace(_task.DOOR_ID)) { if (_task.DOOR_ID == "-1") { doorTree.Nodes[0].Checked = true; doorTree.SetAllCheckState(true); } else { string[] doorIds = _task.DOOR_ID.Split(','); List <decimal> doorIdd = new List <decimal>(); foreach (var id in doorIds) { decimal dd; if (decimal.TryParse(id, out dd)) { doorIdd.Add(decimal.Parse(id)); } } var nodes = doorTree.GetNodeList(typeof(Maticsoft.Model.SMT_DOOR_INFO)); foreach (var item in nodes) { if (doorIdd.Contains(((Maticsoft.Model.SMT_DOOR_INFO)item.Tag).ID)) { item.Checked = true; } } } ShowDoorText(); } } foreach (Node item in doorTree.Nodes) { item.ExpandAll(); } })); }); waiting.Show(this, 300); }