예제 #1
0
        //
        // 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;
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        //
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        /// <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);
        }
예제 #8
0
        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();
        }
예제 #9
0
        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
        }
예제 #10
0
 public ViewtMessage GettMessageOnly(int Touid, int FromUid, int ParentID)
 {
     return(ViewtMessage.ToViewModel(Repository.GettMessageOnly(Touid, FromUid, ParentID)));
 }
예제 #11
0
 public ViewtMessage GettMessageDistinct(int Touid, string strContent, int FromUid, int ParentID)
 {
     return(ViewtMessage.ToViewModel(Repository.GettMessageDistinct(Touid, strContent, FromUid, ParentID)));
 }
예제 #12
0
 public ViewtMessage GettMessageById(int id)
 {
     return(ViewtMessage.ToViewModel(Repository.GettMessageById(id)));
 }
예제 #13
0
 public int Update(ViewtMessage model)
 {
     Repository.updateEntity(ViewtMessage.ToEntity(model));
     return(Repository.Save());
 }
예제 #14
0
 public int Add(ViewtMessage model)
 {
     Repository.Add(ViewtMessage.ToEntity(model));
     return(Repository.Save());
 }