Exemplo n.º 1
0
        /// <summary>
        /// Export roles to excel.
        /// </summary>
        private void ExportBtn_Click(object sender, EventArgs e)
        {
            try {
                if (GridDepartments.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("部门编号", typeof(String));
                    data.Columns.Add("部门名称", typeof(String));
                    data.Columns.Add("备注", typeof(String));
                    data.Columns.Add("状态", typeof(String));
                    for (var i = 0; i < GridDepartments.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]   = i + 1;
                        dr["部门编号"] = GridDepartments[i].DepId;
                        dr["部门名称"] = GridDepartments[i].DepName;
                        dr["备注"]   = GridDepartments[i].Comment;
                        dr["状态"]   = GridDepartments[i].Enabled ? "启用" : "禁用";
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "部门信息", "智能门禁管理系统 系统部门报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.DepartmentManagerForm.ExportBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Export Data To Excel.
        /// </summary>
        private void ExportBtn_Click(object sender, EventArgs e)
        {
            try {
                if (CurStations.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("所属地区", typeof(String));
                    data.Columns.Add("所属县市", typeof(String));
                    data.Columns.Add("局站编号", typeof(String));
                    data.Columns.Add("局站名称", typeof(String));
                    data.Columns.Add("网格编号", typeof(String));
                    data.Columns.Add("网格名称", typeof(String));
                    for (var i = 0; i < CurStations.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]   = i + 1;
                        dr["所属地区"] = CurStations[i].Area2Name;
                        dr["所属县市"] = CurStations[i].Area3Name;
                        dr["局站编号"] = CurStations[i].StaID;
                        dr["局站名称"] = CurStations[i].StaName;
                        dr["网格编号"] = CurStations[i].NetGridID;
                        dr["网格名称"] = CurStations[i].NetGridName;
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "局站网格信息", String.Format("智能门禁管理系统 局站网格信息报表"), String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.GridGroupForm.ExportBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Export Data To Excel.
        /// </summary>
        private void ExportExcelBtn_Click(object sender, EventArgs e)
        {
            try {
                if (GridLogs.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("日志时间", typeof(String));
                    data.Columns.Add("日志类型", typeof(String));
                    data.Columns.Add("触发对象", typeof(String));
                    data.Columns.Add("触发来源", typeof(String));
                    data.Columns.Add("日志描述", typeof(String));
                    for (var i = 0; i < GridLogs.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]   = i + 1;
                        dr["日志时间"] = Common.GetDateTimeString(GridLogs[i].EventTime);
                        dr["日志类型"] = ComUtility.GetLogTypeText(GridLogs[i].EventType);
                        dr["触发对象"] = GridLogs[i].Operator;
                        dr["触发来源"] = GridLogs[i].Source;
                        dr["日志描述"] = GridLogs[i].Message;
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "系统日志", "智能门禁管理系统 系统日志报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.LogManagerForm.ExportBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Record Menu Item Click Event.
        /// </summary>
        private void RecMenuItem1_Click(object sender, EventArgs e)
        {
            try {
                var data   = new DataTable();
                var colors = new Dictionary <Int32, Excel.Color>();

                data.Columns.Add("序号", typeof(String));
                data.Columns.Add("地区", typeof(String));
                data.Columns.Add("县市", typeof(String));
                data.Columns.Add("局站", typeof(String));
                data.Columns.Add("设备编号", typeof(String));
                data.Columns.Add("设备名称", typeof(String));
                data.Columns.Add("授权卡片", typeof(String));
                for (var i = 0; i < CurDevices.Count; i++)
                {
                    var dr = data.NewRow();
                    dr["序号"]   = i + 1;
                    dr["地区"]   = CurDevices[i].ID.Area2Name;
                    dr["县市"]   = CurDevices[i].ID.Area3Name;
                    dr["局站"]   = CurDevices[i].ID.StaName;
                    dr["设备编号"] = CurDevices[i].ID.DevID.ToString();
                    dr["设备名称"] = CurDevices[i].ID.DevName;
                    dr["授权卡片"] = CurDevices[i].Value.ToString();
                    data.Rows.Add(dr);
                }

                Common.ExportDataToExcel(null, "设备信息", "智能门禁管理系统 设备信息报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data, colors);
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.DeviceForm.RecMenuItem1.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Menu Item Click Event.
        /// </summary>
        private void RecMenuItem1_Click(object sender, EventArgs e)
        {
            try {
                if (CurRecords.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("工号", typeof(String));
                    data.Columns.Add("姓名", typeof(String));
                    data.Columns.Add("性别", typeof(String));
                    data.Columns.Add("身份证号", typeof(String));
                    data.Columns.Add("身份证住址", typeof(String));
                    data.Columns.Add("身份证签发机关", typeof(String));
                    data.Columns.Add("籍贯", typeof(String));
                    data.Columns.Add("所属公司", typeof(String));
                    data.Columns.Add("所属项目", typeof(String));
                    data.Columns.Add("办公电话", typeof(String));
                    data.Columns.Add("手机", typeof(String));
                    data.Columns.Add("Email", typeof(String));
                    data.Columns.Add("责任人", typeof(String));
                    data.Columns.Add("所属部门", typeof(String));
                    data.Columns.Add("备注", typeof(String));
                    data.Columns.Add("状态", typeof(String));
                    data.Columns.Add("关联卡片", typeof(String));
                    data.Columns.Add("授权设备", typeof(String));
                    for (var i = 0; i < CurRecords.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]      = i + 1;
                        dr["工号"]      = CurRecords[i].Value1.EmpId;
                        dr["姓名"]      = CurRecords[i].Value1.EmpName;
                        dr["性别"]      = CurRecords[i].Value1.Sex.Equals("M", StringComparison.CurrentCultureIgnoreCase) ? "男" : "女";
                        dr["身份证号"]    = CurRecords[i].Value1.CardId;
                        dr["身份证住址"]   = CurRecords[i].Value1.CardAddress;
                        dr["身份证签发机关"] = CurRecords[i].Value1.CardIssue;
                        dr["籍贯"]      = CurRecords[i].Value1.Hometown;
                        dr["所属公司"]    = CurRecords[i].Value1.CompanyName;
                        dr["所属项目"]    = CurRecords[i].Value1.ProjectName;
                        dr["办公电话"]    = CurRecords[i].Value1.OfficePhone;
                        dr["手机"]      = CurRecords[i].Value1.MobilePhone;
                        dr["Email"]   = CurRecords[i].Value1.Email;
                        dr["责任人"]     = String.Format("{0} - {1}", CurRecords[i].Value1.ParentEmpId, CurRecords[i].Value1.ParentEmpName);
                        dr["所属部门"]    = String.Format("{0} - {1}", CurRecords[i].Value1.DepId, CurRecords[i].Value1.DepName);
                        dr["备注"]      = CurRecords[i].Value1.Comment;
                        dr["状态"]      = CurRecords[i].Value1.Enabled ? "启用" : "禁用";
                        dr["关联卡片"]    = CurRecords[i].Value2 != null ? CurRecords[i].Value2.CardSn : String.Empty;
                        dr["授权设备"]    = CurRecords[i].Value3.ToString();
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "外协人员信息", "智能门禁管理系统 外协人员信息报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OutEmployeeReportForm.ExportBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Export users to excel.
        /// </summary>
        private void ExportBtn_Click(object sender, EventArgs e)
        {
            try {
                if (GridUsers.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("用户标识", typeof(String));
                    data.Columns.Add("用户名称", typeof(String));
                    data.Columns.Add("备注名称", typeof(String));
                    data.Columns.Add("用户描述", typeof(String));
                    data.Columns.Add("所属角色", typeof(String));
                    data.Columns.Add("手机", typeof(String));
                    data.Columns.Add("Email", typeof(String));
                    data.Columns.Add("创建时间", typeof(String));
                    data.Columns.Add("有效日期", typeof(String));
                    data.Columns.Add("最后登录时间", typeof(String));
                    data.Columns.Add("修改密码时间", typeof(String));
                    if (Common.IsCheckFailedPasswordAttemptCount)
                    {
                        data.Columns.Add("锁定状态", typeof(String));
                        data.Columns.Add("锁定时间", typeof(String));
                    }
                    data.Columns.Add("状态", typeof(String));

                    for (var i = 0; i < GridUsers.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]     = i + 1;
                        dr["用户标识"]   = GridUsers[i].UserID.ToString().ToUpper();
                        dr["用户名称"]   = GridUsers[i].UserName;
                        dr["备注名称"]   = GridUsers[i].RemarkName;
                        dr["用户描述"]   = GridUsers[i].Comment;
                        dr["所属角色"]   = GridUsers[i].Role.RoleName;
                        dr["手机"]     = GridUsers[i].MobilePhone;
                        dr["Email"]  = GridUsers[i].Email;
                        dr["创建时间"]   = Common.GetDateTimeString(GridUsers[i].CreateDate);
                        dr["有效日期"]   = GridUsers[i].LimitDate.Equals(new DateTime(2099, 12, 31)) ? "永不过期" : Common.GetDateString(GridUsers[i].LimitDate);
                        dr["最后登录时间"] = Common.GetDateTimeString(GridUsers[i].LastLoginDate);
                        dr["修改密码时间"] = Common.GetDateTimeString(GridUsers[i].LastPasswordChangedDate);
                        if (Common.IsCheckFailedPasswordAttemptCount)
                        {
                            dr["锁定状态"] = GridUsers[i].IsLockedOut ? "锁定" : "正常";
                            dr["锁定时间"] = Common.GetDateTimeString(GridUsers[i].LastLockoutDate);
                        }
                        dr["状态"] = GridUsers[i].Enabled ? "启用" : "禁用";
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "用户信息", "智能门禁管理系统 系统用户报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.UserManagerForm", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Alarm Menu Item Click Event.
        /// </summary>
        private void AlarmMenuItem2_Click(object sender, EventArgs e)
        {
            try {
                var data   = new DataTable();
                var colors = new Dictionary <Int32, Excel.Color>();

                data.Columns.Add("序号", typeof(String));
                data.Columns.Add("告警标识", typeof(String));
                data.Columns.Add("所属地区", typeof(String));
                data.Columns.Add("所属县市", typeof(String));
                data.Columns.Add("所属局站", typeof(String));
                data.Columns.Add("所属设备", typeof(String));
                data.Columns.Add("测点编号", typeof(String));
                data.Columns.Add("测点名称", typeof(String));
                data.Columns.Add("告警描述", typeof(String));
                data.Columns.Add("告警级别", typeof(String));
                data.Columns.Add("告警时间", typeof(String));
                data.Columns.Add("结束时间", typeof(String));
                data.Columns.Add("告警历时", typeof(String));
                data.Columns.Add("处理标识", typeof(String));
                data.Columns.Add("处理时间", typeof(String));
                data.Columns.Add("处理人员", typeof(String));

                for (var i = 0; i < CurAlarms.Count; i++)
                {
                    var dr = data.NewRow();
                    dr["序号"]   = i + 1;
                    dr["告警标识"] = CurAlarms[i].SerialNO.ToString();
                    dr["所属地区"] = CurAlarms[i].Area2Name;
                    dr["所属县市"] = CurAlarms[i].Area3Name;
                    dr["所属局站"] = CurAlarms[i].StaName;
                    dr["所属设备"] = CurAlarms[i].DevName;
                    dr["测点编号"] = CurAlarms[i].NodeID.ToString();
                    dr["测点名称"] = CurAlarms[i].NodeName;
                    dr["告警描述"] = CurAlarms[i].AlarmDesc;
                    dr["告警级别"] = ((Int32)CurAlarms[i].AlarmLevel).ToString();
                    dr["告警时间"] = Common.GetDateTimeString(CurAlarms[i].StartTime);
                    dr["结束时间"] = Common.GetDateTimeString(CurAlarms[i].EndTime);
                    dr["告警历时"] = Common.GetTimeInterval(CurAlarms[i].StartTime, CurAlarms[i].EndTime);
                    dr["处理标识"] = Common.GetConfirmMarkingName(CurAlarms[i].ConfirmMarking);
                    dr["处理时间"] = Common.GetDateTimeString(CurAlarms[i].ConfirmTime);
                    dr["处理人员"] = CurAlarms[i].ConfirmName;
                    data.Rows.Add(dr);

                    if (AlarmMenuItem1.Checked)
                    {
                        colors[i] = Common.GetExcelAlarmColor(CurAlarms[i].AlarmLevel);
                    }
                }

                Common.ExportDataToExcel(null, "历史告警信息", "智能门禁管理系统 历史告警信息报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data, colors);
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.HisAlarmForm.AlarmMenuItem2.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Export Data Button Click Event.
 /// </summary>
 private void BExportBtn_Click(object sender, EventArgs e)
 {
     try {
         var data = new Employee().ExportOutEmployees(Common.CurUser.Role.RoleID);
         Common.ExportDataToExcel(null, "外协人员信息", "智能门禁管理系统 外协人员信息", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OrgEmployeeManagerForm.BExportBtn.Click", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// Record Menu Item Click Event.
        /// </summary>
        private void RecMenuItem1_Click(object sender, EventArgs e)
        {
            try {
                var data = new DataTable();
                data.Columns.Add("序号", typeof(String));
                data.Columns.Add("所属地区", typeof(String));
                data.Columns.Add("所属县市", typeof(String));
                data.Columns.Add("所属局站", typeof(String));
                data.Columns.Add("设备编号", typeof(String));
                data.Columns.Add("设备名称", typeof(String));
                data.Columns.Add("刷卡描述", typeof(String));
                data.Columns.Add("刷卡卡号", typeof(String));
                data.Columns.Add("刷卡时间", typeof(String));
                data.Columns.Add("刷卡人员", typeof(String));
                data.Columns.Add("人员类型", typeof(String));
                data.Columns.Add("所属部门", typeof(String));

                for (var i = 0; i < CurRecords.Count; i++)
                {
                    var dr = data.NewRow();
                    dr["序号"]   = i + 1;
                    dr["所属地区"] = CurRecords[i].Device.Area2Name;
                    dr["所属县市"] = CurRecords[i].Device.Area3Name;
                    dr["所属局站"] = CurRecords[i].Device.StaName;
                    dr["设备编号"] = CurRecords[i].Device.DevID.ToString();
                    dr["设备名称"] = CurRecords[i].Device.DevName;
                    dr["刷卡描述"] = CurRecords[i].Remark;
                    dr["刷卡卡号"] = CurRecords[i].CardSn;
                    dr["刷卡时间"] = Common.GetDateTimeString(CurRecords[i].CardTime);
                    dr["刷卡人员"] = CurRecords[i].Card != null?String.Format("{0} - {1}", CurRecords[i].Card.WorkerId, CurRecords[i].Card.WorkerName) : String.Empty;

                    dr["人员类型"] = CurRecords[i].Card != null?ComUtility.GetWorkerTypeText(CurRecords[i].Card.WorkerType) : String.Empty;

                    dr["所属部门"] = CurRecords[i].Card != null?String.Format("{0} - {1}", CurRecords[i].Card.DepId, CurRecords[i].Card.DepName) : String.Empty;

                    data.Rows.Add(dr);
                }

                Common.ExportDataToExcel(null, "刷卡记录", "智能门禁管理系统 刷卡记录报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.HisCardRecordsForm.RecMenuItem1.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Menu Item Click Event.
        /// </summary>
        private void RecMenuItem1_Click(object sender, EventArgs e)
        {
            try {
                if (CurRecords.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("工号", typeof(String));
                    data.Columns.Add("姓名", typeof(String));
                    data.Columns.Add("部门", typeof(String));
                    data.Columns.Add("卡号", typeof(String));
                    data.Columns.Add("开始日期", typeof(String));
                    data.Columns.Add("结束日期", typeof(String));
                    data.Columns.Add("权限类型", typeof(String));
                    data.Columns.Add("权限分组", typeof(String));
                    data.Columns.Add("状态", typeof(String));

                    for (var i = 0; i < CurRecords.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"] = i + 1;
                        dr["工号"] = CurRecords[i].ID != null ? CurRecords[i].ID.WorkerId : String.Empty;
                        dr["姓名"] = CurRecords[i].ID != null ? CurRecords[i].ID.WorkerName : String.Empty;
                        dr["部门"] = CurRecords[i].ID != null?String.Format("{0} - {1}", CurRecords[i].ID.DepId, CurRecords[i].ID.DepName) : String.Empty;

                        dr["卡号"]   = CurRecords[i].Value.CardSn;
                        dr["开始日期"] = Common.GetDateString(CurRecords[i].Value.BeginTime);
                        dr["结束日期"] = Common.GetDateString(CurRecords[i].Value.EndTime);
                        dr["权限类型"] = ComUtility.GetLimitIDText(CurRecords[i].Value.LimitId);
                        dr["权限分组"] = CurRecords[i].Value.LimitIndex == ComUtility.DefaultInt32 ? String.Empty : CurRecords[i].Value.LimitIndex.ToString();
                        dr["状态"]   = CurRecords[i].Value.Enabled ? "启用" : "禁用";
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "设备授权信息", "智能门禁管理系统 设备授权信息报表", String.Format("操作员:{0}{1}  日期:{2} 设备:{3} - {4}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now), CurDevice.DevID, String.Format("{0}>{1}>{2}>{3}", CurDevice.Area2Name, CurDevice.Area3Name, CurDevice.StaName, CurDevice.DevName)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.CardAuthDetailDialog.RecMenuItem1.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Export All Cards To Excel.
        /// </summary>
        private void ExportBtn_Click(object sender, EventArgs e)
        {
            try {
                if (GridCards.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("持卡人", typeof(String));
                    data.Columns.Add("卡号", typeof(String));
                    data.Columns.Add("所属部门", typeof(String));
                    data.Columns.Add("卡片类型", typeof(String));
                    data.Columns.Add("发卡时间", typeof(String));
                    data.Columns.Add("发卡原因", typeof(String));
                    data.Columns.Add("备注", typeof(String));
                    data.Columns.Add("状态", typeof(String));
                    for (var i = 0; i < GridCards.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]   = i + 1;
                        dr["持卡人"]  = String.Format("{0} - {1}", GridCards[i].WorkerId, GridCards[i].WorkerName);
                        dr["卡号"]   = GridCards[i].CardSn;
                        dr["所属部门"] = String.Format("{0} - {1}", GridCards[i].DepId, GridCards[i].DepName);
                        dr["卡片类型"] = ComUtility.GetCardTypeText(GridCards[i].CardType);
                        dr["发卡时间"] = Common.GetDateTimeString(GridCards[i].BeginTime);
                        dr["发卡原因"] = GridCards[i].BeginReason;
                        dr["备注"]   = GridCards[i].Comment;
                        dr["状态"]   = GridCards[i].Enabled ? "启用" : "禁用";
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "员工卡片信息", "智能门禁管理系统 员工卡片信息报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OrgCardManagerForm.ExportBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Menu Item Click Event.
        /// </summary>
        private void RecMenuItem1_Click(object sender, EventArgs e)
        {
            try {
                if (CurRecords.Count > 0)
                {
                    var data = new DataTable();
                    data.Columns.Add("序号", typeof(String));
                    data.Columns.Add("工号", typeof(String));
                    data.Columns.Add("姓名", typeof(String));
                    data.Columns.Add("类别", typeof(String));
                    data.Columns.Add("英文名", typeof(String));
                    data.Columns.Add("性别", typeof(String));
                    data.Columns.Add("身份证号", typeof(String));
                    data.Columns.Add("籍贯", typeof(String));
                    data.Columns.Add("出生日期", typeof(String));
                    data.Columns.Add("婚姻状况", typeof(String));
                    data.Columns.Add("家庭地址", typeof(String));
                    data.Columns.Add("家庭电话", typeof(String));
                    data.Columns.Add("入职日期", typeof(String));
                    data.Columns.Add("转正日期", typeof(String));
                    data.Columns.Add("部门名称", typeof(String));
                    data.Columns.Add("职务", typeof(String));
                    data.Columns.Add("办公电话", typeof(String));
                    data.Columns.Add("手机", typeof(String));
                    data.Columns.Add("Email", typeof(String));
                    data.Columns.Add("备注", typeof(String));
                    data.Columns.Add("状态", typeof(String));
                    data.Columns.Add("离职日期", typeof(String));
                    data.Columns.Add("离职原因", typeof(String));
                    data.Columns.Add("关联卡片", typeof(String));
                    data.Columns.Add("授权设备", typeof(String));
                    for (var i = 0; i < CurRecords.Count; i++)
                    {
                        var dr = data.NewRow();
                        dr["序号"]    = i + 1;
                        dr["工号"]    = CurRecords[i].Value1.EmpId;
                        dr["姓名"]    = CurRecords[i].Value1.EmpName;
                        dr["类别"]    = ComUtility.GetWorkerTypeText(CurRecords[i].Value1.EmpType);
                        dr["英文名"]   = CurRecords[i].Value1.EnglishName;
                        dr["性别"]    = CurRecords[i].Value1.Sex.Equals("M", StringComparison.CurrentCultureIgnoreCase) ? "男" : "女";
                        dr["身份证号"]  = CurRecords[i].Value1.CardId;
                        dr["籍贯"]    = CurRecords[i].Value1.Hometown;
                        dr["出生日期"]  = Common.GetDateString(CurRecords[i].Value1.BirthDay);
                        dr["婚姻状况"]  = ComUtility.GetMarriageTypeText(CurRecords[i].Value1.Marriage);
                        dr["家庭地址"]  = CurRecords[i].Value1.HomeAddress;
                        dr["家庭电话"]  = CurRecords[i].Value1.HomePhone;
                        dr["入职日期"]  = Common.GetDateString(CurRecords[i].Value1.EntryDay);
                        dr["转正日期"]  = Common.GetDateString(CurRecords[i].Value1.PositiveDay);
                        dr["部门名称"]  = String.Format("{0} - {1}", CurRecords[i].Value1.DepId, CurRecords[i].Value1.DepName);
                        dr["职务"]    = CurRecords[i].Value1.DutyName;
                        dr["办公电话"]  = CurRecords[i].Value1.OfficePhone;
                        dr["手机"]    = CurRecords[i].Value1.MobilePhone;
                        dr["Email"] = CurRecords[i].Value1.Email;
                        dr["备注"]    = CurRecords[i].Value1.Comment;
                        dr["状态"]    = CurRecords[i].Value1.Enabled ? "在职" : "离职";
                        dr["离职日期"]  = Common.GetDateString(CurRecords[i].Value1.ResignationDate);
                        dr["离职原因"]  = CurRecords[i].Value1.ResignationRemark;
                        dr["关联卡片"]  = CurRecords[i].Value2 != null ? CurRecords[i].Value2.CardSn : String.Empty;
                        dr["授权设备"]  = CurRecords[i].Value3.ToString();
                        data.Rows.Add(dr);
                    }

                    Common.ExportDataToExcel(null, "员工信息", "智能门禁管理系统 员工信息报表", String.Format("操作员:{0}{1}  日期:{2}", Common.CurUser.UserName, String.IsNullOrWhiteSpace(Common.CurUser.RemarkName) ? String.Empty : String.Format("({0})", Common.CurUser.RemarkName), Common.GetDateTimeString(DateTime.Now)), data);
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OrgEmployeeReportForm.RecMenuItem1.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }