NBA球员管理系统方案_第1页
NBA球员管理系统方案_第2页
NBA球员管理系统方案_第3页
NBA球员管理系统方案_第4页
NBA球员管理系统方案_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、word 完美格式 NBA 球员管理系统数据库原理课程设计报告 NBA 球员管理系统设计与实现学院:信息学院专业班级:计算机科学与技术 1 班组员姓名:王治铭201424020105陈昭儒201424020106殷鹏飞201424020110指导老师:李晓莉完成日期:2016-6-17精心整理学习帮手一、概述1.1 背景说明软件名称: NBA 球员信息管理系统用户:球队数据分析师1.2 开发环境操作系统Windows 7软件配置Visual Basic 6.0 & SQL Server 2014二、需求分析2.1 用户需求NBA 发展至今,整个联盟涵括了三十支球队,每支球队的球员名单上限在常规

2、赛时期可以达到 15 位,加上不计其数的自由球员,管理并分析这些球员的生涯数据成为了一件棘手的事, NBA 球员信息管理系统可以师解决这个问题。本系统面向的对象为球队数据分析师, 对于专业人士, 他们不仅有权浏览数据, 也可以对数据进行修改、删除,用户共享数据并更新数据。2.2 主要功能本系统从用户的需求出发,可实现以下功能:a) 球员数据浏览b) 球员数据修改c) 球员数据删除2.3 数据字典名称数据类型字段描述charchar球员姓名Pragesmallint球员年龄Pnosmallint球衣号码PIDchar球员代号Pcapitalmoney球员薪金Tnamechar隶属球队名称TIDc

3、har隶属球队代号ppgfloat场均得分rpgfloat场均篮板1apgfloat场均助攻spgfloat场均抢断bpgfloat场均盖帽Pbesmallint最近一场得分三、数据库概念结构设计根据需求分析,可知本系统有以下E-R 图:3.1 球员信息 E-R 图球员姓名球员代号球员年龄球衣号码球员信息球员薪金隶属球队代号隶属球队名称3.2 球员数据 E-R 图场均得分场均篮板场均盖帽球员代号球员数据场均抢断球员姓名场均助攻3.3 球员表现 E-R 图最近一场得分球员代号2球员表现四、逻辑结构设计4.1 球员信息表列名NULL约束PIDNOT NULLprimary keyPnameNOT

4、NULLPcapitalNOT NULLPrageNOT NULLPnoNOT NULLTnameNOT NULLTIDNOT NULL4.2 球员数据表列名NULL约束PIDNOT NULLprimary keyPnameNOT NULLppgNOT NULLrpgNOT NULLapgNOT NULLspgNOT NULLbpgNOT NULL4.3球员表现表列名NULL约束PIDNOT NULLprimary keyPnameNOT NULLPbeNOT NULL3五、创建数据库及其对象5.1 建表5.1.1球员信息表createtableplayer(PIDchar (10)NOT N

5、ULL,Pnamechar (25) NOT NULL,Pcapital moneyNOT NULL,PragesmallintNOT NULL,Tnamechar (30)NOT NULL,PnosmallintNOT NULL,TIDchar (15)NOT NULL,primarykey(PID,Pname )5.1.2球员数据表createtableplayerData(PIDchar (10)NOT NULL,Pnamechar (25)NOT NULL,ppgfloatNOT NULL,rpgfloatNOT NULL,apgfloatNOT NULL,spgfloatNOT NU

6、LL,bpgfloatNOT NULL,primarykey(PID,Pname)5.1.3球员表现表createtablebehave(PIDchar (10)NOT NULL,Pbesmallint NOT NULL,Pnamechar (25)NOT NULLprimarykey(PID)六、基于 VB的UI设计46.1 Form1 窗口Private Sub Add_Click()Adodc1.Recordset.AddNewAdd.Enabled = FalseDel.Enabled = FalseEdit.Enabled = TrueCancel.Enabled = TrueEnd

7、 SubPrivate Sub Cancel_Click()Adodc1.Recordset.CancelUpdateAdd.Enabled = TrueDel.Enabled = TrueCancel.Enabled = FalseEnd SubPrivate Sub Command1_Click()/打开 form2 窗口Form2.ShowEnd SubPrivate Sub Del_Click()Dim res As Integerres = MsgBox( 确实要删除此行吗? , vbExclamation + vbYesNo + vbDefaultButton2)If res =

8、vbYes ThenAdodc1.Recordset.DeleteAdodc1.Recordset.MoveNextIf Adodc1.Recordset.EOF = True ThenAdodc1.Recordset.MoveLastEnd IfEnd IfEnd SubPrivate Sub Edit_Click()Adodc1.Recordset.Fields(Pno) = Trim(TextPno.Text)Adodc1.Recordset.Fields(Pname) = Trim(TextPname.Text)Adodc1.Recordset.Fields(Prage) = Trim

9、(TextPrage.Text)Adodc1.Recordset.Fields(Pcapital) = Trim(TextPcpt.Text)Adodc1.Recordset.Fields(PID) = Trim(TextPID.Text)Adodc1.Recordset.Fields(TID) = Trim(TextTID.Text)Adodc1.Recordset.Fields(Tname) = Trim(TextTname.Text)Adodc1.Recordset.UpdateAdd.Enabled = True5Del.Enabled = TrueCancel.Enabled = F

10、alseEnd SubPrivate Sub Exit_Click()EndEnd SubPrivate Sub First_Click()Adodc1.Recordset.MoveFirstEnd SubPrivate Sub Last_Click()Adodc1.Recordset.MoveLastEnd SubPrivate Sub Next_Click()Adodc1.Recordset.MoveNextIf Adodc1.Recordset.EOF = True ThenAdodc1.Recordset.MoveLastEnd IfEnd SubPrivate Sub Previou

11、s_Click()Adodc1.Recordset.MovePreviousIf Adodc1.Recordset.BOF = True ThenAdodc1.Recordset.MoveFirstEnd IfEnd SubPrivate Sub Print_Click()/打开 apg 窗口apg.ShowEnd SubPrivate Sub Form_Load()Cancel.Enabled = FalseCombo1.AddItem 球员信息 Combo1.AddItem 球员数据 Combo1.AddItem 球员表现 Combo1.AddItem 球员表现对比Dim strPID A

12、s StringDim strSelect As StringstrPID = Trim(TextPID.Text)strSelect = select * from player6Adodc1.CommandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshSet DtgCond.DataSource = Adodc1Call InitGirdDim strPID1 As StringDim strSelect1 As StringstrPID1 = Trim(TextPID.Text)strSelect1 = sele

13、ct * from playerDataAdodc2.CommandType = adCmdTextAdodc2.RecordSource = strSelect1Adodc2.RefreshSet DtgCond1.DataSource = Adodc2Call InitGird1Dim strPID2 As StringDim strSelect2 As StringstrPID2 = Trim(TextPID.Text)strSelect2 = select * from behaveAdodc3.CommandType = adCmdTextAdodc3.RecordSource =

14、strSelect2Adodc3.RefreshSet DtgCond2.DataSource = Adodc3Call InitGird2Dim strPID3 As StringDim strSelect3 As StringstrPID3 = Trim(TextPID.Text)strSelect3 = select * from playerData join behave on playerData.PID = behave.PID Adodc4.CommandType = adCmdTextAdodc4.RecordSource = strSelect3Adodc4.Refresh

15、Set DtgCond3.DataSource = Adodc4End SubPrivate Sub InitGird()With DtgCond.Columns(0).Caption = ID.Columns(1).Caption = Name.Columns(2).Caption = Capital.Columns(3).Caption = Age.Columns(4).Caption = Team.Columns(5).Caption = No.Columns(6).Caption = Team ID.Columns(0).Width = 10007.Columns(1).Width =

16、 1000.Columns(2).Width = 1000.Columns(3).Width = 1000End WithEnd SubPrivate Sub InitGird1()With DtgCond1.Columns(0).Caption = ID.Columns(1).Caption = Name.Columns(2).Caption = ppg.Columns(3).Caption = rpg.Columns(4).Caption = apg.Columns(5).Caption = spg.Columns(6).Caption = bpg.Columns(0).Width = 1

17、000.Columns(1).Width = 1000.Columns(2).Width = 1000.Columns(3).Width = 1000End WithEnd SubPrivate Sub InitGird2()With DtgCond2.Columns(0).Caption = ID.Columns(1).Caption = pbe.Columns(2).Caption = Name.Columns(0).Width = 1000.Columns(1).Width = 1000.Columns(2).Width = 1000End WithEnd SubPrivate Sub

18、Combo1_Click()If Combo1.Text = 球员信息 ThenFrame1.ZOrder 0ElseIf Combo1.Text = 球员数据 ThenFrame2.ZOrder 0ElseIf Combo1.Text = 球员表现 ThenDtgCond2.ZOrder 0ElseIf Combo1.Text = 球员表现对比 ThenDtgCond3.ZOrder 0End IfEnd Sub6.2 Form2 窗口8Private Sub Add_Click()Adodc2.Recordset.AddNewAdd.Enabled = FalseDel.Enabled =

19、 FalseEdit.Enabled = TrueCancel.Enabled = TrueEnd SubPrivate Sub Cancel_Click()Adodc2.Recordset.CancelUpdateAdd.Enabled = TrueDel.Enabled = TrueCancel.Enabled = FalseEnd SubPrivate Sub Del_Click()Dim res As Integerres = MsgBox( 确实要删除此行吗? , vbExclamation + vbYesNo + vbDefaultButton2)If res = vbYes Th

20、enAdodc2.Recordset.DeleteAdodc2.Recordset.MoveNextIf Adodc2.Recordset.EOF = True ThenAdodc2.Recordset.MoveLastEnd IfEnd IfEnd SubPrivate Sub Edit_Click()Adodc2.Recordset.Fields(Pbe) = Trim(TextPbe.Text)Adodc2.Recordset.Fields(Pname) = Trim(TextPname.Text)Adodc2.Recordset.Fields(PID) = Trim(TextPID.T

21、ext)Adodc2.Recordset.UpdateAdd.Enabled = TrueDel.Enabled = TrueCancel.Enabled = FalseEnd SubPrivate Sub Exit_Click()EndEnd SubPrivate Sub First_Click()Adodc2.Recordset.MoveFirst9End SubPrivate Sub Last_Click()Adodc2.Recordset.MoveLastEnd SubPrivate Sub Next_Click()Adodc2.Recordset.MoveNextIf Adodc2.

22、Recordset.EOF = True ThenAdodc2.Recordset.MoveLastEnd IfEnd SubPrivate Sub Previous_Click()Adodc2.Recordset.MovePreviousIf Adodc2.Recordset.BOF = True ThenAdodc2.Recordset.MoveFirstEnd IfEnd SubPrivate Sub Form_Load()Cancel.Enabled = FalseEnd Sub6.3 apg 窗口Private Sub Add_Click()Adodc2.Recordset.AddN

23、ewAdd.Enabled = FalseDel.Enabled = FalseEdit.Enabled = TrueCancel.Enabled = TrueEnd SubPrivate Sub Cancel_Click()Adodc2.Recordset.CancelUpdateAdd.Enabled = TrueDel.Enabled = TrueCancel.Enabled = FalseEnd SubPrivate Sub Del_Click()Dim res As Integer10res = MsgBox(确实要删除此行吗?, vbExclamation + vbYesNo +

24、vbDefaultButton2)If res = vbYes ThenAdodc2.Recordset.DeleteAdodc2.Recordset.MoveNextIf Adodc2.Recordset.EOF = True ThenAdodc2.Recordset.MoveLastEnd IfEnd IfEnd SubPrivate Sub Edit_Click()Adodc2.Recordset.Fields(ppg) = Trim(Textppg.Text)Adodc2.Recordset.Fields(Pname) = Trim(TextPname.Text)Adodc2.Reco

25、rdset.Fields(rpg) = Trim(Textrpg.Text)Adodc2.Recordset.Fields(apg) = Trim(Textapg.Text)Adodc2.Recordset.Fields(PID) = Trim(TextPID.Text)Adodc2.Recordset.Fields(bpg) = Trim(Textbpg.Text)Adodc2.Recordset.Fields(spg) = Trim(Textspg.Text)Adodc2.Recordset.UpdateAdd.Enabled = TrueDel.Enabled = TrueCancel.

26、Enabled = FalseEnd SubPrivate Sub Exit_Click()EndEnd SubPrivate Sub First_Click()Adodc2.Recordset.MoveFirstEnd SubPrivate Sub Last_Click()Adodc2.Recordset.MoveLastEnd SubPrivate Sub Next_Click()Adodc2.Recordset.MoveNextIf Adodc2.Recordset.EOF = True ThenAdodc2.Recordset.MoveLastEnd IfEnd SubPrivate Sub Previous_Click()11Adodc2.Recordset.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论