コード例 #1
0
 /// <summary>
 /// 增加一条数据
 /// 增加发内线活跃抽奖入口--姚志光
 /// 删去入口20160608
 /// </summary>
 public int Add(BCW.Model.Guest model)
 {
     return(dal.Add(model));
     //int ID = dal.Add(model);
     //try
     //{
     //    string xmlPath = "/Controls/winners.xml";
     //    string TextForUbb = (ub.GetSub("TextForUbb", xmlPath));//设置内线提示的文字
     //    string WinnersStatus = (ub.GetSub("WinnersStatus", xmlPath));//状态1维护2测试0正常
     //    string WinnersOpenOrClose = (ub.GetSub("WinnersOpenOrClose", xmlPath));//0|停止放送机会|1|开启放送机会
     //    string WinnersOpenChoose = (ub.GetSub("WinnersOpenChoose", xmlPath));//1全社区2社区3仅游戏
     //    string WinnersGuessOpen = (ub.GetSub("WinnersGuessOpen", xmlPath));//1发内线2不发内线
     //    int usid = model.FromId;
     //    string username = model.FromName;
     //    string Notes = "发内线";
     //    int id = new BCW.BLL.Action().GetMaxId();
     //    int isHit = new BCW.winners.winners().CheckActionForAll(0, 0, usid, username, Notes, id);
     //    if (isHit == 1)
     //    {
     //        if (WinnersGuessOpen == "1")
     //        {
     //            new BCW.BLL.Guest().Add(0, usid, username, TextForUbb);//发内线到该ID
     //        }
     //    }
     //    return ID;
     //}
     //catch { return ID; }
 }
コード例 #2
0
ファイル: function.aspx.cs プロジェクト: radtek/GitKB288
    private void RecomSaveAllPage(int uid)
    {
        BCW.User.Users.ShowVerifyRole("o", uid);                                        //非验证会员提示
        new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_Guest, uid); //会员本身权限
        //int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误"));
        //int bid = int.Parse(Utils.GetRequest("bid", "all", 2, @"^[0-9]\d*$", "帖子ID错误"));
        string Forforumid = Utils.GetRequest("forumid", "all", 2, @"^[^\^]+$", "论坛ID错误");
        string Forbid     = Utils.GetRequest("bid", "all", 2, @"^[^\^]+$", "帖子ID错误");

        if (Forforumid.Contains(","))
        {
            Forforumid = Utils.DelLastChar(Forforumid, ",");
        }
        if (Forbid.Contains(","))
        {
            Forbid = Utils.DelLastChar(Forbid, ",");
        }
        if (Utils.ParseInt(Forforumid) == 0)
        {
            Utils.Error("论坛ID错误", "");
        }
        if (Utils.ParseInt(Forbid) == 0)
        {
            Utils.Error("帖子ID错误", "");
        }
        int forumid = Convert.ToInt32(Forforumid);
        int bid     = Convert.ToInt32(Forbid);

        if (!new BCW.BLL.Forum().Exists2(forumid))
        {
            Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1");
        }
        if (!new BCW.BLL.Text().Exists2(bid, forumid))
        {
            Utils.Error("帖子不存在或已被删除", "");
        }
        string ToIds   = Utils.GetRequest("ToIds", "all", 2, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "多个会员ID请用#分隔");
        string Content = Utils.GetRequest("Content", "post", 3, @"^[^\^]{1,50}$", "附言最多50字,可留空");

        if (Content.Contains(","))
        {
            Content = Utils.DelLastChar(Content, ",");
        }
        if (!Utils.IsRegex(ToIds.Replace("#", ""), @"^[0-9]\d*$"))
        {
            Utils.Error("多个会员ID请用#分隔", "");
        }
        int iNum = Utils.GetStringNum(ToIds, "#");

        if (iNum > 14)
        {
            Utils.Error("最多可以推荐15人", "");
        }
        string[] Temp = ToIds.Split('#');
        int      k    = 0;

        if (Content != "")
        {
            Content = ",附言:" + Content + "";
        }

        for (int i = 0; i < Temp.Length; i++)
        {
            int ToId = Utils.ParseInt(Temp[i]);
            if (!new BCW.BLL.User().Exists(ToId))
            {
                continue;//不存在的推荐会员ID
            }
            //你是否是对方的黑名单
            if (new BCW.BLL.Friend().Exists(ToId, uid, 1))
            {
                continue;//对方已把您加入黑名单
            }
            string ForumSet = new BCW.BLL.User().GetForumSet(ToId);
            int    Nore     = BCW.User.Users.GetForumSet(ForumSet, 14);
            if (Nore == 1)
            {
                continue;//对方已设置拒绝接收推荐消息
            }

            string          UsName = new BCW.BLL.User().GetUsName(uid);
            BCW.Model.Guest model  = new BCW.Model.Guest();
            model.FromId   = 0;
            model.FromName = UsName;
            model.ToId     = ToId;
            model.ToName   = new BCW.BLL.User().GetUsName(ToId);
            model.Content  = "[url=/bbs/uinfo.aspx?uid=" + uid + "]" + UsName + "[/url]向您推荐帖子:[url=/bbs/topic.aspx?forumid=" + forumid + "&amp;bid=" + bid + "]" + new BCW.BLL.Text().GetTitle(bid) + "[/url]" + Content + "";
            model.TransId  = 0;
            new BCW.BLL.Guest().Add(model);
            //更新联系时间
            new BCW.BLL.Friend().UpdateTime(uid, ToId);
            long Share = Convert.ToInt64(ub.GetSub("GuestShare", xmlPath));
            if (Share > 0)
            {
                new BCW.BLL.User().UpdateiGold(uid, -Share, "分享好友");
            }
            k++;
        }
        Utils.Success("推荐帖子", "恭喜!成功推荐" + k + "位会员<br /><a href=\"" + Utils.getUrl("function.aspx?act=recom&amp;forumid=" + forumid + "&amp;bid=" + bid + "&amp;backurl=" + Utils.getPage(0) + "") + "\">继续推荐&gt;&gt;</a>", Utils.getPage("topic.aspx?forumid=" + forumid + "&amp;bid=" + bid + ""), "3");
    }