Ejemplo n.º 1
0
    private void OkPage()
    {
        string LinkName  = Utils.GetRequest("LinkName", "post", 2, @"^[\s\S]{2,10}$", "请输入不超过10字的网站名称");
        string LinkNamt  = Utils.GetRequest("LinkNamt", "post", 2, @"^(?:[\u4E00-\u9FA5]{2,3}|[\w\-\.]{2,5})$", "请输入正确的网站简称,中文限2-3字,字母或数字限2-5字");
        string LinkUrl   = Utils.GetRequest("LinkUrl", "post", 2, @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", "请输入合法的网址");
        string LinkNotes = Utils.GetRequest("LinkNotes", "post", 3, @"^[\s\S]{0,500}$", "请输入不超过500字的网站简介");
        string KeyWord   = Utils.GetRequest("KeyWord", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}(?:\|[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}){0,9}$", "关键词最少必须输入1个,最多10个,每个关键词最多不能超过9字,并且不能使用特殊字符");
        int    Leibie    = int.Parse(Utils.GetRequest("Leibie", "post", 1, @"^[0-9]\d*$", "0"));
        int    LinkRd    = int.Parse(Utils.GetRequest("LinkRd", "post", 2, @"^[0-1]$", "是否推荐选择错误"));

        if (new BCW.BLL.Link().Exists(LinkUrl))
        {
            Utils.Error("该网站已发布成功", "");
        }
        //友链是否要审核
        int LinkAc = 1;
        //友链ID
        int LID = new BCW.BLL.Link().GetMaxId();

        BCW.Model.Link model = new BCW.Model.Link();
        model.ID        = LID;
        model.LinkName  = LinkName;
        model.LinkNamt  = LinkNamt;
        model.LinkUrl   = LinkUrl;
        model.LinkNotes = LinkNotes;
        model.KeyWord   = KeyWord;
        model.LinkIn    = 0;
        model.LinkOut   = 0;
        model.ReStats   = "";
        model.ReLastIP  = "";
        model.LinkTime  = DateTime.Now;
        model.LinkTime2 = DateTime.Now;
        model.AddTime   = DateTime.Now;
        model.Leibie    = Leibie;
        model.LinkRd    = LinkRd;
        model.Hidden    = LinkAc;
        new BCW.BLL.Link().Add(model);

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("发布网站成功");

        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("添加网站成功");
        builder.Append("<br />名称:" + ub.GetSub("LinkwebName", xmlPath) + "<br />");
        builder.Append("网址:" + ub.GetSub("LinkDomain", xmlPath) + "/?kid=" + LID + "<br />");
        if (!string.IsNullOrEmpty(ub.GetSub("LinkSummary", xmlPath)))
        {
            builder.Append("简介:" + ub.GetSub("LinkSummary", xmlPath) + "");
        }

        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("link.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 />"));
    }
Ejemplo n.º 2
0
    private void SavePage()
    {
        int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Link().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        string LinkName  = Utils.GetRequest("LinkName", "post", 2, @"^[\s\S]{2,10}$", "请输入不超过10字的网站名称");
        string LinkNamt  = Utils.GetRequest("LinkNamt", "post", 2, @"^(?:[\u4E00-\u9FA5]{2,3}|[\w\-\.]{2,5})$", "请输入正确的网站简称,中文限2-3字,字母或数字限2-5字");
        string LinkUrl   = Utils.GetRequest("LinkUrl", "post", 2, @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", "请输入合法的网址");
        string LinkNotes = Utils.GetRequest("LinkNotes", "post", 3, @"^[\s\S]{0,500}$", "请输入不超过500字的网站简介");
        string KeyWord   = Utils.GetRequest("KeyWord", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}(?:\|[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}){0,9}$", "关键词最少必须输入1个,最多10个,每个关键词最多不能超过9字,并且不能使用特殊字符");
        int    LinkIn    = int.Parse(Utils.GetRequest("LinkIn", "post", 2, @"^[0-9]\d*$", "链入PV填写错误"));
        int    LinkOut   = int.Parse(Utils.GetRequest("LinkOut", "post", 2, @"^[0-9]\d*$", "链出PV填写错误"));
        int    LinkIPIn  = int.Parse(Utils.GetRequest("LinkIPIn", "post", 2, @"^[0-9]\d*$", "链入IP填写错误"));
        int    LinkIPOut = int.Parse(Utils.GetRequest("LinkIPOut", "post", 2, @"^[0-9]\d*$", "链出IP填写错误"));
        int    LinkRd    = int.Parse(Utils.GetRequest("LinkRd", "post", 2, @"^[0-1]$", "是否推荐选择错误"));
        int    Leibie    = int.Parse(Utils.GetRequest("Leibie", "post", 1, @"^[0-9]\d*$", "0"));
        int    Hidden    = int.Parse(Utils.GetRequest("Hidden", "post", 2, @"^[0-1]$", "审核性质选择错误"));

        BCW.Model.Link model = new BCW.Model.Link();
        model.ID        = id;
        model.LinkName  = LinkName;
        model.LinkNamt  = LinkNamt;
        model.LinkUrl   = LinkUrl;
        model.LinkNotes = LinkNotes;
        model.KeyWord   = KeyWord;
        model.LinkIn    = LinkIn;
        model.LinkOut   = LinkOut;
        model.LinkIPIn  = LinkIPIn;
        model.LinkIPOut = LinkIPOut;
        model.LinkRd    = LinkRd;
        model.Leibie    = Leibie;
        model.Hidden    = Hidden;
        new BCW.BLL.Link().Update(model);
        Utils.Success("修改成功", "修改成功,正在返回..", Utils.getUrl("link.aspx?act=edit&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + ""), "1");
    }
Ejemplo n.º 3
0
    private void OkPage()
    {
        Master.Title = "发布您的网站";
        //会员发表权限
        int meid = new BCW.User.Users().GetUsId();

        if (ub.GetSub("LinkIsUser", xmlPath) == "1")
        {
            if (meid == 0)
            {
                Utils.Login();
            }
        }
        string LinkName = Utils.GetRequest("LinkName", "post", 2, @"^[\s\S]{2,10}$", "请输入不超过10字的网站名称");
        string LinkNamt = Utils.GetRequest("LinkNamt", "post", 2, @"^(?:[\u4E00-\u9FA5]{2,3}|[\w\-\.]{2,5})$", "请输入正确的网站简称,中文限2-3字,字母或数字限2-5字");
        //string LinkUrl = Utils.GetRequest("LinkUrl", "post", 2, @"^(?:http:\/\/)?(?:[\w\-]{1,10}\.)?[\w\-]{1,20}\.(?:com\.cn|net\.cn|com|net|org|mobi|cn|cc|us|name|me)(?:\/[\w\-]+){0,5}(?:\.aspx|\.asp|\.aspx|\.jsp|\.php|\.do|\.eu|\.action|\/)?(?:\?[\w\-]{1,20}\=[\w\.\-]{1,30})?$", "请输入合法的网址");
        string LinkUrl   = Utils.GetRequest("LinkUrl", "post", 2, @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", "请输入合法的网址");
        string LinkNotes = Utils.GetRequest("LinkNotes", "post", 3, @"^[\s\S]{0,500}$", "请输入不超过500字的网站简介");
        string KeyWord   = Utils.GetRequest("KeyWord", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}(?:\|[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{2,9}){0,9}$", "关键词最少必须输入1个,最多10个,每个关键词最多不能超过9字,并且不能使用特殊字符");
        int    Leibie    = int.Parse(Utils.GetRequest("Leibie", "post", 1, @"^[0-9]\d*$", "0"));

        if (new BCW.BLL.Link().Exists(LinkUrl))
        {
            Utils.Error("您的网站已发布成功", "");
        }

        //是否刷屏
        string appName = "LIGHT_LINK";
        int    Expir   = Convert.ToInt32(ub.GetSub("LinkExpir", xmlPath));

        BCW.User.Users.IsFresh(appName, Expir);

        //友链是否要审核
        int LinkAc = Convert.ToInt32(ub.GetSub("LinkIsAc", xmlPath));
        //友链ID
        int LID = new BCW.BLL.Link().GetMaxId();

        BCW.Model.Link model = new BCW.Model.Link();
        model.ID        = LID;
        model.LinkName  = LinkName;
        model.LinkNamt  = LinkNamt;
        model.LinkUrl   = LinkUrl;
        model.LinkNotes = LinkNotes;
        model.KeyWord   = KeyWord;
        model.LinkIn    = 0;
        model.LinkOut   = 0;
        model.ReStats   = "";
        model.ReLastIP  = "";
        model.LinkTime  = DateTime.Now;
        model.LinkTime2 = DateTime.Now;
        model.AddTime   = DateTime.Now;
        model.Leibie    = Leibie;
        model.LinkRd    = 0;
        model.Hidden    = LinkAc;
        new BCW.BLL.Link().Add(model);

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("发布网站成功");

        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("请在您的网站显眼位置投放我们的网站");
        if (LinkAc == 0)
        {
            builder.Append("<br />待管理员审核方能显示在我站友链");
        }
        builder.Append("<br />名称:" + ub.GetSub("LinkwebName", xmlPath) + "<br />");
        builder.Append("网址:" + ub.GetSub("LinkDomain", xmlPath) + "/?kid=" + LID + "<br />");
        if (!string.IsNullOrEmpty(ub.GetSub("LinkSummary", xmlPath)))
        {
            builder.Append("简介:" + ub.GetSub("LinkSummary", xmlPath) + "");
        }
        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.getUrl("link.aspx?backurl=" + Utils.getPage(0) + "") + "\">上级</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("link.aspx?act=view&amp;ID=" + LID + "&amp;backurl=" + Utils.getPage(0) + "") + "\">查看效果</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Link model)
 {
     dal.Update(model);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(BCW.Model.Link model)
 {
     dal.Add(model);
 }