@{
    ViewBag.Title = "Přidat roli uživateli";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@Html.ActionLink("Vytvořit novou roli", "RoleCreate") | @Html.ActionLink("Role", "RoleIndex")

<h2>Přidat roli uživateli</h2>

@using (Html.BeginForm("RoleAddToUser", "Account"))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <div class="message-success">@ViewBag.ResultMessage</div>
    <p>
        Uživatelské jméno : @Html.TextBox("UserName")
        Role: @Html.DropDownList("RoleName", ViewBag.Roles as SelectList)

    </p>

    <input type="submit" value="Uložit" />
}

<h3>Odebrat roli uživateli</h3>

@using (Html.BeginForm("DeleteRoleForUser", "Account"))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <p>
        Uživatelské jméno : @Html.TextBox("UserName")
        Role: @Html.DropDownList("RoleName", ViewBag.Roles as SelectList)

    </p>

    <input type="submit" value="Odebrat" />
}

<div class="hr"></div>
@using (Html.BeginForm("GetRoles", "Account"))
{
    @Html.AntiForgeryToken()
    <p>
        Uživatelské jméno : @Html.TextBox("UserName")
        <input type="submit" value="Vypsat role uživatele" />
    </p>
}

@if (ViewBag.RolesForThisUser != null)
{
    <h3>Role uživatele</h3>
    <ol>
        @foreach (string s in ViewBag.RolesForThisUser)
        {
            <li>@s</li>
        }
    </ol>
}
