修改数据库脚本以及代码中Category的类型
This commit is contained in:
parent
43c21d1a82
commit
af3ce6d625
|
@ -27,7 +27,7 @@ namespace Bootstrap.Admin.Models
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Category))
|
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>();
|
var ret = new QueryData<Menu>();
|
||||||
ret.total = data.Count();
|
ret.total = data.Count();
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace Bootstrap.DataAccess
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得/设置 菜单分类
|
/// 获得/设置 菜单分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Category { get; set; }
|
public string Category { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得/设置 是否当前被选中 active为选中
|
/// 获得/设置 是否当前被选中 active为选中
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace Bootstrap.DataAccess
|
||||||
Order = (int)reader[3],
|
Order = (int)reader[3],
|
||||||
Icon = LgbConvert.ReadValue(reader[4], string.Empty),
|
Icon = LgbConvert.ReadValue(reader[4], string.Empty),
|
||||||
Url = LgbConvert.ReadValue(reader[5], string.Empty),
|
Url = LgbConvert.ReadValue(reader[5], string.Empty),
|
||||||
Category = (int)reader[6]
|
Category = (string)reader[6]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ CREATE TABLE [dbo].[Navigations](
|
||||||
[Order] [int] NOT NULL,
|
[Order] [int] NOT NULL,
|
||||||
[Icon] [varchar](50) NULL,
|
[Icon] [varchar](50) NULL,
|
||||||
[Url] [varchar](50) NULL,
|
[Url] [varchar](50) NULL,
|
||||||
[Category] [int] NOT NULL,
|
[Category] [nvarchar](50) NOT NULL,
|
||||||
CONSTRAINT [PK_Navigations] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_Navigations] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
[ID] ASC
|
[ID] ASC
|
||||||
|
@ -160,6 +160,26 @@ CREATE TABLE [dbo].[Navigations](
|
||||||
|
|
||||||
GO
|
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
|
SET ANSI_PADDING OFF
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue