Exemple #1
0
        //
        // GET: /Manage/WriteLog/Details/5

        public ActionResult Details(int id)
        {
            ViewtWriteLog model      = client.GetById(id);
            ViewYogaUser  userEntity = userClient.GetYogaUserById(model.Uid.Value);

            if (userEntity != null)
            {
                ViewBag.NickName = userEntity.NickName;
            }
            return(View(model));
        }
Exemple #2
0
        //被赞
        public ActionResult ZanIndex(int page = 1)
        {
            List <ViewtZanModels> listWhere0 = zanclient.GetByFromUidList(user.Uid, 0, out count);

            if (count > 0)
            {
                //第一次登录
                foreach (ViewtZanModels item in listWhere0)
                {
                    item.loginType = 1;
                    zanclient.Update(item);
                }
            }
            else
            {
                List <ViewtZanModels> listWhere1 = zanclient.GetByFromUidList(user.Uid, 1, out count);
                if (count > 0)
                {
                    foreach (ViewtZanModels item in listWhere1)
                    {
                        item.loginType = 2;
                        zanclient.Update(item);
                    }
                }
            }

            List <ViewtZanModels>      Zanlist  = zanclient.GetToUidList(user.Uid);
            PagedList <ViewtZanModels> pagelist = new PagedList <ViewtZanModels>(Zanlist, page, 10, count);

            #region
            List <ViewFollowUserDetail> listFollowGroup = new List <ViewFollowUserDetail>();
            foreach (var item in Zanlist)
            {
                ViewYogaUser         userEntity = clientUser.GetYogaUserById(item.iFromUid.Value);
                ViewFollowUserDetail model      = new ViewFollowUserDetail();
                model.FollowersName = userEntity.NickName;//昵称
                model.flag          = item.iType.Value;
                model.CreateTime    = item.CreateDate;
                model.iNew          = item.loginType.Value;
                switch (item.iToType)
                {
                    #region


                case 0:    //"0习练者

                    ViewYogaUserDetail udmodel = udclient.GetYogaUserDetailById(item.iFromUid.Value);
                    model.spic    = CommonInfo.GetDisplayImg(udmodel.DisplayImg);
                    model.userurl = "/YogaUserDetail/Details/";
                    model.uid     = udmodel.UID;

                    listFollowGroup.Add(model);

                    break;

                case 1:    //1导师

                    ViewYogisModels mmodel = clientModel.GetYogisModelsById(item.iFromUid.Value);
                    model.spic = CommonInfo.GetDisplayImg(mmodel.DisplayImg);

                    if (mmodel.YogisLevel == 4)
                    {
                        model.userurl  = "/YogaGuru/Details/";
                        model.nickname = mmodel.RealName;
                    }
                    else
                    {
                        model.userurl = "/YogisModels/Details/";
                    }

                    model.uid = mmodel.UID;

                    listFollowGroup.Add(model);
                    break;
                    #endregion

                case 2:    //2 学习互动(社区)

                    break;

                case 3:    //3 日志标识" 日志表加个字段ID 表示赞的主键
                    ViewtWriteLog  entity    = new ViewtWriteLog();
                    ViewtZanModels zanentity = zanclient.GetByiToType(item.iToType.Value);
                    if (zanentity != null)
                    {
                        if (zanentity.ToUid != user.Uid)
                        {
                            entity        = writelogclient.GetById(zanentity.iToUid.Value);
                            model.Profile = entity.sTitle;   //标题
                            #region
                            model.ID = zanentity.iToUid.Value;
                            if (userEntity.UserType == 0)
                            {
                                ViewYogaUserDetail udmodel3 = udclient.GetYogaUserDetailById(item.iFromUid.Value);
                                model.spic    = CommonInfo.GetDisplayImg(udmodel3.DisplayImg);
                                model.userurl = "/YogaUserDetail/Details/";
                                model.uid     = udmodel3.UID;

                                listFollowGroup.Add(model);
                            }
                            else
                            {
                                ViewYogisModels mmodel3 = clientModel.GetYogisModelsById(item.iFromUid.Value);
                                model.spic = CommonInfo.GetDisplayImg(mmodel3.DisplayImg);

                                if (mmodel3.YogisLevel == 4)
                                {
                                    model.userurl  = "/YogaGuru/Details/";
                                    model.nickname = mmodel3.RealName;
                                }
                                else
                                {
                                    model.userurl = "/YogisModels/Details/";
                                }

                                model.uid = mmodel3.UID;

                                listFollowGroup.Add(model);
                            }

                            #endregion
                        }
                    }

                    break;
                }
            }

            ViewBag.listFollowGroup = listFollowGroup;

            #endregion

            return(View(pagelist));
        }