刚用ASP.net做完一套用户和新闻管理系统

发表于:2007-06-30来源:作者:点击数: 标签:
在运行之初,先进行web.config文件的配置 add key="connString" value="Persist Security Info=False;server=(local);database=数据库名;uid=用户名;pwd=密码" / add key="LocalPath" value="虚拟目录的物理路径" / 数据库脚本如下: /****** Object: Table [d

在运行之初,先进行web.config文件的配置

 <add key="connString" value="Persist Security Info=False;server=(local);database=数据库名;uid=用户名;pwd=密码" />
 <add key="LocalPath" value="虚拟目录的物理路径" />

数据库脚本如下:

/****** Object:  Table [dbo].[AdminUser]    Script Date: 2005-6-12 16:26:46 ******/

if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[AdminUser]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)drop table [dbo].[AdminUser]GO

/****** Object:  Table [dbo].[Article]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[Article]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[Article]
GO

/****** Object:  Table [dbo].[ArticleGroup]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[ArticleGroup]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[ArticleGroup]
GO

/****** Object:  Table [dbo].[GroupPurview]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[GroupPurview]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[GroupPurview]
GO

/****** Object:  Table [dbo].[ImageArticle]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[ImageArticle]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[ImageArticle]
GO

/****** Object:  Table [dbo].[Logs]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[Logs]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[Logs]
GO

/****** Object:  Table [dbo].[PurviewType]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[PurviewType]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[PurviewType]
GO

/****** Object:  Table [dbo].[SinglePurview]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[SinglePurview]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[SinglePurview]
GO

/****** Object:  Table [dbo].[UploadFile]    Script Date: 2005-6-12 16:26:46 ******/
if exists (select * from dbo.sysobjects where id = object_id(N@#[dbo].[UploadFile]@#) and OBJECTPROPERTY(id, N@#IsUserTable@#) = 1)
drop table [dbo].[UploadFile]
GO

/****** Object:  Table [dbo].[AdminUser]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[AdminUser] (
 [uid] [int] IDENTITY (1, 1) NOT NULL ,
 [uname] [varchar] (24) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [upsw] [varchar] (36) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [gid] [int] NULL ,
 [realname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [regtime] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Article]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[Article] (
 [aid] [int] IDENTITY (1, 1) NOT NULL ,
 [agid] [int] NULL ,
 [isHidden] [bit] NULL ,
 [isMain] [bit] NULL ,
 [atitle] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [acontent] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [ntime] [datetime] NOT NULL ,
 [nclick] [int] NULL ,
 [isBold] [bit] NULL ,
 [uid] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[ArticleGroup]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[ArticleGroup] (
 [agid] [int] NOT NULL ,
 [groupName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [describe] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[GroupPurview]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[GroupPurview] (
 [gid] [int] IDENTITY (1, 1) NOT NULL ,
 [gname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [describe] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [subpurview] [varchar] (200) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[ImageArticle]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[ImageArticle] (
 [iaid] [int] IDENTITY (1, 1) NOT NULL ,
 [iaName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [imageName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [iaContent] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
 [iaTime] [datetime] NOT NULL ,
 [imageOldName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [imageThum1] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [imageThum2] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [isHide] [bit] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Logs]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[Logs] (
 [lid] [int] IDENTITY (1, 1) NOT NULL ,
 [uname] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
 [uip] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
 [utime] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [describe] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[PurviewType]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[PurviewType] (
 [pid] [int] NOT NULL ,
 [describe] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[SinglePurview]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[SinglePurview] (
 [sid] [int] IDENTITY (1, 1) NOT NULL ,
 [describe] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
 [ptype] [int] NULL ,
 [psubcode] [int] NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[UploadFile]    Script Date: 2005-6-12 16:26:48 ******/
CREATE TABLE [dbo].[UploadFile] (
 [fid] [int] IDENTITY (1, 1) NOT NULL ,
 [aid] [int] NULL ,
 [fname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [foldname] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [fsize] [int] NULL
) ON [PRIMARY]
GO


insert into PurviewType values(1, @#系统设置类型@#);
insert into PurviewType values(2, @#新闻管理类型@#);

insert into SinglePurview(describe, ptype, psubcode) values(@#权限管理-对权限组进行建立及管理@#, 1, 1);
insert into SinglePurview(describe, ptype, psubcode) values(@#用户管理-对管理员进行建立及管理@#, 1, 2);
insert into SinglePurview(describe, ptype, psubcode) values(@#系统管理-对系统日志进行查看及网站信息的查看@#, 1, 3);

insert into SinglePurview(describe, ptype, psubcode) values(@#图片新闻模块-对图片新闻专栏进行管理@#, 2, 0);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-教学管理_本科教学-的添加、编辑、删除管理@#, 2, 1);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-教学管理_工学硕士-的添加、编辑、删除管理@#, 2, 2);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-教学管理_工程硕士-的添加、编辑、删除管理@#, 2, 3);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_工作计划-的添加、编辑、删除管理@#, 2, 11);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_学生活动-的添加、编辑、删除管理@#, 2, 12);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_科技学术-的添加、编辑、删除管理@#, 2, 13);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_党团之窗-的添加、编辑、删除管理@#, 2, 14);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_工作简报-的添加、编辑、删除管理@#, 2, 15);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学生工作_学生信息-的添加、编辑、删除管理@#, 2, 16);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-就业工作_就业政策-的添加、编辑、删除管理@#, 2, 21);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-就业工作_就业指导-的添加、编辑、删除管理@#, 2, 22);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-就业工作_需求信息-的添加、编辑、删除管理@#, 2, 23);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-研发合作_合作交流-的添加、编辑、删除管理@#, 2, 31);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-专题信息_文档下载-的添加、编辑、删除管理@#, 2, 41);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-专题信息_本科评估-的添加、编辑、删除管理@#, 2, 42);
insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-专题信息_爱心服务-的添加、编辑、删除管理@#, 2, 43);

insert into SinglePurview(describe, ptype, psubcode) values(@#对新闻版块-学院新闻-的添加、编辑、删除管理@#, 2, 51);

insert into GroupPurview(gname, describe, subpurview) values(@#系统管理员@#, @#对权限组和用户进行管理@#, @#1,2,3@#);

insert into AdminUser(uname, upsw, gid, realname, regtime, email) values(@#admin@#, @#21232F297A57A5A743894A0E4A801FC3@#, 1, @#Justin@#, @#2005-5-1@#, );

insert into ArticleGroup values(1, @#教学管理_本科教学@#, @#新闻类别1_相关信息@#);
insert into ArticleGroup values(2, @#教学管理_工学硕士@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(3, @#教学管理_工程硕士@#, @#新闻类别3_相关信息@#);

insert into ArticleGroup values(11, @#学生工作_工作计划@#, @#新闻类别1_相关信息@#);
insert into ArticleGroup values(12, @#学生工作_学生活动@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(13, @#学生工作_科技学术@#, @#新闻类别3_相关信息@#);
insert into ArticleGroup values(14, @#学生工作_党团之窗@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(15, @#学生工作_工作简报@#, @#新闻类别3_相关信息@#);
insert into ArticleGroup values(16, @#学生工作_学生信息@#, @#新闻类别2_相关信息@#);

insert into ArticleGroup values(21, @#就业工作_就业政策@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(22, @#就业工作_就业指导@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(23, @#就业工作_需求信息@#, @#新闻类别2_相关信息@#);

insert into ArticleGroup values(31, @#研发合作_合作交流@#, @#新闻类别2_相关信息@#);

insert into ArticleGroup values(41, @#专题信息_文档下载@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(42, @#专题信息_本科评估@#, @#新闻类别2_相关信息@#);
insert into ArticleGroup values(43, @#专题信息_爱心服务@#, @#新闻类别2_相关信息@#);

insert into ArticleGroup values(51, @#学院新闻@#, @#新闻类别2_相关信息@#);


原文转自:http://www.ltesting.net