vgquotes/Src/VideoGameQuotes.Web/Models/UserModel.cs

28 lines
826 B
C#
Raw Normal View History

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using VideoGameQuotes.Api;
namespace VideoGameQuotes.Web.Models {
public class UserModel {
public User CurrentUser { get; set; }
public User User { get; set; }
}
public class EditUserModel {
[Required]
public int Id { get; set; }
public string Username { get; set; }
[Required]
public UserGroup Group { get; set; }
public string IpAddress { get; set; }
public IEnumerable<SelectListItem> GetGroupList(UserGroup selectedGroup) {
return Enum.GetValues(typeof(UserGroup))
.Cast<UserGroup>()
.Select(group => new SelectListItem { Text = group.ToString(), Value = group.ToString()/*, Selected = group == selectedGroup*/ });
}
}
}