diff --git a/Bootstrap.Admin/Models/QueryMenuOption.cs b/Bootstrap.Admin/Models/QueryMenuOption.cs index 0afd0276..9eb21483 100644 --- a/Bootstrap.Admin/Models/QueryMenuOption.cs +++ b/Bootstrap.Admin/Models/QueryMenuOption.cs @@ -27,7 +27,7 @@ namespace Bootstrap.Admin.Models } if (!string.IsNullOrEmpty(Category)) { - data = data.Where(t => t.Category.ToString().Equals(Category)); + data = data.Where(t => t.Category.Contains(Category)); } var ret = new QueryData(); ret.total = data.Count(); diff --git a/Bootstrap.DataAccess/Menu.cs b/Bootstrap.DataAccess/Menu.cs index b5fe0ec4..fe02fe49 100644 --- a/Bootstrap.DataAccess/Menu.cs +++ b/Bootstrap.DataAccess/Menu.cs @@ -34,7 +34,7 @@ namespace Bootstrap.DataAccess /// /// 获得/设置 菜单分类 /// - public int Category { get; set; } + public string Category { get; set; } /// /// 获得/设置 是否当前被选中 active为选中 /// diff --git a/Bootstrap.DataAccess/MenuHelper.cs b/Bootstrap.DataAccess/MenuHelper.cs index e51964eb..c102bdd6 100644 --- a/Bootstrap.DataAccess/MenuHelper.cs +++ b/Bootstrap.DataAccess/MenuHelper.cs @@ -41,7 +41,7 @@ namespace Bootstrap.DataAccess Order = (int)reader[3], Icon = LgbConvert.ReadValue(reader[4], string.Empty), Url = LgbConvert.ReadValue(reader[5], string.Empty), - Category = (int)reader[6] + Category = (string)reader[6] }); } } diff --git a/DatabaseScripts/Install.sql b/DatabaseScripts/Install.sql index 6db08bbd..c80f84b2 100644 --- a/DatabaseScripts/Install.sql +++ b/DatabaseScripts/Install.sql @@ -151,7 +151,7 @@ CREATE TABLE [dbo].[Navigations]( [Order] [int] NOT NULL, [Icon] [varchar](50) NULL, [Url] [varchar](50) NULL, - [Category] [int] NOT NULL, + [Category] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Navigations] PRIMARY KEY CLUSTERED ( [ID] ASC @@ -160,6 +160,26 @@ CREATE TABLE [dbo].[Navigations]( GO + +/****** Object: Table [dbo].[NavigationRole] Script Date: 10/28/2016 15:14:35 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +CREATE TABLE [dbo].[NavigationRole]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [NavigationID] [int] NOT NULL, + [RoleID] [int] NOT NULL, + CONSTRAINT [PK_NavigationRole] PRIMARY KEY CLUSTERED +( + [ID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + SET ANSI_PADDING OFF GO