Exemplo n.º 1
0
 /// <summary>
 /// 更新用户组信息
 /// </summary>
 /// <param name="info">用户组信息</param>
 public static void UpdateUserGroup(UserGroupInfo info)
 {
     DatabaseProvider.GetInstance().UpdateUserGroup(info);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 创建用户组信息
 /// </summary>
 /// <param name="userGroupInfo">用户组信息</param>
 public static void CreateUserGroup(UserGroupInfo userGroupInfo)
 {
     DatabaseProvider.GetInstance().AddUserGroup(userGroupInfo);
 }
Exemplo n.º 3
0
 public void UpdateUserGroup(UserGroupInfo userGroupInfo)
 {
     DbParameter[] parms =
             {
                 DbHelper.MakeInParam("@Radminid",(DbType)SqlDbType.Int,4,(userGroupInfo.Groupid == 1) ? 1 : userGroupInfo.Radminid),
                 DbHelper.MakeInParam("@Grouptitle",(DbType)SqlDbType.NVarChar,50, Utils.RemoveFontTag(userGroupInfo.Grouptitle)),
                 DbHelper.MakeInParam("@Creditshigher",(DbType)SqlDbType.Int,4,userGroupInfo.Creditshigher),
                 DbHelper.MakeInParam("@Creditslower",(DbType)SqlDbType.Int,4, userGroupInfo.Creditslower),
                 DbHelper.MakeInParam("@Stars",(DbType)SqlDbType.Int,4,userGroupInfo.Stars),
                 DbHelper.MakeInParam("@Color",(DbType)SqlDbType.Char,7,userGroupInfo.Color),
                 DbHelper.MakeInParam("@Groupavatar",(DbType)SqlDbType.NVarChar,60,userGroupInfo.Groupavatar),
                 DbHelper.MakeInParam("@Readaccess",(DbType)SqlDbType.Int,4,userGroupInfo.Readaccess),
                 DbHelper.MakeInParam("@Allowvisit",(DbType)SqlDbType.Int,4,userGroupInfo.Allowvisit),
                 DbHelper.MakeInParam("@Allowpost",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpost),
                 DbHelper.MakeInParam("@Allowreply",(DbType)SqlDbType.Int,4,userGroupInfo.Allowreply),
                 DbHelper.MakeInParam("@Allowpostpoll",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostpoll),
                 DbHelper.MakeInParam("@Allowdirectpost",(DbType)SqlDbType.Int,4,userGroupInfo.Allowdirectpost),
                 DbHelper.MakeInParam("@Allowgetattach",(DbType)SqlDbType.Int,4,userGroupInfo.Allowgetattach),
                 DbHelper.MakeInParam("@Allowpostattach",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostattach),
                 DbHelper.MakeInParam("@Allowvote",(DbType)SqlDbType.Int,4,userGroupInfo.Allowvote),
                 DbHelper.MakeInParam("@Allowmultigroups",(DbType)SqlDbType.Int,4,userGroupInfo.Allowmultigroups),
                 DbHelper.MakeInParam("@Allowsearch",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsearch),
                 DbHelper.MakeInParam("@Allowavatar",(DbType)SqlDbType.Int,4,userGroupInfo.Allowavatar),
                 DbHelper.MakeInParam("@Allowcstatus",(DbType)SqlDbType.Int,4,userGroupInfo.Allowcstatus),
                 DbHelper.MakeInParam("@Allowuseblog",(DbType)SqlDbType.Int,4,userGroupInfo.Allowuseblog),
                 DbHelper.MakeInParam("@Allowinvisible",(DbType)SqlDbType.Int,4,userGroupInfo.Allowinvisible),
                 DbHelper.MakeInParam("@Allowtransfer",(DbType)SqlDbType.Int,4,userGroupInfo.Allowtransfer),
                 DbHelper.MakeInParam("@Allowsetreadperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetreadperm),
                 DbHelper.MakeInParam("@Allowsetattachperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetattachperm),
                 DbHelper.MakeInParam("@Allowhidecode",(DbType)SqlDbType.Int,4,userGroupInfo.Allowhidecode),
                 DbHelper.MakeInParam("@Allowhtml",(DbType)SqlDbType.Int,4,userGroupInfo.Allowhtml),
                 DbHelper.MakeInParam("@Allowhtmltitle",(DbType)SqlDbType.Int,4,userGroupInfo.Allowhtmltitle),
                 DbHelper.MakeInParam("@Allowcusbbcode",(DbType)SqlDbType.Int,4,userGroupInfo.Allowcusbbcode),
                 DbHelper.MakeInParam("@Allownickname",(DbType)SqlDbType.Int,4,userGroupInfo.Allownickname),
                 DbHelper.MakeInParam("@Allowsigbbcode",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsigbbcode),
                 DbHelper.MakeInParam("@Allowsigimgcode",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsigimgcode),
                 DbHelper.MakeInParam("@Allowviewpro",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewpro),
                 DbHelper.MakeInParam("@Allowviewstats",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewstats),
                 DbHelper.MakeInParam("@Allowtrade",(DbType)SqlDbType.Int,4,userGroupInfo.Allowtrade),
                 DbHelper.MakeInParam("@Allowdiggs",(DbType)SqlDbType.Int,4,userGroupInfo.Allowdiggs),
                 DbHelper.MakeInParam("@Disableperiodctrl",(DbType)SqlDbType.Int,4,userGroupInfo.Disableperiodctrl),
                 DbHelper.MakeInParam("@Allowdebate",(DbType)SqlDbType.Int,4,userGroupInfo.Allowdebate),
                 DbHelper.MakeInParam("@Allowbonus",(DbType)SqlDbType.Int,4,userGroupInfo.Allowbonus),
                 DbHelper.MakeInParam("@Minbonusprice",(DbType)SqlDbType.Int,4,userGroupInfo.Minbonusprice),
                 DbHelper.MakeInParam("@Maxbonusprice",(DbType)SqlDbType.Int,4,userGroupInfo.Maxbonusprice),
                 DbHelper.MakeInParam("@Reasonpm",(DbType)SqlDbType.Int,4,userGroupInfo.Reasonpm),
                 DbHelper.MakeInParam("@Maxprice",(DbType)SqlDbType.SmallInt,2,userGroupInfo.Maxprice),
                 DbHelper.MakeInParam("@Maxpmnum",(DbType)SqlDbType.SmallInt,2,userGroupInfo.Maxpmnum),
                 DbHelper.MakeInParam("@Maxsigsize",(DbType)SqlDbType.SmallInt,2,userGroupInfo.Maxsigsize),
                 DbHelper.MakeInParam("@Maxattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.Maxattachsize),
                 DbHelper.MakeInParam("@Maxsizeperday",(DbType)SqlDbType.Int,4,userGroupInfo.Maxsizeperday),
                 DbHelper.MakeInParam("@Attachextensions",(DbType)SqlDbType.Char,100,userGroupInfo.Attachextensions),
                 DbHelper.MakeInParam("@Maxspaceattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.Maxspaceattachsize),
                 DbHelper.MakeInParam("@Maxspacephotosize",(DbType)SqlDbType.Int,4,userGroupInfo.Maxspacephotosize),
                 DbHelper.MakeInParam("@Groupid",(DbType)SqlDbType.Int,4,userGroupInfo.Groupid),
                 //DbHelper.MakeInParam("@Maxfriendscount",(DbType)SqlDbType.Int,4,userGroupInfo.MaxFriendsCount),
                 DbHelper.MakeInParam("@ModNewTopics",(DbType)SqlDbType.SmallInt,2,userGroupInfo.ModNewTopics),
                 DbHelper.MakeInParam("@ModNewPosts",(DbType)SqlDbType.SmallInt,2,userGroupInfo.ModNewPosts),
                 DbHelper.MakeInParam("@Ignoreseccode",(DbType)SqlDbType.Int,4,userGroupInfo.Ignoreseccode)
     };
     DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, string.Format("{0}updateusergroup", BaseConfigs.GetTablePrefix), parms);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 获得用户组数据
        /// </summary>
        /// <returns>用户组数据</returns>
        public static List<UserGroupInfo> GetUserGroupList()
        {
            DataTable dt = GetUserGroupForDataTable();
            List<UserGroupInfo> userGruopInfoList = new List<UserGroupInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                UserGroupInfo info = new UserGroupInfo();
                info.Groupid = TypeConverter.StrToInt(dr["groupid"].ToString());
                info.Radminid = TypeConverter.StrToInt(dr["radminid"].ToString());
                info.Type = TypeConverter.StrToInt(dr["type"].ToString());
                info.System = TypeConverter.StrToInt(dr["system"].ToString());
                info.Color = dr["color"].ToString().Trim();
                info.Grouptitle = dr["grouptitle"].ToString().Trim();
                info.Creditshigher = TypeConverter.StrToInt(dr["creditshigher"].ToString());
                info.Creditslower = TypeConverter.StrToInt(dr["creditslower"].ToString());
                info.Stars = TypeConverter.StrToInt(dr["stars"].ToString());
                info.Groupavatar = dr["groupavatar"].ToString();
                info.Readaccess = TypeConverter.StrToInt(dr["readaccess"].ToString());
                info.Allowvisit = TypeConverter.StrToInt(dr["allowvisit"].ToString());
                info.Allowpost = TypeConverter.StrToInt(dr["allowpost"].ToString());
                info.Allowreply = TypeConverter.StrToInt(dr["allowreply"].ToString());
                info.Allowpostpoll = TypeConverter.StrToInt(dr["allowpostpoll"].ToString());
                info.Allowdirectpost = TypeConverter.StrToInt(dr["allowdirectpost"].ToString());
                info.Allowgetattach = TypeConverter.StrToInt(dr["allowgetattach"].ToString());
                info.Allowpostattach = TypeConverter.StrToInt(dr["allowpostattach"].ToString());
                info.Allowvote = TypeConverter.StrToInt(dr["allowvote"].ToString());
                info.Allowmultigroups = TypeConverter.StrToInt(dr["allowmultigroups"].ToString());
                info.Allowsearch = TypeConverter.StrToInt(dr["allowsearch"].ToString());
                info.Allowavatar = TypeConverter.StrToInt(dr["allowavatar"].ToString());
                info.Allowcstatus = TypeConverter.StrToInt(dr["allowcstatus"].ToString());
                info.Allowuseblog = TypeConverter.StrToInt(dr["allowuseblog"].ToString());
                info.Allowinvisible = TypeConverter.StrToInt(dr["allowinvisible"].ToString());
                info.Allowtransfer = TypeConverter.StrToInt(dr["allowtransfer"].ToString());
                info.Allowsetreadperm = TypeConverter.StrToInt(dr["allowsetreadperm"].ToString());
                info.Allowsetattachperm = TypeConverter.StrToInt(dr["allowsetattachperm"].ToString());
                info.Allowhidecode = TypeConverter.StrToInt(dr["allowhidecode"].ToString());
                info.Allowhtmltitle = TypeConverter.StrToInt(dr["allowhtmltitle"].ToString());
                info.Allowhtml = TypeConverter.StrToInt(dr["allowhtml"].ToString());
                info.Allowcusbbcode = TypeConverter.StrToInt(dr["allowcusbbcode"].ToString());
                info.Allownickname = TypeConverter.StrToInt(dr["allownickname"].ToString());
                info.Allowsigbbcode = TypeConverter.StrToInt(dr["allowsigbbcode"].ToString());
                info.Allowsigimgcode = TypeConverter.StrToInt(dr["allowsigimgcode"].ToString());
                info.Allowviewpro = TypeConverter.StrToInt(dr["allowviewpro"].ToString());
                info.Allowviewstats = TypeConverter.StrToInt(dr["allowviewstats"].ToString());
                info.Disableperiodctrl = TypeConverter.StrToInt(dr["disableperiodctrl"].ToString());
                info.Reasonpm = TypeConverter.StrToInt(dr["reasonpm"].ToString());
                info.Maxprice = TypeConverter.StrToInt(dr["maxprice"].ToString());
                info.Maxpmnum = TypeConverter.StrToInt(dr["maxpmnum"].ToString());
                info.Maxsigsize = TypeConverter.StrToInt(dr["maxsigsize"].ToString());
                info.Maxattachsize = TypeConverter.StrToInt(dr["maxattachsize"].ToString());
                info.Maxsizeperday = TypeConverter.StrToInt(dr["maxsizeperday"].ToString());
                info.Attachextensions = dr["attachextensions"].ToString().Trim();
                info.Raterange = dr["raterange"].ToString().Trim();
                info.Allowspace = TypeConverter.StrToInt(dr["allowspace"].ToString());
                info.Maxspaceattachsize = TypeConverter.StrToInt(dr["maxspaceattachsize"].ToString());
                info.Maxspacephotosize = TypeConverter.StrToInt(dr["maxspacephotosize"].ToString());
                info.Allowbonus = TypeConverter.StrToInt(dr["allowbonus"].ToString());
                info.Allowdebate = TypeConverter.StrToInt(dr["allowdebate"].ToString());
                info.Minbonusprice = TypeConverter.StrToInt(dr["minbonusprice"].ToString());
                info.Maxbonusprice = TypeConverter.StrToInt(dr["maxbonusprice"].ToString());
                info.Allowtrade = TypeConverter.StrToInt(dr["allowtrade"].ToString());
                info.Allowdiggs = TypeConverter.StrToInt(dr["allowdiggs"].ToString());
                //info.MaxFriendsCount = TypeConverter.StrToInt(dr["maxfriendscount"].ToString());
                info.ModNewTopics = TypeConverter.StrToInt(dr["modnewtopics"].ToString());
                info.ModNewPosts = TypeConverter.StrToInt(dr["modnewposts"].ToString());
                info.Ignoreseccode = TypeConverter.ObjectToInt(dr["ignoreseccode"]);
                userGruopInfoList.Add(info);
            }
            return userGruopInfoList;
        }
Exemplo n.º 5
0
 public void UpdateOnlineList(UserGroupInfo userGroupInfo)
 {
     DbParameter[] parms = {
                                 DbHelper.MakeInParam("@groupid", (DbType)SqlDbType.Int, 4, userGroupInfo.Groupid),
                                 DbHelper.MakeInParam("@title", (DbType)SqlDbType.NVarChar, 50, Utils.RemoveFontTag(userGroupInfo.Grouptitle))
                             };
     DbHelper.ExecuteNonQueryInMasterDB(CommandType.StoredProcedure, string.Format("{0}updateonlinelist", BaseConfigs.GetTablePrefix), parms);
 }