コード例 #1
0
        /// <summary>
        /// 最终审批通过
        /// </summary>
        /// <returns></returns>
        private bool AuditPass()
        {
            int returnValue = 0;

            // 是否单个发送?
            if (!string.IsNullOrEmpty(this.CurrentWorkFlowId))
            {
                this.CurrentWorkFlowIds = new string[] { this.CurrentWorkFlowId };
            }
            returnValue += DotNetService.Instance.WorkFlowCurrentService.AuditPass(this.UserInfo, this.CurrentWorkFlowIds, this.txtAuditIdea.Text);

            if (returnValue > 0)
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 更新成功,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0247, returnValue.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 更新成功,进行提示
                    MessageBox.Show(AppMessage.MSG0248, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            // 控件状态
            // this.txtAuditIdea.Enabled = false;
            // this.btnAuditReject.Enabled = false;
            // this.txtFullName.Enabled = false;

            return(returnValue > 0);
        }
コード例 #2
0
ファイル: FrmConfig.cs プロジェクト: windygu/DotNet_Auth
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        public override bool CheckInput()
        {
            if (this.txtCustomerCompanyName.Text.Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG0286), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtCustomerCompanyName.Focus();
                return(false);
            }
            // 是否没有输入用户名
            if (this.txtUser.Text.Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtUser.Focus();
                return(false);
            }
            // 密码强度检查
            if (BaseSystemInfo.CheckPasswordStrength)
            {
                if (this.txtClientPassword.Text.Length == 0)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9964), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtClientPassword.Focus();
                    return(false);
                }
            }

            return(true);
        }
コード例 #3
0
 /// <summary>
 /// 检查输入的有效性
 /// </summary>
 public override bool CheckInput()
 {
     // 允许登录次数已经到了
     if (this.LogOnCount == this.AllowLogOnCount)
     {
         this.txtPassword.Clear();
         this.txtUserName.Enabled = false;
         this.txtPassword.Enabled = false;
         this.btnConfirm.Enabled  = false;
         return(false);
     }
     // 是否没有输入用户名
     if (this.txtUserName.Text.Length == 0)
     {
         MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.txtUserName.Focus();
         return(false);
     }
     // 密码强度检查
     if (BaseSystemInfo.CheckPasswordStrength)
     {
         if (this.txtPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9964), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtPassword.Focus();
             return(false);
         }
     }
     this.btnConfirm.Focus();
     return(true);
 }
コード例 #4
0
        /// <summary>
        /// 申请帐号
        /// </summary>
        /// <returns>保存成功</returns>
        private bool UserAddToOrganize()
        {
            bool   returnValue   = false;
            string statusCode    = string.Empty;
            string statusMessage = string.Empty;
            BaseUserOrganizeEntity userOrganizeEntity = this.GetEntity();

            this.EntityId = DotNetService.Instance.UserService.AddUserToOrganize(this.UserInfo, userOrganizeEntity, out statusCode, out statusMessage);
            if (statusCode == StatusCode.OKAdd.ToString())
            {
                // 没审核通过的,才可以有提示信息
                if (BaseSystemInfo.ShowInformation && !this.chbEnabled.Checked)
                {
                    // 这里应该判断,申请帐号是否需要进行审核,若需要审核提示等待审核,否则直接提示成功信息。
                    // 添加成功,进行提示
                    MessageBox.Show(AppMessage.MSG0235, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                returnValue       = true;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                // 是否用户-组织机构重复了,提高友善性
                if (statusCode == StatusCode.Exist.ToString())
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0008, AppMessage.MSG9971), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(returnValue);
        }
コード例 #5
0
        /// <summary>
        /// 撤消审批流程中的单据
        /// </summary>
        /// <returns></returns>
        private bool AuditQuash()
        {
            int returnValue = 0;

            // 是否单个发送?
            if (!string.IsNullOrEmpty(this.CurrentWorkFlowId))
            {
                this.CurrentWorkFlowIds = new string[] { this.CurrentWorkFlowId };
            }
            // 按多个发送来处理
            for (int i = 0; i < this.CurrentWorkFlowIds.Length; i++)
            {
                returnValue += DotNetService.Instance.WorkFlowCurrentService.AuditQuash(this.UserInfo, this.CurrentWorkFlowIds, this.txtAuditIdea.Text);
            }
            if (returnValue > 0)
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 更新成功,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0272, returnValue.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 更新成功,进行提示
                    MessageBox.Show(AppMessage.MSG0273, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(returnValue > 0);
        }
コード例 #6
0
 /// <summary>
 /// 允许登录次数已经到了
 /// </summary>
 /// <returns>继续允许输入</returns>
 private bool CheckAllowLogOnCount()
 {
     if (this.LogOnCount >= BaseSystemInfo.PasswordErrowLockLimit)
     {
         // 控件重新设置状态
         this.txtPassword.Clear();
         this.txtUser.Enabled     = false;
         this.txtPassword.Enabled = false;
         this.btnConfirm.Enabled  = false;
         // 若是强类型的密码管理
         if (BaseSystemInfo.CheckPasswordStrength)
         {
             // 防止被黑客攻击,帐户被锁定 15分钟后才可以用
             string        userName      = this.txtUser.Text;
             DotNetService dotNetService = new DotNetService();
             dotNetService.LogOnService.LockUser(UserInfo, userName);
             if (dotNetService.LogOnService is ICommunicationObject)
             {
                 ((ICommunicationObject)dotNetService.LogOnService).Close();
             }
             // 提示帐户被锁定
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0400, BaseSystemInfo.LockUserPasswordError.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
         else
         {
             // 进行提示信息,不能再输入了,已经错误N次了。
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0211, BaseSystemInfo.PasswordErrowLockLimit.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
         return(false);
     }
     return(true);
 }
コード例 #7
0
 /// <summary>
 /// 加查输入的有效性
 /// </summary>
 public override bool CheckInput()
 {
     // 密码强度检查
     if (BaseSystemInfo.CheckPasswordStrength)
     {
         // 新密码为空
         if (this.txtNewPassword.Text.Length == 0)
         {
             // 判断是否为确认按钮
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9959), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtNewPassword.Focus();
             return(false);
         }
         // 确认密码为空
         if (this.txtConfirmPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9960), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtConfirmPassword.Focus();
             return(false);
         }
     }
     // 新密码不一致
     if (this.txtNewPassword.Text != this.txtConfirmPassword.Text)
     {
         MessageBox.Show(AppMessage.Format(AppMessage.MSG0039, AppMessage.MSG9959, AppMessage.MSG9960), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.ClearPassword();
         return(false);
     }
     return(true);
 }
コード例 #8
0
        private bool GetByUserName()
        {
            if (string.IsNullOrEmpty(this.txtUserName.Text))
            {
                return(false);
            }

            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();

            parameters.Add(new KeyValuePair <string, object>(BaseUserEntity.FieldUserName, this.txtUserName.Text));
            parameters.Add(new KeyValuePair <string, object>(BaseUserEntity.FieldDeletionStateCode, 0));

            bool exists = DotNetService.Instance.UserService.Exists(this.UserInfo, parameters);

            if (exists)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0008, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtUserName.SelectAll();
                this.txtUserName.Focus();
                return(false);
            }
            if (this.rbtnDefaultPassword.Checked)
            {
                this.txtPassword.Text        = BaseSystemInfo.DefaultPassword;
                this.txtConfirmPassword.Text = BaseSystemInfo.DefaultPassword;
            }
            else if (this.rbtnUserNamePassword.Checked)
            {
                this.txtPassword.Text        = this.txtUserName.Text;
                this.txtConfirmPassword.Text = this.txtUserName.Text;
            }
            return(true);
        }
コード例 #9
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdUserOrganize, "colSelected"))
     {
         if (MessageBox.Show(AppMessage.MSG0075, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
         {
             // 设置鼠标繁忙状态,并保留原先的状态
             Cursor holdCursor = this.Cursor;
             this.Cursor = Cursors.WaitCursor;
             try
             {
                 int returnValue = this.BatchRemove();
                 // 重新加载数据,先刷新屏幕,再显示提示信息
                 this.GetUserOrganizeList();
                 this.SetControlState();
                 // 是否需要有提示信息?
                 if (BaseSystemInfo.ShowInformation)
                 {
                     // 批量保存,进行提示
                     MessageBox.Show(AppMessage.Format(AppMessage.MSG0077, returnValue.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             catch (Exception ex)
             {
                 this.ProcessException(ex);
             }
             finally
             {
                 // 设置鼠标默认状态,原来的光标状态
                 this.Cursor = holdCursor;
             }
         }
     }
 }
コード例 #10
0
ファイル: UCWorkFlow.cs プロジェクト: DreamALittle/C-AccMVC
        /// <summary>
        /// 撤回
        /// </summary>
        /// <returns></returns>
        private bool AuditQuash()
        {
            // 返回值
            bool returnValue = false;
            int  result      = 0;

            result = DotNetService.Instance.WorkFlowCurrentService.AuditQuash(this.UserInfo, this.WorkFlowIds, this.txtAuditIdea.Text);
            if (result > 0)
            {
                // 是否显示信息
                if (BaseSystemInfo.ShowInformation)
                {
                    // 转发成功,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0272, result.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                returnValue = true;
            }
            else
            {
                // 是否显示信息
                if (BaseSystemInfo.ShowInformation)
                {
                    // 审核失败,进行提示
                    MessageBox.Show(AppMessage.MSG0273, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            // 返回
            return(returnValue);
        }
コード例 #11
0
ファイル: UCWorkFlow.cs プロジェクト: DreamALittle/C-AccMVC
        /// <summary>
        /// 退回
        /// </summary>
        /// <returns></returns>
        private bool AuditReject()
        {
            // 返回值
            bool returnValue = false;
            // 定义返回结果
            int result = 0;

            // 获取退回结果
            result = DotNetService.Instance.WorkFlowCurrentService.AuditReject(this.UserInfo, this.WorkFlowIds, this.txtAuditIdea.Text);
            // 执行成功
            if (result > 0)
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 审核成功,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0292, result.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                returnValue = true;
            }
            else
            {
                if (BaseSystemInfo.ShowInformation)
                {
                    // 审核失败,进行提示
                    MessageBox.Show(AppMessage.MSG0293, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(returnValue);
        }
コード例 #12
0
        /// <summary>
        /// 申请帐号
        /// </summary>
        /// <returns>保存成功</returns>
        private bool RequestAnAccount()
        {
            bool           returnValue   = false;
            string         statusCode    = string.Empty;
            string         statusMessage = string.Empty;
            BaseUserEntity userEntity    = this.GetUserEntity();

            this.EntityId = DotNetService.Instance.UserService.AddUser(this.UserInfo, userEntity, out statusCode, out statusMessage);
            if (statusCode == StatusCode.OKAdd.ToString())
            {
                //如果是内部员工,则新建员工记录
                if (this.chkIsStaff.Checked)
                {
                    string          statusCodeStaff    = string.Empty;
                    string          statusMessageStaff = string.Empty;
                    BaseStaffEntity stffEntity         = this.GetStaffEntity();
                    DotNetService.Instance.StaffService.AddStaff(this.UserInfo, stffEntity, out statusCodeStaff, out statusMessageStaff);
                    if (statusCodeStaff != StatusCode.OKAdd.ToString())
                    {
                        // 是否用户名重复了,提高友善性
                        if (statusCodeStaff == StatusCode.ErrorUserExist.ToString())
                        {
                            this.txtUserName.SelectAll();
                            this.txtUserName.Focus();
                        }
                        else if (statusCodeStaff == StatusCode.ErrorUserExist.ToString())
                        {
                            this.txtCode.SelectAll();
                            this.txtCode.Focus();
                        }
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0008, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                // 没审核通过的,才可以有提示信息
                if (BaseSystemInfo.ShowInformation && !this.chkEnabled.Checked)
                {
                    // 这里应该判断,申请帐号是否需要进行审核,若需要审核提示等待审核,否则直接提示成功信息。
                    // 添加成功,进行提示
                    MessageBox.Show(AppMessage.MSG0235, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                returnValue = true;
            }
            else
            {
                // 是否用户名重复了,提高友善性
                if (statusCode == StatusCode.ErrorUserExist.ToString())
                {
                    this.txtUserName.SelectAll();
                    this.txtUserName.Focus();
                }
                else if (statusCode == StatusCode.ErrorUserExist.ToString())
                {
                    this.txtCode.SelectAll();
                    this.txtCode.Focus();
                }
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0008, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(returnValue);
        }
コード例 #13
0
ファイル: FrmRoleAdmin.cs プロジェクト: windygu/DotNet_Auth
        /// <summary>
        /// 删除数据
        /// </summary>
        public int Delete()
        {
            int returnValue = 0;

            // 检查至少要选择一个?
            if (!BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdRole, "colSelected"))
            {
                return(returnValue);
            }
            // 检查是否有不允许删除的数据?
            if (!this.CheckInput())
            {
                return(returnValue);
            }
            // 是否确认删除了?
            if (MessageBox.Show(AppMessage.MSG0015, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.OK)
            {
                return(returnValue);
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                this.btnBatchDelete.Enabled = false;

                switch (BaseSystemInfo.UserCenterDbType)
                {
                case DbTypes.Access:
                    // Access 中的特殊处理
                    returnValue = this.OverDelete();;
                    break;

                default:
                    returnValue = this.BatchDelete();
                    break;
                }

                // 重新加载数据,先刷新屏幕,再显示提示信息
                this.FormOnLoad(false);
                // 是否需要有提示信息?
                if (BaseSystemInfo.ShowInformation)
                {
                    // 批量保存,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0077, returnValue.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
            return(returnValue);
        }
コード例 #14
0
        /// <summary>
        /// 更新帐号
        /// </summary>
        /// <returns>保存成功</returns>
        private bool SaveAccount()
        {
            int    returnValue   = 0;
            string statusCode    = string.Empty;
            string statusMessage = string.Empty;
            //1.先更新用户信息
            BaseUserEntity userEntity = this.GetEntity();

            returnValue = DotNetService.Instance.UserService.UpdateUser(this.UserInfo, userEntity, out statusCode, out statusMessage);
            if (statusCode == StatusCode.OKUpdate.ToString())
            {
                //2.如果更新用户成功,则更新对应的员工
                this.GetStaffEntity();
                if (this.staffEntity.Id != null && this.staffEntity.Id > 0)
                {
                    DotNetService.Instance.StaffService.UpdateStaff(UserInfo, this.staffEntity, out statusCode, out statusMessage);
                    if (statusCode != StatusCode.OKUpdate.ToString())
                    {
                        MessageBox.Show(statusMessage, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        // 是否编号重复了,提高友善性
                        if (statusCode == StatusCode.ErrorCodeExist.ToString())
                        {
                            this.txtCode.SelectAll();
                            this.txtCode.Focus();
                        }
                        if (statusCode == StatusCode.ErrorUserExist.ToString())
                        {
                            this.txtUserName.SelectAll();
                            this.txtUserName.Focus();
                        }
                        return(returnValue < 0);
                    }
                }
                // 没审核通过的,才可以有提示信息
                if (BaseSystemInfo.ShowInformation && !this.chbEnabled.Checked)
                {
                    // 这里应该判断,申请帐号是否需要进行审核,若需要审核提示等待审核,否则直接提示成功信息。
                    // 添加成功,进行提示
                    MessageBox.Show(AppMessage.MSG0230, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                // 是否用户名重复了,提高友善性
                if (statusCode == StatusCode.ErrorUserExist.ToString())
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0008, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtUserName.SelectAll();
                    this.txtUserName.Focus();
                }
                else
                {
                    MessageBox.Show(statusMessage, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                return(returnValue < 0);
            }
            return(returnValue > 0);
        }
コード例 #15
0
 private void btnDeleteStaffUser_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(AppMessage.Format(AppMessage.MSG0016, AppMessage.MSG9914), AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
     {
         DotNetService.Instance.StaffService.DeleteUser(UserInfo, this.StaffId);
         // 加载窗体
         this.OnLoad(e);
     }
 }
コード例 #16
0
 /// <summary>
 /// 加查输入的有效性
 /// </summary>
 public override bool CheckInput()
 {
     // 密码强度检查
     if (BaseSystemInfo.CheckPasswordStrength)
     {
         // 原密码为空
         if (this.txtOldPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9961), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtOldPassword.Focus();
             return(false);
         }
         // 新密码为空
         if (this.txtNewPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9959), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtNewPassword.Focus();
             return(false);
         }
         // 确认密码为空
         if (this.txtConfirmPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9960), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtConfirmPassword.Focus();
             return(false);
         }
         if (!BaseCheckInput.CheckPasswordStrength(this.txtNewPassword))
         {
             return(false);
         }
     }
     // 新密码不一致
     if (this.txtConfirmPassword.Text != this.txtNewPassword.Text)
     {
         MessageBox.Show(AppMessage.Format(AppMessage.MSG0039, AppMessage.MSG9959, AppMessage.MSG9960), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.ClearNewPassword();
         return(false);
     }
     if (this.txtDigitalSignature.Text.Length == 0)
     {
         MessageBox.Show("请选择签名密钥文件存放位置。", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.btnSelectDigitalSignature.Focus();
         return(false);
     }
     else
     {
         if (!System.IO.File.Exists(this.txtDigitalSignature.Text))
         {
             this.txtDigitalSignature.Text = string.Empty;
             MessageBox.Show("请选择签名密钥文件存放位置。", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.btnSelectDigitalSignature.Focus();
             return(false);
         }
     }
     return(true);
 }
コード例 #17
0
ファイル: FrmUserEdit.cs プロジェクト: windygu/DotNet_Auth
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns>有效</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            this.txtUserName.Text = this.txtUserName.Text.TrimEnd();
            if (this.txtUserName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9978), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtUserName.Focus();
                return(false);
            }
            // 这里需要检查系统设置的用户名长度限制
            if (BaseSystemInfo.CheckPasswordStrength && BaseSystemInfo.AccountMinimumLength > 0)
            {
                if (this.txtUserName.Text.Trim().Length < BaseSystemInfo.AccountMinimumLength)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0026, AppMessage.MSG9957, BaseSystemInfo.AccountMinimumLength.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtUserName.Focus();
                    return(false);
                }
            }
            this.txtRealName.Text = this.txtRealName.Text.TrimEnd();
            if (this.txtRealName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG0233), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtRealName.Focus();
                return(false);
            }
            if (this.dtpAllowStartTime.Checked)
            {
                this.dtpAllowStartTime.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, this.dtpAllowStartTime.Value.Hour, this.dtpAllowStartTime.Value.Minute, this.dtpAllowStartTime.Value.Second);
            }
            if (this.dtpAllowEndTime.Checked)
            {
                this.dtpAllowEndTime.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, this.dtpAllowEndTime.Value.Hour, this.dtpAllowEndTime.Value.Minute, this.dtpAllowEndTime.Value.Second);
            }
            if (this.dtpAllowStartTime.Checked && this.dtpAllowEndTime.Checked)
            {
                if (this.dtpAllowStartTime.Value > this.dtpAllowEndTime.Value)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0025, AppMessage.MSG0092, AppMessage.MSG0093), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.dtpAllowStartTime.Focus();
                    return(false);
                }
            }
            if (this.dtpLockStartDate.Checked && this.dtpLockEndDate.Checked)
            {
                if (this.dtpLockStartDate.Value > this.dtpLockEndDate.Value)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0025, AppMessage.MSG0094, AppMessage.MSG0095), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.dtpLockStartDate.Focus();
                    return(false);
                }
            }
            return(returnValue);
        }
コード例 #18
0
ファイル: FrmStaffAdd.cs プロジェクト: windygu/DotNet_Auth
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns>有效</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            this.txtRealName.Text = this.txtRealName.Text.TrimEnd();
            if (this.txtRealName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9978), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtRealName.Focus();
                return(false);
            }

            if (this.ucCompany.SelectedId == null)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9900), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ucCompany.Focus();
                return(false);
            }
            if ((this.ucDepartment.SelectedId == null))
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9901), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ucDepartment.Focus();
                return(false);
            }

            if (this.chbCreateUser.Checked)
            {
                this.txtUserName.Text = this.txtUserName.Text.TrimEnd();
                if (this.txtUserName.Text.Trim().Length == 0)
                {
                    MessageBox.Show(AppMessage.MSG0223, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtUserName.Focus();
                    return(false);
                }
                //if (this.cmbRole.SelectedValue == null || this.cmbRole.SelectedValue.ToString() == "")
                //{
                //    MessageBox.Show("默认角色不能为空。", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    this.cmbRole.Focus();
                //    return false;
                //}
                // 密码强度检查
                if (this.lblPasswordReq.Visible)
                {
                    if (this.txtConfirmPassword.Text != this.txtPassword.Text)
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0039, AppMessage.MSG9964, AppMessage.MSG9960), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.txtPassword.Clear();
                        this.txtConfirmPassword.Clear();
                        this.txtPassword.Focus();
                        return(false);
                    }
                }
            }
            return(returnValue);
        }
コード例 #19
0
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns>有效</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            this.txtUserName.Text = this.txtUserName.Text.TrimEnd();
            if (this.txtUserName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtUserName.Focus();
                return(false);
            }
            // 这里需要检查系统设置的用户名长度限制
            if (BaseSystemInfo.CheckPasswordStrength && BaseSystemInfo.AccountMinimumLength > 0)
            {
                if (this.txtUserName.Text.Trim().Length < BaseSystemInfo.AccountMinimumLength)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0026, AppMessage.MSG9957, BaseSystemInfo.AccountMinimumLength.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtUserName.Focus();
                    return(false);
                }
            }
            this.txtRealName.Text = this.txtRealName.Text.TrimEnd();
            if (this.txtRealName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9978), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtRealName.Focus();
                return(false);
            }

            // 密码不能为空
            if (BaseSystemInfo.CheckPasswordStrength)
            {
                if (this.txtPassword.Text.Trim().Length == 0)
                {
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9964), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtPassword.Focus();
                    return(false);
                }
                if (!BaseCheckInput.CheckPasswordStrength(this.txtPassword))
                {
                    return(false);
                }
            }
            if (!this.txtConfirmPassword.Text.Equals(this.txtPassword.Text))
            {
                MessageBox.Show(AppMessage.MSG9967, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtPassword.Clear();
                this.txtConfirmPassword.Clear();
                this.txtPassword.Focus();
                return(false);
            }
            return(returnValue);
        }
コード例 #20
0
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns>有效</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            this.txtRealName.Text = this.txtRealName.Text.TrimEnd();
            if (this.txtRealName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9978), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtRealName.Focus();
                return(false);
            }
            return(returnValue);
        }
コード例 #21
0
        /// <summary>
        /// 检查批量删除
        /// </summary>
        /// <returns>允许删除</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            foreach (DataGridViewRow dgvRow in grdUser.Rows)
            {
                DataRow dataRow = (dgvRow.DataBoundItem as DataRowView).Row;
                if ((System.Boolean)(dgvRow.Cells["colSelected"].Value ?? false))
                {
                    BaseUserEntity userEntity = new BaseUserEntity(dataRow);
                    // 自己不允许删除自己
                    if (userEntity.Id != null && this.UserInfo.Id.Equals(userEntity.Id.ToString()))
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0101, userEntity.RealName), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        returnValue = false;
                        break;
                    }
                    // 已经在线的用户不能被删除
                    userEntity = DotNetService.Instance.UserService.GetEntity(this.UserInfo, userEntity.Id.ToString());
                    if (userEntity.UserOnLine != null && userEntity.UserOnLine > 0)
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0100, userEntity.RealName), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        returnValue = false;
                        break;
                    }
                    // 超级管理员等不允许删除
                    if (userEntity.Code != null && userEntity.Code.Equals(DefaultRole.Administrator.ToString()))
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0018, userEntity.RealName), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        returnValue = false;
                        break;
                    }
                }
            }

            //foreach (DataRowView dataRowView in this.DTUser.DefaultView)
            //{
            //    if (dataRowView.Row[BaseBusinessLogic.SelectedColumn].ToString().ToUpper().Equals(true.ToString().ToUpper()))
            //    {
            //        BaseUserEntity userEntity = new BaseUserEntity(dataRowView.Row);
            //        if (userEntity.Code != null && userEntity.Code.Equals(DefaultRole.Administrator.ToString()))
            //        {
            //            // 有不允许删除的数据
            //            MessageBox.Show(AppMessage.Format(AppMessage.MSG0018, userEntity.RealName), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
            //            returnValue = false;
            //            break;
            //        }
            //    }
            //}
            return(returnValue);
        }
コード例 #22
0
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns>有效</returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            if (!BaseCheckInput.CheckEmpty(this.txtFolderName, AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9974)))
            {
                return(false);
            }
            if (!BaseCheckInput.CheckFolderName(this.txtFolderName, AppMessage.Format(AppMessage.MSG0032, AppMessage.MSG9974)))
            {
                return(false);
            }
            return(returnValue);
        }
コード例 #23
0
ファイル: FrmScreenLock.cs プロジェクト: windygu/DotNet_Auth
 /// <summary>
 /// 检查输入的有效性
 /// </summary>
 public override bool CheckInput()
 {
     // 密码强度检查
     if (BaseSystemInfo.CheckPasswordStrength)
     {
         if (this.txtPassword.Text.Length == 0)
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9964), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtPassword.Focus();
             return(false);
         }
     }
     return(true);
 }
コード例 #24
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     this.txtSearch.Text = this.txtSearch.Text.TrimEnd();
     if (this.txtSearch.Text.Trim().Length == 0)
     {
         MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG0212), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.txtSearch.Focus();
         return;
     }
     this.DTRoleList         = DotNetService.Instance.RoleService.Search(UserInfo, this.ParentEntityId, this.txtSearch.Text);
     this.grdRole.DataSource = this.DTRoleList.DefaultView;
     // 设置按钮状态
     this.SetControlState();
 }
コード例 #25
0
        /// <summary>
        /// 检查输入的有效性
        /// </summary>
        /// <returns></returns>
        public override bool CheckInput()
        {
            bool returnValue = true;

            // 是否为空
            if (this.cmbAuditCategoryCode.SelectedValue != null)
            {
                string categoryCode = this.cmbAuditCategoryCode.SelectedValue.ToString();
                // 按组织机构
                if (categoryCode.Equals("ByOrganize"))
                {
                    if (string.IsNullOrEmpty(this.ucOrganize.SelectedId))
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0303, AppMessage.MSG9971), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.ucOrganize.Focus();
                        return(false);
                    }
                }
                // 按用户
                else if (categoryCode.Equals("ByUser"))
                {
                    if (string.IsNullOrEmpty(this.ucUser.SelectedId))
                    {
                        MessageBox.Show(AppMessage.Format(AppMessage.MSG0303, AppMessage.MSG9957), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.ucUser.Focus();
                        return(false);
                    }
                }
            }
            if (this.txtFullName.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9978), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtFullName.Focus();
                return(false);
            }
            if (this.txtCode.Text.Trim().Length == 0)
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0007, AppMessage.MSG9977), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtCode.Focus();
                return(false);
            }
            if ((this.cmbWorkFlowCategory.SelectedValue == null) || (string.IsNullOrEmpty(this.cmbWorkFlowCategory.SelectedValue.ToString())))
            {
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0303, AppMessage.MSG0302), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.cmbWorkFlowCategory.Focus();
                return(false);
            }
            return(returnValue);
        }
コード例 #26
0
        /// <summary>
        /// 设置当前所有选中的记录为隐藏状态
        /// </summary>
        /// <returns>设置更新成功</returns>
        private bool SetInvisible()
        {
            bool   returnValue   = false;
            string statusCode    = string.Empty;
            string statusMessage = string.Empty;

            // 检查至少要选择一个
            if (!BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdSequence, "colSelected"))
            {
                return(returnValue);
            }
            int selectedCount = 0;
            BaseSequenceEntity  sequenceEntity  = new BaseSequenceEntity();
            BaseSequenceManager sequenceManager = new BaseSequenceManager(this.UserInfo);

            foreach (DataGridViewRow dgvRow in grdSequence.Rows)
            {
                DataRow dataRow = (dgvRow.DataBoundItem as DataRowView).Row;
                if (dataRow.RowState != DataRowState.Deleted)
                {
                    if ((System.Boolean)(dgvRow.Cells["colSelected"].Value ?? false))
                    {
                        sequenceEntity = new BaseSequenceEntity(dataRow);
                        // 记录BaseSequence不能被隐藏
                        if (!sequenceEntity.FullName.Equals("BaseSequence"))
                        {
                            selectedCount++;
                            sequenceEntity.IsVisible = 0;
                            //sequenceManager.Update(sequenceEntity);该方法调用不成,所以使用了下面调用服务方法更新,待优化
                            int rowCount = DotNetService.Instance.SequenceService.Update(UserInfo, sequenceEntity, out statusCode, out statusMessage);
                        }
                        else
                        {
                            MessageBox.Show(AppMessage.Format(AppMessage.MSG0018, "BaseSequence"), AppMessage.MSG0020, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return(returnValue);
                        }
                    }
                }
            }

            // 被选中记录中被设置隐藏的次数
            returnValue = selectedCount > 0;
            if (!returnValue)
            {
                MessageBox.Show(AppMessage.MSG0024, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(returnValue);
        }
コード例 #27
0
        /// <summary>
        /// 允许登录次数已经到了
        /// </summary>
        /// <returns>继续允许输入</returns>
        private bool CheckAllowLogOnCount()
        {
            if (this.LogOnCount >= this.AllowLogOnCount)
            {
                // 控件重新设置状态
                this.txtPassword.Clear();
                this.cmbUser.Enabled     = false;
                this.txtPassword.Enabled = false;
                this.btnConfirm.Enabled  = false;

                // 进行提示信息,不能再输入了,已经错误N次了。
                MessageBox.Show(AppMessage.Format(AppMessage.MSG0211, this.AllowLogOnCount.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }
            return(true);
        }
コード例 #28
0
ファイル: BaseForm.cs プロジェクト: windygu/DotNet_Auth
 /// <summary>
 /// 检查文件是否存在
 /// </summary>
 /// <param name="fileName">文件名</param>
 /// <returns>是否存在</returns>
 private bool FileExist(string fileName)
 {
     if (System.IO.File.Exists(fileName))
     {
         string targetFileName = System.IO.Path.GetFileName(fileName);
         if (MessageBox.Show(AppMessage.Format(AppMessage.MSG0236, targetFileName), AppMessage.MSG0000, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             System.IO.File.Delete(fileName);
         }
         else
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #29
0
ファイル: UCWorkFlow.cs プロジェクト: DreamALittle/C-AccMVC
        /// <summary>
        /// 审核通过
        /// <param name="isAutoFlow">是否是步骤流</param>
        /// </summary>
        private bool AuditPass(bool isAutoFlow)
        {
            bool returnValue = false;
            int  result      = 0;

            if (isAutoFlow)
            {
                // 步骤流审核
                result = DotNetService.Instance.WorkFlowCurrentService.AuditPass(this.UserInfo, this.WorkFlowIds, this.txtAuditIdea.Text);
            }
            else
            {
                //
                if ((this.SelectedIds == null) || (this.SelectedIds[0] == null))
                {
                    // 若没选人,就是直接结束了
                    result = DotNetService.Instance.WorkFlowCurrentService.AuditComplete(this.UserInfo, this.WorkFlowIds, this.txtAuditIdea.Text);
                }
                else
                {
                    // 若是选了人了,进入下一个审批流程了
                    result = DotNetService.Instance.WorkFlowCurrentService.AuditTransmit(this.UserInfo, this.WorkFlowIds[0], this.WorkFlowCategory, this.SelectedIds[0], this.txtAuditIdea.Text);
                }
            }

            if (result > 0)
            {
                // 是否显示信息
                if (BaseSystemInfo.ShowInformation)
                {
                    // 审核成功,进行提示
                    MessageBox.Show(AppMessage.Format(AppMessage.MSG0247, result.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                returnValue = true;
            }
            else
            {
                // 是否显示信息
                if (BaseSystemInfo.ShowInformation)
                {
                    // 审核失败,进行提示
                    MessageBox.Show(AppMessage.MSG0248, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            return(returnValue);
        }
コード例 #30
0
 private void mItmDelete_Click(object sender, EventArgs e)
 {
     if (this.LastControl == this.tvOrganize)
     {
         if (!BaseInterfaceLogic.NodeAllowDelete(this.tvOrganize.SelectedNode))
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0035, this.tvOrganize.SelectedNode.Text), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             if (MessageBox.Show(AppMessage.MSG0015, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
             {
                 // this.SingleDelete();
             }
         }
     }
 }