// POST api/<controller>
        public IEnumerable <IMConversation> Post([FromBody] GetIMClass GetIM)
        {
            int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

            IMConversation[] m_IMConversations = new IMConversation().GetIMConversation(_UserID, GetIM.OtherUserID);
            return(m_IMConversations);
        }
Beispiel #2
0
        public bool Post([FromBody] GetIMClass GetIM)
        {
            int  _UserID          = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
            bool ISUSerAbleToChat = new UserAccountSettings().ISUserAbleToChat(_UserID, GetIM.OtherUserID);

            return(ISUSerAbleToChat);
        }
 public IEnumerable <IMConversation> Post([FromBody] GetIMClass GetIM)
 {
     try
     {
         int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
         IMConversation[] m_IMConversations = new IMConversation().GetIMConversation(_UserID, GetIM.OtherUserID);
         return(m_IMConversations.Reverse().Take(10).OrderBy(x => x.SentTime));
     }
     catch (Exception)
     {
         return(null);
     }
 }