From f853bd13b77354671103567b9d9d333cacb2d28a Mon Sep 17 00:00:00 2001 From: yubaolee Date: Tue, 22 Dec 2015 11:55:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E5=88=86?= =?UTF-8?q?=E9=85=8D=E8=A7=92=E8=89=B2=E6=93=8D=E4=BD=9C=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeSmith/Add.cshtml.cst | 140 ++++++++++++++ CodeSmith/{本身带级联 => }/Application.cst | 2 +- CodeSmith/{本身带级联 => }/Controller.cst | 2 +- CodeSmith/{本身带级联 => }/IRepository.cst | 2 +- CodeSmith/{本身带级联 => }/Index.cshtml.cst | 2 +- .../Index.cshtml.cst => NoCascadeIndex.cshtml.cst} | 42 +---- CodeSmith/Repository.cst | 49 +++++ CodeSmith/带其他级联/Add.cshtml.cst | 145 --------------- CodeSmith/带其他级联/Application.cst | 138 -------------- CodeSmith/带其他级联/Controller.cst | 110 ----------- CodeSmith/带其他级联/IRepository.cst | 28 --- CodeSmith/本身带级联/Add.cshtml.cst | 145 --------------- OpenAuth.App/LoginApp.cs | 20 +- OpenAuth.App/RoleManagerApp.cs | 4 +- OpenAuth.App/ViewModel/LoginUserVM.cs | 8 + .../Controllers/RoleManagerController.cs | 13 +- OpenAuth.Mvc/OpenAuth.Mvc.csproj | 2 +- .../Views/RoleManager/LookupMulti.cshtml | 175 +++++++++++------- OpenAuth.Mvc/Views/UserManager/Index.cshtml | 2 + OpenAuth.UnitTest/TestLogin.cs | 3 +- 20 files changed, 349 insertions(+), 683 deletions(-) create mode 100644 CodeSmith/Add.cshtml.cst rename CodeSmith/{本身带级联 => }/Application.cst (99%) rename CodeSmith/{本身带级联 => }/Controller.cst (99%) rename CodeSmith/{本身带级联 => }/IRepository.cst (98%) rename CodeSmith/{本身带级联 => }/Index.cshtml.cst (99%) rename CodeSmith/{带其他级联/Index.cshtml.cst => NoCascadeIndex.cshtml.cst} (76%) create mode 100644 CodeSmith/Repository.cst delete mode 100644 CodeSmith/带其他级联/Add.cshtml.cst delete mode 100644 CodeSmith/带其他级联/Application.cst delete mode 100644 CodeSmith/带其他级联/Controller.cst delete mode 100644 CodeSmith/带其他级联/IRepository.cst delete mode 100644 CodeSmith/本身带级联/Add.cshtml.cst diff --git a/CodeSmith/Add.cshtml.cst b/CodeSmith/Add.cshtml.cst new file mode 100644 index 00000000..d4157f11 --- /dev/null +++ b/CodeSmith/Add.cshtml.cst @@ -0,0 +1,140 @@ +<%-- +Name: 添加界面 +Author: yubaolee +Description: 任务对象界面 +--%> +<%@ CodeTemplate Language="C#" TargetLanguage="C#" Debug="False" Encoding="utf-8" Description="添加模块" %> +<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" +Description="连接的数据库" %> +<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %> +<%@ Property Name="NeedViewModel" Type="Boolean" Category="Context" Default="False" Description="是否需要ViewModel" %> +<%@ Property Name="CascadeId" Type="String" Category="" Default="ParentId" Description="级联字段" %> +<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> +<%@ Assembly Name="SchemaExplorer" %> +<%@ Import Namespace="SchemaExplorer" %> + +<%if(NeedViewModel){ %> +@model OpenAuth.App.ViewModel.<%=GetModelName()%> +<%} else{ %> +@model OpenAuth.Domain.<%=GetModelName()%> +<%} %> +@{ + ViewBag.Title = "<%=GetModelName()%>编辑界面"; + Layout = null; +} +
+
+ + + <% foreach (ColumnSchema column in this.SourceTable.Columns) { + if(column.Name == "CascadeId") continue; //cascadeId字段需要程序控制 + %> + + + + <% } %> + +
+ <%if(column.IsPrimaryKeyMember){ %> + @Html.HiddenFor(m =>m.<%=column.Name%>) + <% } else if(column.Name == CascadeId) {%> + @Html.HiddenFor(m =>m.<%=CascadeId %>) + @if (Model.Id == 0) //添加 + { + //这个只用于显示使用,并不会进行提交处理,真正提交的是cascadeId + + +
    + + } + else //编辑 + { + + + } + <% } else if(CSharpAlias[column.SystemType.FullName] == "bool") {%> + + + <%} else{%> + + + <%} %> +
    +
    +
    + diff --git a/CodeSmith/本身带级联/Application.cst b/CodeSmith/Application.cst similarity index 99% rename from CodeSmith/本身带级联/Application.cst rename to CodeSmith/Application.cst index d6120175..8425cd7b 100644 --- a/CodeSmith/本身带级联/Application.cst +++ b/CodeSmith/Application.cst @@ -1,6 +1,6 @@ <%-- Name: Database Table Properties -Author: Paul Welter +Author: yubaolee Description: Create a list of properties from a database table --%> <%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="应用层" %> diff --git a/CodeSmith/本身带级联/Controller.cst b/CodeSmith/Controller.cst similarity index 99% rename from CodeSmith/本身带级联/Controller.cst rename to CodeSmith/Controller.cst index 6e45e6a8..8c088a98 100644 --- a/CodeSmith/本身带级联/Controller.cst +++ b/CodeSmith/Controller.cst @@ -1,6 +1,6 @@ <%-- Name: Database Table Properties -Author: Paul Welter +Author: yubaolee Description: Create a list of properties from a database table --%> <%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="控制器" %> diff --git a/CodeSmith/本身带级联/IRepository.cst b/CodeSmith/IRepository.cst similarity index 98% rename from CodeSmith/本身带级联/IRepository.cst rename to CodeSmith/IRepository.cst index 4e1ec96c..e8f31b2d 100644 --- a/CodeSmith/本身带级联/IRepository.cst +++ b/CodeSmith/IRepository.cst @@ -1,6 +1,6 @@ <%-- Name: Database Table Properties -Author: Paul Welter +Author: yubaolee Description: Create a list of properties from a database table --%> <%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="创建包含组织机构的接口" %> diff --git a/CodeSmith/本身带级联/Index.cshtml.cst b/CodeSmith/Index.cshtml.cst similarity index 99% rename from CodeSmith/本身带级联/Index.cshtml.cst rename to CodeSmith/Index.cshtml.cst index a674c30a..9f0e55df 100644 --- a/CodeSmith/本身带级联/Index.cshtml.cst +++ b/CodeSmith/Index.cshtml.cst @@ -1,6 +1,6 @@ <%-- Name: Database Table Properties -Author: Paul Welter +Author: yubaolee Description: Create a list of properties from a database table --%> <%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="True" Description="Create a list of properties from database table." %> diff --git a/CodeSmith/带其他级联/Index.cshtml.cst b/CodeSmith/NoCascadeIndex.cshtml.cst similarity index 76% rename from CodeSmith/带其他级联/Index.cshtml.cst rename to CodeSmith/NoCascadeIndex.cshtml.cst index a674c30a..5c4e104b 100644 --- a/CodeSmith/带其他级联/Index.cshtml.cst +++ b/CodeSmith/NoCascadeIndex.cshtml.cst @@ -1,7 +1,7 @@ <%-- Name: Database Table Properties -Author: Paul Welter -Description: Create a list of properties from a database table +Author: yubaolee +Description: 没有树状导航的datagrid --%> <%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="True" Description="Create a list of properties from database table." %> <%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="Table that the object is based on." %> @@ -20,20 +20,12 @@ Description: Create a list of properties from a database table @{ Html.RenderAction("MenuHeader", "Home");}
    -
    -
      -
      - -
      -
      +
      - -<%if(NeedViewModel){ %> -@model OpenAuth.App.ViewModel.<%=GetModelName()%> -<%} else{ %> -@model OpenAuth.Domain.<%=GetModelName()%> -<%} %> -@{ - ViewBag.Title = "<%=GetModelName()%>编辑界面"; - Layout = null; -} - -
      -
      - - - <% foreach (ColumnSchema column in this.SourceTable.Columns) { - if(column.Name == CascadeName) continue; - %> - - - - <% } %> - -
      - <%if(column.IsPrimaryKeyMember){ %> - @Html.HiddenFor(m =>m.Id) - <% } else if(column.Name == CascadeId) {%> - - - -
        - - <% } else if(CSharpAlias[column.SystemType.FullName] == "bool") {%> - - - - <%} else if(CSharpAlias[column.SystemType.FullName] == "int") {%> - - - <%} else{%> - - - <%} %> -
        -
        -
        - - - \ No newline at end of file diff --git a/CodeSmith/带其他级联/Application.cst b/CodeSmith/带其他级联/Application.cst deleted file mode 100644 index d6120175..00000000 --- a/CodeSmith/带其他级联/Application.cst +++ /dev/null @@ -1,138 +0,0 @@ -<%-- -Name: Database Table Properties -Author: Paul Welter -Description: Create a list of properties from a database table ---%> -<%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="应用层" %> -<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %> -<%@ Property Name="NeedViewModel" Type="Boolean" Category="Context" Default="False" Description="是否需要ViewModel" %> -<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> -<%@ Assembly Name="SchemaExplorer" %> -<%@ Import Namespace="SchemaExplorer" %> - - -<%if(NeedViewModel){ %> -using OpenAuth.App.ViewModel; -<%} %> -using OpenAuth.Domain; -using OpenAuth.Domain.Interface; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace OpenAuth.App -{ - public class <%=ModuleName%>ManagerApp - { - private I<%=ModuleName%>Repository _repository; - private IOrgRepository _orgRepository; - - public <%=ModuleName%>ManagerApp(I<%=ModuleName%>Repository repository, - IOrgRepository orgRepository) - { - _repository = repository; - _orgRepository = orgRepository; - } - - public int Get<%=GetModelName()%>CntInOrg(int orgId) - { - if (orgId == 0) - { - return _repository.Find(null).Count(); - } - else - { - return _repository.Get<%=GetModelName()%>CntInOrgs(GetSubOrgIds(orgId)); - } - } - - public List<<%=GetModelName()%>> LoadAll() - { - return _repository.Find(null).ToList(); - } - - /// - /// 加载一个节点下面的一个或全部<%=GetModelName()%>s - /// - public dynamic Load(int orgId, int pageindex, int pagesize) - { - IEnumerable<<%=ModuleName%>> <%=ModuleName%>s; - int total = 0; - if (orgId == 0) - { - <%=ModuleName%>s = _repository.Load<%=ModuleName%>s(pageindex, pagesize); - total = _repository.GetCount(); - } - else - { - <%=ModuleName%>s = _repository.LoadInOrgs(pageindex, pagesize,GetSubOrgIds(orgId)); - total = _repository.Get<%=ModuleName%>CntInOrgs(orgId); - } - <%if(NeedViewModel){ %> - var <%=ModuleName%>views = new List<<%=ModuleName%>View>(); - foreach (var <%=ModuleName%> in <%=ModuleName%>s) - { - <%=ModuleName%>View uv = <%=ModuleName%>; - uv.Organizations = string.Join(",", _orgRepository.LoadBy<%=ModuleName%>(<%=ModuleName%>.Id).Select(u => u.Name).ToList()); - <%=ModuleName%>views.Add(uv); - } - <%} %> - - return new - { - total = total, - list = <%=GetModelName()%>s, - pageCurrent = pageindex - }; - } - - /// - /// 获取当前节点的所有下级节点 - /// - private int[] GetSubOrgIds(int orgId) - { - var org = _orgRepository.FindSingle(u => u.Id == orgId); - var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray(); - return orgs; - } - - public <%=GetModelName()%> Find(int id) - { - var <%=ModuleName.ToLower()%> = _repository.FindSingle(u => u.Id == id); - if (<%=ModuleName.ToLower()%> == null) return new <%=GetModelName()%>(); - - return <%=ModuleName.ToLower() %>; - } - - public void Delete(int id) - { - _repository.Delete(id); - } - - public void AddOrUpdate(<%=GetModelName()%> model) - { - <%=ModuleName%> <%=ModuleName.ToLower()%> = new <%=ModuleName%>(); - model.CopyTo(<%=ModuleName.ToLower()%>); - - if (<%=ModuleName.ToLower()%>.Id == 0) - { - _repository.Add(<%=ModuleName.ToLower()%>); - } - else - { - _repository.Update(<%=ModuleName.ToLower()%>); - } - - } - - - } -} \ No newline at end of file diff --git a/CodeSmith/带其他级联/Controller.cst b/CodeSmith/带其他级联/Controller.cst deleted file mode 100644 index 6e45e6a8..00000000 --- a/CodeSmith/带其他级联/Controller.cst +++ /dev/null @@ -1,110 +0,0 @@ -<%-- -Name: Database Table Properties -Author: Paul Welter -Description: Create a list of properties from a database table ---%> -<%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="控制器" %> -<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %> -<%@ Property Name="NeedViewModel" Type="Boolean" Category="Context" Default="False" Description="是否需要ViewModel" %> -<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> -<%@ Assembly Name="SchemaExplorer" %> -<%@ Import Namespace="SchemaExplorer" %> - - -using System; -using System.Web.Mvc; -using Infrastructure; -using OpenAuth.App; -<%if(NeedViewModel){ %> -using OpenAuth.App.ViewModel; -<%} %> -using OpenAuth.Domain; - -namespace OpenAuth.Mvc.Controllers -{ - public class <%=ModuleName%>ManagerController : BaseController - { - private <%=ModuleName%>ManagerApp _app; - - public <%=ModuleName%>ManagerController() - { - _app = AutofacExt.GetFromFac<<%=ModuleName%>ManagerApp>(); - } - - // - // GET: /UserManager/ - public ActionResult Index() - { - return View(); - } - - public ActionResult Add(int id = 0) - { - return View(_app.Find(id)); - } - - //添加或修改<%=ModuleName %> - [HttpPost] - public string Add(<%=GetModelName()%> model) - { - try - { - _app.AddOrUpdate(model); - - } - catch (Exception ex) - { - BjuiResponse.statusCode = "300"; - BjuiResponse.message = ex.Message; - } - return JsonHelper.Instance.Serialize(BjuiResponse); - } - - /// - /// 加载节点下面的所有<%=ModuleName %>s - /// - public string Load(int parentidId, int pageCurrent = 1, int pageSize = 30) - { - return JsonHelper.Instance.Serialize(_app.Load(parentidId, pageCurrent, pageSize)); - } - - public string LoadForTree() - { - var models = _app.LoadAll(); - //添加根节点 - models.Add(new <%=ModuleName %> - { - Id = 0, - ParentId = -1, - Name = "根结点", - CascadeId = "0" - }); - return JsonHelper.Instance.Serialize(models); - } - - public string Delete(int Id) - { - try - { - _app.Delete(Id); - } - catch (Exception e) - { - BjuiResponse.statusCode = "300"; - BjuiResponse.message = e.Message; - } - - return JsonHelper.Instance.Serialize(BjuiResponse); - } - - - } -} \ No newline at end of file diff --git a/CodeSmith/带其他级联/IRepository.cst b/CodeSmith/带其他级联/IRepository.cst deleted file mode 100644 index 4e1ec96c..00000000 --- a/CodeSmith/带其他级联/IRepository.cst +++ /dev/null @@ -1,28 +0,0 @@ -<%-- -Name: Database Table Properties -Author: Paul Welter -Description: Create a list of properties from a database table ---%> -<%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="创建包含组织机构的接口" %> -<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %> -<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> -<%@ Assembly Name="SchemaExplorer" %> -<%@ Import Namespace="SchemaExplorer" %> - -using System.Collections.Generic; -using System.Linq; - -namespace OpenAuth.Domain.Interface -{ - public interface I<%=ModuleName%>Repository :IRepository<<%=ModuleName%>> - { - IEnumerable<<%=ModuleName%>> Load<%=ModuleName%>s(int pageindex, int pagesize); - - IEnumerable<<%=ModuleName%>> LoadInOrgs(params int[] orgId); - int Get<%=ModuleName%>CntInOrgs(params int[] orgIds); - IEnumerable<<%=ModuleName%>> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds); - - void Delete(int id); - - } -} \ No newline at end of file diff --git a/CodeSmith/本身带级联/Add.cshtml.cst b/CodeSmith/本身带级联/Add.cshtml.cst deleted file mode 100644 index 5b4f093e..00000000 --- a/CodeSmith/本身带级联/Add.cshtml.cst +++ /dev/null @@ -1,145 +0,0 @@ -<%-- -Name: Database Table Properties -Author: Paul Welter -Description: Create a list of properties from a database table ---%> -<%@ CodeTemplate Language="C#" TargetLanguage="C#" Debug="False" Encoding="utf-8" Description="添加模块" %> -<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" -Description="连接的数据库" %> -<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %> -<%@ Property Name="NeedViewModel" Type="Boolean" Category="Context" Default="False" Description="是否需要ViewModel" %> -<%@ Property Name="CascadeId" Type="String" Category="" Default="ParentId" Description="级联字段" %> -<%@ Property Name="CascadeName" Type="String" Category="" Default="ParentName" Description="级联显示的文字" %> -<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> -<%@ Assembly Name="SchemaExplorer" %> -<%@ Import Namespace="SchemaExplorer" %> - -<%if(NeedViewModel){ %> -@model OpenAuth.App.ViewModel.<%=GetModelName()%> -<%} else{ %> -@model OpenAuth.Domain.<%=GetModelName()%> -<%} %> -@{ - ViewBag.Title = "<%=GetModelName()%>编辑界面"; - Layout = null; -} - -
        -
        - - - <% foreach (ColumnSchema column in this.SourceTable.Columns) { - if(column.Name == CascadeName) continue; - %> - - - - <% } %> - -
        - <%if(column.IsPrimaryKeyMember){ %> - @Html.HiddenFor(m =>m.Id) - <% } else if(column.Name == CascadeId) {%> - - - -
          - - <% } else if(CSharpAlias[column.SystemType.FullName] == "bool") {%> - - - - <%} else if(CSharpAlias[column.SystemType.FullName] == "int") {%> - - - <%} else{%> - - - <%} %> -
          -
          -
          - - - \ No newline at end of file diff --git a/OpenAuth.App/LoginApp.cs b/OpenAuth.App/LoginApp.cs index 259ad2ae..8206a415 100644 --- a/OpenAuth.App/LoginApp.cs +++ b/OpenAuth.App/LoginApp.cs @@ -14,17 +14,20 @@ namespace OpenAuth.App private IUserRepository _repository; private IModuleRepository _moduleRepository; private IRelevanceRepository _relevanceRepository; - private IRepository _moduleElementRepository; + private IRepository _moduleElementRepository; + private IResourceRepository _resourceRepository; public LoginApp(IUserRepository repository, IModuleRepository moduleRepository, IRelevanceRepository relevanceRepository, - IRepository moduleElementRepository ) + IRepository moduleElementRepository, + IResourceRepository resourceRepository) { _repository = repository; _moduleRepository = moduleRepository; _relevanceRepository = relevanceRepository; _moduleElementRepository = moduleElementRepository; + _resourceRepository = resourceRepository; } public LoginUserVM Login(string userName, string password) @@ -64,8 +67,15 @@ namespace OpenAuth.App { module.Elements = _moduleElementRepository.Find(u => u.ModuleId == module.Id && elementIds.Contains( u.Id)).ToList(); } - - return loginVM; + + //ûɫԼ䵽ԴID + var resourceIds = _relevanceRepository.Find( + u => + (u.FirstId == user.Id && u.Key == "UserResource") || + (u.Key == "RoleResource" && userRoleIds.Contains(u.FirstId))).Select(u => u.SecondId).ToList(); + loginVM.Resources = _resourceRepository.Find(u => resourceIds.Contains(u.Id)).ToList(); + + return loginVM; } /// @@ -86,6 +96,8 @@ namespace OpenAuth.App { module.Elements = _moduleElementRepository.Find(u => u.ModuleId == module.Id).ToList(); } + + loginUser.Resources = _resourceRepository.Find(null).ToList(); return loginUser; } } diff --git a/OpenAuth.App/RoleManagerApp.cs b/OpenAuth.App/RoleManagerApp.cs index e73673e1..90a8c438 100644 --- a/OpenAuth.App/RoleManagerApp.cs +++ b/OpenAuth.App/RoleManagerApp.cs @@ -96,9 +96,9 @@ namespace OpenAuth.App } } - public List LoadWithUser(int userId) + public List LoadForOrgAndUser(int orgId, int userId) { - var roleIds = _repository.Find(null).ToList(); + var roleIds = _repository.Find(u =>u.OrgId == orgId).ToList(); var rolevms = new List(); foreach (var role in roleIds) { diff --git a/OpenAuth.App/ViewModel/LoginUserVM.cs b/OpenAuth.App/ViewModel/LoginUserVM.cs index b8ea1a7c..71c45f0b 100644 --- a/OpenAuth.App/ViewModel/LoginUserVM.cs +++ b/OpenAuth.App/ViewModel/LoginUserVM.cs @@ -27,6 +27,14 @@ namespace OpenAuth.App.ViewModel /// 用户可以访问到的模块(包括所属角色与自己的所有模块) /// public List Modules { get; set; } + + //用户可以访问的资源 + public List Resources { get; set; } + + /// + /// 用户所属机构 + /// + public List Orgs { get; set; } } } diff --git a/OpenAuth.Mvc/Controllers/RoleManagerController.cs b/OpenAuth.Mvc/Controllers/RoleManagerController.cs index ab8fbabb..10394b0c 100644 --- a/OpenAuth.Mvc/Controllers/RoleManagerController.cs +++ b/OpenAuth.Mvc/Controllers/RoleManagerController.cs @@ -71,10 +71,16 @@ namespace OpenAuth.Mvc.Controllers } #region 为用户设置角色界面 - public ActionResult LookUpMulti(int userId) + + public ActionResult LookupMulti(int userId) { ViewBag.UserId = userId; - return View(_app.LoadWithUser(userId)); + return View(); + } + + public string LoadForOrgAndUser(int orgId, int userId) + { + return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId)); } public string AccessRoles(int userId, string ids) @@ -83,6 +89,7 @@ namespace OpenAuth.Mvc.Controllers _app.AccessRole(userId, roleids); return JsonHelper.Instance.Serialize(BjuiResponse); } - #endregion + + #endregion 为用户设置角色界面 } } \ No newline at end of file diff --git a/OpenAuth.Mvc/OpenAuth.Mvc.csproj b/OpenAuth.Mvc/OpenAuth.Mvc.csproj index 3f75f336..4807e3a9 100644 --- a/OpenAuth.Mvc/OpenAuth.Mvc.csproj +++ b/OpenAuth.Mvc/OpenAuth.Mvc.csproj @@ -574,6 +574,7 @@ + @@ -640,7 +641,6 @@ - 10.0 diff --git a/OpenAuth.Mvc/Views/RoleManager/LookupMulti.cshtml b/OpenAuth.Mvc/Views/RoleManager/LookupMulti.cshtml index 52bc66d8..31ccc0d9 100644 --- a/OpenAuth.Mvc/Views/RoleManager/LookupMulti.cshtml +++ b/OpenAuth.Mvc/Views/RoleManager/LookupMulti.cshtml @@ -1,77 +1,126 @@ -@model List -@{ - ViewBag.Title = "title"; - Layout = null; +@{ + string _prefix = "assignRoleForUser"; + var _treeId = _prefix + "Tree"; + var _gridId = _prefix + "Grid"; + var _treeDetail = _prefix + "Detail"; } -@*
          -