Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         AutoId = Request["AutoId"];
         if (!string.IsNullOrEmpty(AutoId))
         {
             tInfo = bll.Get <BLLJIMP.Model.TutorInfo>(string.Format(" AutoId={0}", AutoId));
             Gettrade();        //获取行业
             GetProfessional(); //获取行业
         }
         else
         {
             Gettrade1();        //获取行业
             GetProfessional1(); //获取行业
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 获取关注的导师发布的文章
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetGuanZhuArticleList(HttpContext context)
        {
            int           pageIndex  = int.Parse(context.Request["PageIndex"]);
            int           pageSize   = int.Parse(context.Request["PageSize"]);
            int           totalCount = 0;
            StringBuilder sbWhere    = new StringBuilder(string.Format("WebsiteOwner='{0}' And ArticleType='article' And IsHide=0 And IsDelete=0", bllUser.WebsiteOwner));

            List <UserFollowChain> list = bllUser.GetList <UserFollowChain>(string.Format("FromUserId='{0}'", currentUserInfo.UserID));

            if (list.Count > 0)
            {
                string strJoin = "";
                foreach (var item in list)
                {
                    strJoin += string.Format("'{0}',", item.ToUserId);
                }
                strJoin = strJoin.TrimEnd(',');
                sbWhere.AppendFormat(" And UserID in({0})", strJoin);
            }
            else
            {
                sbWhere.AppendFormat(" And 1=0");
            }
            totalCount = bllUser.GetCount <ZentCloud.BLLJIMP.Model.JuActivityInfo>(sbWhere.ToString());
            List <ZentCloud.BLLJIMP.Model.JuActivityInfo> data = bllUser.GetLit <ZentCloud.BLLJIMP.Model.JuActivityInfo>(pageSize, pageIndex, sbWhere.ToString(), " Sort DESC,JuActivityID DESC");

            for (int i = 0; i < data.Count; i++)
            {
                BLLJIMP.Model.TutorInfo tutorInfo = bllUser.Get <BLLJIMP.Model.TutorInfo>(string.Format(" UserID='{0}'", data[i].UserID));
                if (tutorInfo != null)
                {
                    data[i].ThumbnailsPath = tutorInfo.TutorImg ?? data[i].ThumbnailsPath;
                }
                data[i].ActivityDescription = null;
            }
            resp.ExObj = data;
            int TotalPage = bllUser.GetTotalPage(totalCount, pageSize);

            if ((TotalPage > pageIndex) && (pageIndex.Equals(1)))
            {
                resp.ExStr = "1";//是否增加下一页按钮
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Пример #3
0
 /// <summary>
 /// 获取导师详情
 /// </summary>
 /// <param name="UserId"></param>
 private void GetTutor(string UserId)
 {
     tInfo = bllUser.Get <BLLJIMP.Model.TutorInfo>(string.Format(" AutoId='{0}'", UserId));
     if (tInfo != null)
     {
         BLLJIMP.Model.UserInfo uInfo = bllUser.Get <BLLJIMP.Model.UserInfo>(string.Format("UserId='{0}'", tInfo.UserId));
         IheadImg.Src        = tInfo.TutorImg;
         txtExplain.Text     = tInfo.TutorExplain;
         txtTrade.Text       = GetTradeStr(tInfo.TradeStr);                 //行业标签
         txtProfessiona.Text = GettxtProfessionaStr(tInfo.ProfessionalStr); //专业标签
         IsFollowedString    = bllUser.CheckFollow(bllUser.GetCurrentUserInfo().UserID, tInfo.UserId) ? "关注" : "已关注";
         FansNum.InnerText   = uInfo.FansCount.ToString();
         FansNumInt          = uInfo.FansCount;
         BLLJIMP.Model.ForwardingRecord frecord = bllUser.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName='导师赞'", DataLoadTool.GetCurrUserModel().UserID, tInfo.UserId, bllUser.WebsiteOwner));
         if (frecord != null)
         {
             zan = true;
         }
         UserLevel = bllUserScore.GetUserLevelByTotalScore(uInfo.HistoryTotalScore);
     }
 }
Пример #4
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetNewsList(HttpContext context)
        {
            int           pageIndex    = int.Parse(context.Request["PageIndex"]);
            int           pageSize     = int.Parse(context.Request["PageSize"]);
            string        activityName = context.Request["ArticleName"];
            string        categoryId   = context.Request["CategoryId"];
            int           totalCount   = 0;
            StringBuilder sbWhere      = new StringBuilder(string.Format("WebsiteOwner='{0}' And ArticleType='article' And IsHide=0 And IsDelete=0", bllUser.WebsiteOwner));
            List <int>    listJieDu    = new List <int>();//市场解读

            //if (context.Request.Url.Host.Equals("xixinxian.comeoncloud.net"))
            //{
            //    ListJieDu.Add(169);
            //}
            //else
            //{
            //    ListJieDu.Add(240);
            //}
            listJieDu.Add(240);
            List <ZentCloud.BLLJIMP.Model.ArticleCategory> jieDuCategoryList = bllUser.GetList <ZentCloud.BLLJIMP.Model.ArticleCategory>(string.Format("PreID={0}", listJieDu[0].ToString()));

            for (int i = 0; i < jieDuCategoryList.Count; i++)
            {
                listJieDu.Add(jieDuCategoryList[i].AutoID);
            }

            if (!string.IsNullOrEmpty(activityName))
            {
                sbWhere.AppendFormat(" And ActivityName like '%{0}%'", activityName);
            }
            if (!string.IsNullOrEmpty(categoryId))
            {
                ZentCloud.BLLJIMP.Model.ArticleCategory category = bllUser.Get <ZentCloud.BLLJIMP.Model.ArticleCategory>(string.Format("AutoID={0} And WebsiteOwner='{1}'", categoryId, bllUser.WebsiteOwner));
                if ((category != null) && category.PreID.Equals(0))
                {
                    List <ZentCloud.BLLJIMP.Model.ArticleCategory> subCategoryList = bllUser.GetList <ZentCloud.BLLJIMP.Model.ArticleCategory>(string.Format("PreID={0}", categoryId));
                    if (subCategoryList.Count > 0)
                    {
                        string strCategoryIds = "";
                        for (int i = 0; i < subCategoryList.Count; i++)
                        {
                            strCategoryIds += subCategoryList[i].AutoID.ToString() + ",";
                        }
                        strCategoryIds += categoryId;
                        sbWhere.AppendFormat(" And CategoryId in({0})", strCategoryIds);
                    }
                    else
                    {
                        sbWhere.AppendFormat(" And CategoryId={0}", categoryId);
                    }
                }
                else
                {
                    sbWhere.AppendFormat(" And CategoryId={0}", categoryId);
                }
            }
            totalCount = bllUser.GetCount <ZentCloud.BLLJIMP.Model.JuActivityInfo>(sbWhere.ToString());
            List <ZentCloud.BLLJIMP.Model.JuActivityInfo> data = bllUser.GetLit <ZentCloud.BLLJIMP.Model.JuActivityInfo>(pageSize, pageIndex, sbWhere.ToString(), " Sort DESC,LastUpdateDate DESC,JuActivityID DESC");

            for (int i = 0; i < data.Count; i++)
            {
                BLLJIMP.Model.TutorInfo tutorInfo = bllUser.Get <BLLJIMP.Model.TutorInfo>(string.Format(" UserID='{0}'", data[i].UserID));
                if (tutorInfo != null)
                {
                    data[i].ThumbnailsPath = tutorInfo.TutorImg ?? data[i].ThumbnailsPath;
                }
                data[i].ActivityDescription = null;
            }


            resp.ExObj = data;
            resp.ExStr = "";
            int TotalPage = bllUser.GetTotalPage(totalCount, pageSize);

            if ((TotalPage > pageIndex) && (pageIndex.Equals(1)))
            {
                resp.ExStr = "1";//是否增加下一页按钮
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }