Ejemplo n.º 1
0
        public BasicResponse <RightInfo> UpdateRight(RightUpdateRequest rightrequest)
        {
            RightInfo rightDTO = rightrequest.RightInfo;

            if (string.IsNullOrEmpty(rightDTO.RightID))
            {
                // throw new BusinessException("权限编号不能为空!");
                ThrowException("UpdateRight", new Exception("权限编号不能为空!"));
            }
            if (string.IsNullOrEmpty(rightDTO.RightName))
            {
                //throw new BusinessException("权限名称不能为空!");
                ThrowException("UpdateRight", new Exception("权限名称不能为空!"));
            }

            var _right = ObjectConverter.Copy <RightInfo, RightModel>(rightDTO);

            _Repository.UpdateRight(_right);
            var rightresponse = new BasicResponse <RightInfo>();

            rightresponse.Data = ObjectConverter.Copy <RightModel, RightInfo>(_right);
            return(rightresponse);
        }
Ejemplo n.º 2
0
 public BasicResponse <RightInfo> UpdateRight(RightUpdateRequest rightrequest)
 {
     return(_rightService.UpdateRight(rightrequest));
 }
        public BasicResponse <RightInfo> UpdateRight(RightUpdateRequest rightrequest)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/Right/Update?token=" + Token, JSONHelper.ToJSONString(rightrequest));

            return(JSONHelper.ParseJSONString <BasicResponse <RightInfo> >(responseStr));
        }