コード例 #1
0
        public ActionResult DetailEval(int id)
        {
            ViewEvaluatesGroup group = new ViewEvaluatesGroup();
            ViewEvaluates      eval  = new ViewEvaluates();

            using (EvaluatesServiceClient c = new EvaluatesServiceClient())
            {
                eval         = c.GetEvaluatesById(id);
                group.entity = eval;
            }
            if (eval != null)
            {
                ViewYogaUser user = clientUser.GetById(eval.Evaluateid);
                if (user != null)
                {
                    group.FromUser = user.NickName;
                }
                ViewCenters center = client.GetById(eval.ToUid.Value);
                if (center != null)
                {
                    group.CetnerName = center.CenterName;
                }
            }
            return(View(group));
        }
コード例 #2
0
        /// <summary>
        /// 点评
        /// </summary>
        /// <param name="page"></param>
        /// <param name="centertype"></param>
        /// <returns></returns>
        public ActionResult IndexEval(int page = 1, string centertype = "0")
        {
            ViewBag.centertype = centertype;
            List <ViewEvaluatesGroup> listGroupMsg = new List <ViewEvaluatesGroup>();
            List <ViewEvaluates>      list         = new List <ViewEvaluates>();
            int count = 0;

            using (EvaluatesServiceClient evalclient = new EvaluatesServiceClient())
            {
                list = evalclient.GetEvaluatesPageList(page, 15, out count);
            }
            foreach (var item in list)
            {
                ViewEvaluatesGroup model = new ViewEvaluatesGroup();
                model.entity = item;
                ViewYogaUser usermodel = clientUser.GetYogaUserById(item.FromUid.Value);
                if (usermodel != null)
                {
                    model.FromUser = usermodel.NickName;
                }

                ViewCenters center = client.GetById(item.ToUid.Value);
                if (center != null)
                {
                    model.CetnerName = center.CenterName;
                }
                listGroupMsg.Add(model);
            }

            PagedList <ViewEvaluatesGroup> pagelist = new PagedList <ViewEvaluatesGroup>(listGroupMsg, page, 15, count);

            return(View(pagelist));
        }
コード例 #3
0
        private ViewCenters GetCenterAllInfo(int id)
        {
            ViewCenters c = new ViewCenters();

            using (CentersServiceClient client = new CentersServiceClient())
            {
                c = client.GetCentersById(id);
            }
            ViewBag.centerid = id;

            #region 评价列表
            using (EvaluatesServiceClient clientEval = new EvaluatesServiceClient())
            {
                int count = 0;
                clientEval.GetRecommendCount(id, out count);
                ViewBag.Recommend = count;

                List <ViewEvaluates> evalEntity = new List <ViewEvaluates>();
                evalEntity = clientEval.GettEvalUid(id);
                List <ViewEvaluatesGroup> listGroupMsg = new List <ViewEvaluatesGroup>();

                foreach (var item in evalEntity)
                {
                    ViewEvaluatesGroup model = new ViewEvaluatesGroup();

                    model.entity = item;

                    //评论人
                    ViewYogaUser usermodel = clientUser.GetYogaUserById(item.FromUid.Value);
                    if (usermodel != null)
                    {
                        model.FromUser = usermodel.NickName;
                    }

                    //回复
                    List <ViewEvaluates>      listM      = clientEval.GetEvalParentID(item.Evaluateid);
                    List <ViewEvaluatesGroup> entitylist = new List <ViewEvaluatesGroup>();
                    foreach (var it in listM)
                    {
                        ViewEvaluatesGroup entityMsg = new ViewEvaluatesGroup();
                        entityMsg.entity = it;

                        //评论人
                        ViewYogaUser usermodel2 = clientUser.GetYogaUserById(it.FromUid.Value);
                        if (usermodel2 != null)
                        {
                            entityMsg.FromUser = usermodel2.NickName;
                        }

                        entitylist.Add(entityMsg);
                    }
                    model.msgList = entitylist;
                    listGroupMsg.Add(model);
                }
                ViewBag.EvalInfo = listGroupMsg;
            }
            #endregion
            return(c);
        }
コード例 #4
0
        public ViewCenters GetAllMechanis(int id, out int mycount, int page = 1)
        {
            ViewCenters c = new ViewCenters();

            using (CentersServiceClient client = new CentersServiceClient())
            {
                c = client.GetCentersById(id);
            }
            ViewBag.centerid = id;

            #region 评价列表
            int count    = 0;
            int pagesize = 10;
            List <ViewEvaluatesGroup> listGroupMsg = new List <ViewEvaluatesGroup>();
            using (EvaluatesServiceClient clientEval = new EvaluatesServiceClient())
            {
                int tjcount = 0;
                clientEval.GetRecommendCount(id, out tjcount);
                ViewBag.Recommend = tjcount;

                List <ViewEvaluates> evalEntity = new List <ViewEvaluates>();
                evalEntity = clientEval.GettEvalUid(id, page, pagesize, out count);
                mycount    = count;

                foreach (var item in evalEntity)
                {
                    ViewEvaluatesGroup model = new ViewEvaluatesGroup();
                    model.entity = item;
                    //评论人
                    ViewYogaUser usermodel = clientUser.GetYogaUserById(item.FromUid.Value);
                    if (usermodel != null)
                    {
                        model.FromUser = usermodel.NickName;
                    }
                    if (usermodel.UserType == 0)
                    {
                        ViewYogaUserDetail newmodel = clientuserdetail.GetYogaUserDetailById(item.FromUid.Value);
                        if (newmodel != null)
                        {
                            model.DisplayImg = CommonInfo.GetDisplayImg(newmodel.DisplayImg);
                            model.Url        = "/YogaUserDetail/Details/" + item.FromUid.Value;
                        }
                    }
                    else
                    {
                        ViewYogisModels newmodel = clientmodel.GetYogisModelsById(item.FromUid.Value);
                        if (newmodel != null)
                        {
                            model.DisplayImg = CommonInfo.GetDisplayImg(newmodel.DisplayImg);
                            model.FromUser   = newmodel.RealName;
                            if (newmodel.YogisLevel == 4)
                            {
                                model.Url = "/Yogaguru/Details/" + item.FromUid.Value;
                            }
                            else
                            {
                                model.Url = "/YogisModels/Details/" + item.FromUid.Value;
                            }
                        }
                    }

                    //回复
                    List <ViewEvaluates>      listM      = clientEval.GetEvalParentID(item.Evaluateid);
                    List <ViewEvaluatesGroup> entitylist = new List <ViewEvaluatesGroup>();
                    foreach (var it in listM)
                    {
                        ViewEvaluatesGroup entityMsg = new ViewEvaluatesGroup();
                        entityMsg.entity = it;

                        //评论人
                        ViewYogaUser usermodel2 = clientUser.GetYogaUserById(it.FromUid.Value);
                        if (usermodel2 != null)
                        {
                            entityMsg.FromUser = usermodel2.NickName;
                        }
                        entitylist.Add(entityMsg);
                    }
                    model.msgList = entitylist;
                    listGroupMsg.Add(model);
                }
                ViewBag.EvalInfo = listGroupMsg;
            }
            #endregion
            return(c);
        }