コード例 #1
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 /// 根据--是否显示--得到话题信息
 public DataSet FindTopicByVisible(TopicManage topicmanage, string tbName)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@isvisible", SqlDbType.Bit, 1, topicmanage._IsVisible),
     };
     return(data.RunProcReturn("select * from aspnet_Topic where IsVisible = @isvisible ORDER BY PublishTime", prams, tbName));
 }
コード例 #2
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 /// 根据--标题关键字--得到话题信息
 public DataSet FindTopicByTitle(TopicManage topicmanage, string tbName)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@title", SqlDbType.NVarChar, 50, "%" + topicmanage._Title + "%"),
     };
     return(data.RunProcReturn("select * from aspnet_Topic where Title like @title ORDER BY PublishTime", prams, tbName));
 }
コード例 #3
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 /// 根据--用户编号--得到话题信息
 public DataSet FindTopicByUerID(TopicManage topicmanage, string tbName)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@createuserid", SqlDbType.UniqueIdentifier, 16, topicmanage._CreateUserID),
     };
     return(data.RunProcReturn("select * from aspnet_Topic where CreateUserID = @createuserid ORDER BY PublishTime", prams, tbName));
 }
コード例 #4
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 /// 根据--话题编号--得到话题信息
 public DataSet FindTopicByTopicID(TopicManage topicmanage, string tbName)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@topicid", SqlDbType.Int, 4, topicmanage._TopicID),
     };
     return(data.RunProcReturn("select * from aspnet_Topic where TopicID = @topicid ORDER BY PublishTime", prams, tbName));
 }
コード例 #5
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 public int DeleteTopic(TopicManage topicmanage)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@topicid", SqlDbType.Int, 4, topicmanage._TopicID),
     };
     return(data.RunProc("delete from aspnet_Topic where TopicID=@topicid", prams));
 }
コード例 #6
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 public int AddTopic(TopicManage topicmanage)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@classid",      SqlDbType.Int,                 4, topicmanage._ClassID),
         data.MakeInParam("@createuserid", SqlDbType.UniqueIdentifier,   16, topicmanage._CreateUserID),
         data.MakeInParam("@title",        SqlDbType.NVarChar,          100, topicmanage._Title),
         data.MakeInParam("@topiccontent", SqlDbType.NVarChar,         2000, topicmanage._TopicContent),
         data.MakeInParam("@revertnum",    SqlDbType.Int,                 4, topicmanage._RevertNum),
         data.MakeInParam("@image",        SqlDbType.NVarChar,           50, topicmanage._Image),
         data.MakeInParam("@attention",    SqlDbType.Int,                 4, topicmanage._Attention),
         data.MakeInParam("@publishtime",  SqlDbType.DateTime,            8, topicmanage._PublishTime),
         data.MakeInParam("@isfoused",     SqlDbType.Bit,                 1, topicmanage._IsFoused),
         data.MakeInParam("@isvisible",    SqlDbType.Bit,                 1, topicmanage._IsVisible),
     };
     return(data.RunProc("insert into aspnet_Topic values(ClassID,CreateUserID,Title,TopicContent,RevertNum,Image,Attention,PublishTime,IsFoused,IsVisible) values(@classid,@createuserid,@title,@topiccontent,@revertnum,@image,@attention,@publishtime,@isfoused,@isvisible)", prams));
 }
コード例 #7
0
ファイル: TopicManage.cs プロジェクト: cruelworld/Fastener
 public int UpdateTopic(TopicManage topicmanage)
 {
     SqlParameter[] prams =
     {
         data.MakeInParam("@topicid",      SqlDbType.Int,                 4, topicmanage._TopicID),
         data.MakeInParam("@classid",      SqlDbType.Int,                 4, topicmanage._ClassID),
         data.MakeInParam("@createuserid", SqlDbType.UniqueIdentifier,   16, topicmanage._CreateUserID),
         data.MakeInParam("@title",        SqlDbType.NVarChar,          100, topicmanage._Title),
         data.MakeInParam("@topiccontent", SqlDbType.NVarChar,         2000, topicmanage._TopicContent),
         data.MakeInParam("@revertnum",    SqlDbType.Int,                 4, topicmanage._RevertNum),
         data.MakeInParam("@image",        SqlDbType.NVarChar,           50, topicmanage._Image),
         data.MakeInParam("@attention",    SqlDbType.Int,                 4, topicmanage._Attention),
         data.MakeInParam("@publishtime",  SqlDbType.DateTime,            8, topicmanage._PublishTime),
         data.MakeInParam("@isfoused",     SqlDbType.Bit,                 1, topicmanage._IsFoused),
         data.MakeInParam("@isvisible",    SqlDbType.Bit,                 1, topicmanage._IsVisible),
     };
     return(data.RunProc("update aspnet_Topic set ClassID = @classid, CreateUserID = @createuserid,Title = @title,TopicContent= @topiccontent,RevertNum = @revertnum,Image = @image,Attention = @attention,PublishTime = @publishtime,IsFoused = @isfoused,IsVisible = @isvisible where TopicID = @topicid", prams));
 }