// 返回用户对应的角色 public static string GetRole(string userName) { if(string.IsNullOrWhiteSpace(userName)) return "0"; UserModel accountModel = new UserModel(); var userGrade = accountModel.GetUserGrade(userName); return userGrade.GradeLevel.ToString(); }