Exemplo n.º 1
0
    private void AddQuestion()
    {
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("添加问题说明" + "<br />");
        builder.Append(Out.Tab("</div>", "" + ""));
        string info = Utils.GetRequest("info", "all", 1, "", "");

        if (info == "")
        {
            string strText = "输入问题名称:/,输入问题的解释:/,输入的链接:";
            string strName = "Title,Explain,LinkName";
            string strType = "textarea,big,select";
            string strValu = "''";
            string strEmpt = "false,false,null|null|brag.aspx|brag.aspx|GetPwd.aspx|GetPwd.aspx";
            string strIdea = "/";
            string strOthe = "添加问题,BackMoreQuestion.aspx?act=addquestion&amp;info=ok,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        }
        else
        {
            string Title    = Utils.GetRequest("Title", "post", 1, "", "");
            string Explain  = Utils.GetRequest("Explain", "post", 1, "", "");
            string LinkName = Utils.GetRequest("LinkName", "post", 1, "", "");

            Explain = Explain.Replace("\n", "<br/>");
            BCW.Model.tb_Help objHelp = new BCW.Model.tb_Help();
            objHelp.Title   = Title;
            objHelp.Explain = Explain;
            if (!LinkName.Equals("null"))
            {
                objHelp.LinkName = LinkName;
                objHelp.HasLink  = 1;
            }
            else
            {
                objHelp.HasLink  = 0;
                objHelp.LinkName = "null";
            }
            int maxid = new BCW.BLL.tb_Help().GetMaxId();
            int i;
            for (i = 1; i <= maxid; i++)
            {
                if (!new BCW.BLL.tb_Help().Exists(i))
                {
                    objHelp.ID = i;
                    break;
                }
            }
            if (i == maxid + 1)
            {
                objHelp.ID = (maxid + 1);
            }
            new BCW.BLL.tb_Help().Add(objHelp);
            Utils.Success("添加问题", "添加成功..", Utils.getPage("BackMoreQuestion.aspx"), "3");
        }
        builder.Append(Out.Tab("<div class=\"title\">", "<br/>"));
        builder.Append("<a href=\"" + Utils.getUrl("BackMoreQuestion.aspx") + "\">返回上一级</a>" + "");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.tb_Help model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(BCW.Model.tb_Help model)
 {
     dal.Add(model);
 }
Exemplo n.º 4
0
    private void Change()
    {
        //builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        //builder.Append("这里是编辑修改原本的问题说明的:" + "<br/>");
        //builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("BackMoreQuestion.aspx") + "\">返回上一级</a>" + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        string info = Utils.GetRequest("info", "all", 1, "", "");

        if (info == "")
        {
            int id = Convert.ToInt32(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));
            BCW.Model.tb_Help help     = new BCW.BLL.tb_Help().Gettb_Help(id);
            string            Title    = help.Title;
            string            Explain  = help.Explain;
            string            LinkName = help.LinkName;
            int hasLink = help.HasLink;
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("你的ID 是:" + help.ID + "<br/>");
            builder.Append("你原本的问题题目是:" + help.Title + "<br/>");
            builder.Append("你原本的问题解释是:" + help.Explain + "<br/>");
            builder.Append("你原本的链接名字是:" + help.LinkName + "<br/>");
            builder.Append("你原来是否有链接的( 1:代表有, 0:代表没有 ):" + help.HasLink + "<br/>");
            builder.Append(Out.Tab("</div>", "<br />"));
            string strText = "输入新的问题标题:/,输入新的问题解释:/,输入新的链接:";
            string strName = "Title,Explain,LinkName";
            string strType = "textarea,big,select";
            string strValu = "''";
            string strEmpt = "false,false,null|null|GetPwd.aspx|GetPwd.aspx";
            string strIdea = "/";
            string strOthe = "提交,BackMoreQuestion.aspx?act=change&amp;info=ok&amp;id=" + help.ID + ",post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            builder.Append("<br/>");
        }
        else
        {
            string Title    = Utils.GetRequest("Title", "post", 1, "", "");
            string Explain  = Utils.GetRequest("Explain", "post", 1, "", "");
            string LinkName = Utils.GetRequest("LinkName", "post", 1, "", "");

            Explain = Explain.Replace("\n", "<br/>");

            BCW.Model.tb_Help objHelp = new BCW.Model.tb_Help();
            objHelp.Title   = Title;
            objHelp.Explain = Explain;
            if (!LinkName.Equals("null"))
            {
                objHelp.LinkName = LinkName;
                objHelp.HasLink  = 1;
            }
            else
            {
                objHelp.HasLink  = 0;
                objHelp.LinkName = "null";
            }
            objHelp.ID = Convert.ToInt32(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));
            new BCW.BLL.tb_Help().Update(objHelp);
            Utils.Success("修改问题", "修改成功..", Utils.getPage("BackMoreQuestion.aspx"), "3");
        }
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("BackMoreQuestion.aspx") + "\">返回上一级</a>" + "");
        builder.Append(Out.Tab("</div>", "<br />"));
    }