コード例 #1
0
    private void ViewPage()
    {
        Master.Title = "查看留言";
        int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Vbook().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Vbook model = new BCW.BLL.Vbook().GetVbook(id);

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(model.Title);
        builder.Append(Out.Tab("</div>", ""));

        builder.Append(Out.Tab("<div>", "<br />"));
        //if (model.Face != 0)
        //builder.Append("<img src=\"/Files/face/" + model.Face + ".gif\" alt=\"load\"/>");

        builder.Append(model.Content);
        builder.Append("<br />作者:" + model.UsName);
        if (model.UsID != 0)
        {
            builder.Append("(ID:" + model.UsID + ")");
        }

        builder.Append("<br />提交IP:" + model.AddUsIP);
        builder.Append("<br />时间:" + model.AddTime);
        builder.Append("<br />查看密码:" + model.VPwd);
        builder.Append("<br />保密内容:" + model.SyText);
        if (!string.IsNullOrEmpty(model.ReText))
        {
            builder.Append("<br />~~~~~~");
            builder.Append("<br />" + model.ReName + "回复:" + model.ReText);
            builder.Append("<br />回复时间:" + model.ReTime);
        }
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("vbook.aspx") + "\">返回上一级</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
コード例 #2
0
    private void EditPage()
    {
        Master.Title = "管理留言";
        int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Vbook().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Vbook model = new BCW.BLL.Vbook().GetVbook(id);
        //回复时间
        DateTime reTime = DateTime.Now;

        if (!string.IsNullOrEmpty(model.ReTime.ToString()))
        {
            reTime = Convert.ToDateTime(model.ReTime);
        }

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("管理" + model.Title);
        builder.Append(Out.Tab("</div>", ""));
        string strText = "您的昵称:/,标题:/,内容:/,保密内容:(管理员可见)/,查看密码:(留空不加密)/,回复昵称:/,回复内容:/,回复时间:/,,,";
        string strName = "UsName,Title,Content,SyText,VPwd,ReName,ReText,ReTime,id,act,backurl";
        string strType = "text,text,textarea,text,text,text,text,date,hidden,hidden,hidden";
        string strValu = "" + model.UsName + "'" + model.Title + "'" + model.Content + "'" + model.SyText + "'" + model.VPwd + "'" + model.ReName + "'" + model.ReText + "'" + reTime + "'" + id + "'ok'" + Utils.getPage(0) + "";
        string strEmpt = "false,false,false,false,false,false,true,true,false,false,false";
        string strIdea = "/";
        string strOthe = "管理留言|reset,vbook.aspx,post,1,red|blue";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?backurl=" + Utils.getPage(0) + "") + "\">返回上一级</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
コード例 #3
0
    private void ReloadPage()
    {
        Master.Title = "管理网友留言";
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-9]\d*$", "0"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("管理留言");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (ptype == 0)
        {
            builder.Append("等待回复|");
            builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">已回复</a>");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?ptype=0&amp;backurl=" + Utils.getPage(0) + "") + "\">等待回复</a>");
            builder.Append("|已回复");
        }
        builder.Append(Out.Tab("</div>", "<br />"));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere += "Types=0";
        if (ptype == 0)
        {
            strWhere += " AND (ReText IS NULL OR ReText='')";
        }
        else
        {
            strWhere += " AND ReText<>''";
        }

        // 开始读取列表
        IList <BCW.Model.Vbook> listVbook = new BCW.BLL.Vbook().GetVbooks(pageIndex, pageSize, strWhere, out recordCount);

        if (listVbook.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Vbook n in listVbook)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                if (k == 1)
                {
                    builder.Append(Out.Tab("<div>", ""));
                }
                else
                {
                    builder.Append(Out.Tab("<div>", "<br />"));
                }

                string sFace = string.Empty;
                if (!string.IsNullOrEmpty(n.VPwd))
                {
                    sFace = "*";
                }
                builder.AppendFormat("<a href=\"" + Utils.getUrl("vbook.aspx?act=edit&amp;id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">[管理]</a>{1}{2}.<a href=\"" + Utils.getUrl("vbook.aspx?act=view&amp;id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>", n.ID, sFace, (pageIndex - 1) * pageSize + k, n.Title);
                builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?act=del&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[删]</a>");
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?act=add") + "\">添加留言</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
コード例 #4
0
ファイル: vbook.aspx.cs プロジェクト: radtek/GitKB288
    private void ReloadPage()
    {
        Master.Title = ub.GetSub("VBookName", xmlPath);
        if (ub.GetSub("VBookLogo", xmlPath) != "")
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<img src=\"" + ub.GetSub("VBookLogo", xmlPath) + "\" alt=\"load\"/>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">" + ub.GetSub("VBookName", xmlPath) + "</div>", ""));
        }
        if (ub.GetSub("VBookNotes", xmlPath) != "")
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("" + ub.GetSub("VBookNotes", xmlPath) + "");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere = "Types=0";

        // 开始读取列表
        IList <BCW.Model.Vbook> listVbook = new BCW.BLL.Vbook().GetVbooks(pageIndex, pageSize, strWhere, out recordCount);

        if (listVbook.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Vbook n in listVbook)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                if (k == 1)
                {
                    builder.Append(Out.Tab("<div>", ""));
                }
                else
                {
                    builder.Append(Out.Tab("<div>", "<br />"));
                }

                string sFace = string.Empty;
                if (!string.IsNullOrEmpty(n.VPwd))
                {
                    sFace = "*";
                }
                if (string.IsNullOrEmpty(n.ReText) && ub.GetSub("VBookIsAc", xmlPath) == "1")
                {
                    builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".留言处理中,请稍后..");
                }
                else
                {
                    builder.AppendFormat("{0}.<a href=\"" + Utils.getUrl("vbook.aspx?act=view&amp;id={1}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{2}{3}</a>", (pageIndex - 1) * pageSize + k, n.ID, sFace, n.Title);
                }
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("vbook.aspx?act=add&amp;backurl=" + Utils.getPage(0) + "") + "\">发表留言</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
コード例 #5
0
ファイル: vbook.aspx.cs プロジェクト: radtek/GitKB288
    private void ViewPage()
    {
        Master.Title = "查看留言";
        int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Vbook().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Vbook model = new BCW.BLL.Vbook().GetVbook(id);

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(model.Title);
        builder.Append(Out.Tab("</div>", ""));

        builder.Append(Out.Tab("<div>", "<br />"));

        //----------------密码访问开始
        string pwd = Utils.GetRequest("pwd", "post", 1, "", "");

        if (!string.IsNullOrEmpty(model.VPwd) && pwd != model.VPwd)
        {
            new Out().head(Utils.ForWordType("温馨提示"));
            Response.Write(Out.Tab("<div class=\"title\">", ""));
            Response.Write("本留言内容已加密");
            Response.Write(Out.Tab("</div>", ""));
            string strText = "输入密码:/,,,";
            string strName = "pwd,id,act,backurl";
            string strType = "password,hidden,hidden,hidden,hidden";
            string strValu = "'" + id + "'view'" + Utils.getPage(0) + "";
            string strEmpt = "false,false,false,false";
            string strIdea = "/";
            string strOthe = "确认查看,vbook.aspx,post,1,red";

            Response.Write(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            Response.Write(Out.Tab("<div class=\"ft\">", ""));
            Response.Write(" <a href=\"" + Utils.getPage("vbook.aspx") + "\">取消</a>");
            Response.Write(Out.Tab("</div>", "<br />"));
            Response.Write(new Out().foot());
            Response.End();
        }

        //----------------密码访问结束
        //if (model.Face != 0)
        //builder.Append("<img src=\"Files/face/" + model.Face + ".gif\" alt=\"load\"/>");

        builder.Append(model.Content);
        builder.Append("<br />作者:" + model.UsName);
        builder.Append("<br />时间:" + model.AddTime);
        if (!string.IsNullOrEmpty(model.ReText))
        {
            builder.Append("<br />~~~~~~");
            builder.Append("<br />" + model.ReName + "回复:" + model.ReText);
            builder.Append("<br />回复时间:" + model.ReTime);
        }
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("vbook.aspx") + "\">返回上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }