コード例 #1
0
        internal static User GetUserInfoByName(string pName)
        {
            GetUserInfoByParamsReq req = new GetUserInfoByParamsReq();

            req.BusinessData.UserName = pName;

            GetUserInfoByParamsRes res = _ClientServiceBase.ExecuteService <GetUserInfoByParamsReq, GetUserInfoByParamsRes>(WrapperSecurityProvider, req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }

            return(res.BusinessData.UserInfo);
        }
コード例 #2
0
        public void GetUserInfoByParams_NoService()
        {
            string strErrorResult = string.Empty;

            Fwk.Security.SVC.GetUserInfoByParamsService service = new Fwk.Security.SVC.GetUserInfoByParamsService();
            GetUserInfoByParamsReq req = new GetUserInfoByParamsReq();

            req.BusinessData.UserName = wTestUser.UserName;
            try
            {
                GetUserInfoByParamsRes res = service.Execute(req);
            }
            catch (Exception ex)
            {
                strErrorResult = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            }

            Assert.AreEqual <String>(strErrorResult, string.Empty, strErrorResult);
        }
コード例 #3
0
        User GetByNAme(string pUserName)
        {
            GetUserInfoByParamsService service = new GetUserInfoByParamsService();
            GetUserInfoByParamsReq     req     = new GetUserInfoByParamsReq();

            req.BusinessData.UserName = pUserName;

            GetUserInfoByParamsRes res = null;

            try
            {
                //Comprovar si se creo el usuario
                res = service.Execute(req);
            }
            catch (Exception ex)
            {
                base.StrExceptionMessage = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
                return(null);
            }

            return(res.BusinessData.UserInfo);
        }