Exemplo n.º 1
0
        //[MultiButton("Reject")]
        public JsonResult Reject(long UserId, long verificationId, RoleType roleType)
        {
            var res = new ResponseResult <RoleStateViewModel>();

            bool result      = false;
            long auditUserId = UserId;

            switch (roleType)
            {
            case RoleType.Farmer:
                result = this.roleVerificationRepository.RejectVerification(verificationId, auditUserId, RoleType.Farmer);
                break;

            case RoleType.MachineryOperator:
                result = this.roleVerificationRepository.RejectVerification(verificationId, auditUserId, RoleType.MachineryOperator);
                break;

            case RoleType.Business:
                result = this.roleVerificationRepository.RejectVerification(verificationId, auditUserId, RoleType.Business);
                break;
            }
            if (result == true)
            {
                res.Message   = "拒绝了【" + roleType.GetDescription() + "】角色的认证!";
                res.IsSuccess = true;
            }
            else
            {
                res.IsSuccess = false;
            }

            return(new JsonResultEx(res));
        }