/// <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 })); }
/// <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 })); }
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" })); }
/// <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); }
/// <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 })); }
/// <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 })); }
/// <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 })); }
/// <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 })); }
/// <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); }
/// <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); }
/// <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); }
public async Task <JsonResult> CheckPostCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _postLogic.CheckPostCode(input))); }
public async Task <JsonResult> CheckGroupCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _groupLogic.CheckGroupCode(input))); }
public async Task <JsonResult> CheckDistrictId(CheckSameValueInput input) { return(JsonForCheckSameValue(await _districtLogic.CheckDistrictId(input))); }
public async Task <JsonResult> CheckDictionaryCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _dictionaryLogic.CheckDictionaryCode(input))); }
public async Task <JsonResult> CheckUserCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _userInfoLogic.CheckUserCode(input))); }
public async Task <JsonResult> CheckRoleCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _roleLogic.CheckRoleCode(input))); }
public async Task <JsonResult> CheckMenuCode(CheckSameValueInput input) { return(JsonForCheckSameValue(await _menuLogic.CheckMenuCode(input))); }
public async Task <JsonResult> CheckOldPassword(CheckSameValueInput input) { input.Id = CurrentUser.UserId; return(JsonForCheckSameValue(await _userInfoLogic.CheckOldPassword(input))); }
public async Task <JsonResult> CheckUserCode(CheckSameValueInput input) { input.Id = CurrentUser.UserId; return(Json(await _systemUserLogic.CheckUserCode(input))); }
/// <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 })); }