--	添加基础应用
INSERT INTO [DB_CLASS]
           ([Name]
           ,[Remark]
           ,[Icon]
           ,[Url]
           ,[Type])
     VALUES
           ('网络硬盘'
           ,'管理系统的全部文件资源'
           ,'Template/Image/icon_application_storage.gif'
           ,'Main/Broswer/Default.aspx'
           ,1);
INSERT INTO [DB_CLASS]
           ([Name]
           ,[Remark]
           ,[Icon]
           ,[Url]
           ,[Type])
     VALUES
           ('公告板'
           ,'可以发布通知，公告，新闻等公共信息'
           ,'Template/Image/icon_application_board.gif'
           ,'Main/Board/Default.aspx'
           ,0);
--	添加应用扩展类型
INSERT INTO [DB_CLASS_EXTENSION]
           ([ClassId]
           ,[Name]
           ,[Extension])
	SELECT ClassId, '公告', 'rbt'
		From DB_CLASS Where Name = '公告板';
--	添加标签
INSERT INTO [DB_ATTRIBUTE]
           ([ClassId]
           ,[Name]
           ,[Remark]
           ,[Type]
           ,[Required]
           ,[Special]
           ,[DefaultValue])
	SELECT ClassId, '公告类型', '', 2, 0, 0, ''
		From DB_CLASS Where Name = '公告板';
--	用户分组
INSERT INTO [DB_GRADE]
           ([Name]
           ,[Remark]
           ,[Users]
           ,[IsDefault])
     VALUES
           ('默认分组'
           ,'默认分组'
           ,0
           ,1);
--	用户分级
INSERT INTO [DB_LEVEL]
           ([Name]
           ,[Remark]
           ,[Type]
           ,[Lock]
           ,[SetConfig]
           ,[SetUser]
           ,[SetRegister]
           ,[SetFile]
           ,[Capacity]
           ,[Users]
           ,[IsDefault])
     VALUES
           ('超级管理员'
           ,'超级管理员'
           ,2
           ,1
           ,1
           ,1
           ,1
           ,1
           ,0
           ,0
           ,0);

INSERT INTO [DB_LEVEL]
           ([Name]
           ,[Remark]
           ,[Type]
           ,[Lock]
           ,[SetConfig]
           ,[SetUser]
           ,[SetRegister]
           ,[SetFile]
           ,[Capacity]
           ,[Users]
           ,[IsDefault])
     VALUES
           ('普通级别'
           ,'普通级别'
           ,0
           ,0
           ,0
           ,0
           ,1
           ,0
           ,0
           ,0
           ,1);

INSERT INTO [DB_LEVEL]
           ([Name]
           ,[Remark]
           ,[Type]
           ,[Lock]
           ,[SetConfig]
           ,[SetUser]
           ,[SetRegister]
           ,[SetFile]
           ,[Capacity]
           ,[Users]
           ,[IsDefault])
     VALUES
           ('匿名分级'
           ,'匿名分级'
           ,1
           ,1
           ,0
           ,0
           ,1
           ,0
           ,0
           ,0
           ,0);

--	初始化管理员
INSERT INTO [DB_USER]
           ([GradeId]
           ,[LevelId]
           ,[Username]
           ,[Password]
           ,[Email]
           ,[Sex]
           ,[Birthday]
           ,[Capacity]
           ,[Used]
           ,[Header]
           ,[State]
           ,[IP]
           ,[First]
           ,[Last])
     Select 0, LevelId,'admini','2CHpU2qtEW8=','', 1, '1982-01-01', 0, 0, Null, 0, '', GetDate(), GetDate()
		From DB_LEVEL Where Name = '超级管理员';