[WinForm]WinForm之简易权限管理

2020-12-13 03:14

阅读:238

标签:des   winform   style   class   blog   code   

   [摘要]陆续在今年写了固定资产和低值易耗品,采购模具管理以及将要进行的制程管理等子系统,都是各自写一个小程序,每次都要搭建下环境。每做一个小系统部署的时候都得打包一次。干脆做一个简易框架去实现吧。

权限管理仿照自己协同工作平台。

表一:菜单管理

CREATE TABLE [dbo].[WinForm_MenuInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[NAME] [nvarchar](100) NOT NULL,
	[PARENTID] [int] NOT NULL,
	[FORMNAME] [nvarchar](200) NULL,
	[TYPE] [int] NULL,
	[SORTINDEX] [int] NULL,
 CONSTRAINT [PK_WinForm_MenuInfo] 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

ALTER TABLE [dbo].[WinForm_MenuInfo] ADD  CONSTRAINT [DF_WinForm_MenuInfo_PARENTID]  DEFAULT ((-1)) FOR [PARENTID]
GO

ALTER TABLE [dbo].[WinForm_MenuInfo] ADD  CONSTRAINT [DF_WinForm_MenuInfo_TYPE]  DEFAULT ((0)) FOR [TYPE]
GO

ALTER TABLE [dbo].[WinForm_MenuInfo] ADD  CONSTRAINT [DF_WinForm_MenuInfo_SORTINDEX]  DEFAULT ((0)) FOR [SORTINDEX]
GO

表二:角色管理

CREATE TABLE [dbo].[WinForm_RoleInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[NAME] [nvarchar](100) NOT NULL,
	[DESCRIPT] [nvarchar](500) NULL,
	[PARENTID] [int] NOT NULL,
 CONSTRAINT [PK_WinForm_RoleInfo] 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

表三:角色菜单

CREATE TABLE [dbo].[WinForm_RoleMenu](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[rid] [int] NOT NULL,
	[mid] [int] NOT NULL,
 CONSTRAINT [PK_WinForm_RoleMenu] 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

菜单管理:

soscw.com,搜素材

角色授权:

soscw.com,搜素材


评论


亲,登录后才可以留言!