diff --git a/Bootstrap.Admin/Controllers/AdminController.cs b/Bootstrap.Admin/Controllers/AdminController.cs index 479d40e6..ce319f1d 100644 --- a/Bootstrap.Admin/Controllers/AdminController.cs +++ b/Bootstrap.Admin/Controllers/AdminController.cs @@ -15,7 +15,6 @@ namespace Bootstrap.Admin.Controllers public ActionResult Index() { var v = new NavigatorBarModel(); - v.UserName = "Argo Zhang"; v.ShowMenu = "hide"; v.HomeUrl = "~/Admin"; return View(v); @@ -27,7 +26,6 @@ namespace Bootstrap.Admin.Controllers public ActionResult Users() { var v = new NavigatorBarModel(); - v.UserName = "Argo Zhang"; v.BreadcrumbName = "用户管理"; v.ShowMenu = "hide"; v.Menus[1].Active = "active"; diff --git a/Bootstrap.Admin/Models/HeaderBarModel.cs b/Bootstrap.Admin/Models/HeaderBarModel.cs index 1d1502eb..0ac3de60 100644 --- a/Bootstrap.Admin/Models/HeaderBarModel.cs +++ b/Bootstrap.Admin/Models/HeaderBarModel.cs @@ -1,30 +1,33 @@ -namespace Bootstrap.Admin.Models -{ - /// - /// - /// - public class HeaderBarModel : ModelBase - { - public HeaderBarModel() - { - UserName = "Argo Zhang"; - HomeUrl = "~/"; - } - /// - /// - /// - public string UserName { get; set; } - /// - /// - /// - public string BreadcrumbName { get; set; } - /// - /// - /// - public string ShowMenu { get; set; } - /// - /// - /// - public string HomeUrl { get; set; } - } +using Bootstrap.DataAccess; +using System.Web; + +namespace Bootstrap.Admin.Models +{ + /// + /// + /// + public class HeaderBarModel : ModelBase + { + public HeaderBarModel() + { + DisplayName = UserHelper.RetrieveUsersByName(HttpContext.Current.User.Identity.Name).DisplayName; + HomeUrl = "~/"; + } + /// + /// + /// + public string DisplayName { get; set; } + /// + /// + /// + public string BreadcrumbName { get; set; } + /// + /// + /// + public string ShowMenu { get; set; } + /// + /// + /// + public string HomeUrl { get; set; } + } } \ No newline at end of file diff --git a/Bootstrap.Admin/Scripts/Users.js b/Bootstrap.Admin/Scripts/Users.js index a64f6037..1c4ea571 100644 --- a/Bootstrap.Admin/Scripts/Users.js +++ b/Bootstrap.Admin/Scripts/Users.js @@ -3,7 +3,8 @@ map: { ID: "userID", UserName: "userName", - Password: "password" + Password: "password", + DisplayName: "displayName" } }); @@ -53,4 +54,6 @@ equalTo: "#password" } }); + + //TODO: 客户端点击保存用户后,要更新页面右上角用户显示名称 }); \ No newline at end of file diff --git a/Bootstrap.Admin/Views/Admin/Users.cshtml b/Bootstrap.Admin/Views/Admin/Users.cshtml index 964cc8e6..d284a4c4 100644 --- a/Bootstrap.Admin/Views/Admin/Users.cshtml +++ b/Bootstrap.Admin/Views/Admin/Users.cshtml @@ -15,11 +15,15 @@ @section query {
- -
+ +
+
+ +
+
@@ -34,21 +38,25 @@