コード例 #1
0
 public IActionResult Index()
 {
     ViewBag.tycount   = barBll.SelYTCount();                                         //发贴统计
     ViewBag.rpt_focus = barBll.SelFocus();                                           //热点
     ViewBag.rpt_week  = barBll.SelTop(15);                                           //每周热门
     ViewBag.rpt_top   = GetBarImg();
     ViewBag.rpt_cart  = cateBll.Cate_SelByType(M_GuestBookCate.TypeEnum.PostBar, 0); //第一级贴吧
     ViewBag.cartdt    = cateBll.GetCateList();
     return(View());
 }
コード例 #2
0
ファイル: VM_PClass.cs プロジェクト: baixue001/IPS
        //贴子列表
        public VM_PClass(HttpContext ctx, int cpage)
        {
            HttpRequest Request = ctx.Request;

            tuBll  = new B_TempUser(ctx);
            CateID = DataConverter.CLng(Request.GetParam("ID"));
            mu     = tuBll.GetLogin(); //barBll.GetUser();
            //dt = barBll.SelByCateID(CateID.ToString(), 1, true);
            setting = barBll.SelPage(cpage, 15, CateID, 0, Request.GetParam("skey"), true);
            cateMod = cateBll.SelReturnModel(CateID);
            if (cateMod == null)
            {
                throw new Exception("指定栏目不存在");
            }
            #region 权限校验
            if (cateMod.IsBarOwner(mu.UserID))//按用户或搜索时无cateid
            {
                auth_barowner = true;
                auth_send     = true;
                //DPBind();
            }
            else//非吧主权限验证
            {
                switch (cateMod.PermiBit)
                {
                case "1":    //版面类别
                    //emptydiv.Style.Add("display", "none");
                    //send_div.Visible = false;
                    //RPT.Visible = false;
                    break;

                default:
                    if (!authBll.AuthCheck(cateMod, mu, "needlog"))    //访问权限
                    {
                        throw new Exception("你没有访问权限");
                    }
                    auth_send = authBll.AuthCheck(cateMod, mu, "send");  //发贴权限
                    break;
                }
            }
            #endregion
            childCateDT = cateBll.GetCateList(CateID);
        }
コード例 #3
0
        //贴子列表
        public VM_PClass(HttpRequestBase Request, int cpage)
        {
            CateID = DataConverter.CLng(Request.QueryString["ID"]);
            mu     = tuBll.GetLogin(); //barBll.GetUser();
            //dt = barBll.SelByCateID(CateID.ToString(), 1, true);
            setting = barBll.SelPage(cpage, 15, CateID, 0, Request.Form["skey"], true);
            cateMod = cateBll.SelReturnModel(CateID);
            if (cateMod == null)
            {
                function.WriteErrMsg("指定栏目不存在");
            }
            #region 权限校验
            if (cateMod.IsBarOwner(mu.UserID))//按用户或搜索时无cateid
            {
                auth_barowner = true;
                auth_send     = true;
                //DPBind();
            }
            else//非吧主权限验证
            {
                switch (cateMod.PermiBit)
                {
                case "1":    //版面类别
                    //emptydiv.Style.Add("display", "none");
                    //send_div.Visible = false;
                    //RPT.Visible = false;
                    break;

                default:
                    if (!authBll.AuthCheck(cateMod, mu, "needlog"))    //访问权限
                    {
                        function.WriteErrMsg("你没有访问权限");
                    }
                    auth_send = authBll.AuthCheck(cateMod, mu, "send");  //发贴权限
                    break;
                }
            }
            #endregion
            childCateDT = cateBll.GetCateList(CateID);
        }