我想做一个C#有特色的学生管理系统 ,请大侠们给点设计报告. 因为是科技活动月

2024-12-21 15:07:02
推荐回答(1个)
回答1:

可惜这里不能放文件,我先把数据库设计的一部分代码贴上了你看看吧!!
USE [EXAM]
GO
/****** Object: Table [dbo].[TB_INFO] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TB_INFO](
[T_ID] [int] NOT NULL,
[t_WeekInfo] [int] NOT NULL,
[t_sk] [bit] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[STUDENT] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[STUDENT](
[SNO] [varchar](3) NOT NULL,
[SNAME] [varchar](4) NOT NULL,
[SSEX] [varchar](2) NOT NULL,
[SBIRTHDAY] [datetime] NULL,
[CLASS] [varchar](5) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[SCORE] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SCORE](
[SNO] [varchar](3) NOT NULL,
[CNO] [varchar](5) NOT NULL,
[DEGREE] [numeric](10, 1) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbFunInfo] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbFunInfo](
[F_ID] [int] IDENTITY(1,1) NOT NULL,
[F_INTR] [nvarchar](100) NOT NULL,
[F_CLASS] [nvarchar](100) NOT NULL,
[PF_ID] [int] NOT NULL,
CONSTRAINT [PK_tbFunInfo] PRIMARY KEY CLUSTERED
(
[F_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
/****** Object: Table [dbo].[tbOperInfo] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbOperInfo](
[O_ID] [int] IDENTITY(1,1) NOT NULL,
[O_INTR] [nvarchar](100) NOT NULL,
[O_NO] [nvarchar](5) NOT NULL,
CONSTRAINT [PK_tbOperInfo] PRIMARY KEY CLUSTERED
(
[O_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
/****** Object: Table [dbo].[tbRoleInfo] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbRoleInfo](
[R_ID] [int] IDENTITY(1,1) NOT NULL,
[R_NAME] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_tbRoleInfo] PRIMARY KEY CLUSTERED
(
[R_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
/****** Object: Table [dbo].[tbCourse] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbCourse](
[COURSE_ID] [int] IDENTITY(1,1) NOT NULL,
[COURSE_NO] [nvarchar](100) NOT NULL,
[COURSE_NAME] [nvarchar](100) NOT NULL,
[COURSE_CENT] [float] NOT NULL,
CONSTRAINT [PK_tb_Course] PRIMARY KEY CLUSTERED
(
[COURSE_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
/****** Object: Table [dbo].[tbCollege] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbCollege](
[C_ID] [int] IDENTITY(1,1) NOT NULL,
[C_NO] [nvarchar](100) NOT NULL,
[C_NAME] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_tbCollege] PRIMARY KEY CLUSTERED
(
[C_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
/****** Object: Table [dbo].[People] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[People](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [nvarchar](10) NOT NULL,
[writeexam] [float] NULL,
[lamexam] [float] NULL,
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
/****** Object: Table [dbo].[GRADE] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GRADE](
[LOW] [numeric](3, 0) NULL,
[UPP] [numeric](3, 0) NULL,
[RANK] [nvarchar](10) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[E_example] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[E_example](
[e_id] [int] NOT NULL,
[n_char] [nvarchar](20) NULL,
[n_text] [text] NULL,
PRIMARY KEY CLUSTERED
(
[e_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] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[COURSE] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[COURSE](
[CNO] [varchar](5) NOT NULL,
[CNAME] [varchar](10) NOT NULL,
[TNO] [varchar](10) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[TEACHER] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TEACHER](
[TNO] [varchar](3) NOT NULL,
[TNAME] [varchar](4) NOT NULL,
[TSEX] [varchar](2) NOT NULL,
[TBIRTHDAY] [datetime] NOT NULL,
[PROF] [varchar](6) NULL,
[DEPART] [varchar](10) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbUserInfo] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbUserInfo](
[U_ID] [int] IDENTITY(1,1) NOT NULL,
[U_NAME] [nvarchar](100) NOT NULL,
[U_PWD] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_tbUserInfo] PRIMARY KEY CLUSTERED
(
[U_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
/****** Object: Table [dbo].[tbDepart] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbDepart](
[D_ID] [int] IDENTITY(1,1) NOT NULL,
[D_NO] [nvarchar](100) NOT NULL,
[D_NAME] [nvarchar](100) NOT NULL,
[D_TYPE] [bit] NOT NULL,
[C_ID] [int] NULL,
CONSTRAINT [PK_tbDepart] PRIMARY KEY CLUSTERED
(
[D_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
/****** Object: Table [dbo].[tbURrelation] Script Date: 05/17/2011 22:20:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbURrelation](
[UR_ID] [int] IDENTITY(1,1) NOT NULL,
[U_ID] [int] NOT NULL,
[R_ID] [int] NOT NULL,
CONSTRAINT [PK_tbURrelation] PRIMARY KEY CLUSTERED
(
[UR_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
/****** Object: StoredProcedure [dbo].[proc_select] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create Proc [dbo].[proc_select]
as
begin
declare @we char
select @we= '大'
SELECT COURSE_ID,COURSE_NO,COURSE_NAME,COURSE_CENT FROM tbCourse WHERE COURSE_NAME LIKE @we
end
GO
/****** Object: StoredProcedure [dbo].[proc_FindByNo] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[proc_FindByNo] @courseno varchar(20)
AS
BEGIN
SELECT @courseno = '%'+RTRIM(@courseno) + '%';
SELECT COURSE_ID,COURSE_NO,COURSE_NAME,COURSE_CENT FROM tbCourse WHERE COURSE_NO LIKE @courseno ORDER BY COURSE_ID DESC
END
GO
/****** Object: StoredProcedure [dbo].[proc_FindByName] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[proc_FindByName] @coursename varchar(20)
AS
BEGIN
SELECT @coursename ='%'+ RTRIM(@coursename) + '%';
SELECT COURSE_ID,COURSE_NO,COURSE_NAME,COURSE_CENT FROM tbCourse WHERE COURSE_NAME LIKE @coursename ORDER BY COURSE_ID DESC
END
GO
/****** Object: Table [dbo].[tbOUrelation] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbOUrelation](
[OU_ID] [int] IDENTITY(1,1) NOT NULL,
[O_ID] [int] NOT NULL,
[U_ID] [int] NOT NULL,
CONSTRAINT [PK_tbOUrelation] PRIMARY KEY CLUSTERED
(
[OU_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
/****** Object: Table [dbo].[tbFRrelation] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbFRrelation](
[FR_ID] [int] IDENTITY(1,1) NOT NULL,
[F_ID] [int] NOT NULL,
[R_ID] [int] NOT NULL,
CONSTRAINT [PK_tbFRrelation] PRIMARY KEY CLUSTERED
(
[FR_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
/****** Object: StoredProcedure [dbo].[proUPDATEUser] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[proUPDATEUser](@UID int,
@RID int,
@UNAME nvarchar(100),
@UPWD nvarchar(100))
AS
BEGIN

DECLARE @NUM int

SELECT @NUM=COUNT(UR_ID) FROM tbURrelation WHERE U_ID=@UID

IF(@NUM>0)
BEGIN
DELETE FROM tbURrelation WHERE U_ID=@UID
END

INSERT INTO tbURrelation (U_ID,R_ID) VALUES(@UID,@RID)

UPDATE tbUserInfo SET U_NAME=@UNAME,U_PWD=@UPWD WHERE U_ID=@UID

END
GO
/****** Object: StoredProcedure [dbo].[proUPDATEOper] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[proUPDATEOper](@OID int,
@UID int,
@OINTR nvarchar(100),
@ONO int)

AS
BEGIN

DECLARE @NUM int

SELECT @NUM=COUNT(OU_ID) FROM tbOUrelation WHERE O_ID=@OID

IF(@NUM>0)
BEGIN
DELETE FROM tbOUrelation WHERE O_ID=@OID
END

INSERT INTO tbOUrelation (O_ID,U_ID) VALUES(@OID,@UID)

UPDATE tbOperInfo SET O_INTR=@OINTR,O_NO=@ONO WHERE O_ID=@OID

END
GO
/****** Object: StoredProcedure [dbo].[proUPDATEFun] Script Date: 05/17/2011 22:20:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[proUPDATEFun](@FID int,
@RID int,
@FINTR nvarchar(100),
@FCLASS nvarchar(100))

AS
BEGIN

DECLARE @NUM int

SELECT @NUM=COUNT(FR_ID) FROM tbFRrelation WHERE F_ID=@FID

IF(@NUM>0)
BEGIN
DELETE FROM tbFRrelation WHERE F_ID=@FID
END

INSERT INTO tbFRrelation (F_ID,R_ID) VALUES(@FID,@RID)

UPDATE tbFunInfo SET F_Intr=@FINTR,F_Class=@FCLASS WHERE F_ID=@FID

END
GO
/****** Object: StoredProcedure [dbo].[proDELEUser] Script Date: 05/17/2011 22:20:28 ******/