예제 #1
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_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));
        }