Example #1
0
        /// <summary>
        /// 删除一条数据,所有标题和回贴都清掉
        /// </summary>
        public bool Delete(int Id)
        {
            //循环清除

            BLL.Forum_Topic bllTopic = new Forum_Topic();

            List <Model.Forum_Topic> listTopic = new BLL.Forum_Topic().GetModelList(" 1=1 ");

            foreach (Model.Forum_Topic item in listTopic)
            {
                bllTopic.Delete(item.Id);
            }

            return(dal.Delete(Id));
        }
Example #2
0
        /// <summary>
        /// 删除一条数据,相关会员贴子和记录都清掉,掉用和前端一样的方法
        /// </summary>
        public bool Delete(int UserId)
        {
            BLL.Forum_MyTopic bllMyTopic = new Forum_MyTopic();
            BLL.Forum_MyPost  bllMyPost  = new Forum_MyPost();
            BLL.Forum_Topic   bllTopic   = new Forum_Topic();

            //清我的贴子
            List <Model.Forum_MyTopic> listMyTopic = bllMyTopic.GetModelList("UserId=" + UserId);

            foreach (Model.Forum_MyTopic item in listMyTopic)
            {
                bllTopic.Delete(item.TopicId);
            }

            //清我的回贴记录
            bllMyPost.Delete("UserId=" + UserId);

            return(dal.Delete(UserId));
        }