public static string GetRankName(int rankId) { try { var item = RankList.Find(e => e.Id == rankId); return(item.RankName); } catch (Exception e) { return("-"); } }
public static void GivePrize(int rankId, Member user) { var rank = RankList.Find(e => e.Id == rankId); switch (rank.PrizeKind) { case PrizeKind.MainBalance: user.AddToMainBalance(new Money(int.Parse(rank.PrizeValue)), "LeadershipSystem Rank " + rank.RankName); user.SaveBalances(); break; case PrizeKind.Points: user.AddToPointsBalance(int.Parse(rank.PrizeValue), "LeadershipSystem Rank " + rank.RankName, BalanceLogType.Other, true, false); user.SaveBalances(); break; case PrizeKind.CustomPrize: //NOTHING break; } }