コード例 #1
0
        /// <summary>
        /// 获取本学院导师
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult GetModelBuycenterid(int id)
        {
            List <ViewUserModelsGroup> users      = new List <ViewUserModelsGroup>();
            FollowServiceClient        clientFoll = new FollowServiceClient();
            ViewUserModelsGroup        user       = null;

            JsonResult js = new JsonResult();

            List <ViewYogisModels> list = new List <ViewYogisModels>();

            using (YogisModelsServiceClient client = new YogisModelsServiceClient())
            {
                //返回个数
                int count = 4;
                list = client.GetYogisModelsByCenterId(id, count);
            }
            for (int i = 0; i < list.Count; i++)
            {
                list[i].DisplayImg  = CommonInfo.GetDisplayImg(list[i].DisplayImg);
                list[i].YogisDepict = list[i].YogisDepict.Length > 320 ? list[i].YogisDepict.Substring(0, 320) + "..." : list[i].YogisDepict;
                user             = new ViewUserModelsGroup();
                user.VmList      = list[i];
                user.FollowCount = clientFoll.GetFollowByCount(list[i].UID);
                users.Add(user);
            }
            js.Data = users;
            js.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            return(js);
        }
コード例 #2
0
        public tInstationInfoController()
        {
            ViewBag.user   = user;
            method         = new method();
            client         = new tInstationInfoServiceClient();
            list           = new List <ViewtInstationInfo>();
            zanclient      = new tZanModelsServiceClient();
            followclient   = new FollowServiceClient();
            messageclient  = new tMessageServiceClient();
            clientUser     = new YogaUserServiceClient();
            clientModel    = new YogisModelsServiceClient();
            udclient       = new YogaUserDetailServiceClient();
            writelogclient = new tWriteLogServiceClient();
            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = udclient.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level  = temp.Ulevel;
                    ViewBag.Gender = temp.Gender;
                }
            }
            else//导师级别
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = clientModel.GetYogisModelsById(user.Uid);

                if (vyogism != null)
                {
                    ViewBag.level  = vyogism.YogisLevel;
                    ViewBag.Gender = vyogism.Gender;
                }
            }
            #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
        }
コード例 #3
0
        public YogaGuruController()
        {
            ViewBag.user = user;
            client       = new YogisModelsServiceClient();
            clientUser   = new YogaUserServiceClient();
            clientMsg    = new tMessageServiceClient();
            clientFoll   = new FollowServiceClient();
            clientDetail = new YogaUserDetailServiceClient();

            logClient = new tWriteLogServiceClient();
            clientPic = new YogaPictureServiceClient();
            dicclient = new YogaDicItemServiceClient();
            zanclient = new tZanModelsServiceClient();
            method    = new method();
            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = clientDetail.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level = temp.Ulevel;
                }
            }
            else
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = client.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
        }
コード例 #4
0
        public FollowController()
        {
            ViewBag.user      = user;
            client            = new FollowServiceClient();
            yuserclient       = new YogaUserServiceClient();
            modelclient       = new YogisModelsServiceClient();
            userdetailsclient = new YogaUserDetailServiceClient();
            list   = new List <ViewFollow>();
            model  = new ViewFollow();
            method = new method();
            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = userdetailsclient.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level = temp.Ulevel;
                }
            }
            else
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = modelclient.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
        }
コード例 #5
0
ファイル: method.cs プロジェクト: wangweicoder/IYogaKoo
 public method()
 {
     client              = new ClassServiceClient();
     dicclient           = new YogaDicItemServiceClient();
     interclient         = new InterestServiceClient();
     msgclient           = new tMessageServiceClient();
     clientUser          = new YogaUserServiceClient();
     clientbanner        = new tBannerServiceClient();
     udclient            = new YogaUserDetailServiceClient();
     modelsclient        = new YogisModelsServiceClient();
     userloginInfoclient = new tUserLoginInfoServiceClient();
     tinstaclient        = new tInstationInfoServiceClient();
     followclient        = new FollowServiceClient();
     zanclient           = new tZanModelsServiceClient();
     messageclient       = new tMessageServiceClient();
     cenclient           = new IYogaKoo.Client.CentersServiceClient();
 }
コード例 #6
0
        /// <summary>
        /// 属于机构的导师列表
        /// </summary>
        /// <returns></returns>
        public List <ViewUserModelsGroup> Members(int id)
        {
            #region 属于机构的导师列表
            List <ViewYogisModels> list = new List <ViewYogisModels>();
            using (YogisModelsServiceClient client = new YogisModelsServiceClient())
            {
                //返回个数
                int count = 4;
                list = client.GetYogisModelsByCenterId(id, count);
            }
            List <ViewUserModelsGroup> users      = new List <ViewUserModelsGroup>();
            FollowServiceClient        clientFoll = new FollowServiceClient();
            ViewUserModelsGroup        userModels = null;
            for (int i = 0; i < list.Count; i++)
            {
                list[i].DisplayImg = CommonInfo.GetDisplayImg(list[i].DisplayImg);
                if (!string.IsNullOrEmpty(list[i].YogisDepict))
                {
                    string tempdepict = NoHTML(list[i].YogisDepict);

                    list[i].YogisDepict = tempdepict.Length > 320 ? tempdepict.Substring(0, 320) + "..." : tempdepict;
                }
                userModels = new ViewUserModelsGroup();
                if (list[i].CountryID.Value != -1)
                {
                    userModels.CountryName = dicclient.GetById(list[i].CountryID.Value).ItemName;
                }
                else
                {
                    userModels.CountryName = dicclient.GetById(66).ItemName;
                }
                userModels.VmList = list[i];
                //user.FollowCount = clientFoll.GetFollowByCount(list[i].UID);
                userModels.iFollow = method.iGetFollow(user.Uid, list[i].UID);
                users.Add(userModels);
            }

            return(users);

            // return Json(users,JsonRequestBehavior.AllowGet);
            // ViewBag.Members = users;
            #endregion
        }
コード例 #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id">报道ClassId</param>
        /// <param name="classReportId">报道id</param>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult ActivityReportDetailsPage(int id, int classReportId, int page = 1)
        {
            ViewBag.id = id;
            int       rcount   = 0;
            int       pagesize = 10;
            ViewClass entity   = new ViewClass();

            entity = client.Get(id);

            if (entity.iReadNums == null)
            {
                entity.iReadNums = 1;
            }
            else
            {
                entity.iReadNums++;
            }
            client.Edit(entity);
            ViewBag.iShareNums = entity.iShareNums == null ? 0 : entity.iShareNums;

            ViewBag.Entity     = entity;
            ViewBag.interCount = interclient.Count(id);                    //分享人数

            ViewBag.MsgInfo = method.listMessage(id, 3, page, out rcount); //评论

            YogisModelsServiceClient ymClient = new YogisModelsServiceClient();
            //老师粉丝
            FollowServiceClient followClient = new FollowServiceClient();
            int teacherFollowCount           = 0;

            foreach (var item in entity.Teachers)
            {
                //followClient.GetFollowUidList(item.UserId, 1, 1, out teacherFollowCount);
                //ViewData[item.UserId.ToString()] = teacherFollowCount;
                var ymModel = ymClient.GetById((int)item.TeacherId);
                int num     = followClient.GetFollowByCount(ymModel.UID);
                ViewData[item.UserId.ToString()] = num;
            }
            //发起人粉丝
            ViewBag.Sponsor = followClient.GetFollowByCount(entity.UserId);

            Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup> messlist = new Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup>(ViewBag.MsgInfo, page, pagesize, rcount);
            if (Request.IsAjaxRequest())
            {
                return(PartialView("PartialMessage", messlist));
            }

            ViewData["ClassStatus"] = Session["ClassStatus"];

            using (ClassReportServiceClient rClient = new ClassReportServiceClient())
            {
                List <ViewClassReport> classReportList = rClient.GetClassId(id);
                ViewBag.ClassReport     = classReportList;
                ViewBag.ClassReportShow = new ViewClassReport();
                if (classReportList.Any())
                {
                    if (classReportId == -99)
                    {
                        ViewBag.ClassReportShow = classReportList.First();
                    }
                    else
                    {
                        ViewBag.ClassReportShow = classReportList.First(p => p.Id == classReportId);
                    }
                }
            }

            return(View(messlist));
        }
コード例 #8
0
        public ActionResult ViewActivity(int id)
        {
            //, bool isOrder = false ViewBag.isOrder = isOrder;
            ViewBag.id = id;
            ClassServiceClient       client  = new ClassServiceClient();
            YogaDicItemServiceClient dclient = new YogaDicItemServiceClient();
            ViewClass model             = client.Get(id);
            List <ViewYogaDicItem> dics = dclient.GetSelectList(model.TopicIds);

            model.TopicIds = "";
            //主题
            foreach (var item in dics)
            {
                if (model.TopicIds == "")
                {
                    model.TopicIds = item.ItemName;
                }
                else
                {
                    model.TopicIds = model.TopicIds + " " + item.ItemName;
                }
            }
            //发起人头像
            model.Poster = client.GetAvatars(model.UserId.ToString())[0];

            //兴趣
            InterestServiceClient interestClient = new InterestServiceClient();

            ViewBag.IsInterest    = interestClient.Exists(id, user.Uid);
            ViewBag.InterestCount = interestClient.ClassInterests(id, 1, 10).RecordCount;

            ////老师粉丝
            //FollowServiceClient followClient = new FollowServiceClient();
            //int teacherFollowCount = 0;
            //foreach (var item in model.Teachers)
            //{
            //    followClient.GetFollowUidList(item.UserId, 1, 1, out teacherFollowCount);
            //    ViewData[item.UserId.ToString()] = teacherFollowCount;
            //}

            YogisModelsServiceClient ymClient = new YogisModelsServiceClient();
            //老师粉丝
            FollowServiceClient followClient = new FollowServiceClient();

            foreach (var item in model.Teachers)
            {
                //followClient.GetFollowUidList(item.UserId, 1, 1, out teacherFollowCount);
                //ViewData[item.UserId.ToString()] = teacherFollowCount;
                var ymModel = ymClient.GetById((int)item.TeacherId);
                int num     = followClient.GetFollowByCount(ymModel.UID);
                ViewData[item.UserId.ToString()] = num;
            }
            //发起人粉丝
            ViewBag.Sponsor = followClient.GetFollowByCount(model.UserId);

            //参加
            OrderServiceClient orderClient = new OrderServiceClient();
            // 只查询出有效的订单
            PageResult <ViewOrder> orders = orderClient.GetByClass(id, 1, 6000);

            //等待加入
            #region
            string uids      = "";
            int    joinCount = 0;
            foreach (ViewOrder item in orders.Objects)
            {
                if (uids == "")
                {
                    uids = item.UserId.ToString();
                }
                else
                {
                    uids += "," + item.UserId;
                }
                joinCount += item.Number;
            }
            ViewBag.JoinCount = joinCount;
            List <UserListItem> orderAvatars   = client.GetAvatars(uids == "" ? "0" : uids);
            List <UserListItem> allJoinAvatars = new List <UserListItem>();
            foreach (var item in orders.Objects)
            {
                foreach (var ui in orderAvatars)
                {
                    if (item.UserId == ui.ID)
                    {
                        for (int i = 0; i < item.Number; i++)
                        {
                            allJoinAvatars.Add(ui);
                        }
                    }
                }
            }
            ViewData["AllJoinAvatars"] = allJoinAvatars;
            #endregion

            return(View(model));
        }
コード例 #9
0
        public string SetFollow(int quertid, string isf, int UserType)
        {
            int        uid   = user.Uid;
            ViewFollow model = new ViewFollow();

            model.Uid      = uid;
            model.QuiltUid = quertid;
            model.iType    = UserType;
            string restring = null;
            int    reid     = 0;

            if (uid != quertid)
            {
                if (isf == "+关注")
                {
                    using (FollowServiceClient clent = new FollowServiceClient())
                    {
                        model = clent.GetFollowById(uid, quertid);
                        if (model != null)
                        {
                            //update
                            model.FollowDate = DateTime.Now;
                            model.isfollow   = true;

                            clent.Update(model);
                        }
                        else
                        {
                            //insert
                            model               = new ViewFollow();
                            model.Uid           = uid;
                            model.QuiltUid      = quertid;
                            model.FollowDate    = DateTime.Now;
                            model.isfollow      = true;
                            model.iType         = UserType;
                            model.QuiltCenterID = user.UserType;
                            model.loginType     = 0;
                            clent.Add(model);
                        }
                        restring = "1";
                    }
                }
                else if (isf == "已关注")
                {
                    using (FollowServiceClient clent = new FollowServiceClient())
                    {
                        model = clent.GetFollowById(uid, quertid);

                        model.isfollow   = false;
                        model.FollowDate = DateTime.Now;
                        reid             = clent.Update(model);

                        restring = "0";
                    }
                }
            }
            else
            {
                restring = "3";//自己不需要关注自己
            }
            return(restring);
        }
コード例 #10
0
        /// <summary>
        ///  瑜伽达人/导师 主页
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(int id, int page = 1)
        {
            #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
            ///Follow iType
            ViewBag.UserType = 1;

            ViewBag.id = id;

            int strUid   = user.Uid;
            int iLoginID = user.Uid;//登录用户ID
            ViewBag.iLoginID = user.Uid;

            #region 导师专页 基本信息

            ViewYogisModels temp = new ViewYogisModels();

            temp = client.GetYogisModelsById(id);
            if (!temp.IsNullOrEmpty())
            {
                ///昵称
                ViewBag.NickName = clientUser.GetYogaUserById(temp.UID).NickName;

                strUid         = temp.UID;
                ViewBag.strUid = temp.UID;
                ///位置
                string strCountryID  = "";
                string strProvinceID = "";
                string strCityID     = "";
                string strDistrictID = "";
                if (temp.CountryID != null && temp.CountryID != 0)
                {
                    strCountryID = GetItemName(temp.CountryID.Value) + "· ";
                }
                if (temp.ProvinceID != null && temp.ProvinceID != 0)
                {
                    strProvinceID = GetItemName(temp.ProvinceID.Value) + " · ";
                }
                if (temp.CityID != null && temp.CityID != 0)
                {
                    strCityID = GetItemName(temp.CityID.Value) + " ·";
                }
                if (temp.DistrictID != null && temp.DistrictID != 0)
                {
                    strDistrictID = GetItemName(temp.DistrictID.Value);
                }

                ViewBag.AddRessName = strCountryID + strProvinceID + strCityID + strDistrictID;
                ///流派
                if (!string.IsNullOrEmpty(temp.YogaTypeid))
                {
                    string[] ids = temp.YogaTypeid.Split(',');
                    foreach (var i in ids)
                    {
                        ViewBag.YogaTypeid += GetItemName(Convert.ToInt32(i)) + " ";
                    }
                }
                else
                {
                    ViewBag.YogaTypeid = "";
                }
                ViewBag.listGroup = temp;
            }
            #endregion

            //关注 粉丝 人气
            ViewFollow viewMoel = new ViewFollow();
            using (FollowServiceClient followClient = new FollowServiceClient())
            {
                ViewBag.iCount = followClient.GetFollowByUid(id);
                ViewBag.FCount = followClient.GetFollowByCount(id);
            }

            #region 瑜伽圈

            List <ViewFollow> listFollow = new List <ViewFollow>();

            listFollow = clientFoll.GetFollowUidQuiltList(id);

            ViewFollow vm = clientFoll.GetFollowById(iLoginID, strUid);
            ViewBag.isfollow = vm == null ? false : vm.isfollow;

            List <ViewFollowUserDetail> list2Group = new List <ViewFollowUserDetail>();

            #region

            string idsUid      = string.Join(",", listFollow.Where(a => a.Uid != id).Select(a => a.Uid));
            string idsQuiltUid = string.Join(",", listFollow.Where(a => a.QuiltUid != id).Select(a => a.QuiltUid));

            string idsval = idsUid + "," + idsQuiltUid;
            //数组
            var idslist = idsval.Split(',').Distinct();

            foreach (var item in idslist)
            {
                if (!string.IsNullOrEmpty(item))
                {
                    ViewFollowUserDetail model     = new ViewFollowUserDetail();
                    ViewYogaUser         modelyoga = clientUser.GetYogaUserById(Convert.ToInt32(item));

                    if (modelyoga.UserType == 0)
                    {
                        //专页id和被关注id是同一个
                        //习练者
                        ViewYogaUserDetail udmodel = clientDetail.GetYogaUserDetailById(Convert.ToInt32(item));
                        model.spic    = CommonInfo.GetDisplayImg(udmodel.DisplayImg);
                        model.userurl = "/YogaUserDetail/Details/";
                        model.uid     = udmodel.UID;
                        //登录表
                        model.nickname = modelyoga.NickName;

                        list2Group.Add(model);
                    }
                    else if (modelyoga.UserType == 1)
                    {
                        #region 导师
                        ViewYogisModels mmodel = client.GetYogisModelsById(Convert.ToInt32(item));
                        model.spic = CommonInfo.GetDisplayImg(mmodel.DisplayImg);
                        //登录表
                        model.nickname = modelyoga.NickName;
                        if (mmodel.YogisLevel != null)
                        {
                            if (mmodel.YogisLevel == 4)
                            {
                                model.userurl  = "/YogaGuru/Details/";
                                model.nickname = mmodel.RealName;
                            }
                            else
                            {
                                model.userurl = "/YogisModels/Details/";
                            }
                        }
                        else
                        {
                            model.userurl = "/YogisModels/Details/";
                        }
                        model.uid = mmodel.UID;
                        #endregion
                        list2Group.Add(model);
                    }
                }
            }

            #endregion

            ViewBag.list2Group = list2Group;

            #endregion

            #region 相册

            List <ViewYogaPicture> listPic = new List <ViewYogaPicture>();
            int piccount = 0;
            listPic = clientPic.GetYogaPicturePageList(id, 1, 7, out piccount);
            if (listPic.Count() > 0)
            {
                ViewBag.listPic = listPic;
            }
            #endregion
            int rcount   = 0;
            int mcount   = 0;
            int pagesize = 10;
            ViewBag.msginfo = method.listMessage(id, 0, page, out mcount);//留言 评论
            ViewBag.mcount  = mcount;
            ViewBag.rcount  = clientMsg.GettMessageUid(id, 1).Count();
            #region 我的日志列表
            int count = 0;
            List <ViewtWriteLog> listwriteLog = logClient.GettWriteLogPageList(id, 1, 6, out count);

            List <ViewtWriteLogGroup> listLog = new List <ViewtWriteLogGroup>();
            foreach (var item in listwriteLog)
            {
                ViewtWriteLogGroup model = new ViewtWriteLogGroup();
                model.entity = item;

                ViewYogaUser userEntity = clientUser.GetYogaUserById(item.Uid.Value);
                if (userEntity != null)
                {
                    model.UserName = userEntity.NickName;
                }
                else
                {
                    model.UserName = "";
                }

                listLog.Add(model);
            }
            ViewBag.listLog = listLog;
            #endregion

            ViewBag.url = Request.Url.AbsolutePath;
            Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup> l = new Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup>(ViewBag.msginfo, page, pagesize, mcount);

            string strRec = "";
            if (!string.IsNullOrEmpty(Request.Form["levelid"]))
            {
                strRec = Request.Form["levelid"];
            }
            if (Session["levelid"] != null)
            {
                if (string.IsNullOrEmpty(strRec))
                {
                    strRec = Session["levelid"].ToString();
                }
            }
            if (!string.IsNullOrEmpty(strRec))
            {
                if (strRec == "1")
                {
                    #region 推荐数据
                    List <ViewtMessage> recommendEntity = new List <ViewtMessage>();
                    recommendEntity = clientMsg.GettMessageUidList(id, 1, page, pagesize, out rcount);
                    List <ViewtMessageGroup> listGroupRec = new List <ViewtMessageGroup>();

                    foreach (var item in recommendEntity)
                    {
                        ViewtMessageGroup model = new ViewtMessageGroup();

                        model.entity      = item;
                        model.entity.iZan = zanclient.ZanCount(item.ID, item.FormType.Value);
                        //被留言人

                        ViewYogaUser yuser = clientUser.GetYogaUserById(item.ToUid.Value);
                        if (yuser != null)
                        {
                            model.ToUser   = yuser.NickName;
                            model.UserType = yuser.UserType;
                        }
                        //留言人
                        ViewYogaUser usermodel = clientUser.GetYogaUserById(item.FromUid.Value);
                        if (usermodel != null)
                        {
                            model.FromUser = usermodel.NickName;
                            model.UserType = usermodel.UserType;
                        }
                        if (item.FormType == 0)
                        {
                            //习练者头像
                            using (YogaUserDetailServiceClient clientDet = new YogaUserDetailServiceClient())
                            {
                                ViewYogaUserDetail ViewDet = new ViewYogaUserDetail();
                                if (item.FromUid != 0)
                                {
                                    model.DisplayImg = clientDet.GetYogaUserDetailById(item.FromUid.Value).DisplayImg;
                                }
                                model.sUrl = "/YogaUserDetail/Details/" + item.FromUid.Value;
                            }
                        }
                        else
                        {
                            //导师头像
                            using (YogisModelsServiceClient clientDet = new YogisModelsServiceClient())
                            {
                                ViewYogisModels ViewDet = new ViewYogisModels();
                                if (item.FromUid != 0)
                                {
                                    model.DisplayImg = clientDet.GetYogisModelsById(item.FromUid.Value).DisplayImg;
                                }
                                model.sUrl = "/YogisModels/Details/" + item.FromUid.Value;
                            }
                        }
                        //回复
                        List <ViewtMessage>      listM      = clientMsg.GettMessageParentID(item.ID);
                        List <ViewtMessageGroup> entitylist = new List <ViewtMessageGroup>();
                        foreach (var it in listM)
                        {
                            ViewtMessageGroup entityMsg = new ViewtMessageGroup();
                            entityMsg.entity = it;
                            //被留言人

                            ViewYogaUser yuser2 = clientUser.GetYogaUserById(it.ToUid.Value);
                            if (yuser2 != null)
                            {
                                entityMsg.ToUser = yuser2.NickName;
                            }
                            //留言人
                            ViewYogaUser usermodel2 = clientUser.GetYogaUserById(it.FromUid.Value);
                            if (usermodel2 != null)
                            {
                                entityMsg.FromUser = usermodel2.NickName;
                            }

                            entitylist.Add(entityMsg);
                        }
                        model.msgList = entitylist;
                        listGroupRec.Add(model);
                    }

                    ViewBag.RecInfo = listGroupRec;

                    #endregion
                    Session["levelid"] = strRec;
                    Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup> l2 = new Webdiyer.WebControls.Mvc.PagedList <ViewtMessageGroup>(ViewBag.RecInfo, page, pagesize, rcount);
                    if (Request.IsAjaxRequest())
                    {
                        return(PartialView("PartialRec", l2));
                    }
                }
            }
            if (Request.IsAjaxRequest())
            {
                Session["levelid"] = 0;
                return(PartialView("PartialRec", l));
            }
            return(View(l));
        }
コード例 #11
0
        public ActionResult PicList2(int id, int page = 1)
        {
            ///Follow iType
            ViewBag.UserType = 1;

            ViewBag.id = id;

            int strUid   = user.Uid;
            int iLoginID = user.Uid;//登录用户ID

            ViewBag.iLoginID = user.Uid;

            #region 导师专页 基本信息

            ViewYogisModels temp = new ViewYogisModels();

            temp = client.GetYogisModelsById(id);
            ///昵称
            ViewBag.NickName = clientUser.GetYogaUserById(temp.UID).NickName;

            strUid         = temp.UID;
            ViewBag.strUid = temp.UID;
            ///位置
            string strCountryID  = "";
            string strProvinceID = "";
            string strCityID     = "";
            string strDistrictID = "";
            if (temp.CountryID != null && temp.CountryID != 0)
            {
                strCountryID = GetItemName(temp.CountryID.Value) + "· ";
            }
            if (temp.ProvinceID != null && temp.ProvinceID != 0)
            {
                strProvinceID = GetItemName(temp.ProvinceID.Value) + " · ";
            }
            if (temp.CityID != null && temp.CityID != 0)
            {
                strCityID = GetItemName(temp.CityID.Value) + " ·";
            }
            if (temp.DistrictID != null && temp.DistrictID != 0)
            {
                strDistrictID = GetItemName(temp.DistrictID.Value);
            }

            ViewBag.AddRessName = strCountryID + strProvinceID + strCityID + strDistrictID;
            ///流派
            if (!string.IsNullOrEmpty(temp.YogaTypeid))
            {
                string[] ids = temp.YogaTypeid.Split(',');
                foreach (var i in ids)
                {
                    ViewBag.YogaTypeid += GetItemName(Convert.ToInt32(i)) + " ";
                }
            }
            else
            {
                ViewBag.YogaTypeid = "";
            }
            ViewBag.listGroup = temp;
            #endregion

            //推荐的数据
            using (tZanModelsServiceClient zclient = new tZanModelsServiceClient())
            {
                List <ViewtZanModels> listz = zclient.GettZanUid(id);
                ViewBag.tzancount = listz.Count();
            }
            //关注 粉丝 人气
            ViewFollow viewMoel = new ViewFollow();
            using (FollowServiceClient followClient = new FollowServiceClient())
            {
                ViewBag.iCount = followClient.GetFollowByUid(id);
                ViewBag.FCount = followClient.GetFollowByCount(id);
            }

            #region 相册

            List <ViewYogaPicture> listPic = new List <ViewYogaPicture>();

            listPic = clientPic.GetUidList(id);


            #endregion
            return(View(listPic));
        }