1、课程设计任务书及成绩评定一、 课程设计的目的和任务Delphi应用程序设计是一门实践性较强的课程,在学完该课程之后进行综合课程设计,有助于加深学生对Delphi编程理论方面的理解,从而更好地掌握使用Delphi语言开发应用系统的技术;有助于学生将课堂所学的知识和实践有机结合起来,初步掌握应用系统开发的步骤和方法,提高分析和解决实际问题的能力,从而培养学生理论与实践相结合和实践创新的能力。在学习完上述课程之后,依据所学的知识及课外查阅的资料完成预定的综合课程设计任务。指导教师签字: 日期: 指导教师评语成绩: 指导教师签字: 日期: 课程设计所需软件、硬件等硬件:PC机软件:Windows xp
2、 操作系统Delphi7环境课程设计进度计划起至日期工作内容备注2010.5.1-2010.5.152010.5.16-2010.6.12010.6.2-2010.6.15收集资料编写代码运行、调试参考文献、资料索引序号文献、资料名称编著者出版单位1 Delphi应用程序设计 李目海 电子科技大学出版社2Delphi程序设计实用教程 叶核亚 电子工业出版社3 Delphi 2005程序设计教程 刘瑞新编著 机械工业出版社4Delphi数据库程序设计教程 刘瑞新 张志纲 张兵义 机械工业出版社目录一、概述41、项目背景42、编写目的53、软件定义54、开发环境5本系统以Delphi7为开发环境,
3、SQL Server 2005为数据库平台,实现火车票管理系统的制作和开发过程。5二、需求分析51、问题的提出52、系统的业务功能分析53、系统的业务流程分析54、需完成的功能6三、系统设计61、数据表:62.表的物理设计:7四、系统实施81、系统的界面设计82、事件的设计过程:123、主要代码描述12五、系统测试26六、收获和体会27一、概述1、项目背景随着计算机技术的发展,特别是计算机网络技术与数据库技术的发展,使用人们的生活与工作方式发生了很大的改观。而互联网技术的出现,更是进一步丰富的人类生活,数字化生存已经一步步走进我们的生活与工作。互联网技术与数据库技术的结合为计算的在人类生活中的
4、应用带来了巨大的影响。产业信息化,管理现代化,科学化已经成为行业发展的重要课题,这不仅是企业提高自身竞争力,甚至是国家提高综合国力,走向国民富强的重要手段。在我国,许多人都要用火车出行,没到春节火车票都是十分的紧缺,给人们买票带来了不便,由此设计火车票查询管理系统。 2、编写目的根据需求分析报告,我又对火车售票系统软件的功能划分、数据结构、软件总体结构有了一些的想法。我将这些想法记录下来,来介绍这一管理系统。3、软件定义火车票该管理系统:是一个集查询和管理的一个软件,可以供管理员添加线路,删除线路,改变线路的信息,供一般用户查询讯息。 4、开发环境本系统以Delphi7为开发环境,SQL Se
5、rver 2005为数据库平台,实现火车票管理系统的制作和开发过程。二、需求分析1、问题的提出春节期间是买票的高峰时期,很多人都因为买不到票而耽误了回家的时间,如果对火车票的情况有所先知,则可以节约买票的时间,及时选择其他出行工具,以及转乘一些其他的火车线路,由此设计火车票管理系统。2、系统的业务功能分析(1)此系统设系统管理员登陆,需要ID和密码才可以登录,登录后可以对火车票的信息进行管理,可以查找线路,查询车次、票价、以及员工信息等,并对这些信息作修改、删除、插入操作。(2)系统还有一般的员工登录登陆,也需要ID和密码。用户等路后可以查询车次的信息,信息包括火车票量,火车票价,各到站时间,
6、各站出发时间,运行时间,站站查询,等。3、系统的业务流程分析系统登录管理员登录员工登录查询车次查询车辆类型查询员工信息车次线路车票查询4、需完成的功能(1)管理员的登录(2)一般员工的登录(3)登录后可以进行车次的查询,查询结果包括,这个车次的站点到达时间,出发时间,各类票的票量,票价等三、系统设计1、数据表: E-R图2.表的物理设计:车辆信息: 列车信息: 管理员:员工: 列车售票:四、系统实施1、系统的界面设计(1)系统进入等待页面所用控件:Image1:image;/加载等待页面(2)登录页面所用控件: Label1: TLabel;/火车票销售系统 Label2: TLabel;/管
7、理员ID Label3: TLabel;/管理员密码 Edit1: TEdit;/输入管理员ID Edit2: TEdit;/输入管理员密码 Label6: TLabel;/密码提示 Label8: TLabel;/管理员登陆 Image1: TImage;/欢迎画面加载 Button1: TButton;/登陆 Label4: TLabel;/员工登陆 DataSource1: TDataSource;/ ADOConnection1: TADOConnection/; ADOTable1: TADOTable;/ Edit3: TEdit;/输入员工ID Label5: TLabel;/员
8、工ID Label7: TLabel;/员工密码 Edit4: TEdit;/输入员工密码 Label9: TLabel;/密码提示 Button2: TButton;/登陆 Button3: TButton;/取消 Button4: TButton;/取消 DataSource2: TDataSource;/数据库及 ADOConnection2: TADOConnection;/数据库连接 ADOTable2:TADOTable;(3)用户模块主页面所用控件: DataSource1: TDataSource; PageControl1: TPageControl; TabSheet1:
9、TTabSheet; TabSheet2: TTabSheet; TabSheet3: TTabSheet; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Label3: TLabel; Edit3: TEdit; Button1: TButton; Edit5: TEdit; DBGrid1: TDBGrid; ADOConnection1: TADOConnection; ADOTable1: TADOTable; GroupBox1: TGroupBox; GroupBox2: TGroupBox; GroupBo
10、x3: TGroupBox; Label5: TLabel; Label6: TLabel; Label7: TLabel; Edit6: TEdit; Edit7: TEdit; Edit8: TEdit; Label8: TLabel; Label9: TLabel; Label10: TLabel; Edit9: TEdit; Edit10: TEdit; Edit11: TEdit; Label11: TLabel; Edit12: TEdit; Edit13: TEdit; Edit14: TEdit; Label12: TLabel; Label13: TLabel; Button
11、2: TButton; Button3: TButton; Button5: TButton; GroupBox4: TGroupBox; DBGrid2: TDBGrid; Button6: TButton; Button7: TButton; Button8: TButton; Button9: TButton; Button10: TButton; Button11: TButton; Label17: TLabel; DBGrid3: TDBGrid; Button12: TButton; Button13: TButton; Button14: TButton; Button15:
12、TButton; ADOQuery1: TADOQuery; DataSource2: TDataSource; ADOConnection2: TADOConnection; ADOTable2: TADOTable; ADOQuery2: TADOQuery; Button16: TButton; Button17: TButton; Button18: TButton; DataSource3: TDataSource; DataSource4: TDataSource; DataSource5: TDataSource; DataSource6: TDataSource; ADOCon
13、nection3: TADOConnection; ADOConnection4: TADOConnection; ADOConnection5: TADOConnection; ADOConnection6: TADOConnection; ADOTable3: TADOTable; ADOTable4: TADOTable; ADOTable5: TADOTable; ADOTable6: TADOTable; ADOTable7: TADOTable; Button4: TButton; ADOConnection7: TADOConnection; DataSource7: TData
14、Source; ADOTable8: TADOTable; Button19: TButton; Edit4: TEdit; Button20: TButton;Edit15: TEdit;2、事件的设计过程:当按下某一个按钮后触发按下按钮事件,进行相应的处理3、主要代码描述(1)登录模块代码unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, jpeg, ExtCtrls, DB, ADODB;type TFo
15、rm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Edit1: TEdit; Edit2: TEdit; Label6: TLabel; Label8: TLabel; Image1: TImage; Button1: TButton; Label4: TLabel; DataSource1: TDataSource; ADOConnection1: TADOConnection; ADOTable1: TADOTable; Edit3: TEdit; Label5: TLabel; Label7: TLabe
16、l; Edit4: TEdit; Label9: TLabel; Button2: TButton; Button3: TButton; Button4: TButton; DataSource2: TDataSource; ADOConnection2: TADOConnection; ADOTable2: TADOTable; procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure
17、Button4Click(Sender: TObject); private Private declarations public Public declarations end;var Form1: TForm1;implementationuses Unit3;$R *.dfmprocedure TForm1.Button1Click(Sender: TObject);begin if(edit1.Text=)or(edit2.Text=) then begin showmessage(ID或密码不能为空!);end;if adotable1.Locate(ID;password,var
18、arrayof(edit1.Text,edit2.Text),)thenbeginApplication.CreateForm(TForm3,Form3); Form3.ShowModal; Form3.Free;endelseshowmessage(ID或密码错误)end;procedure TForm1.Button3Click(Sender: TObject);beginclose;end;procedure TForm1.Button2Click(Sender: TObject);begin if(edit3.Text=)or(edit4.Text=) then begin showm
19、essage(ID或密码不能为空!);end;if adotable2.Locate(ID;密码,vararrayof(edit3.Text,edit4.Text),)thenbeginApplication.CreateForm(TForm3,Form3); Form3.ShowModal; Form3.Free;endelseshowmessage(ID或密码错误)end;procedure TForm1.Button4Click(Sender: TObject);beginclose;end;end.(2)用户模块代码:unit Unit3;interfaceuses Windows,
20、Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, TabNotBk, DB, DBClient, StdCtrls, ADODB, Grids, DBGrids;type TForm3 = class(TForm) DataSource1: TDataSource; PageControl1: TPageControl; TabSheet1: TTabSheet; TabSheet2: TTabSheet; TabSheet3: TTabSheet; Label1: TLab
21、el; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Label3: TLabel; Edit3: TEdit; Button1: TButton; Edit5: TEdit; DBGrid1: TDBGrid; ADOConnection1: TADOConnection; ADOTable1: TADOTable; GroupBox1: TGroupBox; GroupBox2: TGroupBox; GroupBox3: TGroupBox; Label5: TLabel; Label6: TLabel; Label7: TLabel; Edit
22、6: TEdit; Edit7: TEdit; Edit8: TEdit; Label8: TLabel; Label9: TLabel; Label10: TLabel; Edit9: TEdit; Edit10: TEdit; Edit11: TEdit; Label11: TLabel; Edit12: TEdit; Edit13: TEdit; Edit14: TEdit; Label12: TLabel; Label13: TLabel; Button2: TButton; Button3: TButton; Button5: TButton; GroupBox4: TGroupBo
23、x; DBGrid2: TDBGrid; Button6: TButton; Button7: TButton; Button8: TButton; Button9: TButton; Button10: TButton; Button11: TButton; Label17: TLabel; DBGrid3: TDBGrid; Button12: TButton; Button13: TButton; Button14: TButton; Button15: TButton; ADOQuery1: TADOQuery; DataSource2: TDataSource; ADOConnect
24、ion2: TADOConnection; ADOTable2: TADOTable; ADOQuery2: TADOQuery; Button16: TButton; Button17: TButton; Button18: TButton; DataSource3: TDataSource; DataSource4: TDataSource; DataSource5: TDataSource; DataSource6: TDataSource; ADOConnection3: TADOConnection; ADOConnection4: TADOConnection; ADOConnec
25、tion5: TADOConnection; ADOConnection6: TADOConnection; ADOTable3: TADOTable; ADOTable4: TADOTable; ADOTable5: TADOTable; ADOTable6: TADOTable; ADOTable7: TADOTable; Button4: TButton; ADOConnection7: TADOConnection; DataSource7: TDataSource; ADOTable8: TADOTable; Button19: TButton; Edit4: TEdit; Butt
26、on20: TButton; Edit15: TEdit; procedure Button1Click(Sender: TObject); procedure Button16Click(Sender: TObject); procedure Button17Click(Sender: TObject); procedure Button18Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure Button6Click(Sender: TObject); procedure Button8Clic
27、k(Sender: TObject); procedure Button7Click(Sender: TObject); procedure Button9Click(Sender: TObject); procedure Button12Click(Sender: TObject); procedure Button13Click(Sender: TObject); procedure Button14Click(Sender: TObject); procedure Button15Click(Sender: TObject); procedure Button2Click(Sender:
28、 TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); private Private declarations public Public declarations end;var Form3: TForm3;implementation$R *.dfmprocedure TForm3.Button1Click(Sender: TObject);begin if edit3.Text then with adoquery1 do beginClose;adoque
29、ry1.sql.Clear;adoquery1.sql.Add(select* from 列车售票 where checi=:a);parameters.ParamByName(a).Value:=trim(form3.edit3.Text); open; if adoquery1.RecordCount0 then datasource1.DataSet:=adoquery1 else begin application.MessageBox(不存在,请重新输入!,提示,64); end; edit5.Text:=(adoquery1.FieldValuesshengyupiaoshu);
30、end;end;procedure TForm3.Button16Click(Sender: TObject);begin if edit1.Text then with adoquery2 do beginClose;sql.Clear;sql.Add(select* from 列车信息 where start=:b and zhongdianzhan=:c);parameters.ParamByName(b).Value:=trim(form3.edit1.Text); parameters.ParamByName(c).Value:=trim(form3.edit2.Text); ope
31、n; if adoquery2.RecordCount0 then datasource2.DataSet:=adoquery2 else begin application.MessageBox(不存在,请重新输入!,提示,64); end; edit7.Text:=(adoquery2.FieldValuespiaojia); edit8.Text:=(adoquery2.FieldValuespiaojia)*(strtoint(edit6.Text); end;end;procedure TForm3.Button17Click(Sender: TObject);begin if ed
32、it1.Text then with adoquery2 do beginClose;sql.Clear;sql.Add(select* from 列车信息 where start=:b and zhongdianzhan=:c);parameters.ParamByName(b).Value:=trim(form3.edit1.Text); parameters.ParamByName(c).Value:=trim(form3.edit2.Text); open; if adoquery2.RecordCount0 then datasource2.DataSet:=adoquery2 el
33、se begin application.MessageBox(不存在,请重新输入!,提示,64); end; edit10.Text:=(adoquery2.FieldValuespiaojia); edit11.Text:=(adoquery2.FieldValuespiaojia)*(strtoint(edit9.Text); end;end;procedure TForm3.Button18Click(Sender: TObject);begin if edit1.Text then with adoquery2 do beginClose;sql.Clear;sql.Add(sele
34、ct* from 列车信息 where start=:b and zhongdianzhan=:c);parameters.ParamByName(b).Value:=trim(form3.edit1.Text); parameters.ParamByName(c).Value:=trim(form3.edit2.Text); open; if adoquery2.RecordCount0 then datasource2.DataSet:=adoquery2 else begin application.MessageBox(不存在,请重新输入!,提示,64); end; edit13.Te
35、xt:=(adoquery2.FieldValuespiaojia); edit14.Text:=(adoquery2.FieldValuespiaojia)*(strtoint(edit12.Text); end;end;procedure TForm3.Button5Click(Sender: TObject);begincloseend;procedure TForm3.Button6Click(Sender: TObject);beginadotable3.Active:=true; DBGrid2.DataSource:=DataSource3; adotable4.Active:=
36、false; adotable5.Active:=false; adotable6.Active:=false; end;procedure TForm3.Button8Click(Sender: TObject);begin adotable4.Active:=true; DBGrid2.DataSource:=DataSource4; adotable3.Active:=false; adotable5.Active:=false; adotable6.Active:=false;end;procedure TForm3.Button7Click(Sender: TObject);begi
37、nadotable5.Active:=true; DBGrid2.DataSource:=DataSource5; adotable4.Active:=false; adotable3.Active:=false; adotable6.Active:=false;end;procedure TForm3.Button9Click(Sender: TObject);beginadotable6.Active:=true; DBGrid2.DataSource:=DataSource6; adotable4.Active:=false; adotable5.Active:=false; adota
38、ble3.Active:=false;end;procedure TForm3.Button12Click(Sender: TObject);beginif adotable3.Active=true then beginadotable3.First;end;if adotable4.Active=true thenbeginadotable4.First;end ;if adotable6.Active=true thenbeginadotable6.First;endelseif adotable5.Active=true thenbeginadotable5.First;end;end
39、;procedure TForm3.Button13Click(Sender: TObject);beginif adotable3.Active=true then beginadotable3.Prior;end;if adotable4.Active=true thenbeginadotable4.Prior;end ;if adotable6.Active=true thenbeginadotable6.Prior;endelseif adotable5.Active=true thenbeginadotable5.Prior;end;end;procedure TForm3.Butt
40、on14Click(Sender: TObject);beginif adotable3.Active=true then beginadotable3.Next;end;if adotable4.Active=true thenbeginadotable4.Next;end ;if adotable6.Active=true thenbeginadotable6.Next;endelseif adotable5.Active=true thenbeginadotable5.Next;end;end;procedure TForm3.Button15Click(Sender: TObject);begin if adotable3.Active=true then beginadotable3.Last;end;if adotable4.Active=true thenbeginadotable4.Last;end ;if adotable6.Active=true thenbeginadotable6.Last;endelseif adotable5.Active=true thenbeginadotable5.Last;end;end;procedure TForm3
版权声明:以上文章中所选用的图片及文字来源于网络以及用户投稿,由于未联系到知识产权人或未发现有关知识产权的登记,如有知识产权人并不愿意我们使用,如有侵权请立即联系:2622162128@qq.com ,我们立即下架或删除。
Copyright© 2022-2024 www.wodocx.com ,All Rights Reserved |陕ICP备19002583号-1
陕公网安备 61072602000132号 违法和不良信息举报:0916-4228922