Ejemplo n.º 1
0
        public IActionResult Default()
        {
            int             CateID  = DataConverter.CLng(RequestEx["cateid"]);
            string          Skey    = RequestEx["skey"];
            M_GuestBookCate cateMod = cateBll.SelReturnModel(CateID);

            if (cateMod == null)
            {
                cateMod = new M_GuestBookCate()
                {
                    CateID = 0, CateName = "留言信息", NeedLog = 0
                };
            }
            ViewBag.cateMod = cateMod;
            ViewBag.cateDt  = cateBll.SelByGuest();
            ViewBag.needlog = cateMod.NeedLog;
            ViewBag.mu      = buser.GetLogin();
            PageSetting setting = B_GuestBook.SelPage(CPage, PSize, new F_Guest()
            {
                parentId  = 0,
                skey      = Skey,
                cateIds   = cateMod.CateID.ToString(),
                uids      = mu.UserID.ToString(),
                onlyAudit = true
            });

            return(View(setting));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string  str    = "分类名称";
            B_Admin badmin = new B_Admin();

            Egv.txtFunc = txtPageFunc;
            if (!this.Page.IsPostBack)
            {
                int CateID = string.IsNullOrEmpty(Request.QueryString["CateID"]) ? 0 : DataConverter.CLng(Request.QueryString["CateID"]);
                if (CateID <= 0)
                {
                    function.WriteErrMsg("缺少留言分类ID", "../Plus/GuestCateMana.aspx");
                }
                else
                {
                    this.HdnCateID.Value = CateID.ToString();
                }
                guestMod = cateBll.SelReturnModel(Convert.ToInt32(Request.QueryString["CateID"]));
                if (guestMod != null)
                {
                    str = guestMod.CateName;
                }
                cateName = ">>" + guestMod.CateName;
                DataBind();
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li></li><li><a href='GuestManage.aspx'>留言管理</a></li><li><a href='Default.aspx?CateID=" + Request.QueryString["CateID"] + "'>" + str + "</a></li><li class='active'>留言回复列表</li>");
        }
Ejemplo n.º 3
0
    //public string UrlRef
    //{
    //    get
    //    {
    //        string _urlRef = "";
    //        if (!string.IsNullOrEmpty(Request.QueryString["urlref"]))//多图上传
    //        {
    //            _urlRef = Request.QueryString["urlref"].ToLower();
    //        }
    //        else
    //        {
    //            _urlRef = Request.UrlReferrer == null ? "" : Request.UrlReferrer.ToString().ToLower();
    //        }
    //        return _urlRef;
    //    }
    //}
    //private bool IsBar()
    //{
    //    bool flag = false;
    //    if (!string.IsNullOrEmpty(UrlRef))
    //    {
    //        flag = (UrlRef.Contains("/pclass?") || UrlRef.Contains("/pitem?") || UrlRef.Contains("/editcontent?"));
    //    }
    //    return flag;
    //}
    private M_GuestBookCate GetBarModel(UploadConfig config)
    {
        M_GuestBookCate model  = null;
        B_Guest_Bar     barBll = new B_Guest_Bar();

        if (config.SourceUrl.Contains("/pclass?"))
        {
            int cateid = DataConverter.CLng(StrHelper.GetValFromUrl(config.SourceUrl, "id"));
            model = cateBll.SelReturnModel(cateid);
        }
        else
        {
            int cateid = 0;
            int postid = DataConverter.CLng(StrHelper.GetValFromUrl(config.SourceUrl, "cateid"));
            if (postid > 0)
            {
                cateid = barBll.SelCateIDByPost(postid);
            }
            else
            {
                cateid = DataConverter.CLng(StrHelper.GetValFromUrl(config.SourceUrl, "cateid"));
            }
            model = cateBll.SelReturnModel(cateid);
        }
        return(model);
    }
Ejemplo n.º 4
0
        public IActionResult CateAdd()
        {
            M_GuestBookCate cateMod = cateBll.SelReturnModel(Mid);

            if (cateMod == null)
            {
                cateMod = new M_GuestBookCate();
            }
            return(View("CateAdd", cateMod));
        }
Ejemplo n.º 5
0
        public IActionResult CateAdd()
        {
            M_GuestBookCate cateMod = cateBll.SelReturnModel(Mid);

            if (cateMod == null)
            {
                cateMod          = new M_GuestBookCate();
                cateMod.ParentID = DataConvert.CLng(GetParam("PID"));
            }
            return(View("CateAdd", cateMod));
        }
 protected void BtnSetRecomPosation_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.Form["idchk"]))
     {
         string[] ids = Request.Form["idchk"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         foreach (var item in ids)
         {
             M_GuestBookCate mc = cateBll.SelReturnModel(Convert.ToInt32(item));
             mc.BarInfo = "Recommend";
             cateBll.UpdateByID(mc);
         }
         function.WriteSuccessMsg("操作完成!");
     }
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.HdnCateID.Value = CateID.ToString();
         if (!string.IsNullOrEmpty(Request.QueryString["type"]) && Request.QueryString["type"].Equals("del"))
         {
             barBll.DelByCid(CateID);
         }
         SKey = Request.QueryString["Skey"];
         MyBind();
         M_GuestBookCate cateMod  = cateBll.SelReturnModel(CateID);
         string          catename = cateMod == null ? "全部帖子" : cateMod.CateName;
         Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx" + "'>"
                            + "工作台</a></li><li><a href='GuestCateMana.aspx?Type=1'>贴吧版面</a></li><li class='active'><a href='TieList.aspx?CateID=" + CateID + "'>贴子列表:</a>"
                            + catename + "[<a href='TieList.aspx?" + (BarStatus != (int)ZLEnum.ConStatus.Recycle ? "&status=" + (int)ZLEnum.ConStatus.Recycle : "") + "'>" + (BarStatus != (int)ZLEnum.ConStatus.Recycle ? "回收站" : "返回") + "</a>]</li>");
     }
 }
Ejemplo n.º 8
0
        public ActionResult Default()
        {
            int             CateID  = DataConverter.CLng(Request["cateid"]);
            string          Skey    = Request["skey"];
            M_GuestBookCate cateMod = cateBll.SelReturnModel(CateID);

            if (cateMod == null)
            {
                cateMod = new M_GuestBookCate()
                {
                    CateID = 0, CateName = "留言信息", NeedLog = 0
                };
            }
            ViewBag.cateMod = cateMod;
            ViewBag.cateDt  = cateBll.SelByGuest();
            ViewBag.needlog = cateMod.NeedLog;
            ViewBag.mu      = buser.GetLogin();
            PageSetting setting = cateBll.SelPage(CPage, PSize, -100, cateMod.CateID, 0, Skey, buser.GetLogin().UserID, true);

            return(View(setting));
        }
Ejemplo n.º 9
0
        public VM_PItem(HttpRequestBase Request, int cpage, int psize)
        {
            barMod = barBll.SelReturnModel(DataConvert.CLng(Request.QueryString["id"]));
            if (barMod == null)
            {
                function.WriteErrMsg("该贴子不存在!!");
            }
            cateMod = cateBll.SelReturnModel(barMod.CateID);
            mu      = tuBll.GetLogin();
            if (barMod.Status != (int)ZLEnum.ConStatus.Audited && cateMod.Status != 1)
            {
                function.WriteErrMsg("该贴子需要审核通过才能浏览!");
            }
            if (cateMod.IsBarOwner(mu.UserID))//吧主
            {
                auth_barowner = true;
                auth_edit     = true;
            }
            else
            {
                if (!authBll.AuthCheck(cateMod, mu))
                {
                    function.WriteErrMsg("你没有访问权限或未登录,请<a href='/User/Login?Returnurl=/PItem?id=" + barMod.ID + "&cpage=" + cpage + "'>登录</a>后查看");
                }
                if ((!authBll.AuthCheck(cateMod, mu, "send")))
                {
                    auth_send = false;
                }
            }
            if (barMod.CUser == mu.UserID)
            {
                auth_edit = true;
            }
            setting = barBll.SelByID(cpage, psize, barMod, Request.QueryString["Filter"]);
            barBll.AddHitCount(barMod.ID);
            barMod.HitCount++;
            string msgids = "";

            for (int i = 0; i < setting.dt.Rows.Count; i++)
            {
                msgids += setting.dt.Rows[i]["ID"].ToString() + ",";
            }
            likeDT  = likeBll.SelByMsgIDS(msgids.Trim(','), "bar");
            mediaDT = medalBll.SelByBarIDS(msgids.Trim(','));
            if (barMod.Status < 0 && barMod.Status == (int)ZLEnum.ConStatus.Recycle)
            {
                function.WriteErrMsg("该帖子已删除!!", "/PClass?id=" + barMod.CateID);
            }
            auth_like = !barMod.ColledIDS.Contains("," + mu.UserID + ",");
        }
        public void MyBind()
        {
            cateMod                 = cateBll.SelReturnModel(CateID);
            txtCateName.Text        = cateMod.CateName;
            selected_Hid.Value      = cateMod.ParentID.ToString();
            NeedLog.SelectedValue   = cateMod.NeedLog.ToString();
            PostAuth.SelectedValue  = cateMod.PostAuth.ToString();
            GType_Rad.SelectedValue = cateMod.GType.ToString();
            SenderScore_T.Text      = cateMod.SendScore.ToString();
            ReplyScore_T.Text       = cateMod.ReplyScore.ToString();
            PostType.SelectedValue  = DataConverter.CLng(cateMod.PermiBit).ToString();
            ZipImgSize_T.Text       = cateMod.ZipImgSize.ToString();
            IsPlat_T.Text           = cateMod.IsPlat.ToString();
            ImageInfo_T.Text        = cateMod.BarImage;
            cateMod.Desc            = BarDesc_T.Text;
            IsCheck_Ra.Checked      = cateMod.Status == 1;
            CheckOpt_Ra.Checked     = cateMod.IsShowUnaudit == 1;
            DataTable userDT = buser.SelectUserByIds(cateMod.BarOwner);

            if (userDT != null && userDT.Rows.Count > 0)
            {
                userDT = userDT.DefaultView.ToTable(true, "UserID", "UserName");
                BarOwner_Json_T.Value = JsonConvert.SerializeObject(userDT);
            }
            BarOwner_Hid.Value = cateMod.BarOwner;
            BarOption baroption = GuestConfig.GuestOption.BarOption.Find(v => v.CateID == CateID);

            if (baroption != null)
            {
                UserTime_T.Text = baroption.UserTime.ToString();
                SendTime_T.Text = baroption.SendTime.ToString();
            }
            if (cateMod.GType != (int)M_GuestBookCate.TypeEnum.PostBar)
            {
                function.Script(this, "HideBarSet();");
            }
        }
Ejemplo n.º 11
0
 protected void SaveOrder_B_Click(object sender, EventArgs e)
 {
     string[] ids = changeids.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
     if (ids.Length > 0)
     {
         string[] orderIds = changeorders.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         for (int i = 0; i < ids.Length; i++)
         {
             M_GuestBookCate CateMod = cateBll.SelReturnModel(Convert.ToInt32(ids[i]));
             CateMod.OrderID = Convert.ToInt32(orderIds[i]);
             cateBll.UpdateByID(CateMod);
         }
         MyBind();
     }
     function.Script(this, "Refresh();");
 }
Ejemplo n.º 12
0
        //贴子列表
        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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        //贴子编辑|新建
        public IActionResult EditContent()
        {
            M_UserInfo      mu      = tuBll.GetLogin();// buser.GetLogin();
            M_Guest_Bar     barMod  = new M_Guest_Bar();
            M_GuestBookCate cateMod = null;

            if (Mid >= 0)
            {
                barMod = barBll.SelReturnModel(Mid);
                if (barMod == null)
                {
                    return(WriteErr("该贴子不存在!"));
                }
                cateMod = cateBll.SelReturnModel(barMod.CateID);
                if ((cateMod.IsBarOwner(mu.UserID) || barMod.CUser == mu.UserID) && barMod.ReplyID == 0)
                {
                    barMod.MsgContent = StrHelper.DecompressString(barMod.MsgContent);
                }
                else
                {
                    return(WriteErr("您没有权限修改此贴!"));
                }
            }
            else
            {
                cateMod = cateBll.SelReturnModel(CateID);
                string errtitle = "<h3 class='panel-title'><span class='fa fa-exclamation-circle'></span> 系统提示</h3>";
                if (!authBll.AuthCheck(cateMod, mu, "send"))//验证发贴权限
                {
                    string url = "/User/Login?ReturnUrl=" + HttpUtility.UrlEncode(Request.RawUrl());
                    return(WriteErr(errtitle, "你没有登录,请[<a href='" + url + "'>登录</a>]后再发贴!", url));
                }
                else if (!authBll.AuthCheck(cateMod, mu, "send"))
                {
                    return(WriteErr(errtitle, "您没有权限在此发帖,请[<a href='/Bar/Index'>返回</a>]论坛主页!", "/Index"));
                }
            }
            ViewBag.cateMod = cateMod;
            return(View(barMod));
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = "分类名称";

            function.AccessRulo();
            Egv1.txtFunc = txtPageFunc;
            if (!this.Page.IsPostBack)
            {
                guestMod = cateBll.SelReturnModel(CateID);
                if (guestMod != null)
                {
                    str = guestMod.CateName;
                }
                if (ID <= 0)
                {
                    function.WriteErrMsg("留言ID不正确!", "../Plus/Default.aspx");
                }
                else
                {
                    DataBind();
                }
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='GuestCateMana.aspx?Type=1'>贴吧版面</a></li><li><a href='TieList.aspx?CateID=" + Request.QueryString["CateID"] + "'>" + str + "</a></li><li class='active'>贴子内容</li>");
        }