예제 #1
0
        /// <summary>
        ///     检测代码是否已经具有重复项
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public Task <bool> CheckUserCode(CheckSameValueInput input)
        {
            string sql = "select UserId from Sys_User where Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " And Id!=@UserId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemUser>(sql, new { param = input.Param, UserId = input.Id }));
        }
예제 #2
0
        /// <summary>
        ///     检查代码:唯一性检查
        /// </summary>
        /// <param name="input">代码</param>
        /// <returns></returns>
        public Task <bool> CheckGroupCode(CheckSameValueInput input)
        {
            var sql = "SELECT GroupId FROM System_Group WHERE Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " AND GroupId!=@groupId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemGroup>(sql, new { param = input.Param, groupId = input.Id }));
        }
예제 #3
0
        public async Task <JsonResult> CheckOrganizationCode(CheckSameValueInput input)
        {
            var operateStatus = await _organizationLogic.CheckOrganizationCode(input);

            return
                (Json(
                     new
            {
                info = operateStatus.Message,
                status = operateStatus.ResultSign == ResultSign.Successful ? "y" : "n"
            }));
        }
예제 #4
0
 /// <summary>
 ///     检查字典代码:唯一性检查
 /// </summary>
 /// <param name="input">唯一性检查</param>
 /// <returns></returns>
 public Task<bool> CheckDistrictId(CheckSameValueInput input)
 {
     var sql = "SELECT DistrictId FROM System_District WHERE DistrictId=@param";
     if (!input.Id.IsNullOrEmptyGuid())
     {
         sql += " AND DistrictId!=@districtId";
     }
     return SqlMapperUtil.SqlWithParamsBool<SystemDistrict>(sql, new
     {
         param = input.Param,
         districtId = input.Id
     });
 }
        /// <summary>
        ///     检测代码是否已经具有重复项
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public async Task <bool> CheckUserCode(CheckSameValueInput input)
        {
            string sql = "select UserId from Sys_User where Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " And Id!=@UserId";
            }

            return((await this.DbConnection.QueryFirstOrDefaultAsync <SystemUser>(sql,
                                                                                  new { param = input.Param, UserId = input.Id }))
                   != default);
        }
예제 #6
0
        /// <summary>
        ///     检查代码:唯一性检查
        /// </summary>
        /// <param name="input">代码</param>
        /// <returns></returns>
        public Task <bool> CheckPostCode(CheckSameValueInput input)
        {
            var sql = "SELECT PostId FROM System_Post WHERE Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " AND PostId!=@postId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemPost>(sql, new
            {
                param = input.Param,
                postId = input.Id
            }));
        }
예제 #7
0
        /// <summary>
        ///     检查代码:唯一性检查
        /// </summary>
        /// <param name="input">代码</param>
        /// <returns></returns>
        public Task <bool> CheckOrganizationCode(CheckSameValueInput input)
        {
            var sql = "SELECT OrganizationId FROM System_Organization WHERE Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " AND OrganizationId!=@organizationId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemOrganization>(sql, new
            {
                param = input.Param,
                organizationId = input.Id
            }));
        }
예제 #8
0
        /// <summary>
        ///     检查字典代码:唯一性检查
        /// </summary>
        /// <param name="input">代码</param>
        /// <returns></returns>
        public Task <bool> CheckDictionaryCode(CheckSameValueInput input)
        {
            var sql = "SELECT DictionaryId FROM System_Dictionary WHERE Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " AND DictionaryId!=@dictionaryId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemDictionary>(sql, new
            {
                param = input.Param,
                dictionaryId = input.Id
            }));
        }
예제 #9
0
        /// <summary>
        ///     检查模块代码:唯一性检查
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public Task <bool> CheckMenuCode(CheckSameValueInput input)
        {
            var sql = "SELECT Code FROM System_Menu WHERE Code=@param";

            if (!input.Id.IsNullOrEmptyGuid())
            {
                sql += " AND MenuId!=@menuId";
            }
            return(SqlMapperUtil.SqlWithParamsBool <SystemMenu>(sql, new
            {
                param = input.Param,
                menuId = input.Id
            }));
        }
예제 #10
0
        /// <summary>
        ///     验证旧密码是否输入正确
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public async Task <OperateStatus> CheckOldPassword(CheckSameValueInput input)
        {
            var operateStatus = new OperateStatus();

            input.Param = DEncryptUtil.Encrypt(input.Param, GlobalParams.Get("pwdKey").ToString());
            if (!await _userInfoRepository.CheckOldPassword(input))
            {
                operateStatus.ResultSign = ResultSign.Error;
                operateStatus.Message    = string.Format("旧密码不正确");
            }
            else
            {
                operateStatus.ResultSign = ResultSign.Successful;
            }
            return(operateStatus);
        }
예제 #11
0
        /// <summary>
        ///     检测配置项代码是否已经具有重复项
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public async Task <OperateStatus> CheckUserCode(CheckSameValueInput input)
        {
            var operateStatus = new OperateStatus();

            if (await _userInfoRepository.CheckUserCode(input))
            {
                operateStatus.ResultSign = ResultSign.Error;
                operateStatus.Message    = string.Format(Chs.HaveCode, input.Param);
            }
            else
            {
                operateStatus.ResultSign = ResultSign.Successful;
                operateStatus.Message    = Chs.CheckSuccessful;
            }
            return(operateStatus);
        }
예제 #12
0
        /// <summary>
        ///     验证旧密码是否输入正确
        /// </summary>
        /// <param name="input">需要验证的参数</param>
        /// <returns></returns>
        public async Task <OperateStatus> CheckOldPassword(CheckSameValueInput input)
        {
            var operateStatus = new OperateStatus();

            input.Param = DEncryptUtil.Encrypt(input.Param, _configOptions.Value.PasswordKey);
            if (!await _userInfoRepository.CheckOldPassword(input))
            {
                operateStatus.ResultSign = ResultSign.Error;
                operateStatus.Message    = "旧密码不正确";
            }
            else
            {
                operateStatus.ResultSign = ResultSign.Successful;
            }
            return(operateStatus);
        }
예제 #13
0
 public async Task <JsonResult> CheckPostCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _postLogic.CheckPostCode(input)));
 }
예제 #14
0
 public async Task <JsonResult> CheckGroupCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _groupLogic.CheckGroupCode(input)));
 }
예제 #15
0
 public async Task <JsonResult> CheckDistrictId(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _districtLogic.CheckDistrictId(input)));
 }
예제 #16
0
 public async Task <JsonResult> CheckDictionaryCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _dictionaryLogic.CheckDictionaryCode(input)));
 }
예제 #17
0
 public async Task <JsonResult> CheckUserCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _userInfoLogic.CheckUserCode(input)));
 }
예제 #18
0
 public async Task <JsonResult> CheckRoleCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _roleLogic.CheckRoleCode(input)));
 }
예제 #19
0
 public async Task <JsonResult> CheckMenuCode(CheckSameValueInput input)
 {
     return(JsonForCheckSameValue(await _menuLogic.CheckMenuCode(input)));
 }
예제 #20
0
 public async Task <JsonResult> CheckOldPassword(CheckSameValueInput input)
 {
     input.Id = CurrentUser.UserId;
     return(JsonForCheckSameValue(await _userInfoLogic.CheckOldPassword(input)));
 }
예제 #21
0
 public async Task <JsonResult> CheckUserCode(CheckSameValueInput input)
 {
     input.Id = CurrentUser.UserId;
     return(Json(await _systemUserLogic.CheckUserCode(input)));
 }
예제 #22
0
        /// <summary>
        ///     检查代码:唯一性检查
        /// </summary>
        /// <param name="input">代码</param>
        /// <returns></returns>
        public Task <bool> CheckOldPassword(CheckSameValueInput input)
        {
            const string sql = "SELECT UserId FROM System_UserInfo WHERE Password=@param AND UserId=@userId";

            return(SqlMapperUtil.SqlWithParamsBool <SystemUserInfo>(sql, new { param = input.Param, userId = input.Id }));
        }