From 0149819af3367ef1d558696bf32dae3c809b76c1 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 24 Oct 2016 01:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B5=E9=9D=A2=E5=8F=B3?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E6=98=BE=E7=A4=BA=E5=90=8D=E7=A7=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AdminController.cs | 2 - Bootstrap.Admin/Models/HeaderBarModel.cs | 61 ++++++++++--------- Bootstrap.Admin/Scripts/Users.js | 5 +- Bootstrap.Admin/Views/Admin/Users.cshtml | 22 ++++--- Bootstrap.Admin/Views/Shared/Header.cshtml | 2 +- Bootstrap.Admin/Web.config | 1 + Bootstrap.DataAccess/User.cs | 6 +- Bootstrap.DataAccess/UserHelper.cs | 51 +++++++++------- 8 files changed, 88 insertions(+), 62 deletions(-) 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 @@