// // GET: /Manage/tMessage/Details/5 public ActionResult Details(int id) { ViewtMessage model = msgclient.GetById(id); if (model != null) { ViewYogaUser user = clientUser.GetYogaUserById(model.ToUid.Value); if (user != null) { ViewBag.ToUser = user.NickName; } //留言人 ViewYogaUser user2 = clientUser.GetYogaUserById(model.FromUid.Value); if (user2 != null) { ViewBag.FromUser = user2.NickName; } return(View(model)); } else { return(View()); } }
public int Update(ViewtMessage model) { try { return(tMessageServiceImpl.Update(model)); } catch (Exception ex) { throw ex; } }
public List <ViewtMessage> GettMessageParentID(int ParentID) { List <tMessage> list = Repository.GettMessageParentID(ParentID); List <ViewtMessage> model = new List <ViewtMessage>(); foreach (var item in list) { model.Add(ViewtMessage.ToViewModel(item)); } return(model); }
public List <ViewtMessage> GettMessageUid(int id, int toType) { List <tMessage> list = Repository.GettMessageUid(id, toType); List <ViewtMessage> model = new List <ViewtMessage>(); foreach (var item in list) { model.Add(ViewtMessage.ToViewModel(item)); } return(model); }
// public List <ViewtMessage> GetByMessageFromUid(int toType, int id, int ParentID) { List <tMessage> list = Repository.GetByMessageFromUid(toType, id, ParentID); List <ViewtMessage> model = new List <ViewtMessage>(); foreach (var item in list) { model.Add(ViewtMessage.ToViewModel(item)); } return(model); }
public List <ViewtMessage> GetPageListWhereFormUidAndloginType(int uid, int loginType, out int count) { List <tMessage> list = Repository.GetPageListWhereFormUidAndloginType(uid, loginType, out count); List <ViewtMessage> model = new List <ViewtMessage>(); foreach (var item in list) { model.Add(ViewtMessage.ToViewModel(item)); } return(model); }
/// <summary> /// 留言列表按id和类型分页 /// </summary> public List <ViewtMessage> GettMessageUidList(int id, int totype, int page, int pagesize, out int count) { List <tMessage> list = Repository.GettMessageUidList(id, totype, page, pagesize, out count); List <ViewtMessage> model = new List <ViewtMessage>(); foreach (var item in list) { model.Add(ViewtMessage.ToViewModel(item)); } return(model); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Charset = "utf-8"; context.Response.CacheControl = "no-cache"; string commentJson = string.Empty; StringBuilder sb = new StringBuilder(); if (context.Request.Params["msg"] != null) { using (tMessageServiceClient msgClient = new tMessageServiceClient()) { ViewtMessage msgmodel = new ViewtMessage(); msgmodel.ToUid = Convert.ToInt32(context.Request.Params["pictureid"]); msgmodel.ToType = 5; msgmodel.sContent = context.Request.Params["msg"]; msgmodel.FromUid = user.Uid; msgmodel.FormType = user.UserType; msgmodel.CreateDate = DateTime.Now; msgmodel.iZan = 0; msgmodel.iAudio = 0; msgmodel.ParentID = 0; msgmodel.photo = " "; if (user != null) { msgClient.Add(msgmodel); } } sb.Append("{"); sb.Append("\"code\":1,"); sb.Append("\"msg\":\"成功\","); sb.Append("\"comment\":"); sb.Append("["); sb.Append("{"); sb.Append(string.Format("\"avatar\":\"{0}\",", user.Avatar)); sb.Append(string.Format("\"user\":\"{0}\",", user.NickName)); sb.Append(String.Format("\"msg\":\"{0}\"", context.Request.Params["msg"])); sb.Append("}"); sb.Append("]"); sb.Append("}"); } context.Response.Write(sb.ToString()); context.Response.End(); }
public MessageController() { ViewBag.user = user; client = new tMessageServiceClient(); model = new ViewtMessage(); list = new List <ViewtMessage>(); clientUser = new YogaUserServiceClient(); udclient = new YogaUserDetailServiceClient(); mclient = new YogisModelsServiceClient(); logclient = new tWriteLogServiceClient(); method = new method(); #region 登录者的级别 if (user.UserType == 0) { ViewYogaUserDetail temp = new ViewYogaUserDetail(); temp = udclient.GetYogaUserDetailById(user.Uid); if (temp != null) { ViewBag.level = temp.Ulevel; } } else//导师级别 { ViewYogisModels vyogism = new ViewYogisModels(); vyogism = mclient.GetYogisModelsById(user.Uid); if (vyogism != null) { ViewBag.level = vyogism.YogisLevel; } } #endregion #region 站内信-信息数量 int tinstatcount = 0; int follcount = 0; int zancount = 0; int msgcount = 0; method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount); ViewBag.tinstatcount = tinstatcount; ViewBag.follcount = follcount; ViewBag.zancount = zancount; ViewBag.msgcount = msgcount; ViewBag.AllCount = tinstatcount + follcount + zancount + msgcount; #endregion }
public ViewtMessage GettMessageOnly(int Touid, int FromUid, int ParentID) { return(ViewtMessage.ToViewModel(Repository.GettMessageOnly(Touid, FromUid, ParentID))); }
public ViewtMessage GettMessageDistinct(int Touid, string strContent, int FromUid, int ParentID) { return(ViewtMessage.ToViewModel(Repository.GettMessageDistinct(Touid, strContent, FromUid, ParentID))); }
public ViewtMessage GettMessageById(int id) { return(ViewtMessage.ToViewModel(Repository.GettMessageById(id))); }
public int Update(ViewtMessage model) { Repository.updateEntity(ViewtMessage.ToEntity(model)); return(Repository.Save()); }
public int Add(ViewtMessage model) { Repository.Add(ViewtMessage.ToEntity(model)); return(Repository.Save()); }