diff --git a/OpenAuth.Domain/Module.cs b/OpenAuth.Domain/Module.cs
index e7d6888e..8e38b403 100644
--- a/OpenAuth.Domain/Module.cs
+++ b/OpenAuth.Domain/Module.cs
@@ -6,12 +6,12 @@ using System.Linq;
namespace OpenAuth.Domain
{
///
- /// 系统模块
+ /// 用户ID
///
public partial class Module
{
///
- /// 模块ID
+ /// 用户ID
///
///
public int Id { get; set; }
diff --git a/OpenAuth.Domain/ModuleElement.cs b/OpenAuth.Domain/ModuleElement.cs
index 96e041ba..d5349903 100644
--- a/OpenAuth.Domain/ModuleElement.cs
+++ b/OpenAuth.Domain/ModuleElement.cs
@@ -29,10 +29,10 @@ namespace OpenAuth.Domain
public string Name { get; set; }
///
- /// 组织类型
+ /// 元素的类型(如:button/a)
///
///
- public int Type { get; set; }
+ public string Type { get; set; }
///
/// 功能模块Id
@@ -40,6 +40,30 @@ namespace OpenAuth.Domain
///
public int ModuleId { get; set; }
+ ///
+ /// 元素附加属性
+ ///
+ ///
+ public string Attr { get; set; }
+
+ ///
+ /// 元素调用脚本
+ ///
+ ///
+ public string Script { get; set; }
+
+ ///
+ /// 元素图标
+ ///
+ ///
+ public string Icon { get; set; }
+
+ ///
+ /// 元素样式
+ ///
+ ///
+ public string Class { get; set; }
+
///
/// 备注
///
@@ -52,9 +76,13 @@ namespace OpenAuth.Domain
this.Id= 0;
this.DomId= string.Empty;
this.Name= string.Empty;
- this.Type= 0;
+ this.Type = string.Empty;
this.ModuleId= 0;
- this.Remark= string.Empty;
+ this.Attr= string.Empty;
+ this.Script= string.Empty;
+ this.Icon= string.Empty;
+ this.Class= string.Empty;
+ this.Remark= string.Empty;
}
diff --git a/OpenAuth.Domain/ModuleElementGrant.cs b/OpenAuth.Domain/ModuleElementGrant.cs
deleted file mode 100644
index b51d81eb..00000000
--- a/OpenAuth.Domain/ModuleElementGrant.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Linq;
-
-namespace OpenAuth.Domain
-{
- ///
- /// 用户ID
- ///
- public partial class ModuleElementGrant
- {
- ///
- /// 用户ID
- ///
- ///
- public int Id { get; set; }
-
- ///
- /// 元素流水号
- ///
- ///
- public int ElementId { get; set; }
-
- ///
- /// 用户流水号
- ///
- ///
- public int UserId { get; set; }
-
- ///
- /// 角色流水号
- ///
- ///
- public int RoleId { get; set; }
-
- ///
- /// 权限类型
- ///
- ///
- public int GrantType { get; set; }
-
-
- public ModuleElementGrant()
- {
- this.Id= 0;
- this.ElementId= 0;
- this.UserId= 0;
- this.RoleId= 0;
- this.GrantType= 0;
- }
-
-
-
- }
-}
\ No newline at end of file
diff --git a/OpenAuth.Domain/OpenAuth.Domain.csproj b/OpenAuth.Domain/OpenAuth.Domain.csproj
index e6e982e1..ae2a7487 100644
--- a/OpenAuth.Domain/OpenAuth.Domain.csproj
+++ b/OpenAuth.Domain/OpenAuth.Domain.csproj
@@ -51,7 +51,6 @@
-
diff --git a/OpenAuth.Domain/Relevance.cs b/OpenAuth.Domain/Relevance.cs
index 103b7532..4b2c25db 100644
--- a/OpenAuth.Domain/Relevance.cs
+++ b/OpenAuth.Domain/Relevance.cs
@@ -1,77 +1,77 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Linq;
-
-namespace OpenAuth.Domain
-{
- ///
- /// 用户ID
- ///
- public partial class Relevance
- {
- ///
- /// 用户ID
- ///
- ///
- public int Id { get; set; }
-
- ///
- /// 第一个表主键ID
- ///
- ///
- public int FirstId { get; set; }
-
- ///
- /// 第二个表主键ID
- ///
- ///
- public int SecondId { get; set; }
-
- ///
- /// 描述
- ///
- ///
- public string Description { get; set; }
-
- ///
- ///
- ///
- ///
- public string Key { get; set; }
-
- ///
- /// 状态
- ///
- ///
- public int Status { get; set; }
-
- ///
- /// 授权时间
- ///
- ///
- public System.DateTime OperateTime { get; set; }
-
- ///
- /// 授权人
- ///
- ///
- public int OperatorId { get; set; }
-
-
- public Relevance()
- {
- this.Id= 0;
- this.FirstId= 0;
- this.SecondId= 0;
- this.Description= string.Empty;
- this.Key= string.Empty;
- this.Status= 0;
- this.OperateTime= DateTime.Now;
- this.OperatorId= 0;
- }
-
-
-
- }
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+
+namespace OpenAuth.Domain
+{
+ ///
+ /// 用户ID
+ ///
+ public partial class Relevance
+ {
+ ///
+ /// 用户ID
+ ///
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 第一个表主键ID
+ ///
+ ///
+ public int FirstId { get; set; }
+
+ ///
+ /// 第二个表主键ID
+ ///
+ ///
+ public int SecondId { get; set; }
+
+ ///
+ /// 描述
+ ///
+ ///
+ public string Description { get; set; }
+
+ ///
+ ///
+ ///
+ ///
+ public string Key { get; set; }
+
+ ///
+ /// 状态
+ ///
+ ///
+ public int Status { get; set; }
+
+ ///
+ /// 授权时间
+ ///
+ ///
+ public System.DateTime OperateTime { get; set; }
+
+ ///
+ /// 授权人
+ ///
+ ///
+ public int OperatorId { get; set; }
+
+
+ public Relevance()
+ {
+ this.Id= 0;
+ this.FirstId= 0;
+ this.SecondId= 0;
+ this.Description= string.Empty;
+ this.Key= string.Empty;
+ this.Status= 0;
+ this.OperateTime= DateTime.Now;
+ this.OperatorId= 0;
+ }
+
+
+
+ }
}
\ No newline at end of file
diff --git a/OpenAuth.Mvc/Controllers/ModuleElementManagerController.cs b/OpenAuth.Mvc/Controllers/ModuleElementManagerController.cs
index 375dde94..5960026f 100644
--- a/OpenAuth.Mvc/Controllers/ModuleElementManagerController.cs
+++ b/OpenAuth.Mvc/Controllers/ModuleElementManagerController.cs
@@ -1,69 +1,72 @@
-// ***********************************************************************
-// Assembly : OpenAuth.Mvc
-// Author : Yubao Li
-// Created : 12-02-2015
-//
-// Last Modified By : Yubao Li
-// Last Modified On : 12-02-2015
-// ***********************************************************************
-//
-// Copyright (c) . All rights reserved.
-//
-// 模块元素管理,无需权限控制
-// ***********************************************************************
-
-using System;
-using System.Web.Mvc;
-using Infrastructure;
-using OpenAuth.App;
-using OpenAuth.Domain;
-using OpenAuth.Mvc.Models;
-
-namespace OpenAuth.Mvc.Controllers
-{
- public class ModuleElementManagerController : Controller
- {
- private readonly BjuiResponse _bjuiResponse = new BjuiResponse();
- private ModuleElementManagerApp _app;
-
- public ModuleElementManagerController()
- {
- _app = (ModuleElementManagerApp) DependencyResolver.Current.GetService(typeof (ModuleElementManagerApp));
- }
-
- public ActionResult Index(int id = 0)
- {
- ViewBag.ModuleId = id;
- return View(_app.LoadByModuleId(id));
- }
-
- [HttpPost]
- public string AddOrEditButton(ModuleElement button)
- {
- try
- {
- _app.AddOrUpdate(button);
- }
- catch (Exception e)
- {
- _bjuiResponse.statusCode = "300";
- _bjuiResponse.message = e.Message;
- }
- return JsonHelper.Instance.Serialize(_bjuiResponse);
- }
-
- public string DelButton(int id)
- {
- try
- {
- _app.Delete(id);
- }
- catch (Exception e)
- {
- _bjuiResponse.statusCode = "300";
- _bjuiResponse.message = e.Message;
- }
- return JsonHelper.Instance.Serialize(_bjuiResponse);
- }
- }
+// ***********************************************************************
+// Assembly : OpenAuth.Mvc
+// Author : Yubao Li
+// Created : 12-02-2015
+//
+// Last Modified By : Yubao Li
+// Last Modified On : 12-02-2015
+// ***********************************************************************
+//
+// Copyright (c) . All rights reserved.
+//
+// 模块元素管理,无需权限控制
+// ***********************************************************************
+
+using System;
+using System.Data.Entity.Validation;
+using System.Web.Mvc;
+using Infrastructure;
+using OpenAuth.App;
+using OpenAuth.Domain;
+using OpenAuth.Mvc.Models;
+
+namespace OpenAuth.Mvc.Controllers
+{
+ public class ModuleElementManagerController : Controller
+ {
+ private readonly BjuiResponse _bjuiResponse = new BjuiResponse();
+ private ModuleElementManagerApp _app;
+
+ public ModuleElementManagerController()
+ {
+ _app = (ModuleElementManagerApp) DependencyResolver.Current.GetService(typeof (ModuleElementManagerApp));
+ }
+
+ public ActionResult Index(int id = 0)
+ {
+ ViewBag.ModuleId = id;
+ return View(_app.LoadByModuleId(id));
+ }
+
+ [HttpPost]
+ public string AddOrEditButton(ModuleElement button)
+ {
+ try
+ {
+ var newbtn = new ModuleElement();
+ button.CopyTo(newbtn);
+ _app.AddOrUpdate(newbtn);
+ }
+ catch (DbEntityValidationException e)
+ {
+ _bjuiResponse.statusCode = "300";
+ _bjuiResponse.message = e.Message;
+ }
+ return JsonHelper.Instance.Serialize(_bjuiResponse);
+ }
+
+ public string DelButton(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/OpenAuth.Mvc/Views/ModuleElementManager/Index.cshtml b/OpenAuth.Mvc/Views/ModuleElementManager/Index.cshtml
index f8296054..f5af361f 100644
--- a/OpenAuth.Mvc/Views/ModuleElementManager/Index.cshtml
+++ b/OpenAuth.Mvc/Views/ModuleElementManager/Index.cshtml
@@ -1,61 +1,69 @@
-@model IEnumerable
-
-
-
-
-