Esempio n. 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int  Add(BCW.Model.Mebook 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不发内线
                string ActionText         = (ub.GetSub("ActionText", xmlPath));         //Action语句
                string ActionOpen         = (ub.GetSub("ActionOpen", xmlPath));         //Action语句开关
                int    usid     = model.MID;
                string username = model.MName;
                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); }
        }
Esempio n. 2
0
    private void AddSavePage(int meid, int hid)
    {
        BCW.User.Users.ShowVerifyRole("k", meid);                                         //非验证会员提示
        new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_UsBook, meid); //会员本身权限
        string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,500}$", "留言内容限1-500字");
        //是否刷屏
        string appName = "LIGHT_MEBOOK";
        int    Expir   = Convert.ToInt32(ub.GetSub("BbsMebookExpir", "/Controls/bbs.xml"));

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

        //你是否是对方的黑名单
        if (new BCW.BLL.Friend().Exists(hid, meid, 1))
        {
            Utils.Error("对方已把您加入黑名单", "");
        }
        //限制性
        string ForumSet   = new BCW.BLL.User().GetForumSet(hid);
        int    addBookSet = BCW.User.Users.GetForumSet(ForumSet, 19);

        if (addBookSet == 1 && meid != hid)
        {
            if (!new BCW.BLL.Friend().Exists(hid, meid, 0))
            {
                Utils.Error("您不在对方的好友里,对方已设置拒绝非好友留言", "");
            }
        }
        else if (addBookSet == 2)
        {
            Utils.Error("此留言本已禁止任何人留言", "");
        }

        BCW.Model.Mebook model = new BCW.Model.Mebook();
        model.UsID     = hid;
        model.MID      = meid;
        model.MName    = new BCW.BLL.User().GetUsName(meid);
        model.MContent = Content;
        model.IsTop    = 0;
        model.AddTime  = DateTime.Now;
        new BCW.BLL.Mebook().Add(model);
        //内线通知主人
        if (meid != hid)
        {
            new BCW.BLL.Guest().Add(3, hid, new BCW.BLL.User().GetUsName(hid), "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]在您的空间[url=/bbs/mebook.aspx?hid=" + hid + "]留言啦[/url]!");
        }
        Utils.Success("发表留言", "发表留言成功,正在返回..", Utils.getUrl("mebook.aspx?hid=" + hid + ""), "1");
    }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Mebook model)
 {
     dal.Update(model);
 }