예제 #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
파일: Posts.cs 프로젝트: WySky/Memo-Project
        /// <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
파일: Posts.cs 프로젝트: wenysky/dnt31-lite
        /// <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;
        }