public ActionResult Index()
        {
            if (!B_User.CheckIsLogged(Request.RawUrl))
            {
                return(null);
            }
            M_UserInfo mu = buser.GetLogin();

            if (!B_User.CheckUserStatus(mu, ref err))
            {
                function.WriteErrMsg(err); return(null);
            }
            B_PointGrounp pgBll  = new B_PointGrounp();
            B_Search      shBll  = new B_Search();
            M_Uinfo       basemu = buser.GetUserBaseByuserid(mu.UserID);
            //--------------------------------------------------
            DataTable dt         = shBll.SelByUserGroup(mu.GroupID);
            string    userapptlp = "<div class='col-lg-2 col-md-3 col-sm-4 col-xs-4 padding10'><div class='user_menu'><a target='@target' href='@fileUrl'>@ico<br/>@name</a></div></div>";
            string    onthertlp  = "<li><a target='@target' href='@fileUrl'>@ico<span>@name</span></a></li>";
            string    userhtml   = "";
            string    ontherhtml = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string targetlink = GetLinkTarget(dt.Rows[i]["OpenType"].ToString());
                if (DataConverter.CLng(dt.Rows[i]["EliteLevel"]) == 1)//抽出推荐应用
                {
                    userhtml += ReplaceData(userapptlp, dt.Rows[i]).Replace("@target", targetlink);
                    continue;
                }
                else
                {
                    ontherhtml += ReplaceData(onthertlp, dt.Rows[i]).Replace("@target", targetlink);
                }
            }
            //---------------------
            ViewBag.userhtml   = MvcHtmlString.Create(userhtml);
            ViewBag.ontherhtml = MvcHtmlString.Create(ontherhtml);
            ViewBag.pgMod      = pgBll.SelectPintGroup((int)mu.UserExp);
            ViewBag.basemu     = basemu;
            return(View(mu));
        }
Exemple #2
0
        public ActionResult Index()
        {
            if (!B_User.CheckIsLogged(Request.RawUrl))
            {
                return(null);
            }
            M_UserInfo mu = buser.GetLogin();

            if (!B_User.CheckUserStatus(mu, ref err))
            {
                function.WriteErrMsg(err); return(null);
            }
            B_Search shBll  = new B_Search();
            M_Uinfo  basemu = buser.GetUserBaseByuserid(mu.UserID);
            //--------------------------------------------------
            DataTable dt         = shBll.SelByUserGroup(mu.GroupID);
            string    userapptlp = "<div class='col-xl-2 col-lg-2 col-md-2 col-sm-4 col-4 @mobile user_menuBox'><div class='user_menu'><a target='@target' href='@fileUrl'>@ico<br/>@name</a></div></div>";
            string    onthertlp  = "<li><a target='@target' href='@fileUrl'>@ico<span>@name</span></a></li>";
            string    userhtml   = "";
            string    ontherhtml = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr         = dt.Rows[i];
                string  targetlink = GetLinkTarget(dr["OpenType"].ToString());
                string  mobileStr  = DataConvert.CLng(dr["mobile"]) == 1 ? "" : "d-none d-sm-block";
                if (DataConverter.CLng(dr["EliteLevel"]) == 1)//抽出推荐应用
                {
                    userhtml += ReplaceData(userapptlp, dr).Replace("@target", targetlink).Replace("@mobile", mobileStr);
                }
                else
                {
                    ontherhtml += ReplaceData(onthertlp, dr).Replace("@target", targetlink);
                }
            }
            //---------------------
            ViewBag.userhtml   = MvcHtmlString.Create(userhtml);
            ViewBag.ontherhtml = MvcHtmlString.Create(ontherhtml);
            ViewBag.basemu     = basemu;
            return(View(mu));
        }