コード例 #1
0
ファイル: ThirdPartMode.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userInfo">要保存的用户信息(密码为明文)</param>
        /// <returns>返回经过处理之后的实际用户信息</returns>
        public UserInfo SaveUserInfo(UserInfo userInfo)
        {
            if (Utils.StrIsNullOrEmpty(userInfo.Salt))
                userInfo.Salt = Forum.ForumUtils.CreateAuthStr(6, false);

            userInfo.Password = GetEncryptedPassword(userInfo, userInfo.Password);

            return ASEWH.Data.Users.UpdateUser(userInfo) ? userInfo : null;
        }
コード例 #2
0
ファイル: ThirdPartMode.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 检查密码
        /// </summary>
        /// <param name="userInfo">通过username获取的用户信息,用于进行密码验证</param>
        /// <param name="postpassword">用户提交的密码</param>
        /// <returns>返回当前用户信息与提交密码的验证结果</returns>
        public bool CheckPassword(UserInfo userInfo, string postpassword)
        {
            if (userInfo == null)
            {
                return false;
            }
            string doubleMd5 = GetEncryptedPassword(userInfo, postpassword);

            return doubleMd5 == userInfo.Password;//比较
        }
コード例 #3
0
ファイル: ThirdPartMode.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 获取加密后的密码字符串
 /// </summary>
 /// <param name="userInfo"></param>
 /// <param name="unEncryptPassword">未加密的密码字符串</param>
 /// <returns></returns>
 private string GetEncryptedPassword(UserInfo userInfo, string unEncryptPassword)
 {
     return Utils.MD5(Utils.MD5(unEncryptPassword) + userInfo.Salt);//两遍MD5
 }
コード例 #4
0
ファイル: ThirdPartMode.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 创建用户信息(用于用户注册等行为)
 /// </summary>
 /// <param name="userInfo">要创建的用户信息(密码为明文)</param>
 /// <returns></returns>
 public int CreateUserInfo(UserInfo userInfo)
 {
     userInfo.Salt = Forum.ForumUtils.CreateAuthStr(6, false);
     userInfo.Password = GetEncryptedPassword(userInfo, userInfo.Password);
     return ASEWH.Data.Users.CreateUser(userInfo);
 }
コード例 #5
0
ファイル: Debates.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 增加Digg
 /// </summary>
 /// <param name="tid">主题id</param>
 /// <param name="pid">帖子ID</param>
 /// <param name="type">正反方观点</param>
 /// <param name="userinfo">用户信息</param>
 public static void AddDebateDigg(int tid, int pid, int type, string ip, UserInfo userinfo)
 {
     DatabaseProvider.GetInstance().AddDebateDigg(tid, pid, type, ip, userinfo);
 }
コード例 #6
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 创建新用户.
 /// </summary>
 /// <param name="__userinfo">用户信息</param>
 /// <returns>返回用户ID, 如果已存在该用户名则返回-1</returns>
 public static int CreateUser(UserInfo userinfo)
 {
     userinfo.Uid = DatabaseProvider.GetInstance().CreateUser(userinfo);
     if (appDBCache)
         IUserService.CreateUser(userinfo);
     return userinfo.Uid;
 }
コード例 #7
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
 public static UserInfo LoadSingleUserInfo(IDataReader reader)
 {
     UserInfo userinfo = new UserInfo();
     userinfo.Uid = TypeConverter.ObjectToInt(reader["uid"]);
     userinfo.Username = reader["username"].ToString();
     userinfo.Nickname = reader["nickname"].ToString();
     userinfo.Password = reader["password"].ToString();
     userinfo.Spaceid = TypeConverter.ObjectToInt(reader["spaceid"]);
     userinfo.Secques = reader["secques"].ToString();
     userinfo.Gender = TypeConverter.ObjectToInt(reader["gender"]);
     userinfo.Adminid = TypeConverter.ObjectToInt(reader["adminid"]);
     userinfo.Groupid = TypeConverter.ObjectToInt(reader["groupid"]);
     userinfo.Groupexpiry = TypeConverter.ObjectToInt(reader["groupexpiry"]);
     userinfo.Extgroupids = reader["extgroupids"].ToString();
     userinfo.Regip = reader["regip"].ToString();
     userinfo.Joindate = Utils.GetStandardDateTime(reader["joindate"].ToString());
     userinfo.Lastip = reader["lastip"].ToString();
     userinfo.Lastvisit = Utils.GetStandardDateTime(reader["lastvisit"].ToString());
     userinfo.Lastactivity = Utils.GetStandardDateTime(reader["lastactivity"].ToString());
     userinfo.Lastpost = Utils.GetStandardDateTime(reader["lastpost"].ToString());
     userinfo.Lastpostid = TypeConverter.ObjectToInt(reader["lastpostid"]);
     userinfo.Lastposttitle = reader["lastposttitle"].ToString();
     userinfo.Posts = TypeConverter.ObjectToInt(reader["posts"]);
     userinfo.Digestposts = TypeConverter.ObjectToInt(reader["digestposts"]);
     userinfo.Oltime = TypeConverter.ObjectToInt(reader["oltime"]);
     userinfo.Pageviews = TypeConverter.ObjectToInt(reader["pageviews"]);
     userinfo.Credits = TypeConverter.ObjectToInt(reader["credits"]);
     userinfo.Extcredits1 = TypeConverter.StrToFloat(reader["extcredits1"].ToString());
     userinfo.Extcredits2 = TypeConverter.StrToFloat(reader["extcredits2"].ToString());
     userinfo.Extcredits3 = TypeConverter.StrToFloat(reader["extcredits3"].ToString());
     userinfo.Extcredits4 = TypeConverter.StrToFloat(reader["extcredits4"].ToString());
     userinfo.Extcredits5 = TypeConverter.StrToFloat(reader["extcredits5"].ToString());
     userinfo.Extcredits6 = TypeConverter.StrToFloat(reader["extcredits6"].ToString());
     userinfo.Extcredits7 = TypeConverter.StrToFloat(reader["extcredits7"].ToString());
     userinfo.Extcredits8 = TypeConverter.StrToFloat(reader["extcredits8"].ToString());
     userinfo.Medals = reader["medals"].ToString();
     userinfo.Email = reader["email"].ToString();
     userinfo.Bday = reader["bday"].ToString();
     userinfo.Sigstatus = TypeConverter.ObjectToInt(reader["sigstatus"]);
     userinfo.Tpp = TypeConverter.ObjectToInt(reader["tpp"]);
     userinfo.Ppp = TypeConverter.ObjectToInt(reader["ppp"]);
     userinfo.Templateid = TypeConverter.ObjectToInt(reader["templateid"]);
     userinfo.Pmsound = TypeConverter.ObjectToInt(reader["pmsound"]);
     userinfo.Showemail = TypeConverter.ObjectToInt(reader["showemail"]);
     userinfo.Newsletter = (ReceivePMSettingType)TypeConverter.ObjectToInt(reader["newsletter"]);
     userinfo.Invisible = TypeConverter.ObjectToInt(reader["invisible"]);
     userinfo.Newpm = TypeConverter.ObjectToInt(reader["newpm"]);
     userinfo.Newpmcount = TypeConverter.ObjectToInt(reader["newpmcount"]);
     userinfo.Accessmasks = TypeConverter.ObjectToInt(reader["accessmasks"]);
     userinfo.Onlinestate = TypeConverter.ObjectToInt(reader["onlinestate"]);
     userinfo.Website = reader["website"].ToString();
     userinfo.Icq = reader["icq"].ToString();
     userinfo.Qq = reader["qq"].ToString();
     userinfo.Yahoo = reader["yahoo"].ToString();
     userinfo.Msn = reader["msn"].ToString();
     userinfo.Skype = reader["skype"].ToString();
     userinfo.Location = reader["location"].ToString();
     userinfo.Customstatus = reader["customstatus"].ToString();
     userinfo.Bio = reader["bio"].ToString();
     userinfo.Signature = reader["signature"].ToString();
     userinfo.Sightml = reader["sightml"].ToString();
     userinfo.Authstr = reader["authstr"].ToString();
     userinfo.Authtime = reader["authtime"].ToString();
     userinfo.Authflag = Byte.Parse(TypeConverter.ObjectToInt(reader["authflag"]).ToString());
     userinfo.Realname = reader["realname"].ToString();
     userinfo.Idcard = reader["idcard"].ToString();
     userinfo.Mobile = reader["mobile"].ToString();
     userinfo.Phone = reader["phone"].ToString();
     userinfo.Ignorepm = reader["ignorepm"].ToString();
     userinfo.Salt = reader["salt"].ToString().Trim();
     return userinfo;
 }
コード例 #8
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 更新指定用户的个人资料
 /// </summary>
 /// <param name="__userinfo">用户信息</param>
 /// <returns>如果用户不存在则为false, 否则为true</returns>
 public static void UpdateUserProfile(UserInfo userinfo)
 {
     DatabaseProvider.GetInstance().UpdateUserProfile(userinfo);
     if (appDBCache)
         IUserService.UpdateUserProfile(userinfo);
 }
コード例 #9
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 合并用户
        /// </summary>
        /// <param name="postTableName">分表名称</param>
        /// <param name="targetUserInfo">目标用户</param>
        /// <param name="srcUserInfo">要合并用户</param>
        public static void CombinationUser(string postTableName, UserInfo targetUserInfo, UserInfo srcUserInfo)
        {
            DatabaseProvider.GetInstance().CombinationUser(postTableName, targetUserInfo, srcUserInfo);

            if (appDBCache)
                IUserService.CombinationUser(postTableName, targetUserInfo, srcUserInfo);
        }
コード例 #10
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
 /// <summary>
 /// 更新用户
 /// </summary>
 /// <param name="userinfo">用户信息</param>
 /// <returns>是否更新成功</returns>
 public static bool UpdateUser(UserInfo userinfo)
 {
     if (appDBCache)
         IUserService.UpdateUser(userinfo);
     return DatabaseProvider.GetInstance().UpdateUser(userinfo);
 }
コード例 #11
0
ファイル: Users.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 更新用户短消息设置
        /// </summary>
        /// <param name="user">用户信息</param>
        public static void UpdateUserPMSetting(UserInfo user)
        {
            DatabaseProvider.GetInstance().UpdateUserPMSetting(user);

            if (appDBCache)
                IUserService.UpdateUserPMSetting(user);
        }
コード例 #12
0
ファイル: UserManage.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 创建新用户.
        /// </summary>
        /// <param name="__userinfo">用户信息</param>
        /// <returns>返回用户ID, 如果已存在该用户名则返回-1</returns>
        public int CreateUser(UserInfo userInfo)
        {
            DbParameter[] parms = {
                                       DbHelper.MakeInParam("@username",(DbType)SqlDbType.Char,20,userInfo.Username),
                                       DbHelper.MakeInParam("@nickname",(DbType)SqlDbType.Char,20,userInfo.Nickname),
                                       DbHelper.MakeInParam("@password",(DbType)SqlDbType.Char,32,userInfo.Password),
                                       DbHelper.MakeInParam("@secques",(DbType)SqlDbType.Char,8,userInfo.Secques),
                                       DbHelper.MakeInParam("@gender",(DbType)SqlDbType.Int,4,userInfo.Gender),
                                       DbHelper.MakeInParam("@adminid",(DbType)SqlDbType.Int,4,userInfo.Adminid),
                                       DbHelper.MakeInParam("@groupid",(DbType)SqlDbType.SmallInt,2,userInfo.Groupid),
                                       DbHelper.MakeInParam("@groupexpiry",(DbType)SqlDbType.Int,4,userInfo.Groupexpiry),
                                       DbHelper.MakeInParam("@extgroupids",(DbType)SqlDbType.Char,60,userInfo.Extgroupids),
                                       DbHelper.MakeInParam("@regip",(DbType)SqlDbType.VarChar,0,userInfo.Regip),
                                       DbHelper.MakeInParam("@joindate",(DbType)SqlDbType.VarChar,0,userInfo.Joindate),
                                       DbHelper.MakeInParam("@lastip",(DbType)SqlDbType.Char,15,userInfo.Lastip),
                                       DbHelper.MakeInParam("@lastvisit",(DbType)SqlDbType.VarChar,0,userInfo.Lastvisit),
                                       DbHelper.MakeInParam("@lastactivity",(DbType)SqlDbType.VarChar,0,userInfo.Lastactivity),
                                       DbHelper.MakeInParam("@lastpost",(DbType)SqlDbType.VarChar,0,userInfo.Lastpost),
                                       DbHelper.MakeInParam("@lastpostid",(DbType)SqlDbType.Int,4,userInfo.Lastpostid),
                                       DbHelper.MakeInParam("@lastposttitle",(DbType)SqlDbType.VarChar,0,userInfo.Lastposttitle),
                                       DbHelper.MakeInParam("@posts",(DbType)SqlDbType.Int,4,userInfo.Posts),
                                       DbHelper.MakeInParam("@digestposts",(DbType)SqlDbType.SmallInt,2,userInfo.Digestposts),
                                       DbHelper.MakeInParam("@oltime",(DbType)SqlDbType.Int,2,userInfo.Oltime),
                                       DbHelper.MakeInParam("@pageviews",(DbType)SqlDbType.Int,4,userInfo.Pageviews),
                                       DbHelper.MakeInParam("@credits",(DbType)SqlDbType.Int,4,userInfo.Credits),
                                       DbHelper.MakeInParam("@extcredits1",(DbType)SqlDbType.Float,8,userInfo.Extcredits1),
                                       DbHelper.MakeInParam("@extcredits2",(DbType)SqlDbType.Float,8,userInfo.Extcredits2),
                                       DbHelper.MakeInParam("@extcredits3",(DbType)SqlDbType.Float,8,userInfo.Extcredits3),
                                       DbHelper.MakeInParam("@extcredits4",(DbType)SqlDbType.Float,8,userInfo.Extcredits4),
                                       DbHelper.MakeInParam("@extcredits5",(DbType)SqlDbType.Float,8,userInfo.Extcredits5),
                                       DbHelper.MakeInParam("@extcredits6",(DbType)SqlDbType.Float,8,userInfo.Extcredits6),
                                       DbHelper.MakeInParam("@extcredits7",(DbType)SqlDbType.Float,8,userInfo.Extcredits7),
                                       DbHelper.MakeInParam("@extcredits8",(DbType)SqlDbType.Float,8,userInfo.Extcredits8),
                                       DbHelper.MakeInParam("@avatarshowid",(DbType)SqlDbType.Int,4,0),
                                       DbHelper.MakeInParam("@email",(DbType)SqlDbType.Char,50,userInfo.Email),
                                       DbHelper.MakeInParam("@bday",(DbType)SqlDbType.VarChar,0,userInfo.Bday),
                                       DbHelper.MakeInParam("@sigstatus",(DbType)SqlDbType.Int,4,userInfo.Sigstatus),
                                       DbHelper.MakeInParam("@tpp",(DbType)SqlDbType.Int,4,userInfo.Tpp),
                                       DbHelper.MakeInParam("@ppp",(DbType)SqlDbType.Int,4,userInfo.Ppp),
                                       DbHelper.MakeInParam("@templateid",(DbType)SqlDbType.SmallInt,2,userInfo.Templateid),
                                       DbHelper.MakeInParam("@pmsound",(DbType)SqlDbType.Int,4,userInfo.Pmsound),
                                       DbHelper.MakeInParam("@showemail",(DbType)SqlDbType.Int,4,userInfo.Showemail),
                                       DbHelper.MakeInParam("@newsletter",(DbType)SqlDbType.Int,4,userInfo.Newsletter),
                                       DbHelper.MakeInParam("@invisible",(DbType)SqlDbType.Int,4,userInfo.Invisible),
                                       DbHelper.MakeInParam("@newpm",(DbType)SqlDbType.Int,4,userInfo.Newpm),
                                       DbHelper.MakeInParam("@accessmasks",(DbType)SqlDbType.Int,4,userInfo.Accessmasks),
                                       DbHelper.MakeInParam("@salt",(DbType)SqlDbType.NChar,6,userInfo.Salt),
                                       DbHelper.MakeInParam("@website",(DbType)SqlDbType.VarChar,80,userInfo.Website),
                                       DbHelper.MakeInParam("@icq",(DbType)SqlDbType.VarChar,12,userInfo.Icq),
                                       DbHelper.MakeInParam("@qq",(DbType)SqlDbType.VarChar,12,userInfo.Qq),
                                       DbHelper.MakeInParam("@yahoo",(DbType)SqlDbType.VarChar,40,userInfo.Yahoo),
                                       DbHelper.MakeInParam("@msn",(DbType)SqlDbType.VarChar,40,userInfo.Msn),
                                       DbHelper.MakeInParam("@skype",(DbType)SqlDbType.VarChar,40,userInfo.Skype),
                                       DbHelper.MakeInParam("@location",(DbType)SqlDbType.VarChar,30,userInfo.Location),
                                       DbHelper.MakeInParam("@customstatus",(DbType)SqlDbType.VarChar,30,userInfo.Customstatus),
                                       DbHelper.MakeInParam("@avatar",(DbType)SqlDbType.VarChar,255,""),
                                       DbHelper.MakeInParam("@avatarwidth",(DbType)SqlDbType.Int,4,0),
                                       DbHelper.MakeInParam("@avatarheight",(DbType)SqlDbType.Int,4,0),
                                       DbHelper.MakeInParam("@medals",(DbType)SqlDbType.VarChar,40, userInfo.Medals),
                                       DbHelper.MakeInParam("@bio",(DbType)SqlDbType.NVarChar,500,userInfo.Bio),
                                       DbHelper.MakeInParam("@signature",(DbType)SqlDbType.NVarChar,500,userInfo.Signature),
                                       DbHelper.MakeInParam("@sightml",(DbType)SqlDbType.NVarChar,1000,userInfo.Sightml),
                                       DbHelper.MakeInParam("@authstr",(DbType)SqlDbType.VarChar,20,userInfo.Authstr),
                                       DbHelper.MakeInParam("@realname",(DbType)SqlDbType.NVarChar,10,userInfo.Realname),
                                       DbHelper.MakeInParam("@idcard",(DbType)SqlDbType.VarChar,20,userInfo.Idcard),
                                       DbHelper.MakeInParam("@mobile",(DbType)SqlDbType.VarChar,20,userInfo.Mobile),
                                       DbHelper.MakeInParam("@phone",(DbType)SqlDbType.VarChar,20,userInfo.Phone)
                                   };

            int uid = TypeConverter.ObjectToInt(DbHelper.ExecuteScalar(CommandType.StoredProcedure,
                                                                    string.Format("{0}createuser", BaseConfigs.GetTablePrefix),
                                                                 parms), -1);
            if (uid != -1)
                UpdateTrendStat(TrendType.Register);
            return uid;
        }
コード例 #13
0
ファイル: UserManage.cs プロジェクト: sword88/ASEWH
        public void CombinationUser(string postTableName, UserInfo targetUserInfo, UserInfo srcUserInfo)
        {
            DbParameter[] parms = {
                                    DbHelper.MakeInParam("@target_uid", (DbType)SqlDbType.Int, 4, targetUserInfo.Uid),
                                    DbHelper.MakeInParam("@target_username", (DbType)SqlDbType.NChar, 20, targetUserInfo.Username.Trim()),
                                    DbHelper.MakeInParam("@src_uid", (DbType)SqlDbType.Int, 4, srcUserInfo.Uid)
                                  };
            string commandText = string.Format("UPDATE  [{0}topics] SET [posterid]=@target_uid,[poster]=@target_username  WHERE [posterid]=@src_uid",
                                                BaseConfigs.GetTablePrefix);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);

            commandText = string.Format("UPDATE  [{0}users] SET [posts]={1} WHERE [uid]=@target_uid",
                                         BaseConfigs.GetTablePrefix, srcUserInfo.Posts + targetUserInfo.Posts);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);

            commandText = string.Format("UPDATE  [{0}] SET [posterid]=@target_uid,[poster]=@target_username  WHERE [posterid]=@src_uid", postTableName);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);

            commandText = string.Format("UPDATE  [{0}pms] SET [msgtoid]=@target_uid,[msgto]=@target_username  WHERE [msgtoid]=@src_uid",
                                         BaseConfigs.GetTablePrefix);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);

            commandText = string.Format("UPDATE  [{0}attachments] SET [uid]=@target_uid WHERE [uid]=@src_uid", BaseConfigs.GetTablePrefix);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
コード例 #14
0
ファイル: UserManage.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 更新指定用户的个人资料
        /// </summary>
        /// <param name="__userinfo">用户信息</param>
        /// <returns>如果用户不存在则为false, 否则为true</returns>
        public void UpdateUserProfile(UserInfo userInfo)
        {
            DbParameter[] parms = {
                                       DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4, userInfo.Uid),
                                       DbHelper.MakeInParam("@nickname",(DbType)SqlDbType.Char,20,userInfo.Nickname),
                                       DbHelper.MakeInParam("@gender", (DbType)SqlDbType.Int, 4, userInfo.Gender),
                                       DbHelper.MakeInParam("@email", (DbType)SqlDbType.Char, 50, userInfo.Email),
                                       DbHelper.MakeInParam("@bday", (DbType)SqlDbType.Char, 10, userInfo.Bday),
                                       DbHelper.MakeInParam("@showemail", (DbType)SqlDbType.Int, 4, userInfo.Showemail),
                                       DbHelper.MakeInParam("@website", (DbType)SqlDbType.VarChar, 80, userInfo.Website),
                                       DbHelper.MakeInParam("@icq", (DbType)SqlDbType.VarChar, 12, userInfo.Icq),
                                       DbHelper.MakeInParam("@qq", (DbType)SqlDbType.VarChar, 12, userInfo.Qq),
                                       DbHelper.MakeInParam("@yahoo", (DbType)SqlDbType.VarChar, 40, userInfo.Yahoo),
                                       DbHelper.MakeInParam("@msn", (DbType)SqlDbType.VarChar, 40, userInfo.Msn),
                                       DbHelper.MakeInParam("@skype", (DbType)SqlDbType.VarChar, 40, userInfo.Skype),
                                       DbHelper.MakeInParam("@location", (DbType)SqlDbType.NVarChar, 30, userInfo.Location),
                                       DbHelper.MakeInParam("@bio", (DbType)SqlDbType.NVarChar, 500, userInfo.Bio),
                                       DbHelper.MakeInParam("@signature", (DbType)SqlDbType.NVarChar, 500, userInfo.Signature),
                                       DbHelper.MakeInParam("@sigstatus", (DbType)SqlDbType.Int, 4, userInfo.Sigstatus),
                                       DbHelper.MakeInParam("@sightml", (DbType)SqlDbType.NVarChar, 1000, userInfo.Sightml),
                                       DbHelper.MakeInParam("@realname",(DbType)SqlDbType.NVarChar,10,userInfo.Realname),
                                       DbHelper.MakeInParam("@idcard",(DbType)SqlDbType.VarChar,20,userInfo.Idcard),
                                       DbHelper.MakeInParam("@mobile",(DbType)SqlDbType.VarChar,20,userInfo.Mobile),
                                       DbHelper.MakeInParam("@phone",(DbType)SqlDbType.VarChar,20,userInfo.Phone)
                                   };

            DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, string.Format("{0}updateuserprofile", BaseConfigs.GetTablePrefix), parms);
        }
コード例 #15
0
ファイル: UserManage.cs プロジェクト: sword88/ASEWH
        public void UpdateUserPMSetting(UserInfo user)
        {
            DbParameter[] parms = {
                                    DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4, user.Uid),
                                    DbHelper.MakeInParam("@pmsound", (DbType)SqlDbType.Int, 4, user.Pmsound),
                                    DbHelper.MakeInParam("@newsletter", (DbType)SqlDbType.Int, 4, (int)user.Newsletter)
                                  };
            string commandText = string.Format(@"UPDATE [{0}users] SET [pmsound]=@pmsound, [newsletter]=@newsletter WHERE [uid]=@uid",
                                                 BaseConfigs.GetTablePrefix);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);

            parms = new DbParameter[] {
                                    DbHelper.MakeInParam("@ignorepm", (DbType)SqlDbType.NVarChar, 1000, user.Ignorepm),
                                    DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4, user.Uid)
                                     };
            commandText = string.Format(@"UPDATE [{0}userfields] SET [ignorepm]=@ignorepm WHERE [uid]=@uid", BaseConfigs.GetTablePrefix);
            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
コード例 #16
0
ファイル: UserManage.cs プロジェクト: sword88/ASEWH
        /// <summary>
        /// 更新用户论坛设置
        /// </summary>
        /// <param name="__userinfo">用户信息</param>
        /// <returns>如果用户不存在则返回false, 否则返回true</returns>
        public void UpdateUserForumSetting(UserInfo userInfo)
        {
            DbParameter[] parms = {
                                       DbHelper.MakeInParam("@uid",(DbType)SqlDbType.Int,4,userInfo.Uid),
                                       DbHelper.MakeInParam("@tpp",(DbType)SqlDbType.Int,4,userInfo.Tpp),
                                       DbHelper.MakeInParam("@ppp",(DbType)SqlDbType.Int,4,userInfo.Ppp),
                                       DbHelper.MakeInParam("@invisible",(DbType)SqlDbType.Int,4,userInfo.Invisible),
                                       DbHelper.MakeInParam("@customstatus",(DbType)SqlDbType.VarChar,30,userInfo.Customstatus)
                                   };

            DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, string.Format("{0}updateuserforumsetting", BaseConfigs.GetTablePrefix), parms);
        }