public async Task<IHttpActionResult> PutMessageInbox(int id, MessageInbox messageInbox)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != messageInbox.MessageID)
            {
                return BadRequest();
            }

            db.Entry(messageInbox).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MessageInboxExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
 public async Task<HttpResponseMessage> PostMessageInbox(MessageInbox messageInbox)
 {
     JObject result = new JObject();
     try
     {
         var userId = new SqlParameter("@UserID", messageInbox.UserID);
         var ownerId = new SqlParameter("@OwnerID", messageInbox.OwnerID);
         var content = new SqlParameter("@Content", messageInbox.Content);
         var inboxDate = new SqlParameter("@InboxDate", messageInbox.InboxDate);
         var response = Methods.GetInstance().ExecQueryWithResult("viethung_paybayservice.sp_AddNewMessage", CommandType.StoredProcedure, ref Methods.err, userId, ownerId, content, inboxDate);
         if (response.Count > 0)
         {
             result = response[0].ToObject<JObject>();
             await PushHelper.SendToastAsync(WebApiConfig.Services, result["Username"].ToString(), result["Content"].ToString(), new Uri(result["Avatar"].ToString()), result["UserID"].ToString());
         }                              
     }
     catch (Exception ex)
     {
         return Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
     }
     return Request.CreateResponse(HttpStatusCode.OK, result);
 }