修改数据库脚本以及代码中Category的类型

This commit is contained in:
sunnian 2016-10-28 15:51:08 +08:00
parent 43c21d1a82
commit af3ce6d625
4 changed files with 24 additions and 4 deletions

View File

@ -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<Menu>();
ret.total = data.Count();

View File

@ -34,7 +34,7 @@ namespace Bootstrap.DataAccess
/// <summary>
/// 获得/设置 菜单分类
/// </summary>
public int Category { get; set; }
public string Category { get; set; }
/// <summary>
/// 获得/设置 是否当前被选中 active为选中
/// </summary>

View File

@ -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]
});
}
}

View File

@ -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