示例#1
0
 public void CreateDebatePostExpand(DebatePostExpandInfo dpei)
 {
     DbParameter[] parms = {
                                 DbHelper.MakeInParam("@tid", (DbType)SqlDbType.Int, 4, dpei.Tid),
                                 DbHelper.MakeInParam("@pid", (DbType)SqlDbType.Int, 4, dpei.Pid),
                                 DbHelper.MakeInParam("@opinion", (DbType)SqlDbType.Int, 4, dpei.Opinion),
                                 DbHelper.MakeInParam("@diggs", (DbType)SqlDbType.Int, 4, dpei.Diggs)
                           };
     DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, string.Format("{0}createdebatepostexpand", BaseConfigs.GetTablePrefix), parms);
 }
示例#2
0
        /// <summary>
        /// 创建帖子
        /// </summary>
        /// <param name="postInfo">帖子信息类</param>
        /// <returns>返回帖子id</returns>
        public static int CreatePost(PostInfo postInfo)
        {
            int pid = 0;
            lock (lockHelper)
            {
                pid = Data.Posts.CreatePost(postInfo, GetPostTableId(postInfo.Tid));
            }
            //本帖具有正反方立场
            if (postInfo.Debateopinion > 0)
            {
                DebatePostExpandInfo dpei = new DebatePostExpandInfo();
                dpei.Tid = postInfo.Tid;
                dpei.Pid = pid;
                dpei.Opinion = postInfo.Debateopinion;
                dpei.Diggs = 0;
                Data.Debates.CreateDebateExpandInfo(dpei);
            }

            //将数据同步到sphinx增量表中
            if (pid > 0 && EntLibConfigs.GetConfig() != null && EntLibConfigs.GetConfig().Sphinxconfig.Enable)
            {
                GetSphinxSqlService().CreatePost(GetPostTableName(), pid, postInfo.Tid, postInfo.Fid, postInfo.Posterid, postInfo.Postdatetime, postInfo.Title, postInfo.Message);
            }
            return pid;
        }
示例#3
0
 /// <summary>
 /// 创建参加辩论帖子的扩展信息
 /// </summary>
 /// <param name="dpei">参与辩论的帖子的辩论相关扩展字段实体</param>
 public static void CreateDebateExpandInfo(DebatePostExpandInfo dpei)
 {
     DatabaseProvider.GetInstance().CreateDebatePostExpand(dpei);
 }
示例#4
0
        /// <summary>
        /// 创建帖子
        /// </summary>
        /// <param name="postInfo">帖子信息类</param>
        /// <returns>返回帖子id</returns>
        public static int CreatePost(PostInfo postInfo)
        {
            int pid = Data.Posts.CreatePost(postInfo, GetPostTableId(postInfo.Tid));

            //本帖具有正反方立场
            if (postInfo.Debateopinion > 0)
            {
                DebatePostExpandInfo dpei = new DebatePostExpandInfo();
                dpei.Tid = postInfo.Tid;
                dpei.Pid = pid;
                dpei.Opinion = postInfo.Debateopinion;
                dpei.Diggs = 0;
                Data.Debates.CreateDebateExpandInfo(dpei);
            }
            RemoveShowTopicCache(postInfo.Tid.ToString());
            return pid;
        }
示例#5
0
文件: Posts.cs 项目: ichari/ichari
        /// <summary>
        /// 创建帖子
        /// </summary>
        /// <param name="postinfo">帖子信息类</param>
        /// <returns>返回帖子id</returns>
        public static int CreatePost(PostInfo postinfo)
        {
            int pid = DatabaseProvider.GetInstance().CreatePost(postinfo, GetPostTableID(postinfo.Tid));

            //本帖具有正反方立场
            if (postinfo.Debateopinion > 0)
            {
                DebatePostExpandInfo dpei = new DebatePostExpandInfo();
                dpei.Tid = postinfo.Tid;
                dpei.Pid = pid;
                dpei.Opinion = postinfo.Debateopinion;
                dpei.Diggs = 0;
                CreateDebatePostExpand(dpei);
            }

            return pid;
        }