-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
132 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace AuthSample.ViewModels.Admin | ||
{ | ||
public class UserRoleViewModel | ||
{ | ||
public string UserId { get; set; } | ||
public string UserName { get; set; } | ||
public bool IsSelected { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@using AuthSample.ViewModels.Admin | ||
@* | ||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 | ||
*@ | ||
@{ | ||
var roleId = ViewBag.roleId; | ||
} | ||
@model List<UserRoleViewModel>; | ||
|
||
<form method="post"> | ||
<h2>角色下 新增 / 刪除 使用者</h2> | ||
@for (var i = 0; i < Model.Count; i++) | ||
{ | ||
<div> | ||
<input type="hidden" asp-for="@Model[i].UserId" /> | ||
<input type="hidden" asp-for="@Model[i].UserName"/> | ||
<input asp-for="@Model[i].IsSelected"/> | ||
<label asp-for="@Model[i].IsSelected"> | ||
@Model[i].UserName | ||
</label> | ||
</div> | ||
} | ||
<button>更新</button> | ||
<a asp-action="EditRole" asp-route-id="@roleId">取消</a> | ||
|
||
</form> |