Esempio n. 1
0
 /// <summary>
 /// 获得用户等级列表
 /// </summary>
 /// <returns></returns>
 public static List<UserRankInfo> GetUserRankList()
 {
     List<UserRankInfo> userRankList = new List<UserRankInfo>();
     IDataReader reader = BrnMall.Core.BMAData.RDBS.GetUserRankList();
     while(reader.Read())
     {
         UserRankInfo userRankInfo = new UserRankInfo();
         userRankInfo.UserRid = TypeHelper.ObjectToInt(reader["userrid"]);
         userRankInfo.System = TypeHelper.ObjectToInt(reader["system"]);
         userRankInfo.Title = reader["title"].ToString();
         userRankInfo.Avatar = reader["avatar"].ToString();
         userRankInfo.CreditsLower = TypeHelper.ObjectToInt(reader["creditslower"]);
         userRankInfo.CreditsUpper = TypeHelper.ObjectToInt(reader["creditsupper"]);
         userRankInfo.LimitDays = TypeHelper.ObjectToInt(reader["limitdays"]);
         userRankList.Add(userRankInfo);
     }
     reader.Close();
     return userRankList;
 }
Esempio n. 2
0
        public ActionResult Add(UserRankModel model)
        {
            if (AdminUserRanks.GetUserRidByTitle(model.UserRankTitle) > 0)
                ModelState.AddModelError("UserRankTitle", "名称已经存在");

            if (ModelState.IsValid)
            {
                UserRankInfo userRankInfo = new UserRankInfo()
                {
                    System = 0,
                    Title = model.UserRankTitle,
                    Avatar = model.Avatar,
                    CreditsLower = model.CreditsLower,
                    CreditsUpper = model.CreditsUpper,
                    LimitDays = 0
                };

                AdminUserRanks.CreateUserRank(userRankInfo);
                AddMallAdminLog("添加会员等级", "添加会员等级,会员等级为:" + model.UserRankTitle);
                return PromptView("会员等级添加成功");
            }
            Load();
            return View(model);
        }
Esempio n. 3
0
 /// <summary>
 /// 创建用户等级
 /// </summary>
 public void CreateUserRank(UserRankInfo userRankInfo)
 {
     DbParameter[] parms = {
                                 GenerateInParam("@system", SqlDbType.Int, 4, userRankInfo.System),
                                 GenerateInParam("@title", SqlDbType.NChar,50,userRankInfo.Title),
                                 GenerateInParam("@avatar", SqlDbType.Char,50,userRankInfo.Avatar),
                                 GenerateInParam("@creditslower", SqlDbType.Int, 4, userRankInfo.CreditsLower),
                                 GenerateInParam("@creditsupper", SqlDbType.Int,4,userRankInfo.CreditsUpper),
                                 GenerateInParam("@limitdays", SqlDbType.Int,4,userRankInfo.LimitDays)
                             };
     string commandText = string.Format("INSERT INTO [{0}userranks]([system],[title],[avatar],[creditslower],[creditsupper],[limitdays]) VALUES(@system,@title,@avatar,@creditslower,@creditsupper,@limitdays)",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
Esempio n. 4
0
        /// <summary>
        /// 更新用户等级
        /// </summary>
        public void UpdateUserRank(UserRankInfo userRankInfo)
        {
            DbParameter[] parms = {
                                        GenerateInParam("@system", SqlDbType.Int, 4, userRankInfo.System),
                                        GenerateInParam("@title", SqlDbType.NChar,50,userRankInfo.Title),
                                        GenerateInParam("@avatar", SqlDbType.Char,50,userRankInfo.Avatar),
                                        GenerateInParam("@creditslower", SqlDbType.Int, 4, userRankInfo.CreditsLower),
                                        GenerateInParam("@creditsupper", SqlDbType.Int,4,userRankInfo.CreditsUpper),
                                        GenerateInParam("@limitdays", SqlDbType.Int,4,userRankInfo.LimitDays),
                                        GenerateInParam("@userrid", SqlDbType.SmallInt, 2, userRankInfo.UserRid)    
                                    };

            string commandText = string.Format("UPDATE [{0}userranks] SET [system]=@system,[title]=@title,[avatar]=@avatar,[creditslower]=@creditslower,[creditsupper]=@creditsupper,[limitdays]=@limitdays WHERE [userrid]=@userrid",
                                                RDBSHelper.RDBSTablePre);
            RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
Esempio n. 5
0
 /// <summary>
 /// 更新用户等级
 /// </summary>
 public static void UpdateUserRank(UserRankInfo userRankInfo)
 {
     BrnMall.Data.UserRanks.UpdateUserRank(userRankInfo);
     BMACache.Remove(CacheKeys.MALL_USERRANK_LIST);
 }
Esempio n. 6
0
 /// <summary>
 /// 更新用户等级
 /// </summary>
 public static void UpdateUserRank(UserRankInfo userRankInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateUserRank(userRankInfo);
 }
Esempio n. 7
0
 /// <summary>
 /// 更新用户解禁时间
 /// </summary>
 /// <param name="uid">用户id</param>
 /// <param name="userRankInfo">用户等级</param>
 public static void UpdateUserLiftBanTimeByUid(int uid, UserRankInfo userRankInfo)
 {
     UpdateUserLiftBanTimeByUid(uid, DateTime.Now.AddDays(userRankInfo.LimitDays));
 }