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); }
/// <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; }
/// <summary> /// 创建参加辩论帖子的扩展信息 /// </summary> /// <param name="dpei">参与辩论的帖子的辩论相关扩展字段实体</param> public static void CreateDebateExpandInfo(DebatePostExpandInfo dpei) { DatabaseProvider.GetInstance().CreateDebatePostExpand(dpei); }
/// <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; }
/// <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; }