Beispiel #1
0
        public HttpResponseMessage UpdateProfile([FromBody] UserProfile model)
        {
            var r = UPBL.Update(model, model.UserName);

            if (!r)
            {
                return(this.Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
            else
            {
                return(this.Request.CreateResponse(HttpStatusCode.OK, r));
            }
        }
Beispiel #2
0
        public JsonResultEntity Update([FromBody] UserProfileEntity userprofileEntity)
        {
            UserProfileBL    userprofileBL = new UserProfileBL();
            JsonResultEntity response      = new JsonResultEntity();

            try
            {
                var result = userprofileBL.Update(userprofileEntity);
                if (result.HasWarning() || result.Value == null)
                {
                    response.Message = String.Join(",", result.Warning);
                    return(response);
                }
                response.Success = true;
                response.Data    = result.Value;
            }
            catch (Exception e)
            {
                response.Message = e.Message;
                LoggerHelper.Error(e);
            }
            return(response);
        }