@using MileageTraker.Web.Utility
@model MileageTraker.Web.Models.User
@{
ViewBag.Title = "User Details";
}
@{ Html.RenderPartial("BackToUsers"); }
@Html.Partial("_StatusMessage")
@Html.DisplayFor(m => m.FullName)
-
@Html.DisplayNameFor(m => m.Username)
-
@Html.Encode(Model.Username)
@Html.Partial("_UserStatusLabels")
@Html.DisplayFor(m => m.Email)
-
@Html.DisplayNameFor(m => m.Roles)
-
@{ var roles = Roles.Provider.GetRolesForUser(Model.Username); }
@if (roles.Length > 0)
{
@Html.Encode(string.Join(", ", roles))
}
else
{
No Role
}
-
@Html.DisplayNameFor(m => m.LastActivityDate)
-
@if (!Model.LastActivityDate.IsSqlMinValue())
{
@Html.Encode(Model.LastActivityDate)
(@Html.Encode((DateTime.Now - Model.LastActivityDate).ToVerboseStringHistoric()))
}
else
{
No Activity
}
-
@Html.DisplayNameFor(m => m.LastLoginDate)
-
@if (!Model.LastLoginDate.IsSqlMinValue())
{
@Html.Encode(Model.LastLoginDate)
(@Html.Encode((DateTime.Now - Model.LastLoginDate).ToVerboseStringHistoric()))
}
else
{
Never Logged In
}
-
@Html.DisplayNameFor(m => m.LastPasswordChangedDate)
-
@if (!Model.LastPasswordChangedDate.IsSqlMinValue())
{
@Html.Encode(Model.LastPasswordChangedDate)
(@Html.Encode((DateTime.Now - Model.LastPasswordChangedDate).ToVerboseStringHistoric()))
}
else
{
Never Changed
}
@if (Model.IsLockedOut) {
-
Lockout Password Date
-
@if (!Model.LastLockoutDate.IsSqlMinValue())
{
@Html.Encode(Model.LastLockoutDate)
(@Html.Encode((DateTime.Now - Model.LastLockoutDate).ToVerboseStringHistoric()))
}
else
{
Never Locked (?)
}
}
@Html.ActionLink("Edit", "Edit", new { id = Model.UserId }, new { @class = "btn" })
@Html.ActionLink("Set Password", "SetPassword", new { id = Model.UserId }, new { @class = "btn" })
@if (Model.IsApproved)
{
@Html.ActionLink("Disable Account", "DisableUser", new {id = Model.UserId}, new {@class = "btn"})
}
else
{
@Html.ActionLink("Enable Account", "EnableUser", new {id = Model.UserId}, new {@class = "btn"})
}
@if (Model.IsLockedOut)
{
@Html.ActionLink("Unlock", "UnlockUser", new {id = Model.UserId}, new {@class = "btn"})
}