📄 discuss.cs
字号:
//======================================================
//== (c)2008 aspxcms inc by NeTCMS v1.0 ==
//== Forum:bbs.aspxcms.com ==
//== Website:www.aspxcms.com ==
//======================================================
using System;
using System.Data;
using System.Data.SqlClient;
using NetCMS.DALFactory;
using NetCMS.Model;
using NetCMS.Common;
using System.Text.RegularExpressions;
using System.Text;
using System.Reflection;
using NetCMS.DALProfile;
using NetCMS.Config;
namespace NetCMS.DALSQLServer
{
public class Discuss : DbBase, IDiscuss
{
public DataTable sel_discussInfo(string Id, int flag)
{
#region
SqlParameter param = new SqlParameter("@Id", Id);
string Sql = null;
if (flag == 0)
{
Sql = "select UserName,SiteID,cPoint,aPoint,iPoint,gPoint,ePoint,aPoint,RegTime,UserFace,userFacesize from " + Pre + "sys_User where UserNum=@Id";
}
else if (flag == 1)
{
string _ClassID = Id;
if (Id == "")
_ClassID = "";
else
_ClassID = " and indexnumber=@Id";
Sql = "select DcID,Cname from " + Pre + "user_DiscussClass where UserNum='" + NetCMS.Global.Current.UserNum + "' " + _ClassID + " and SiteID='" + NetCMS.Global.Current.SiteID + "'";
}
else if (flag == 2)
{
Sql = "select Cname,DcID from " + Pre + "user_DiscussClass where indexnumber=@Id";
}
else if (flag == 3)
{
Sql = "select GroupCreatNum,GroupSize,GroupPerNum,GroupTF from " + Pre + "user_Group where GroupNumber=@Id";
}
else if (flag == 4)
{
Sql = "select Fundwarehouse,Cname,Authoritymoney,UserName,Browsenumber,D_Content,Creatime,ClassID,Authority,D_anno from " + Pre + "user_Discuss where DisID=@Id";
}
else if (flag == 5)
{
Sql = "select Cutofftime,Anum,Activesubject,ActivePlace,ActiveExpense,ActivePlan,Contactmethod,CreaTime,UserName,ALabel from " + Pre + "user_DiscussActive where AId=@Id";
}
else if (flag == 6)
{
Sql = "Select PhotoalbumName,PhotoalbumID From " + Pre + "User_Photoalbum where isDisPhotoalbum=1 And DisID=@Id and UserName='" + NetCMS.Global.Current.UserNum + "'";
}
else if (flag == 7)//discussphoto_up.aspx
{
Sql = "select PhotoName,PhotoalbumID,PhotoContent,PhotoUrl,UserNum from " + Pre + "User_Photo where PhotoID=@Id";
}
else if (flag == 8)//discussphoto_up.aspx
{
Sql = "Select PhotoalbumName,PhotoalbumID From " + Pre + "User_Photoalbum where substring(PhotoalbumJurisdiction,1,1) = '1' And DisID=@Id";
}
else if (flag == 9)//discussPhotoalbum.aspx
{
Sql = "Select ClassName,ClassID From " + Pre + "user_PhotoalbumClass where isDisclass=1 and DisID=@Id";
}
else if (flag == 10)//discussPhotoalbumlist.aspx
{
Sql = "select UserNum from " + Pre + "User_DiscussMember where DisID=@Id";
}
else if (flag == 11)//discussPhotoalbumlist.aspx
{
Sql = "select PhotoalbumUrl,UserName,PhotoalbumName from " + Pre + "User_Photoalbum where PhotoalbumID=@Id";
}
else if (flag == 12)//discussTopi_commentary.aspx
{
Sql = "select VoteTF,voteTime,DtID,title,Content,creatTime,UserNum from " + Pre + "User_DiscussTopic where DtID=@Id";
}
else if (flag == 13)//discussTopi_commentary.aspx
{
Sql = "select VoteID,VoteNum,Voteitem,votegenre,CreaTime from " + Pre + "User_Vote where DtID=@Id";
}
else if (flag == 14)
{
Sql = "Select DtID,title,Content,creatTime,UserNum From " + Pre + "User_DiscussTopic where DtID=@Id and UserNum='" + NetCMS.Global.Current.UserNum + "'";
}
return DbHelper.ExecuteTable(CommandType.Text, Sql, param);
#endregion
}
public DataTable sel_disTable(int flag)
{
#region
string Sql = null;
if (flag == 0)
{
Sql = "select AId,UserNum,PId from " + Pre + "user_DiscussActiveMember ";
}
else if (flag == 1)
{
Sql = "select DcID from " + Pre + "User_DiscussClass";
}
else if (flag == 2)
{
Sql = "select DcID,Cname from " + Pre + "user_DiscussClass where indexnumber='0'";
}
else if (flag == 3)
{
Sql = "select DisID,UserNum,Member from " + Pre + "User_DiscussMember ";
}
else if (flag == 4)
{
Sql = "select cPointParam,aPointparam from " + Pre + "sys_PramUser";
}
else if (flag == 5)
{
Sql = "select DisID from " + Pre + "user_Discuss";
}
else if (flag == 6)
{
Sql = "select DtID from " + Pre + "User_DiscussTopic";
}
return DbHelper.ExecuteTable(CommandType.Text, Sql, null);
#endregion
}
public int sel_getDiscuss(string Str,int flag)
{
#region
SqlParameter param = new SqlParameter("@Str", Str);
string Sql = null;
if (flag == 0)
{
Sql = "select count(id) from " + Pre + "user_Discuss where Cname=@Str";
}
else if (flag == 1)
{
Sql = "select count(*) from " + Pre + "user_Discuss where UserName=@Str";
}
else if (flag == 2)
{
Sql = "select count(ID) from " + Pre + "user_DiscussActiveMember where Aid=@Str";
}
else if (flag == 3)
{
Sql = "select count(ID) from " + Pre + "user_DiscussMember where DisID=@Str";
}
else if (flag == 4)
{
Sql = "select count(*) from " + Pre + "user_Vote where VoteID=@Str";
}
else if (flag == 5)
{
Sql = "select VoteTF from " + Pre + "User_DiscussTopic where DtID=@Str ";
}
return Convert.ToInt32(DbHelper.ExecuteScalar(CommandType.Text, Sql, param));
#endregion
}
public int sel_userInfo(string AId,int flag)
{
#region
SqlParameter param = new SqlParameter("@AId", AId);
string Sql = null;
if (flag == 0)
{
Sql = "select sum(ParticipationNum) from " + Pre + "user_DiscussActiveMember where AId=@AId";
}
else if (flag == 1)//discussTopi_view.aspx
{
Sql = "select sum(VoteNum) from " + Pre + "User_Vote where DtID=@AId";
}
object dir = DbHelper.ExecuteScalar(CommandType.Text, Sql, param);
if (dir != null && dir != DBNull.Value)
{
return Convert.ToInt32(dir);
}
else { return 0; }
#endregion
}
public string sel_disInfoStr(string VoteID,int flag)
{
#region
SqlParameter param = new SqlParameter("@VoteID", VoteID);
string Sql = null;
if (flag == 0)
{
Sql = "select VoteNum from " + Pre + "User_Vote where VoteID=@VoteID";
}
else if (flag == 1)
{
Sql = "select UserName from " + Pre + "User_Discuss where DisID=@VoteID";
}
return Convert.ToString(DbHelper.ExecuteScalar(CommandType.Text, Sql, param));
#endregion
}
public int del_userDiscuss(string ID,int flag)
{
#region
SqlParameter param = new SqlParameter("@ID", ID);
string Sql = null;
if (flag == 0)//message_discussclass.aspx
{
Sql = " delete " + Pre + "User_DiscussClass where DcID=@ID and SiteID=" + NetCMS.Global.Current.SiteID + "";
}
else if (flag == 1)//message_userdiscuss_list.aspx
{
Sql = "delete " + Pre + "user_Discuss where DisID=@ID and SiteID=" + NetCMS.Global.Current.SiteID + "";
}
else if (flag == 2)
{
Sql = " delete " + Pre + "user_DiscussActiveMember where Aid=@ID";
}
else if (flag == 3)
{
Sql = " delete " + Pre + "user_DiscussActive where Aid=@ID";
}
else if(flag==4)//discussactijoin_list.aspx
{
Sql = " delete " + Pre + "user_DiscussActiveMember where PId=@ID";
}
else if (flag == 5)//discussManageestablish_list.aspx
{
Sql = " delete " + Pre + "user_DiscussMember where DisID=@ID";
}
else if (flag == 6)
{
Sql = " delete " + Pre + "user_Discuss where DisID=@ID";
}
else if (flag == 7)//discussManagejoin_list.aspx
{
Sql = " delete " + Pre + "user_DiscussMember where Member=@ID and UserNum='" + NetCMS.Global.Current.UserNum + "'";
}
else if (flag == 8)//discussphoto.aspx
{
Sql = "delete " + Pre + "User_Photo where PhotoID=@ID";
}
else if (flag == 9)//discussPhotoalbumlist.aspx
{
Sql = " delete " + Pre + "User_Photoalbum where PhotoalbumID=@ID";
}
else if (flag == 10)
{
Sql = " delete " + Pre + "User_Photo where PhotoalbumID=@ID";
}
else if (flag == 11)//discussTopi_del.aspx
{
Sql = "delete " + Pre + "User_DiscussTopic where DtID=@ID";
}
else if (flag == 12)//discussTopi_del.aspx
{
Sql = "delete " + Pre + "User_DiscussTopic where ParentID=@ID";
}
else if (flag == 13)//discussTopi_del.aspx
{
Sql = "delete " + Pre + "User_Vote where DtID=@ID";
}
else if (flag == 14)//discussTopi_list.aspx
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -