public IActionResult DisableInterFace(QueryStateParam param)
        {
            var resModel = new ResponseModel(ResponseCode.Error, "操作失败", false);

            try
            {
                //判断是否传入id
                if (param.id.IsNullOrEmpty())
                {
                    resModel.msg = "传入接口id为空";
                    return(Json(resModel));
                }
                var model = this.Query <ModulesFunctionInterface>().Where("id", param.id).GetModel();
                model.是否停用 = model.是否停用 == 1 ? 0 : 1;
                model.停用时间 = DateTime.Now;
                //管理员禁用/启用模块
                var state = this.Update <ModulesFunctionInterface>(model)
                            .Columns("是否停用", "停用时间")
                            .Where("id", model.id)
                            .Execute();
                if (state > 0)//判断不为空
                {
                    resModel.data = true;
                    resModel.code = (int)ResponseCode.Success;
                    resModel.msg  = "修改成功";
                }
            }
            catch (Exception ex)
            {
                LogError("停用启用模板功能接口", ex);
                resModel.msg = "修改异常";
            }

            return(Json(resModel));
        }
        public IActionResult UpOrgPeopleState(QueryStateParam param)
        {
            var result = new ResponseModel(ResponseCode.Success, "修改用户状态成功!");

            try
            {
                if (!param.id.IsNullOrEmpty())
                {
                    result.code = (int)ResponseCode.Forbidden;
                    result.msg  = "缺少参数";
                    return(Json(result));
                }
                SystemUser user = new SystemUser()
                {
                    用户状态 = param.state
                };
                var cuteCount = this.Update(user).Columns("用户状态").Where("id", param.id).Execute();
                if (cuteCount == 0)
                {
                    result.msg = "修改用户状态失败";
                }
            }
            catch (Exception ex)
            {
                LogError("修改人员用户状态操作失败", ex);
                result.code = (int)ResponseCode.Error;
                result.msg  = "服务器内部异常";
            }
            return(Json(result));
        }
        public IActionResult DisableFunction(QueryStateParam param)
        {
            var resModel = new ResponseModel(ResponseCode.Error, "操作失败", false);

            try
            {
                //判断是否传入id
                if (!param.id.IsNullOrEmpty())
                {
                    resModel.msg = "数据异常";
                    return(Json(resModel));
                }
                var entity = new ModulesFunction()
                {
                    id   = param.id,
                    是否停用 = param.state
                };
                ////停用
                if (entity.是否停用 == 1)
                {
                    entity.停用人  = loginUser.id;
                    entity.停用时间 = DateTime.Now;
                }
                else
                {
                    entity.停用人  = null;
                    entity.停用时间 = null;
                }
                //管理员禁用/启用模块
                var state = this.Update <ModulesFunction>(entity)
                            .Columns("是否停用")
                            .Where("id", entity.id)
                            .Execute();
                if (state > 0)//大于0修改成功
                {
                    resModel.data = true;
                    resModel.code = (int)ResponseCode.Success;
                    resModel.msg  = "修改成功";
                }
            }
            catch (Exception ex)
            {
                LogError("禁用/启用模块功能异常", ex);
                resModel.msg = "修改异常";
            }

            return(Json(resModel));
        }
        public IActionResult DelModules(QueryStateParam param)
        {
            var resModel = new ResponseModel(ResponseCode.Error, "删除失败", false);

            try
            {
                //判断是否传入id
                if (!param.id.IsNullOrEmpty())
                {
                    resModel.msg = "数据异常";
                    return(Json(resModel));
                }
                var entity = new ModulesInfo()
                {
                    id     = param.id,
                    status = 0
                };
                //管理员禁用/启用模块
                var state = this.Update <ModulesInfo>(entity)
                            .Columns("status")
                            .Where("id", entity.id)
                            .Execute();
                if (state > 0)//判断不为空
                {
                    resModel.data = true;
                    resModel.code = (int)ResponseCode.Success;
                    resModel.msg  = "删除成功";
                }
            }
            catch (Exception ex)
            {
                LogError("删除模块", ex);
                resModel.msg = "修改异常";
            }

            return(Json(resModel));
        }
        public IActionResult DisableRole(QueryStateParam param)
        {
            var resModel = new ResponseModel(ResponseCode.Error, "操作失败", false);

            try
            {
                //判断是否传入id
                if (!param.id.IsNullOrEmpty())
                {
                    resModel.msg = "数据异常";
                    return(Json(resModel));
                }
                var entity = new RoleInfo()
                {
                    id   = param.id,
                    是否停用 = param.state
                };
                //管理员禁用/启用角色
                var count = this.Update <RoleInfo>(entity)
                            .Columns("是否停用")
                            .Where("id", entity.id)
                            .Execute();
                if (count > 0)//判断不为空
                {
                    resModel.data = true;
                    resModel.code = (int)ResponseCode.Success;
                    resModel.msg  = "修改成功";
                }
            }
            catch (Exception ex)
            {
                LogError("禁用/启用角色", ex);
                resModel.msg = "修改异常";
            }
            return(Json(resModel));
        }