public HttpResponseMessage UpdateUserProfile(UserProfileDTO dto)
        {
            var upc = new UserProfileController();
            var up  = upc.Profiles_Get(PortalSettings.PortalId, ActiveModule.ModuleID, dto.UserId);

            if (up == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            if (dto.TrustLevel.HasValue)
            {
                up.TrustLevel = dto.TrustLevel.Value;
            }

            up.UserCaption = dto.UserCaption;
            up.Signature   = dto.Signature;

            if (dto.RewardPoints.HasValue)
            {
                up.RewardPoints = dto.RewardPoints.Value;
            }

            upc.Profiles_Save(up);

            return(Request.CreateResponse(HttpStatusCode.OK));
        }
        public HttpResponseMessage GetUserProfile(int userId)
        {
            var upc = new UserProfileController();
            var up = upc.Profiles_Get(PortalSettings.PortalId, ActiveModule.ModuleID, userId);

            if(up == null)
                return Request.CreateResponse(HttpStatusCode.NotFound);

            var result = new
                             {
                                 up.UserID,
                                 up.TrustLevel,
                                 up.UserCaption,
                                 up.Signature,
                                 up.RewardPoints
                             };

            return Request.CreateResponse(HttpStatusCode.OK, result);
        }
        public HttpResponseMessage GetUserProfile(int userId)
        {
            var upc = new UserProfileController();
            var up  = upc.Profiles_Get(PortalSettings.PortalId, ActiveModule.ModuleID, userId);

            if (up == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            var result = new
            {
                up.UserID,
                up.TrustLevel,
                up.UserCaption,
                up.Signature,
                up.RewardPoints
            };

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
        public HttpResponseMessage UpdateUserProfile(UserProfileDTO dto)
        {
            var upc = new UserProfileController();
            var up = upc.Profiles_Get(PortalSettings.PortalId, ActiveModule.ModuleID, dto.UserId);

            if (up == null)
                return Request.CreateResponse(HttpStatusCode.NotFound);

            if (dto.TrustLevel.HasValue)
                up.TrustLevel = dto.TrustLevel.Value;

            up.UserCaption = dto.UserCaption;
            up.Signature = dto.Signature;

            if (dto.RewardPoints.HasValue)
                up.RewardPoints = dto.RewardPoints.Value;

            upc.Profiles_Save(up);

            return Request.CreateResponse(HttpStatusCode.OK);
        }