From af3ce6d6254994b2d3596f3ef88ead574bef1c8f Mon Sep 17 00:00:00 2001 From: sunnian <853128958@qq.com> Date: Fri, 28 Oct 2016 15:51:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BB=A5=E5=8F=8A=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?Category=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Models/QueryMenuOption.cs | 2 +- Bootstrap.DataAccess/Menu.cs | 2 +- Bootstrap.DataAccess/MenuHelper.cs | 2 +- DatabaseScripts/Install.sql | 22 +++++++++++++++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) 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