public IHttpActionResult GetMessageByUID(int UID) { WebApi_BLL.T_System_Messages tsmbll = new WebApi_BLL.T_System_Messages(); List <WebApi_Model.T_System_Messages> list = tsmbll.GetModelList("IsDelete = 0 and ToUID =" + UID); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(list)))); }
public IHttpActionResult SendMessage(dynamic model) { WebApi_BLL.T_System_Messages tsmbll = new WebApi_BLL.T_System_Messages(); WebApi_Model.T_System_Messages message = (WebApi_Model.T_System_Messages)Newtonsoft.Json.JsonConvert.DeserializeObject(model, typeof(WebApi_Model.T_System_Messages)); int id = tsmbll.Add(message); message.IsView = 0; message.IsDelete = 0; message.PostDate = DateTime.Now; message.MessageID = id; return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(message)))); }
public IHttpActionResult ViewMessage(int UID, int MessageID) { WebApi_BLL.T_System_Messages tsmbll = new WebApi_BLL.T_System_Messages(); WebApi_Model.T_System_Messages message = tsmbll.GetModel(MessageID); if (message != null && message.ToUID == UID) { message.IsView = 1; tsmbll.Update(message); } else { return(Ok(ReturnJsonResult.GetJsonResult(-1, "Error", JsonConvert.SerializeObject("无法找到消息!")))); } return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(message)))); }
public IHttpActionResult DeleteMessage(int MessageID) { WebApi_BLL.T_System_Messages tsmbll = new WebApi_BLL.T_System_Messages(); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(tsmbll.Delete(MessageID))))); }
public IHttpActionResult GetNoReadCount(int UID) { WebApi_BLL.T_System_Messages tsmbll = new WebApi_BLL.T_System_Messages(); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(tsmbll.GetRecordCount("IsDelete = 0 and IsView = 0 and ToUID =" + UID))))); }