/// <summary> /// 删除商城管理员组 /// </summary> /// <param name="mallAGid">商城管理员组id</param> /// <returns>-2代表内置管理员不能删除,-1代表此管理员组下还有会员未删除,0代表删除失败,1代表删除成功</returns> public static int DeleteMallAdminGroupById(int mallAGid) { if (mallAGid < 3) { return(-2); } if (AdminUsers.GetUserCountByMallAGid(mallAGid) > 0) { return(-1); } if (mallAGid > 0) { NStore.Data.MallAdminGroups.DeleteMallAdminGroupById(mallAGid); NStore.Core.BMACache.Remove(CacheKeys.MALL_MALLADMINGROUP_ACTIONHASHSET + mallAGid); NStore.Core.BMACache.Remove(CacheKeys.MALL_MALLADMINGROUP_LIST); File.Delete(IOHelper.GetMapPath(MallAdminNavMeunCacheFolder + "/" + mallAGid + ".js")); return(1); } else { return(0); } }
/// <summary> /// 删除用户等级 /// </summary> /// <param name="userRid">用户等级id</param> /// <returns>-2代表系统等级不能删除,-1代表此等级下还有用户未删除,0代表此用户等级不存在,1代表删除成功</returns> public static int DeleteUserRankById(int userRid) { UserRankInfo userRankInfo = GetUserRankById(userRid); if (userRankInfo != null) { if (userRankInfo.System == 1) { return(-2); } if (AdminUsers.GetUserCountByUserRid(userRid) > 0) { return(-1); } NStore.Data.UserRanks.DeleteUserRankById(userRid); BMACache.Remove(CacheKeys.MALL_USERRANK_LIST); return(1); } return(0); }