private void dgvDoorCamera_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == 3)//删除
         {
             if (MessageBox.Show("确定删除该关联关系?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 DoorCamera  dc      = (DoorCamera)dgvDoorCamera.Rows[e.RowIndex].Tag;
                 CtrlWaiting waiting = new CtrlWaiting(() =>
                 {
                     try
                     {
                         Maticsoft.BLL.SMT_DOOR_CAMERA dcBll = new Maticsoft.BLL.SMT_DOOR_CAMERA();
                         dcBll.Delete(dc.DOOR_ID, dc.CAMERA_ID);
                         this.Invoke(new Action(() =>
                         {
                             dgvDoorCamera.Rows.Remove(dgvDoorCamera.Rows[e.RowIndex]);
                         }));
                     }
                     catch (Exception ex)
                     {
                         log.Error("删除门禁相机关系异常:", ex);
                         WinInfoHelper.ShowInfoWindow(this, "删除门禁相机关系异常:" + ex.Message);
                     }
                 });
                 waiting.Show(this);
             }
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 强制刷新部门
        /// </summary>
        public static void UpdateDepts()
        {
            try
            {
                _depts    = null;
                _allDepts = null;
                Maticsoft.BLL.SMT_ORG_INFO bll = new Maticsoft.BLL.SMT_ORG_INFO();

                if (UserInfoHelper.UserInfo.USER_NAME == "admin" || PrivateMgr.FUN_POINTS.Contains(SYS_FUN_POINT.USER_PRIVATE_CONFIG))
                {
                    log.Debug("管理员加载部门...");
                    _depts = bll.GetModelList("1=1 order by ORDER_VALUE");
                    if (_allDepts == null)
                    {
                        _allDepts = new List <Maticsoft.Model.SMT_ORG_INFO>();
                    }
                    _allDepts.Clear();
                    _allDepts.AddRange(_depts);
                }
                else
                {
                    log.Debug("普通用户加载部门...");
                    _allDepts = bll.GetModelList("1=1 order by ORDER_VALUE");

                    Maticsoft.BLL.SMT_ROLE_FUN rbll = new Maticsoft.BLL.SMT_ROLE_FUN();
                    var funs = rbll.GetModelList("ROLE_TYPE=2 and ROLE_ID=" + UserInfoHelper.UserInfo.ROLE_ID);// _depts = bll.GetModelList("id in (select RF.FUN_ID from SMT_ROLE_FUN RF where RF.ROLE_TYPE=2 and RF.ROLE_ID=" + UserInfoHelper.UserInfo.ROLE_ID + ")  order by ORDER_VALUE");
                    _depts = _allDepts.FindAll(m => funs.Exists(n => n.FUN_ID == m.ID));
                }
            }
            catch (Exception ex)
            {
                WinInfoHelper.ShowInfoWindow(null, "获取区域列表异常:" + ex.Message);
                log.Error("获取区域列表异常:", ex);
            }
        }
Beispiel #3
0
        private void pageDataGridView_PageControl_ExportAll(object sender, Li.Controls.PageEventArgs args)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    DataSet qds  = Maticsoft.DBUtility.DbHelperSQL.Query(sqlAll);
                    DataTable dt = qds.Tables[0];
                    if (dt.Rows.Count == 0)
                    {
                        WinInfoHelper.ShowInfoWindow(this, "没有记录导出!");
                        return;
                    }
                    dt = ToDataTable(dt);
                    this.Invoke(new Action(() =>
                    {
                        Li.Controls.Excel.ExportHelper.ExportEx(dt, "查验记录_" + dtpStart.Value.ToString("yyyyMMdd") + dtpEnd.Value.ToString("yyyyMMdd") + ".xls", "查验记录");
                    }));
                }
                catch (Exception ex)
                {
                    log.Error("导出记录异常:", ex);
                    WinInfoHelper.ShowInfoWindow(this, "导出记录异常:" + ex.Message);
                }
            });

            waiting.Show(this);
        }
Beispiel #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (tbRoleName.Text.Trim() == "")
            {
                WinInfoHelper.ShowInfoWindow(this, "角色名称不能为空!");
                return;
            }
            Maticsoft.Model.SMT_ROLE_INFO role = new Maticsoft.Model.SMT_ROLE_INFO();
            role.ROLE_NAME = tbRoleName.Text.Trim();
            role.ROLE_DESC = tbRoleName.Text.Trim();
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_ROLE_INFO roleBll = new Maticsoft.BLL.SMT_ROLE_INFO();
                    role.ID = roleBll.Add(role);
                    SmtLog.InfoFormat("用户", "添加角色:ID={0},名称={1}", role.ID, role.ROLE_NAME);
                    this.Invoke(new Action(() =>
                    {
                        AddModel(role);
                    }));
                }
                catch (Exception ex)
                {
                    log.Error("添加角色异常:", ex);
                    WinInfoHelper.ShowInfoWindow(this, "添加角色异常:" + ex.Message);
                }
            });

            waiting.Show(this);
        }
Beispiel #5
0
        private void FrmRoleMgr_Load(object sender, EventArgs e)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_ROLE_INFO roleBll = new Maticsoft.BLL.SMT_ROLE_INFO();
                    var models = roleBll.GetModelList("");
                    this.Invoke(new Action(() =>
                    {
                        foreach (var item in models)
                        {
                            AddModel(item);
                        }
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载角色异常:" + ex.Message);
                    log.Error("加载角色异常:", ex);
                }
            });

            waiting.Show(this, 300);
        }
Beispiel #6
0
 private void FrmGetPicture_Load(object sender, EventArgs e)
 {
     _cameraChoice.UpdateDeviceList();
     foreach (var item in _cameraChoice.Devices)
     {
         cboCameraList.Items.Add(item.Name);
     }
     if (cboCameraList.Items.Count > 0)
     {
         cboCameraList.SelectedIndex = 0;
     }
     try
     {
         List <string> devices = WIAScanner.GetDevices();
         foreach (var item in devices)
         {
             cboScanner.Items.Add(item);
         }
         if (cboScanner.Items.Count > 0)
         {
             cboScanner.SelectedIndex = 0;
         }
     }
     catch (Exception ex)
     {
         WinInfoHelper.ShowInfoWindow(this, "扫描仪设备加载失败!" + ex.Message);
         log.Error("扫描仪设备加载失败:", ex);
     }
 }
Beispiel #7
0
 /// <summary>
 /// 获取视频驱动并开启视频
 /// </summary>
 private void OpenVideo()
 {
     try
     {
         if (cameraControl.CameraCreated)
         {
             CloseView();
             biOpenCamera.Text = "打开摄像头";
             return;
         }
         if (cboCameraList.SelectedIndex < 0)
         {
             WinInfoHelper.ShowInfoWindow(this, "请选择摄像头!");
             return;
         }
         if (_cameraChoice.Devices.Count == 0)
         {
             WinInfoHelper.ShowInfoWindow(this, "无摄像头!");
             return;
         }
         CloseView();
         cameraControl.SetCamera(_cameraChoice.Devices[cboCameraList.SelectedIndex].Mon, null);
         biOpenCamera.Text = "关闭摄像头";
     }
     catch (Exception ex)
     {
         WinInfoHelper.ShowInfoWindow(this, "打开相机异常:" + ex.Message);
         log.Error("打开相机异常:", ex);
     }
 }
Beispiel #8
0
 private bool CheckInput()
 {
     if (string.IsNullOrWhiteSpace(ipDevIp.Value))
     {
         WinInfoHelper.ShowInfoWindow(this, "人员设备IP地址不能为空!");
         ipDevIp.Focus();
         return(false);
     }
     if (string.IsNullOrWhiteSpace(tbDbName.Text))
     {
         WinInfoHelper.ShowInfoWindow(this, "数据库名称不能为空!");
         tbDbName.Focus();
         return(false);
     }
     if (string.IsNullOrWhiteSpace(tbDbUserName.Text))
     {
         WinInfoHelper.ShowInfoWindow(this, "数据库用户名不能为空!");
         tbDbUserName.Focus();
         return(false);
     }
     if (string.IsNullOrWhiteSpace(tbDbPassword.Text))
     {
         WinInfoHelper.ShowInfoWindow(this, "数据库密码不能为空!");
         tbDbPassword.Focus();
         return(false);
     }
     return(true);
 }
Beispiel #9
0
        public void AddRealAlarm(decimal alarmId)
        {
            string strSql = "select SAI.*,SDI.DOOR_NAME from SMT_ALARM_INFO SAI left join SMT_DOOR_INFO SDI on SAI.DOOR_ID=SDI.ID where SAI.ID=" + alarmId;

            strSql = "select ttt.*,SSI.REAL_NAME from (" + strSql + ") ttt left join SMT_STAFF_INFO SSI on ttt.STAFF_ID=SSI.ID";
            DataSet qds = Maticsoft.DBUtility.DbHelperSQL.Query(strSql);
            var     dt  = qds.Tables[0];
            Dictionary <decimal, DataRow> newids = new Dictionary <decimal, DataRow>();

            foreach (DataRow item in dt.Rows)
            {
                newids.Add((decimal)item["ID"], item);
            }
            if (newids.Count == 0)
            {
                return;
            }
            var    dr  = newids.Values.First();
            string str = dr["ALARM_NAME"] + ",门:" + dr["DOOR_NAME"] + ",卡号:" + dr["CARD_NO"] + ",姓名:" + dr["REAL_NAME"];

            WinInfoHelper.ShowInfoWindow(this, "发生新报警==>\r\n" + str);

            this.BeginInvoke(new Action(() =>
            {
                try
                {
                    DoShowGrid(newids);
                }
                catch (Exception ex)
                {
                    log.Error("显示报警错误:", ex);
                }
            }));
        }
Beispiel #10
0
 private void modelTree_AfterNodeSelect(object sender, AdvTreeNodeEventArgs e)
 {
     if (e.Node.Tag is Maticsoft.Model.SMT_VERMODEL_INFO)
     {
         Maticsoft.Model.SMT_VERMODEL_INFO model = e.Node.Tag as Maticsoft.Model.SMT_VERMODEL_INFO;
         if (model != null)
         {
             _lastSelectModel = model;
             ShowModelReportPreview(_lastSelectModel);
         }
     }
     else if (e.Node.Tag is FileInfo)//示例模板
     {
         try
         {
             var      dt = StaffDataHelper.GetTestReportDataTable();
             FileInfo fi = (FileInfo)e.Node.Tag;
             _report.Clear();
             _report.Load(fi.FullName);
             _report.RegisterData(dt, dt.TableName);
             _report.AutoFillDataSet = true;
             _report.Prepare();
             _report.ShowPrepared();
         }
         catch (Exception ex)
         {
             log.Error("预览示例模板异常:", ex);
             WinInfoHelper.ShowInfoWindow(this, "预览示例模板异常:" + ex.Message);
         }
     }
 }
Beispiel #11
0
        private void biDeleteModel_Click(object sender, EventArgs e)
        {
            var model = GetSelectModel();

            if (model == null)
            {
                WinInfoHelper.ShowInfoWindow(this, "请选择删除的模板!");
            }
            else
            {
                if (MessageBox.Show("确定删除“" + model.VERM_NAME + "”模板?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    CtrlWaiting waiting = new CtrlWaiting(() =>
                    {
                        try
                        {
                            Maticsoft.BLL.SMT_VERMODEL_INFO bll = new Maticsoft.BLL.SMT_VERMODEL_INFO();
                            bll.Delete(model.ID);
                            _lastSelectModel = null;
                            InternalInitTree();
                        }
                        catch (Exception ex)
                        {
                            log.Error("删除模板异常:" + ex.Message);
                            WinInfoHelper.ShowInfoWindow(this, "删除模板异常:" + ex.Message);
                        }
                    });
                    waiting.Show(this);
                }
            }
        }
Beispiel #12
0
        private void DoLoadByArea(List <Maticsoft.Model.SMT_CONTROLLER_ZONE> areas, string filter = null)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    string strWhere = "1=1";
                    if (areas != null && areas.Count > 0)
                    {
                        strWhere = "AREA_ID in (";
                        foreach (var item in areas)
                        {
                            strWhere += item.ID + ",";
                        }
                        strWhere  = strWhere.TrimEnd(',');
                        strWhere += ")";
                    }
                    List <Maticsoft.Model.SMT_FACERECG_DEVICE> ctrls = FaceRecgHelper.GetList(strWhere, true);//获取所有人脸设备
                    this.Invoke(new Action(() =>
                    {
                        ShowDevs(ctrls, filter);
                    }));
                }
                catch (System.Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载人脸识别设备异常:" + ex.Message);
                    log.Error("加载人脸识别设备异常:", ex);
                }
            });

            waiting.Show(this);
        }
Beispiel #13
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (dtpStart.Value >= dtpEnd.Value)
            {
                WinInfoHelper.ShowInfoWindow(this, "开始时间大于结束时间!");
                return;
            }
            string staffNo   = tbStaffNo.Text.Trim(); //证件号
            string staffName = tbName.Text.Trim();    //姓名
            string strWhere  = "";

            //ORG_ID in (35) and REAL_NAME like '%123%' and STAFF_NO like '%ee%' and DOOR_ID in (35)
            if (staffNo != "")
            {
                strWhere += "STAFF_NO like '%" + staffNo + "%'";
            }
            if (staffName != "")
            {
                if (strWhere != "")
                {
                    strWhere += " and ";
                }
                strWhere += "REAL_NAME like '%" + staffName + "%'";
            }

            if (strWhere != "")
            {
                strWhere += " and ";
            }
            strWhere += "RECORD_DATE >='" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss") + "' and RECORD_DATE <='" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'";
            pageDataGridView.Reset();
            pageDataGridView.SqlWhere = strWhere;
            DoSearch(true);
        }
Beispiel #14
0
 private void dgvDoorCamera_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == 2)
         {
             bool        enable  = (bool)dgvDoorCamera.Rows[e.RowIndex].Cells[2].Value;
             DoorCamera  dc      = (DoorCamera)dgvDoorCamera.Rows[e.RowIndex].Tag;
             CtrlWaiting waiting = new CtrlWaiting(() =>
             {
                 try
                 {
                     Maticsoft.BLL.SMT_DOOR_CAMERA dcBll     = new Maticsoft.BLL.SMT_DOOR_CAMERA();
                     Maticsoft.Model.SMT_DOOR_CAMERA dcModel = new Maticsoft.Model.SMT_DOOR_CAMERA()
                     {
                         DOOR_ID    = dc.DOOR_ID,
                         CAMERA_ID  = dc.CAMERA_ID,
                         ENABLE_CAP = !enable
                     };
                     dcBll.Update(dcModel);
                     this.Invoke(new Action(() =>
                     {
                         dgvDoorCamera.Rows[e.RowIndex].Cells[2].Value = dcModel.ENABLE_CAP;
                     }));
                 }
                 catch (System.Exception ex)
                 {
                     log.Error("更新门禁相机关系异常:", ex);
                     WinInfoHelper.ShowInfoWindow(this, "更新门禁相机关系异常:" + ex.Message);
                 }
             });
             waiting.Show(this);
         }
     }
 }
Beispiel #15
0
 private void biModify_Click(object sender, EventArgs e)
 {
     if (dgvData.SelectedRows.Count > 0)
     {
         DataGridViewRow    row    = dgvData.SelectedRows[0];
         FrmInOutTimeEditor editor = new FrmInOutTimeEditor((Maticsoft.Model.SMT_TIMESCALE_INFO)row.Tag);
         if (editor.ShowDialog(this) == DialogResult.OK)
         {
             var info = editor.TimeScaleInfo;
             row.Cells[0].Value  = info.TIME_NO;
             row.Cells[1].Value  = info.TIME_NAME;
             row.Cells[2].Value  = info.TIME_WEEK_DAY1;
             row.Cells[3].Value  = info.TIME_WEEK_DAY2;
             row.Cells[4].Value  = info.TIME_WEEK_DAY3;
             row.Cells[5].Value  = info.TIME_WEEK_DAY4;
             row.Cells[6].Value  = info.TIME_WEEK_DAY5;
             row.Cells[7].Value  = info.TIME_WEEK_DAY6;
             row.Cells[8].Value  = info.TIME_WEEK_DAY7;
             row.Cells[9].Value  = info.TIME_RANGE_START1;
             row.Cells[10].Value = info.TIME_RANGE_END1;
             row.Cells[11].Value = info.TIME_RANGE_START2;
             row.Cells[12].Value = info.TIME_RANGE_END2;
             row.Cells[13].Value = info.TIME_RANGE_START3;
             row.Cells[14].Value = info.TIME_RANGE_END3;
             row.Cells[15].Value = info.TIME_NEXT_NO;
             row.Cells[16].Value = info.TIME_DATE_START.Date.ToString("yyyy-MM-dd");
             row.Cells[17].Value = info.TIME_DATE_END.ToString("yyyy-MM-dd");
         }
     }
     else
     {
         WinInfoHelper.ShowInfoWindow(this, "请选择编辑对象!");
     }
 }
Beispiel #16
0
        private void DoSave()
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                decimal?old = _userInfo.ROLE_ID;
                try
                {
                    _userInfo.ROLE_ID = SELECT_ROLE.ID;
                    Maticsoft.BLL.SMT_USER_INFO userBll = new Maticsoft.BLL.SMT_USER_INFO();
                    userBll.Update(_userInfo);
                    SmtLog.InfoFormat("用户", "修改用户:{0},角色:{1}成功.", _userInfo.USER_NAME, _userInfo.ROLE_ID + ":" + SELECT_ROLE.ROLE_NAME);
                    this.Invoke(new Action(() =>
                    {
                        _userInfo.ROLE_NAME = SELECT_ROLE.ROLE_NAME + "(点击修改)";
                        this.DialogResult   = DialogResult.OK;
                        this.Close();
                    }));
                }
                catch (Exception ex)
                {
                    _userInfo.ROLE_ID = old;
                    WinInfoHelper.ShowInfoWindow(this, "保存失败:" + ex.Message);
                    log.Error("保存授权角色失败:", ex);
                }
            });

            waiting.Show(this);
        }
Beispiel #17
0
        private void Init()
        {
            this.dgvData.Rows.Clear();
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_TIMESCALE_INFO tsBll = new Maticsoft.BLL.SMT_TIMESCALE_INFO();
                    var models = tsBll.GetModelList("");
                    this.Invoke(new Action(() =>
                    {
                        foreach (var item in models)
                        {
                            AddData(item);
                        }
                    }));
                }
                catch (Exception ex)
                {
                    log.Error("加载列表异常:" + ex.Message);
                    WinInfoHelper.ShowInfoWindow(this, "加载列表异常:" + ex.Message);
                }
            });

            waiting.Show(this);
        }
Beispiel #18
0
 private void biAddSubDept_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.SMT_ORG_INFO orgInfo = GetSelectOrg();
     if (orgInfo == null)
     {
         WinInfoHelper.ShowInfoWindow(this, "请选择一个节点!");
         return;
     }
     else
     {
         FrmAddOrModifyDept frmDept = new FrmAddOrModifyDept(orgInfo.ID);
         if (frmDept.ShowDialog(this) == DialogResult.OK)
         {
             var node = DeptDataHelper.CreateNode(frmDept.OrgInfo, null);
             if (this.deptTree.Tree.SelectedNode == null)
             {
                 this.deptTree.Tree.Nodes.Add(node);
             }
             else
             {
                 this.deptTree.Tree.SelectedNode.Nodes.Add(node);
                 this.deptTree.Tree.SelectedNode.Expand();
             }
         }
     }
 }
Beispiel #19
0
 private void biSave_Click(object sender, EventArgs e)
 {
     if (picImage.Image == null)
     {
         WinInfoHelper.ShowInfoWindow(this, "未有选择图片可以保存!");
         return;
     }
     try
     {
         if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
         {
             if (saveFileDialog.FileName.EndsWith(".jpg", StringComparison.CurrentCultureIgnoreCase))
             {
                 picImage.Image.Save(saveFileDialog.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
             }
             else
             {
                 picImage.Image.Save(saveFileDialog.FileName, System.Drawing.Imaging.ImageFormat.Png);
             }
         }
     }
     catch (Exception ex)
     {
         WinInfoHelper.ShowInfoWindow(this, "保存异常!" + ex.Message);
         log.Error("保存图片异常:", ex);
         return;
     }
 }
Beispiel #20
0
        private void dgvRoleInfos_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                if (dgvRoleInfos.Columns[e.ColumnIndex].Name == "ColDelete")
                {
                    if (MessageBox.Show("确定删除选择角色?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        var orgInfo = GetSelectOrg();
                        Maticsoft.Model.SMT_ROLE_INFO role = (Maticsoft.Model.SMT_ROLE_INFO)dgvRoleInfos.Rows[e.RowIndex].Tag;

                        CtrlWaiting waiting = new CtrlWaiting(() =>
                        {
                            try
                            {
                                Maticsoft.DBUtility.DbHelperSQL.ExecuteSql("delete from SMT_ROLE_FUN  where FUN_ID=" + orgInfo.ID + " and ROLE_TYPE=2 and ROLE_ID=" + role.ID);
                                this.Invoke(new Action(() =>
                                {
                                    dgvRoleInfos.Rows.RemoveAt(e.RowIndex);
                                }));
                            }
                            catch (System.Exception ex)
                            {
                                WinInfoHelper.ShowInfoWindow(this, "删除角色异常:" + ex.Message);
                                log.Error("删除角色异常", ex);
                            }
                        });
                        waiting.Show(this);
                    }
                }
            }
        }
Beispiel #21
0
 private void DoModify()
 {
     if (dgvData.SelectedRows.Count > 0)
     {
         FrmCtrlTaskEditor taskEditor = new FrmCtrlTaskEditor((Maticsoft.Model.SMT_CTRLR_TASK)dgvData.SelectedRows[0].Tag);
         if (taskEditor.ShowDialog(this) == DialogResult.OK)
         {
             DataGridViewRow row  = dgvData.SelectedRows[0];
             var             info = taskEditor.Task;
             row.Cells[0].Value  = info.TASK_NO;
             row.Cells[1].Value  = info.TASK_NAME;
             row.Cells[2].Value  = info.VALID_STARTDATE.Date;
             row.Cells[3].Value  = info.VALID_ENDDATE.Date;
             row.Cells[4].Value  = info.ACTION_TIME;
             row.Cells[5].Value  = info.MON_STATE;
             row.Cells[6].Value  = info.TUE_STATE;
             row.Cells[7].Value  = info.THI_STATE;
             row.Cells[8].Value  = info.WES_STATE;
             row.Cells[9].Value  = info.FRI_STATE;
             row.Cells[10].Value = info.SAT_STATE;
             row.Cells[11].Value = info.SUN_STATE;
             row.Cells[12].Value = info.DOOR_NAMES;     //
             row.Cells[13].Value = info.STR_CTRL_STYLE; //
             row.Cells[14].Value = info.TASK_DESC;
         }
     }
     else
     {
         WinInfoHelper.ShowInfoWindow(this, "请选择一条任务修改!");
     }
 }
Beispiel #22
0
 private void dgvRoleInfos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         if (dgvRoleInfos.Columns[e.ColumnIndex].Name != "ColDelete")
         {
             Maticsoft.Model.SMT_ROLE_INFO role = (Maticsoft.Model.SMT_ROLE_INFO)dgvRoleInfos.Rows[e.RowIndex].Tag;
             CtrlWaiting waiting = new CtrlWaiting(() =>
             {
                 try
                 {
                     Maticsoft.BLL.SMT_USER_INFO userBll = new Maticsoft.BLL.SMT_USER_INFO();
                     var list = userBll.GetModelListByPageEx("ROLE_ID=" + role.ID + " and IS_DELETE=0 and IS_ENABLE=1", "USER_NAME", 0, 100);
                     this.Invoke(new Action(() =>
                     {
                         DoShowUsersToGrid2(list);
                     }));
                 }
                 catch (Exception ex)
                 {
                     WinInfoHelper.ShowInfoWindow(this, "加载权限操作人错误:" + ex.Message);
                     log.Error("加载权限操作人错误:", ex);
                 }
             });
             waiting.Show(dgvRoleInfos);
         }
     }
 }
Beispiel #23
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (tbRoleName.Text.Trim() == "")
     {
         WinInfoHelper.ShowInfoWindow(this, "角色名称不能为空!");
         return;
     }
     if (_selectRow != null && dgvData.Rows.Contains(_selectRow))
     {
         Maticsoft.Model.SMT_ROLE_INFO role = (Maticsoft.Model.SMT_ROLE_INFO)_selectRow.Tag;
         role.ROLE_NAME = tbRoleName.Text.Trim();
         role.ROLE_DESC = tbRoleDesc.Text.Trim();
         CtrlWaiting waiting = new CtrlWaiting(() =>
         {
             try
             {
                 Maticsoft.BLL.SMT_ROLE_INFO roleBll = new Maticsoft.BLL.SMT_ROLE_INFO();
                 roleBll.Update(role);
                 SmtLog.InfoFormat("用户", "更新角色:ID={0},名称={1}", role.ID, role.ROLE_NAME);
                 this.Invoke(new Action(() =>
                 {
                     _selectRow.Cells[0].Value = role.ROLE_NAME;
                     _selectRow.Cells[1].Value = role.ROLE_DESC;
                 }));
             }
             catch (Exception ex)
             {
                 log.Error("更新角色异常:", ex);
                 WinInfoHelper.ShowInfoWindow(this, "更新角色异常:" + ex.Message);
             }
         });
         waiting.Show(this);
     }
 }
Beispiel #24
0
 private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         if (dgvData.Columns[e.ColumnIndex].Name == "Col_ViewPic")
         {
             try
             {
                 DataRow row       = (DataRow)dgvData.Rows[e.RowIndex].Tag;
                 bool    hascamera = (row["FREC_VIDEO_IMAGE"] == null || row["FREC_VIDEO_IMAGE"] == DBNull.Value) ? false : true;
                 if (!hascamera)
                 {
                     return;
                 }
                 MemoryStream ms    = new MemoryStream((byte[])row["FREC_VIDEO_IMAGE"]);
                 Image        image = Image.FromStream(ms);
                 picView.SetImages(image);
                 picView.Visible = true;
             }
             catch (Exception ex)
             {
                 WinInfoHelper.ShowInfoWindow(this, "查看图片异常:" + ex.Message);
                 log.Error("查看图片异常:", ex);
             }
         }
     }
 }
Beispiel #25
0
        private void FrmSelectedUser_Load(object sender, EventArgs e)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_USER_INFO userBll = new Maticsoft.BLL.SMT_USER_INFO();
                    var models = userBll.GetModelList("IS_DELETE!=1");
                    this.Invoke(new Action(() =>
                    {
                        foreach (var item in models)
                        {
                            Node node = new Node(item.USER_NAME + "[" + item.REAL_NAME + "]");
                            node.Tag  = item;
                            advTree.Nodes[0].Nodes.Add(node);
                            if (_selectUserIds.Contains(item.ID))
                            {
                                node.Checked = true;
                            }
                        }
                        advTree.Nodes[0].ExpandAll();
                    }));
                }
                catch (System.Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载用户异常!" + ex.Message);
                }
            });

            waiting.Show(this);
        }
Beispiel #26
0
 private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         if (dgvData.Columns[e.ColumnIndex].Name == "ColDelete")
         {
             Maticsoft.Model.SMT_WEEKEX_INFO info = (Maticsoft.Model.SMT_WEEKEX_INFO)dgvData.Rows[e.RowIndex].Tag;
             if (MessageBox.Show("确定删除该假期约束?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 CtrlWaiting waiting = new CtrlWaiting(() =>
                 {
                     try
                     {
                         Maticsoft.BLL.SMT_WEEKEX_INFO wbll = new Maticsoft.BLL.SMT_WEEKEX_INFO();
                         wbll.Delete(info.ID);
                         SmtLog.InfoFormat("设置", "删除假期约束:{0},开始时间:{1},结束时间:{2},描述:{3}", info.WEEKEX_ON_DUTY ? "上班[允许开门]" : "假期[不能开门]", info.WEEKEX_START_DATE, info.WEEKEX_END_DATE, info.WEEKEX_DESC);
                         this.Invoke(new Action(() =>
                         {
                             dgvData.Rows.Remove(dgvData.Rows[e.RowIndex]);
                         }));
                     }
                     catch (System.Exception ex)
                     {
                         WinInfoHelper.ShowInfoWindow(this, "删除假期约束异常:" + ex.Message);
                         log.Error("删除假期约束异常:", ex);
                     }
                 });
                 waiting.Show(this);
             }
         }
     }
 }
Beispiel #27
0
        private void FaceBlackListMgr_Load(object sender, EventArgs e)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.IMS_FACE_BLACKLIST blBll = new Maticsoft.BLL.IMS_FACE_BLACKLIST();
                    var models = blBll.GetModelList("");
                    this.Invoke(new Action(() =>
                    {
                        listFaces.Items.Clear();
                        foreach (var item in models)
                        {
                            AddFace(item);
                        }
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载人脸黑名单异常:" + ex.Message);
                    log.Error("加载人脸黑名单异常", ex);
                }
            });

            waiting.Show(this);
        }
Beispiel #28
0
        private void Init()
        {
            mapCtrl.ClearDoors();
            modelTree.Nodes[0].Nodes.Clear();
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_MAP_INFO mapBll = new Maticsoft.BLL.SMT_MAP_INFO();
                    var maps = mapBll.GetModelListWithDoors("1=1");
                    this.Invoke(new Action(() =>
                    {
                        foreach (var item in maps)
                        {
                            AddTree(item);
                        }
                        modelTree.ExpandAll();
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载地图列表异常:" + ex.Message);
                    log.Error("加载地图列表异常:", ex);
                }
            });

            waiting.Show(this);
        }
Beispiel #29
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (dtpStart.Value >= dtpEnd.Value)
            {
                WinInfoHelper.ShowInfoWindow(this, "开始时间大于结束时间!");
                return;
            }
            string staffNo   = tbStaffNo.Text.Trim(); //证件号
            string staffName = tbName.Text.Trim();    //姓名
            string strWhere  = "ThroughTime>='" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss") + "' and ThroughTime<='" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'";


            if (!string.IsNullOrWhiteSpace(staffNo))
            {
                strWhere += " and STAFF_NO like '%" + staffNo + "%' ";
            }
            if (!string.IsNullOrWhiteSpace(staffName))
            {
                strWhere += " and REAL_NAME like '%" + staffName + "%' ";
            }

            pageDataGridView.Reset();
            pageDataGridView.SqlWhere = strWhere;
            DoSearch(true);
        }
Beispiel #30
0
        private void InitDoors()
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    var doors = DoorDataHelper.GetDoors();
                    Maticsoft.BLL.SMT_CARD_INFO cardBll = new Maticsoft.BLL.SMT_CARD_INFO();
                    _cards = cardBll.GetModelList("");
                    this.Invoke(new Action(() =>
                    {
                        AddDoorsToView(doors);
                    }));

                    var facedevs = FaceRecgHelper.GetList("");
                    this.Invoke(new Action(() =>
                    {
                        AddFaceDevsToView(facedevs);
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载门禁异常!" + ex.Message);
                    log.Error("加载门禁异常:", ex);
                }
            });

            waiting.Show(this, 200);
        }