Exemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BCW.Model.FComment model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.FComment model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
    private void ReplySavePage(int leibie)
    {
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        BCW.User.Users.ShowVerifyRole("m", meid);                                          //非验证会员提示
        new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_Comment, meid); //会员本身权限
        int    id       = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "ID错误"));
        string Content  = Utils.GetRequest("Content", "post", 2, @"^[^\^]{1,200}$", "评论限1-200字");
        int    NodeId   = 0;
        string xmlPath  = "/Controls/diary.xml";
        string xmlPath2 = "/Controls/albums.xml";
        int    uid      = 0;

        if (leibie == 0)
        {
            //是否刷屏
            string appName = "LIGHT_DIARY";
            int    Expir   = Convert.ToInt32(ub.GetSub("DiaryExpir", xmlPath));
            BCW.User.Users.IsFresh(appName, Expir);
            NodeId = new BCW.BLL.Diary().GetNodeId(id);
            uid    = new BCW.BLL.Diary().GetUsID(id);
        }
        else
        {
            //是否刷屏
            string appName = "LIGHT_DIARY";
            int    Expir   = Convert.ToInt32(ub.GetSub("AlbumsExpir", xmlPath2));
            BCW.User.Users.IsFresh(appName, Expir);
            NodeId = new BCW.BLL.Upfile().GetNodeId(id);
            uid    = new BCW.BLL.Upfile().GetUsID(id);
        }
        if (NodeId == -1)
        {
            Utils.Error("不存在的记录", "");
        }
        //你是否是对方的黑名单
        if (new BCW.BLL.Friend().Exists(uid, meid, 1))
        {
            Utils.Error("对方已把您加入黑名单", "");
        }
        int IsReview = new BCW.BLL.Upgroup().GetIsReview(NodeId);

        if (IsReview == 1)
        {
            Utils.Error("作者已设置不允许评论此分类", "");
        }

        string strLeibie = BCW.User.AppCase.CaseAlbums(leibie);

        BCW.Model.FComment model = new BCW.Model.FComment();
        model.Types    = leibie;
        model.UsID     = meid;
        model.UsName   = new BCW.BLL.User().GetUsName(meid);
        model.DetailId = id;
        model.Content  = Content;
        model.AddUsIP  = Utils.GetUsIP();
        model.AddTime  = DateTime.Now;
        new BCW.BLL.FComment().Add(model);
        //更新回复数
        if (leibie == 0)
        {
            new BCW.BLL.Diary().UpdateReplyNum(id, 1);
        }

        //内线通知主人
        if (meid != uid)
        {
            new BCW.BLL.Guest().Add(0, uid, new BCW.BLL.User().GetUsName(uid), "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]在您的空间" + BCW.User.AppCase.CaseAlbums(leibie) + "[url=/bbs/fcomment.aspx?leibie=" + leibie + "&amp;id=" + id + "]留言啦[/url]!");
        }
        Utils.Success("评论" + strLeibie + "", "发表评论成功,正在返回..", Utils.getPage("fcomment.aspx?act=replylist&amp;leibie=" + leibie + "&amp;id=" + id + ""), "1");
    }