Ejemplo n.º 1
0
 /// <summary>
 /// Sub Cards Checked Changed Event.
 /// </summary>
 private void SubCardCB_CheckedChanged(object sender, EventArgs e)
 {
     try {
         BindCardsToGridView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OutCardManagerForm.SubCardCB.CheckedChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Reset Password Checked Changed Event.
 /// </summary>
 private void UserPasswordCB_CheckedChanged(object sender, EventArgs e)
 {
     try {
         UserPasswordTB.Enabled = UserCPasswordTB.Enabled = UserPasswordCB.Checked;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SaveUserForm.UserPasswordCB.CheckedChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Changed an new image.
 /// </summary>
 private void codeImage_Click(object sender, EventArgs e)
 {
     try {
         generateCodeImage();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.LoginForm", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// OutEmployees TreeView AfterSelect Event.
 /// </summary>
 private void EmpTreeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     try {
         BindCardsToGridView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OutCardManagerForm.EmpTreeView.AfterSelect", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// QZ CheckBox CheckedChanged Event.
 /// </summary>
 private void QZCB_CheckedChanged(object sender, EventArgs e)
 {
     try {
         FilterNodes = null;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.QZCB.CheckedChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Begin Reason CheckBox SelectedIndex Changed Event.
 /// </summary>
 private void BeginReasonCB_SelectedIndexChanged(object sender, EventArgs e)
 {
     try {
         BeginReasonTB.Enabled = Convert.ToInt32(BeginReasonCB.SelectedValue) == 0;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SaveCardForm.BeginReasonCB.SelectedIndexChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Form Load Event.
 /// </summary>
 private void FinderDialog_Load(object sender, EventArgs e)
 {
     try {
         FindBtn.Enabled = !String.IsNullOrEmpty(FContentTB.Text);
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.FinderDialog.Load", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Alarm Menu Item Click Event.
 /// </summary>
 private void AlarmMenuItem1_Click(object sender, EventArgs e)
 {
     try {
         AlarmGridView.Invalidate(AlarmGridView.DisplayRectangle);
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.HisAlarmForm.AlarmMenuItem1.Click", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Combobox SelectedIndex Changed Event.
 /// </summary>
 private void DevNameCB_SelectedIndexChanged(object sender, EventArgs e)
 {
     try {
         BindNodeToCombobox();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.HisAlarmForm.DevNameCB.SelectedIndexChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Sign Cards Context Menu Opening Event.
 /// </summary>
 private void SignContextMenuStrip_Opening(object sender, CancelEventArgs e)
 {
     try {
         SignToolStripMenuItem1.Enabled = CardsGridView.SelectedRows.Count > 0;
         SignToolStripMenuItem2.Enabled = CardsGridView.Rows.Count > 0;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.BatchOrgCardsForm.SignContextMenuStrip.Opening", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Source TreeView3 AfterSelect Event.
 /// </summary>
 private void SourceTreeView3_AfterSelect(object sender, TreeViewEventArgs e)
 {
     try {
         var tag = (IDValuePair <Int32, String>)e.Node.Tag;
         CopyBtn3.Enabled = tag != null && tag.ID == 2;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.CopyAuthForm.SourceTreeView3.AfterSelect", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Form Load Event.
 /// </summary>
 private void DeviceForm_Load(object sender, EventArgs e)
 {
     try {
         //加载Combobox
         BindArea2ToCombobox();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.DeviceForm.Load", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Search Button Click Event.
 /// </summary>
 private void SearchBtn_Click(object sender, EventArgs e)
 {
     try {
         BindAuthToGridView();
         SaveBtn.Enabled = TotalRecords.Count > 0;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.BitchUpdateEndTimeForm.SearchBtn.Click", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Copy machine code to clipboard.
 /// </summary>
 private void copyBtn_Click(object sender, EventArgs e)
 {
     try {
         Clipboard.SetDataObject(machineCode.Text, true);
         MessageBox.Show("机器码已复制到剪贴板", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.RegisterForm", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// RadioButton Checked Changed Event.
 /// </summary>
 private void SHDRB_CheckedChanged()
 {
     try {
         SHDBeginDateDTP.Value = SHDEndDateDTP.Value = new DateTime(DateTime.Today.Year, 1, 1);
         SetSHDTimes();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SetLimitTimeForm.SHDRB.CheckedChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 18
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);
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Form Load Event.
 /// </summary>
 private void DepartmentManagerForm_Load(object sender, EventArgs e)
 {
     try {
         Departments = Common.CurUser.Role.Departments = new MemberShip().GetRoleDepartments(Common.CurUser.Role.RoleID);
         BindDepartmentsToTreeView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.DepartmentManagerForm.Load", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Set DefaultPhoto Click Event.
 /// </summary>
 private void SetDefaultPhotoBtn_Click(object sender, EventArgs e)
 {
     try {
         CurEmployee.Photo          = null;
         PhotoPanel.BackgroundImage = global::Delta.MPS.AccessSystem.Properties.Resources.DefaultEmployee;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SaveOrgEmployeeForm.SetDefaultPhotoBtn.Click", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Grid Manager Button Click Event.
 /// </summary>
 private void GridMgrBtn_Click(object sender, EventArgs e)
 {
     try {
         new GridManagerForm().ShowDialog(this);
         BindGridTreeView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.GridGroupForm.GridMgrBtn.Click", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Form Load Event.
 /// </summary>
 private void RoleManagerForm_Load(object sender, EventArgs e)
 {
     try {
         Roles.AddRange(MemberShipEntity.GetSubRoles(Common.CurUser.Role.RoleID));
         BindRolesToTreeView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.RoleManagerForm.Load", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Change User Password.
        /// </summary>
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            try {
                if (String.IsNullOrWhiteSpace(OriginalPasswordTB.Text))
                {
                    OriginalPasswordTB.Focus();
                    MessageBox.Show("原密码不能为空", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (String.IsNullOrWhiteSpace(NewPasswordTB.Text))
                {
                    NewPasswordTB.Focus();
                    MessageBox.Show("新密码不能为空", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!NewPasswordTB.Text.Equals(NewCPasswordTB.Text))
                {
                    NewPasswordTB.Focus();
                    MessageBox.Show("两次输入密码不一致", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (!MemberShipEntity.CheckPassword(Common.CurUser.Password, OriginalPasswordTB.Text, Common.CurUser.PasswordFormat, Common.CurUser.PasswordSalt))
                {
                    OriginalPasswordTB.Focus();
                    MessageBox.Show("原密码输入错误", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                var User = new UserInfo()
                {
                    UserID                  = Common.CurUser.UserID,
                    UserName                = Common.CurUser.UserName,
                    PasswordFormat          = Common.CurUser.PasswordFormat,
                    PasswordSalt            = MemberShipEntity.GenerateSalt(),
                    Password                = NewPasswordTB.Text.Trim(),
                    LastPasswordChangedDate = DateTime.Now
                };

                User.Password = MemberShipEntity.EncodePassword(User.Password, User.PasswordFormat, User.PasswordSalt);
                MemberShipEntity.ChangePassword(User);

                Common.CurUser.Password                = User.Password;
                Common.CurUser.PasswordSalt            = User.PasswordSalt;
                Common.CurUser.LastPasswordChangedDate = User.LastPasswordChangedDate;
                MessageBox.Show("密码修改完成,下次登录请使用新密码。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Common.WriteLog(DateTime.Now, EnmMsgType.Info, Common.CurUser.UserName, "Delta.MPS.AccessSystem.ChangePasswordForm.SaveBtn.Click", String.Format("用户[{0}]修改密码", User.UserName), null);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.ChangePasswordForm.SaveBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Copy Button1 Click Event.
        /// </summary>
        private void CopyBtn1_Click(object sender, EventArgs e)
        {
            try {
                var source = new List <Int32>();
                if (SourceTreeView1.SelectedNode != null)
                {
                    var tag = (IDValuePair <Int32, EnmNodeType>)SourceTreeView1.SelectedNode.Tag;
                    if (tag != null && tag.Value == EnmNodeType.Dev)
                    {
                        source.Add(tag.ID);
                    }
                }

                if (source.Count == 0)
                {
                    MessageBox.Show("请选择源授权设备", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                var target = new List <Int32>();
                CheckDevTreeView(TargetTreeView1.Nodes, target);
                if (target.Count == 0)
                {
                    MessageBox.Show("请勾选目的授权设备", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (MessageBox.Show(String.Format("源设备[{0}]权限将被复制,您确定要复制吗?", source[0]), "确认对话框", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    var result = Common.ShowWait(() => {
                        CardAuthEntity.CopyAuthByDev(source, target, DeleteOriAuthCB.Checked);
                    }, default(String), "正在复制,请稍后...", default(Int32), default(Int32));

                    if (result == DialogResult.OK)
                    {
                        foreach (var s in source)
                        {
                            foreach (var t in target)
                            {
                                Common.WriteLog(DateTime.Now, EnmMsgType.Authin, Common.CurUser.UserName, "Delta.MPS.AccessSystem.CopyAuthForm.CopyBtn1.Click", String.Format("权限复制:设备[{0}] --> 设备[{1}]", s, t), null);
                            }
                        }

                        MessageBox.Show("权限复制完成", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("权限复制失败", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.CopyAuthForm.CopyBtn1.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Add SHD Button Click Event.
        /// </summary>
        private void SHDAddBtn_Click(object sender, EventArgs e)
        {
            try {
                var startDate = SHDBeginDateDTP.Value;
                var endDate   = SHDEndDateDTP.Value;
                if (endDate < startDate)
                {
                    MessageBox.Show("开始日期必须小于或等于结束日期", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (endDate.Subtract(startDate).TotalDays >= 30)
                {
                    MessageBox.Show("节假日不能大于30天", "系统警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                while (startDate <= endDate)
                {
                    var date = startDate.ToString("MMdd");
                    if (!CurTimes.Any(t => t.LimitId == EnmLimitID.SHD && t.StartTime1.Equals(date)))
                    {
                        CurTimes.Add(new LimitTimeInfo()
                        {
                            ID         = 0,
                            DevId      = 0,
                            LimitId    = EnmLimitID.SHD,
                            LimitIndex = 0,
                            LimitDesc  = "节假日时段",
                            WeekIndex  = ComUtility.DefaultInt32,
                            StartTime1 = date,
                            EndTime1   = ComUtility.DefaultString,
                            StartTime2 = ComUtility.DefaultString,
                            EndTime2   = ComUtility.DefaultString,
                            StartTime3 = ComUtility.DefaultString,
                            EndTime3   = ComUtility.DefaultString,
                            StartTime4 = ComUtility.DefaultString,
                            EndTime4   = ComUtility.DefaultString,
                            StartTime5 = ComUtility.DefaultString,
                            EndTime5   = ComUtility.DefaultString,
                            StartTime6 = ComUtility.DefaultString,
                            EndTime6   = ComUtility.DefaultString,
                        });
                    }

                    startDate = startDate.AddDays(1);
                }

                SetSHDTimes();
                MessageBox.Show("节假日添加完成", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            } catch (Exception err) {
                Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SetLimitTimeForm.SHDAddBtn.Click", err.Message, err.StackTrace);
                MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Context Opening Event.
 /// </summary>
 private void OperationContext_Opening(object sender, CancelEventArgs e)
 {
     try {
         OpMenuItem1.Enabled = DeptGridView.SelectedRows.Count > 0;
         OpMenuItem2.Enabled = DeptGridView.Rows.Count > 0;
         OpMenuItem3.Enabled = GridDepartments.Count > 0;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.DepartmentManagerForm.OperationContext.Opening", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 27
0
 /// <summary>
 /// OrgEmployees TreeView AfterSelect Event.
 /// </summary>
 private void EmpTreeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     try {
         //AddBtn.Enabled = ((IDValuePair<Int32, String>)e.Node.Tag).ID == 1;
         SearchText.Clear();
         BindOutEmployeesToGridView();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OutEmployeeManagerForm.EmpTreeView.AfterSelect", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Parent Department Checked Changed Event.
 /// </summary>
 private void ParentDeptCB_CheckedChanged(object sender, EventArgs e)
 {
     try {
         LastDeptTB.Enabled = SetLastDeptBtn.Enabled = !ParentDeptCB.Checked;
         LastDeptTB.Clear();
         CurDept.LastDepId = String.Empty;
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SaveDepartmentForm.ParentDeptCB.CheckedChanged", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Form Shown Event.
 /// </summary>
 private void OrgEmployeeReportForm_Load(object sender, EventArgs e)
 {
     try {
         BindDeptToCombobox();
         BindQueryTypeToCombobox();
         BindCardTypeToCombobox();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.OrgEmployeeReportForm.Load", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 30
0
 /// <summary>
 /// The load event of this form.
 /// </summary>
 private void ParamForm_Load(object sender, EventArgs e)
 {
     try {
         registryEntity = new RegistryDatabase();
         BindDBTypeCombobox();
         BindDatasource();
     } catch (Exception err) {
         Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.ParamForm", err.Message, err.StackTrace);
         MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }