首页 火车站网上订票系统—计算机毕业设计(论文)

火车站网上订票系统—计算机毕业设计(论文)

举报
开通vip

火车站网上订票系统—计算机毕业设计(论文)火车站网上订票系统—计算机毕业设计(论文) 毕业设计(论文) 火车站网上订票系统 摘要 针对火车站的订票实际情况,按照软件工程的结构化设计思想,本次课程设计经过项目的可行性研究和需求分析、总体设计、详细设计,以及编码实现和调试等步骤设计开发了火车站网上订票系统。并运用数据流图和数据字典、E-R图和数据库逻辑结构、层次图、系统流程图、以及程序流程图,对该系统的数据需求、数据库、系统软件结构、系统流程、以及处理过程等进行了分析和设计。 本次课程设计利用JSP 开发工具和SQL Server 2000数据库来开...

火车站网上订票系统—计算机毕业设计(论文)
火车站网上订票系统—计算机毕业 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 ( 论文 政研论文下载论文大学下载论文大学下载关于长拳的论文浙大论文封面下载 ) 毕业设计(论文) 火车站网上订票系统 摘要 针对火车站的订票实际情况,按照软件工程的结构化设计思想,本次课程设计经过项目的可行性研究和需求分析、总体设计、详细设计,以及编码实现和调试等步骤设计开发了火车站网上订票系统。并运用数据流图和数据字典、E-R图和数据库逻辑结构、层次图、系统流程图、以及程序流程图,对该系统的数据需求、数据库、系统软件结构、系统流程、以及处理过程等进行了分析和设计。 本次课程设计利用JSP 开发工具和SQL Server 2000数据库来开发这个火车站网上订票系统。该系统要解决的是火车站网上订票工作所要解决的问题,可以满足火车站网上订票的基本要求,包括查询、订票、退票等三个方面的功能。该系统能运用到火车站订票的工作中,根据用户的需求,设置其权限,并快捷方便的为用户提供服务。 I 目录 工贸企业有限空间作业目录特种设备作业人员作业种类与目录特种设备作业人员目录1类医疗器械目录高值医用耗材参考目录 第一章 概述 ........................................................................ 4 1.1概述 ........................................................................ 4 1.2意义 ........................................................................ 4 1.3任务 ........................................................................ 4 第二章 系统的可行性研究与需求分析 ................................................... 4 2.1可行性研究 .................................................................. 4 2.1.1经济可行性 ............................................................ 5 2.1.2技术可行性 ............................................................ 5 2.1.3操作可行性 ............................................................ 5 2.2需求分析 .................................................................... 5 2.2.1功能需求 .............................................................. 5 2.2.2数据需求 .............................................................. 6 2.2.3性能需求 .............................................................. 6 2.2.4数据流图 .............................................................. 7 2.2.5数据字典 .............................................................. 7 2.2.6实体-联系图 ........................................................... 8 2.2.7数据库逻辑结构 ........................................................ 9 第三章 系统的总体设计 .............................................................. 10 3.1系统软件结构设计 ........................................................... 10 3.1.1软件结构 ............................................................. 10 3.1.2模块算法 ............................................................. 10 3.2系统流程图 ................................................................. 12 第四章 系统的详细设计 .............................................................. 13 4.1接口设计 ................................................................... 13 4.1.1用户接口 ............................................................. 13 4.1.2外部接口 ............................................................. 13 4.1.3内部接口 ............................................................. 13 4.1.4软件接口 ............................................................. 14 4.1.5模块内部 ............................................................. 14 4.2过程设计 ................................................................... 14 4.2.1程序流程图 ........................................................... 14 第五章 系统的实现与调试 ............................................................ 21 5.1应用系统的开发及测试 ....................................................... 21 5.1.1系统首页 ............................................................. 21 5.1.2产品说明 ............................................................. 22 5.1.3用户登录及访问权限 ................................................... 22 5.1.4车次信息查询 ......................................................... 24 5.1.5订票信息查询 ......................................................... 24 5.1.6订票 ................................................................. 24 5.1.7退票 ................................................................. 25 II 5.2部分代码 ................................................................... 25 5.2.1登陆界面 ............................................................. 25 5.2.2主界面 ............................................................... 25 5.2.3车次查询条件选择界面 ................................................. 29 5.2.4精确车次信息 ......................................................... 30 5.2.5搜索车次信息 ......................................................... 30 5.2.6订票信息查询 ......................................................... 30 5.2.7订票——用户信息 ..................................................... 31 5.2.8订票——订票信息 ..................................................... 32 5.2.9退票 ............................................... 错误~未定义书签。43 结束语 ............................................................................ 34 参考文献 .......................................................................... 37 III 第一章 概述 1.1概述 目前火车站售票的状况是仅靠手工操作,以现有的工作人员很难应付车票订购高峰时刻的大量数据处理问题。同时还会出现由此带来的大量记录存放和管理所带来的问题。本次设计拟开发一个火车站网上订票系统,可以降低工作人员的工作量,提高工作人员的工作效率,同时方便顾客订票。 1.2意义 火车站市场的管理和 规范 编程规范下载gsp规范下载钢格栅规范下载警徽规范下载建设厅规范下载 问题,是困扰我们多年的一个老问题,也是政府管理中的一个难点,订票是客运业务中的一个最基本的业务,表面上看,它只是火车站业务的一个简单的部分,但是它涉及到管理与客户服务等多方面,因此,过去传统的售票方式已经不能满足现代客运业务流量剧增的客观要求,这就要求一种全新的订票方式——网上订票,来缓解订票高峰时期的客运压力,并为用户提供方便快捷的订票服务。本次设计便是利用开发工具JSP 和SQL Server 2000数据库共同开发的一个火车站网上订票系统,它能方便快捷地运用在火车站订票业务的营运之中。 1.3任务 本系统设计主要是根据订票业务的基本流程进行的,系统功能包括如下几个方面: 查询:分为对车次信息的查询和客户对已订车票信息的查询 订票:通过查询系统,客户根据自己的需求找到满意的车次,再输入个人信息后直接通过网上订票确定已预订选中的车票。 退票:可退票,通过查询系统,客户可以根据自己的名字找到自己的订票信息,通过退票模块退去已购车票。 第二章 系统的可行性研究与需求分析 2.1可行性研究 该阶段通过对系统目标的初步调研和分析,提出可行性 方案 气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载 并进行论证。我们在这里主要从技 4 术可行性、经济可行性和操作可行性三方面进行分析。 2.1.1经济可行性 开发该系统所需的相关资料可以通过已存在的网上订票系统进行调查采集,所需的其他应用软件、硬件系统也易于获得.因此,开发成本较低。而引进使用本系统后,与传统方式相比,具有高效率、低成本、高质量的特点,可以节省不少人力、物力及财力。所以,从经济的角度来看,该系统可行。 2.1.2技术可行性 开发工具:JSP 数据库环境:SQL Server 2000 系统环境:Microsoft Windows 2000或以上版本。 系统实现依靠相对熟悉的JSP语言和SQL Server2000数据库系统,其基本操作实质还是对数据库进行添加、删除、查找等操作,暂不存在技术问题。 2.1.3操作可行性 系统采用菜单式,实现用户与数据库的交互,界面简洁友好,操作方便。用户只需对订票流程和业务调查了解即可,不需掌握数据库等相关知识。 2.2需求分析 需求分析是软件设计的一个重要的环节。本阶段对订票系统的应用情况作全面调查,以确定系统目标,并对系统所需要的基础数据以及数据处理要求进行分析,从而确定用户的需求。用户对系统的需求我们从以下几方面进行分析。 2.2.1功能需求 本网上订票系统应该具备如下功能: 1.查询 分为对车次信息的查询和客户对已订车票信息的查询。要求: 1)对车次的查询,可以按照发车车次进行查询; 2)车次信息包括:车号、出发地、目的地、发车日期、开出时刻、票价。 3)座位类型设定。 4)车次信息只允许用户查询,不能修改。 2.订票 通过查询系统,客户根据自己的需求找到满意的车次,再输入个人信息后直接通过网上订票确 5 定已预订选中的车票。要求: 订票记录应包括:会员名、车号、发车日期、订购日期、订购票数、总价。 3.退票 可退票,通过查询系统,客户可以根据自己的名字找到自己的订票信息,通过退票模块退去已购车票。 2.2.2数据需求 信息需求,即在系统中需要处理哪些数据。根据对火车站网上订票系统的分析,本系统的信息需求如表2-1所示。 表2-1信息输入输出 信息输入 信息处理 信息输出 用户输入所需车次 检索系统数据库 符合用户需求的车次及相关 信息 用户输入个人信息及所需订 更新系统中的订票信息, 操作反馈(如订票成功) 购的车票信息 将新信息存入系统数据库 用户输入自己的名字、身份 检索系统数据库 符合用户需求的订票信息 证号;或交易的订单号 用户输入自己的名字 检索系统数据库以得到订票 操作反馈(如退票成功等) 记录,删除用户请求的订票 记录,更新系统数据库 2.2.3性能需求 为了保证系统能够长期、安全、稳定、可靠、高效的运行,本系统应该满足以下的性能需求。 1.准确性和及时性 系统处理的准确性和及时性是系统的必要性能。系统应能及时而且准确的根据用户权限及所输入的信息做出响应。由于本系统的查询功能对于整个系统的功能和性能完成举足轻重。作为系统的很多数据来源,而车票的数量和时间又影响用户的决策活动,其准确性和及时性很大程度上决定了系统的成败。在系统开发过程中,必须采用一定的方法保证系统的准确性和及时性。 2.易用性 6 本系统是直接面对用户的,而用户往往对计算机并不是非常熟悉。这就要求系统能够提供良好的用户接口,易用的人机交互界面。要实现这一点,就要求系统应该尽量使用用户熟悉的术语和中文信息的界面,从而保证系统的易用性。 3.安全性 网上订票系统中涉及到的数据是客运公司相当重要的信息,系统要保证用户的权限,对于车次等信息用户只享有查询服务,不得更改;系统还要提供方便的手段供系统维护人员进行数据备份、日常安全管理、以及系统意外崩溃时数据的恢复等工作。同时系统还要保证对数据库进行及时更新,保证数据一致性。 2.2.4数据流图 车次信息 用 车次 反 用 事务 事务 事务 事务 更新 信息 订 接收 接收 更新 数据 户 馈 户 票 事务 事务 数据 库 库 用户信息 订单信息 用户信息 订单信息 接收事务 事务 事务 接收事务 事务 反馈 用 事务 事务 事务 更新 接收事务 户 退票 查询订单 数据 库 事务 用 反馈 事务 修改订单 更新数据库 户 图2.1数据流图 2.2.5数据字典 表2-2 车次信息数据字典 7 名字:车次信息 别名: 描述:存放车次信息的文件,以供用户查询 定义:车次信息=车号+出发地+目的地+发车日期+开出时刻+到达时刻+ 坐位类型 +票价 位置:输出到CRT终端或类似的显示部件 表2-3订票信息数据字典 名字:订票信息 别名:订单信息 描述:存放订单信息的文件,以供用户查询,并作相应操作 定义:订票记录=用户名+车号+发车日期+订购日期+订购票数+总价 位置:输出到CRT终端或类似的显示部件 表2-4用户信息数据字典 名字:用户信息 别名: 描述:存放用户信息的文件,以供用户方便的查询订单信息,进而做出相应的操 作 定义:用户信息=用户名+地址+性别+电话 位置:输出到CRT终端或类似的显示部件 2.2.6实体-联系图 用户的需求具体体现在各种信息的提供、保存、更新和查询,这就要求数据库结构能充分满足各种信息的输出和输入。 针对火车站网上订票系统,通过对网上订票工作的过程、内容以及数据流程分析,设计如下所示的数据项和数据结构: 1.车次信息包括:车号、出发地、目的地、发车日期、开出时刻、剩余座位数、票价。 2.订票记录包括:订单号、身份证号、车号、订购日期、订购票数、总价。 3.用户信息包括:用户名、身份证号、性别、电话。 E-R图如图2.2所示。 用户名 性别 地址 电话 车用 户 次 m 1 1 退票 8 查询 订票 票坐位n n 价 n 类型 车次 订购票数 图2.2实体-联系图(E-R图) 2.2.7数据库逻辑结构 火车站网上订票系统数据库中各个表格的设计结果如表2-5——表2-7所示。每个表格表示在数 据库中的一个表。 表2-5车次信息表BusInfo 字段名 数据类型 是否可空 说明 BusID char(10) NOT NULL 车号(主键) BusFrom varchar(50) NOT NULL 出发地 BusTo varchar(50) NOT NULL 目的地 BusDate Datetime NOT NULL 发车日期(主键) BusBegin Datetime NOT NULL 开出时刻 BusEnd Datetime NOT NULL 到达时刻 TicketNum int NOT NULL 剩余票数 Price Money NOT NULL 票价 表2-6订单表OrderInfo 字段名 数据类型 是否可空 说明 OrderID Char(10) NOT NULL 订单号(主键) UserID Char(18) NOT NULL 身份证号(外键) BusID char(10) NOT NULL 车号(外键) BusDate datetime NOT NULL 发车日期(外键) OrderDate datetime NOT NULL 订购日期 OrderNum Int NOT NULL 订购票数 Total Money NOT NULL 总价 表2-7用户表User 字段名 数据类型 是否可空 说明 9 UserID char(18) NOT NULL 身份证号(主键) User varchar(50) NOT NULL 用户名 Sex Char(2) 性别 Phone varchar(12) 电话 第三章 系统的总体设计 3.1系统软件结构设计 3.1.1软件结构 本火车站网上订票系统可划分为信息查询、网上订票、取消订票三个部分。其中信息查询又可 分为车次查询和订单查询两个部分。其层次图如图3.1所示。 火车票网上订票系统 网上订票 信息查询 取消订票 车次查询 订票查询 图3.1火车站网上订票系统的层次图 3.1.2模块算法 1.各级别算法 1)界面级算法 处理输入信息,产生相应任务。 输入数据 信息反馈 客户端校验数据 信息加工 产生任务 10 数据 图3.2界面级算法示意图 2)数据库级算法 执行相应数据库操作,并直接返回信息反馈。 任务数据校验,调用相关模块功能 用户界面级模块 底层数据库操作(封装) 图3.3数据库级算法示意图 3)任务级算法 执行所需功能,满足用户需求。 生成数据请求 数据处理 任务触发 并记录 并反馈 权限校验 失败 界面显示 图3.4任务级算法示意图 2.调用关系 1)界面模块调用任务模块 2)任务模块调用数据模块 3)数据模块调用界面模块显示 11 3.2系统流程图 系统顶层流程图如下图3.5所示。图3.6——图3.9为各模块详细系统流程图。 事务 查询程序 订票程序 退票程序 火车站网上订票系统 系统数据库 相应信息 操作反馈 图3.5顶层系统流程 输入所符合用户 事务 查询程序 需车次需求的车 次信息 的重要 信息 系统数据库 图3.6车次信息查询系统流程图 符合用户 输入查 需求的订 事务 查询程序 询条件 票信息 系统数据库 12 图3.7订单信息查询系统流程图 输入订 操作反馈 事务 订票程序 票信息 系统数据库 图3.8订票系统流程图 输入退 操作反馈 退票程序 事务 票信息 系统数据库 图3.9退票系统流程图 第四章 系统的详细设计 4.1接口设计 4.1.1用户接口 用户通过界面接口实现参数的输入,进入相应的界面后输入提示的信息即可产生相应的任务。 4.1.2外部接口 接口通过一个数据转换器,将网络二进制数据流转换为一个合适的数据结构单位并添加到缓冲 区中。 4.1.3内部接口 表4-1内部接口说明表 顶层模块 二级模块 接口 数据模块 底层数据操作模块 取出记录集,执行SQL语句 用户操作模块 对应数据库相关表操作 13 界面模块 界面模块 生成任务 缓冲区模块 生成批处理 4.1.4软件接口 本系统程序所使用的数据库来源于主机数据库,所以系统数据与主机数据库数据向一致。 4.1.5模块内部 模块以接受参数方式独立登陆主机数据库并且独立运行,返回数据包显示在界面上。 4.2过程设计 4.2.1程序流程图 本系统主界面为用户设计了三个功能操作以供选择:查询,订票,退票。另外,为方便用户,还将“退出系统”也单另列了出来,用户可以根据需要触发不同事件。其处理流程如图4.1所示。图4.2——图4.6反映了不同触发事件具体的处理流程。 系统用户权限的系统主处理流程 1. 开始 登录框 登录,确定访问权限 主界面 N 选择订 票窗口 选择查询 N 窗口 Y Y 选择退 N 查询 票窗口 订票 界面 14 界面 Y 退票 查询 查询 界面 车次 订票 图4.1系统用户权限的系统主程序流程图 2.新用户权限的系统主处理流程 开始 登录框 登录,确定访问权限 主界面 N 选择订 票窗口 选择查询 N 窗口 Y Y 查询 订票 界面 15 界面 查询 车次 图4.2新用户权限的系统主程序流程图 3.车次信息查询处理流程 16 开始 查询 界面 N 查询车次信息 Y 用户输入要 查询条件 N 查询 Y 返回主页 读数据文件 输出查询结果 N 关闭窗口 Y 继续查询 车次信息 N 订票 Y Y N 订票 界面 订票 结束 图4.3车次信息查询程序流程图 4.订票处理流程 17 开始 订票 界面 N 订票 Y 输入订 票信息 N 提交 返回主页 Y N 错误提示 信息有效性 Y 继续订票 Y N 修改数据文件 N 关闭窗口 Y 结束 图4.4订票程序流程图 5.订票信息查询处理流程 18 开始 查询 界面 查询订 N 票信息 Y 读数据文件 返回主页 Y 输出查询结果 主界面 N 关闭窗口 N 退票 Y 继续查询 Y Y 订票信息 退票 N 界面 退票 结束 图4.5订票信息查询模块程序流程图 6.退票模块处理流程 19 开始 退票 界面 N 退票 Y 输入退票 信息 N 提交 Y 返回主页 N 错误提示 信息有效性 Y Y 继续退票 修改数据文件 N 关闭窗口 N Y 结束 图4.6退票模块程序流程图 20 第五章 系统的实现与调试 5.1应用系统的开发及测试 5.1.1系统首页 图5.1系统首页 21 5.1.2产品说明 图5.2产品说明 5.1.3用户登录及访问权限 本系统设计要求用户通过登录框选择访问权限,登录系统。其中,用户须输入用户名和密码,以进入系统。未使用过本系统的用户选择注册会员,系统自动跳转至主界面。系统用户权限登录访问时,车次信息查询、订票信息查询、订票、退票等功能均可用。系统用户输入正确的用户名和密码,访问系统,得到其相应的权限。如图5.3-5.4。 22 图5.3登录框 系统用户输入错误的用户名或身份证号,系统拒绝其访问。如图5.5。 图5.5 出错提示 新用户在登录窗口选择“注册”单选钮,系统自动跳转到注册页面,并控制其访问权限,如图5.6所示。 图5.6新用户权限登录主窗体 23 5.1.4车次信息查询 对车次信息的查询,系统提供了车次信息,进行精确的查询,系统经过检索,返回符合用户要求的车次,再由用户自行选择满意的车次。图5.7选择查询条件。 图5.7车次查询条件框 5.1.5订票信息查询 对于订票信息的查询,本系统只提供一种查询方式。由于用户在登录时已选择了访问权限,且输入了身份证号等确认具体身份的重要信息。故用户可以通过菜单选项直接查询自己的订票信息。该信息由系统自动返回,简便、快捷。 图5.16订票 5.1.6订票 系统用户可以通过两种方式进入到订票环节。一是在主界面的菜单选项中,直接选择“订票”服务,二是用户可以由车次查询界面,点击“订票”命令,直接跳转订票界面。新用户在填写订票信息之前,必须填写用户信息,以保证下次访问系统时的系统权限不受限制。订票信息中的订单号由系统提供。如果用户是从车次查询界面跳转至订票界面的,在填写订票信息时,车次的相关信息由系统自动提供。用户只需输入订票数,点击“下一步”完成订票交易。交易成功后,系统会弹出提示框,示意用户订票操作已成功。 新用户通过菜单,直接进入订票程序,如图5.18所示。首先点击新增,激活操作,填写用户信 24 息。如图5.19所示。 图5.18订票信息界面 5.1.7退票 系统进入退票管理也是通过两个方法来实现,用户可以直接进入退票环节,也可以从订单查询环节进入。订票相关信息由系统自动提供。 图5.32系统自动返回退票后的信息 5.2部分代码 5.2.1登陆窗 <%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %> <%@ include file="../../iframe/head.jsp" %> <% String message = (String)request.getAttribute("message"); if(message == null){ message = ""; } if (!message.trim().equals("")){ out.println(""); } request.removeAttribute("message"); String yzm=code.getCheckCode(); %>
Login.shtml?method=PAGEUSERLOGIN method=post > 26

欢迎登陆<%=sysList.get(0).toString() %>

用户名: >
密 码:
验证码: <%=yzm %>
找回密码 注册会员 28

<%@ include file="../../iframe/foot.jsp"%> 5.2.2主界面 <%List list2=tb.getAllTrain(); if(list2.size()!=0){ for(int i = 0; i 29 <%}}%>
序号 车辆路线 车次 开车时间 到站时间 坐位类型 票价 预定
<%=i+1 %> <%=list3.get(1).toString() %> <%=list3.get(2).toString() %> <%=list3.get(3).toString() %> <%=list3.get(4).toString() %> <%=list3.get(5).toString() %><%=list3.get(6).toString() %> 预定
5.2.3车次查询条件选择窗口
路线信息查询
请选择路线:
5.2.5搜索车次信息 public List getOneTrain(String id){ String sql = "select * from train where id='"+id+"' "; 30 DBO dbo=new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); while(rs.next()){ list.add(rs.getString(1)); list.add(rs.getString(2)); list.add(rs.getString(3)); list.add(rs.getString(4)); list.add(rs.getString(5)); list.add(rs.getString(6)); list.add(rs.getString(7)); list.add(rs.getString(8)); } return list; }catch(Exception e){ e.printStackTrace(); return null; }finally{ dbo.close(); } } 5.2.6订票信息查询 public List getOneTrain(String id){ String sql = "select * from train where id='"+id+"' "; DBO dbo=new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); while(rs.next()){ list.add(rs.getString(1)); list.add(rs.getString(2)); list.add(rs.getString(3)); list.add(rs.getString(4)); list.add(rs.getString(5)); list.add(rs.getString(6)); list.add(rs.getString(7)); list.add(rs.getString(8)); 31 } return list; }catch(Exception e){ e.printStackTrace(); return null; }finally{ dbo.close(); } } 5.2.7订票——用户信息 public int personReg(String username,String password,String type,String realname,String sex,String bir, String sheng,String city,String telphone,String email,String question,String answer,String lastip,int off){ password=MD5.MD5(password); String sql = "insert into member(username,password,type,regtime,ifuse,logintimes,lasttime,lastip)" + " values('"+username+"','"+password+"','"+type+"','"+date+"','"+off+"','0','"+date+"','" +lastip+"') "; DBO dbo = new DBO(); dbo.open(); try{ int i = dbo.executeUpdate(sql); if(i == 1){ rs = dbo.executeQuery("select id from member where username='"+username+"'"); rs.next(); int mid = rs.getInt(1); String sql2 = "insert into pmember(mid,realname,sex,bir,sheng,city,telphone,email,question,answer)" + "values('"+mid+"','"+realname+"','"+sex+"','"+bir+"','"+sheng+"','"+city+"','"+tel phone+"','"+email+"','"+question+"','"+answer+"') "; int j = dbo.executeUpdate(sql2); if(j == 1) return Constant.SUCCESS; else return Constant.SYSTEM_ERROR; } 32 else{ return Constant.SYSTEM_ERROR; } }catch(Exception e){ return Constant.SYSTEM_ERROR; }finally{ dbo.close(); } } //某个人会员资料 public List getRegInfo(String username){ String sql = "select * from pmember where mid=(select id from member where username='"+username+"') "; DBO dbo = new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); rs.next(); list.add(rs.getInt("mid"));//0 list.add(rs.getString("realname"));//1 list.add(rs.getString("sex"));//2 list.add(rs.getString("bir"));//3 list.add(rs.getString("sheng"));//4 list.add(rs.getString("city"));//5 list.add(rs.getString("telphone"));//6 list.add(rs.getString("email"));//7 list.add(rs.getString("question"));//8 list.add(rs.getString("answer"));//9 return list; }catch(Exception e){ e.printStackTrace(); return list; }finally{ dbo.close(); } } //个人会员修改资料 public int uppersonReg(String username,String realname,String sex,String bir,String sheng,String city,String telphone,String email,String question,String answer){ String sql = "select id from member where username='"+username+"'"; 33 DBO dbo = new DBO(); dbo.open(); try{ rs = dbo.executeQuery(sql); if(rs.next()){ int mid = rs.getInt(1); String sql2 = "update pmember set realname='"+realname+"',sex='"+sex+"',bir='"+bir+"',sheng='"+sheng+"',city='"+city+"', telphone='"+telphone+"'," + "email='"+email+"',question='"+question+"',answer='"+answer+"' where mid='"+mid+"' "; int i = dbo.executeUpdate(sql2); if(i == 1) return Constant.SUCCESS; else return Constant.SYSTEM_ERROR; } else{ return Constant.SYSTEM_ERROR; } }catch(Exception e){ return Constant.SYSTEM_ERROR; }finally{ dbo.close(); } } 5.2.8订票——订票信息 <%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/" ; String dir=sn.getDir(); %> 后台操作区 34 <% String message = (String)request.getAttribute("message"); if(message == null){ message = ""; } if (!message.trim().equals("")){ out.println(""); } request.removeAttribute("message"); %> <% String username=(String)session.getAttribute("user"); if(username==null){ response.sendRedirect(path+"/error.jsp"); } else{ List list2=tb.getAllPrep(); %> 35 <% if(list2.size()!=0){ for(int i = 0; i <%}}%>
序号 车辆路线 车次 开车时间 到站时间 车票类型 票价 数量付款情况 订票会员 订票时间 删除
<%=i+1 %> <%=list3.get(1).toString() %> <%=list3.get(2).toString() %> <%=list3.get(3).toString() %> <%=list3.get(4).toString() %> <%=list3.get(5).toString() %> <%=list3.get(6).toString() %> <%=list3.get(7).toString() %> <%=list3.get(8).toString() %> <%=list3.get(9).toString() %> <%=list3.get(10).toString() %> 删除
<%} %> 结束语 二十一世纪是一个高速、快捷的年代。在这个高速发展的年代里,速度成了我们追求的目标;二是提高工作效率;三是降低成本。因此,办公自动化的高速度、高效率、高便捷、低成本便成了我们的目的,为此开发了这个火车站网上订票系统。本系统可以大大简化退票、订票、查询等十分繁琐的工作,简化办公环节,提高工作效率,而且易学、易用,满足客户需求。 这次系统的设计从最开始的可行性研究,需求分析,到系统的总体设计,详细设计,再到编码、测试等的一个整体过程,使我真正明白了要做一个软件的难度,特别是要做一个真正可用的软件, 36 就更难了。在老师和同学的帮助下,我把以往所学的软件工程、数据库知识结合起来,利用JSP 开发工具,加上SQL Server2000数据库系统,完成了本次课程设计,尽量使它能满足各个方面的要求。当然,我的个人能力有限,还有很多不足的地方,敬请谅解。 在这次课程设计过程中我遇到了不少的难题,比如数据库操作问题,界面设计问题,函数使用与实现问题,消息处理问题等等。其中,最关键的是在最初对系统的需求分析做的不透彻,导致后续设计工作乃至编码时的修改工作量变大。以至于为了能按时完成设计任务,我一连度过了几个通宵。尤其,越接近结束,就越是时常出现问题。所以,通过这次课程设计我深刻体会到软件工程还是必须学精通点、学透彻点。 通过这次课程设计,我学会了如何对所学课程综合运用,巩固了软件工程的一般规范,对数据库的使用也有了更进一步了解。总体来说,课程设计让我学了不少知识。 我认为课程设计是我们学习生涯中相当重要的一课,除了验证学生的学习成果外,也是训练一个人独立思考及解决问题的能力.在这里,我要感谢指导老师和同学在这次课程设计中对我的帮助。 参考文献 [1]孙卫琴,李洪成.《Tomcat 与 Java Web 开发技术详解》.电子工业出版社,2003年6月:1-205 [2]BruceEckel.《Java编程思想》. 机械工业出版社,2003年10月:1-378 [3]FLANAGAN.《Java技术手册》. 中国电力出版社,2002年6月:1-465 [4]孙一林,彭波.《Java数据库编程实例》. 清华大学出版社,2002年8月:30-210 [5]Lee Anne Phillips.《巧学活用HTML4》.电子工业出版社,2004年8月:1-319 [6]飞思科技产品研发中心.《JSP应用开发详解》.电子工业出版社,2003年9月:32-300 [7]耿祥义,张跃平.《JSP实用教程》. 清华大学出版社,2003年5月1日:1-354 [8]孙涌.《现代软件工程》.北京希望电子出版社,2003年8月:1-246 [9]萨师煊,王珊.《数据库系统概论》.高等教育出版社,2002年2月:3,460 [10]Brown等.《JSP编程指南(第二版)》. 电子工业出版社 ,2003年3月:1-268 [11]清宏计算机工作室.《JSP编程技巧》. 机械工业出版社, 2004年5月:1-410 [12]朱红,司光亚.《JSP Web编程指南》.电子工业出版社, 2001年9月:34-307 [13]赛奎春.《JSP工程应用与项目实践》. 机械工业出版社, 2002年8月:23-294 37 毕业设计(论文) 火车站网上订票系统 38 摘要 针对火车站的订票实际情况,按照软件工程的结构化设计思想,本次课程设计经过项目的可行性研究和需求分析、总体设计、详细设计,以及编码实现和调试等步骤设计开发了火车站网上订票系统。并运用数据流图和数据字典、E-R图和数据库逻辑结构、层次图、系统流程图、以及程序流程图,对该系统的数据需求、数据库、系统软件结构、系统流程、以及处理过程等进行了分析和设计。 本次课程设计利用JSP 开发工具和SQL Server 2000数据库来开发这个火车站网上订票系统。该系统要解决的是火车站网上订票工作所要解决的问题,可以满足火车站网上订票的基本要求,包括查询、订票、退票等三个方面的功能。该系统能运用到火车站订票的工作中,根据用户的需求,设置其权限,并快捷方便的为用户提供服务。 I 目录 第一章 概述 ........................................................................ 4 1.1概述 ........................................................................ 4 1.2意义 ........................................................................ 4 1.3任务 ........................................................................ 4 第二章 系统的可行性研究与需求分析 ................................................... 4 2.1可行性研究 .................................................................. 4 2.1.1经济可行性 ............................................................ 5 2.1.2技术可行性 ............................................................ 5 2.1.3操作可行性 ............................................................ 5 2.2需求分析 .................................................................... 5 2.2.1功能需求 .............................................................. 5 2.2.2数据需求 .............................................................. 6 2.2.3性能需求 .............................................................. 6 2.2.4数据流图 .............................................................. 7 2.2.5数据字典 .............................................................. 7 2.2.6实体-联系图 ........................................................... 8 2.2.7数据库逻辑结构 ........................................................ 9 第三章 系统的总体设计 .............................................................. 10 3.1系统软件结构设计 ........................................................... 10 3.1.1软件结构 ............................................................. 10 3.1.2模块算法 ............................................................. 10 3.2系统流程图 ................................................................. 12 第四章 系统的详细设计 .............................................................. 13 4.1接口设计 ................................................................... 13 4.1.1用户接口 ............................................................. 13 4.1.2外部接口 ............................................................. 13 4.1.3内部接口 ............................................................. 13 4.1.4软件接口 ............................................................. 14 4.1.5模块内部 ............................................................. 14 4.2过程设计 ................................................................... 14 4.2.1程序流程图 ........................................................... 14 第五章 系统的实现与调试 ............................................................ 21 5.1应用系统的开发及测试 ....................................................... 21 5.1.1系统首页 ............................................................. 21 5.1.2产品说明 ............................................................. 22 5.1.3用户登录及访问权限 ................................................... 22 5.1.4车次信息查询 ......................................................... 24 5.1.5订票信息查询 ......................................................... 24 5.1.6订票 ................................................................. 24 5.1.7退票 ................................................................. 25 II 5.2部分代码 ................................................................... 25 5.2.1登陆界面 ............................................................. 25 5.2.2主界面 ............................................................... 25 5.2.3车次查询条件选择界面 ................................................. 29 5.2.4精确车次信息 ......................................................... 30 5.2.5搜索车次信息 ......................................................... 30 5.2.6订票信息查询 ......................................................... 30 5.2.7订票——用户信息 ..................................................... 31 5.2.8订票——订票信息 ..................................................... 32 5.2.9退票 ............................................... 错误~未定义书签。43 结束语 ............................................................................ 34 参考文献 .......................................................................... 37 III 第一章 概述 1.1概述 火车站售票的状况是仅靠手工操作,以现有的工作人员很难应付车票订购高峰时刻目前 的大量数据处理问题。同时还会出现由此带来的大量记录存放和管理所带来的问题。本次设计拟开发一个火车站网上订票系统,可以降低工作人员的工作量,提高工作人员的工作效率,同时方便顾客订票。 1.2意义 火车站市场的管理和规范问题,是困扰我们多年的一个老问题,也是政府管理中的一个难点,订票是客运业务中的一个最基本的业务,表面上看,它只是火车站业务的一个简单的部分,但是它涉及到管理与客户服务等多方面,因此,过去传统的售票方式已经不能满足现代客运业务流量剧增的客观要求,这就要求一种全新的订票方式——网上订票,来缓解订票高峰时期的客运压力,并为用户提供方便快捷的订票服务。本次设计便是利用开发工具JSP 和SQL Server 2000数据库共同开发的一个火车站网上订票系统,它能方便快捷地运用在火车站订票业务的营运之中。 1.3任务 本系统设计主要是根据订票业务的基本流程进行的,系统功能包括如下几个方面: 查询:分为对车次信息的查询和客户对已订车票信息的查询 订票:通过查询系统,客户根据自己的需求找到满意的车次,再输入个人信息后直接通过网上订票确定已预订选中的车票。 退票:可退票,通过查询系统,客户可以根据自己的名字找到自己的订票信息,通过退票模块退去已购车票。 第二章 系统的可行性研究与需求分析 2.1可行性研究 该阶段通过对系统目标的初步调研和分析,提出可行性方案并进行论证。我们在这里主 4 要从技术可行性、经济可行性和操作可行性三方面进行分析。 2.1.1经济可行性 开发该系统所需的相关资料可以通过已存在的网上订票系统进行调查采集,所需的其他应用软件、硬件系统也易于获得.因此,开发成本较低。而引进使用本系统后,与传统方式相比,具有高效率、低成本、高质量的特点,可以节省不少人力、物力及财力。所以,从经济的角度来看,该系统可行。 2.1.2技术可行性 开发工具:JSP 数据库环境:SQL Server 2000 系统环境:Microsoft Windows 2000或以上版本。 系统实现依靠相对熟悉的JSP语言和SQL Server2000数据库系统,其基本操作实质还是对数据库进行添加、删除、查找等操作,暂不存在技术问题。 2.1.3操作可行性 系统采用菜单式,实现用户与数据库的交互,界面简洁友好,操作方便。用户只需对订票流程和业务调查了解即可,不需掌握数据库等相关知识。 2.2需求分析 需求分析是软件设计的一个重要的环节。本阶段对订票系统的应用情况作全面调查,以确定系统目标,并对系统所需要的基础数据以及数据处理要求进行分析,从而确定用户的需求。用户对系统的需求我们从以下几方面进行分析。 2.2.1功能需求 本网上订票系统应该具备如下功能: 1.查询 分为对车次信息的查询和客户对已订车票信息的查询。要求: 1)对车次的查询,可以按照发车车次进行查询; 2)车次信息包括:车号、出发地、目的地、发车日期、开出时刻、票价。 3)座位类型设定。 4)车次信息只允许用户查询,不能修改。 2.订票 通过查询系统,客户根据自己的需求找到满意的车次,再输入个人信息后直接通过网上 5 订票确定已预订选中的车票。要求: 订票记录应包括:会员名、车号、发车日期、订购日期、订购票数、总价。 .退票 3 可退票,通过查询系统,客户可以根据自己的名字找到自己的订票信息,通过退票模块退去已购车票。 2.2.2数据需求 信息需求,即在系统中需要处理哪些数据。根据对火车站网上订票系统的分析,本系统的信息需求如表2-1所示。 表2-1信息输入输出 信息输入 信息处理 信息输出 用户输入所需车次 检索系统数据库 符合用户需求的车次及相关 信息 用户输入个人信息及所需订 更新系统中的订票信息, 操作反馈(如订票成功) 购的车票信息 将新信息存入系统数据库 用户输入自己的名字、身份 检索系统数据库 符合用户需求的订票信息 证号;或交易的订单号 用户输入自己的名字 检索系统数据库以得到订票 操作反馈(如退票成功等) 记录,删除用户请求的订票 记录,更新系统数据库 2.2.3性能需求 为了保证系统能够长期、安全、稳定、可靠、高效的运行,本系统应该满足以下的性能需求。 1.准确性和及时性 系统处理的准确性和及时性是系统的必要性能。系统应能及时而且准确的根据用户权限及所输入的信息做出响应。由于本系统的查询功能对于整个系统的功能和性能完成举足轻重。作为系统的很多数据来源,而车票的数量和时间又影响用户的决策活动,其准确性和及时性很大程度上决定了系统的成败。在系统开发过程中,必须采用一定的方法保证系统的准确性和及时性。 6 2.易用性 本系统是直接面对用户的,而用户往往对计算机并不是非常熟悉。这就要求系统能够提供良好的用户接口,易用的人机交互界面。要实现这一点,就要求系统应该尽量使用用户熟悉的术语和中文信息的界面,从而保证系统的易用性。 3.安全性 网上订票系统中涉及到的数据是客运公司相当重要的信息,系统要保证用户的权限,对于车次等信息用户只享有查询服务,不得更改;系统还要提供方便的手段供系统维护人员进行数据备份、日常安全管理、以及系统意外崩溃时数据的恢复等工作。同时系统还要保证对数据库进行及时更新,保证数据一致性。 2.2.4数据流图 车次信息 用 车次 反 用 事务 事务 事务 事务 更新 信息 订 接收 接收 更新 数据 馈 户 户 票 事务 事务 数据 库 库 用户信息 订单信息 用户信息 订单信息 接收事务 事务 事务 接收事务 事务 用 反馈 事务 事务 事务 更新 接收事务 户 退票 查询订单 数据 库 事务 反馈 用 事务 更新数据库 修改订单 户 图2.1数据流图 2.2.5数据字典 表2-2 车次信息数据字典 名字:车次信息 别名: 7 描述:存放车次信息的文件,以供用户查询 定义:车次信息=车号+出发地+目的地+发车日期+开出时刻+到达时刻+ 坐位类型 +票价 位置:输出到CRT终端或类似的显示部件 表2-3订票信息数据字典 名字:订票信息 别名:订单信息 描述:存放订单信息的文件,以供用户查询,并作相应操作 定义:订票记录=用户名+车号+发车日期+订购日期+订购票数+总价 位置:输出到CRT终端或类似的显示部件 表2-4用户信息数据字典 名字:用户信息 别名: 描述:存放用户信息的文件,以供用户方便的查询订单信息,进而做出相应的操 作 定义:用户信息=用户名+地址+性别+电话 位置:输出到CRT终端或类似的显示部件 2.2.6实体-联系图 用户的需求具体体现在各种信息的提供、保存、更新和查询,这就要求数据库结构能充分满足各种信息的输出和输入。 针对火车站网上订票系统,通过对网上订票工作的过程、内容以及数据流程分析,设计如下所示的数据项和数据结构: 1.车次信息包括:车号、出发地、目的地、发车日期、开出时刻、剩余座位数、票价。 2.订票记录包括:订单号、身份证号、车号、订购日期、订购票数、总价。 3.用户信息包括:用户名、身份证号、性别、电话。 E-R图如图2.2所示。 用户名 性别 地址 电话 车用 户 次 m 1 1 退票 查询 订票 票坐位 n n 价 n 类型 8 车次 订票信息 总价 订单号 开出 目的地 车号 发车日期 时刻 订购票数 图2.2实体-联系图(E-R图) 2.2.7数据库逻辑结构 火车站网上订票系统数据库中各个表格的设计结果如表2-5——表2-7所示。每个表格 表示在数据库中的一个表。 表2-5车次信息表BusInfo 字段名 数据类型 是否可空 说明 BusID char(10) NOT NULL 车号(主键) BusFrom varchar(50) NOT NULL 出发地 BusTo varchar(50) NOT NULL 目的地 BusDate Datetime NOT NULL 发车日期(主键) BusBegin Datetime NOT NULL 开出时刻 BusEnd Datetime NOT NULL 到达时刻 TicketNum int NOT NULL 剩余票数 Price Money NOT NULL 票价 表2-6订单表OrderInfo 字段名 数据类型 是否可空 说明 OrderID Char(10) NOT NULL 订单号(主键) UserID Char(18) NOT NULL 身份证号(外键) BusID char(10) NOT NULL 车号(外键) BusDate datetime NOT NULL 发车日期(外键) OrderDate datetime NOT NULL 订购日期 OrderNum Int NOT NULL 订购票数 Total Money NOT NULL 总价 表2-7用户表User 字段名 数据类型 是否可空 说明 UserID char(18) NOT NULL 身份证号(主键) User varchar(50) NOT NULL 用户名 Sex Char(2) 性别 Phone varchar(12) 电话 9 第三章 系统的总体设计 3.1系统软件结构设计 3.1.1软件结构 本火车站网上订票系统可划分为信息查询、网上订票、取消订票三个部分。其中信息查 询又可分为车次查询和订单查询两个部分。其层次图如图3.1所示。 火车票网上订票系统 网上订票 信息查询 取消订票 车次查询 订票查询 图3.1火车站网上订票系统的层次图 3.1.2模块算法 1.各级别算法 1)界面级算法 处理输入信息,产生相应任务。 输入数据 信息反馈 客户端校验数据 信息加工 产生任务 数据 图3.2界面级算法示意图 2)数据库级算法 执行相应数据库操作,并直接返回信息反馈。 10 任务数据校验,调用相关模块功能 用户界面级模块 底层数据库操作(封装) 图3.3数据库级算法示意图 3)任务级算法 执行所需功能,满足用户需求。 生成数据请求 数据处理 任务触发 并记录 并反馈 权限校验 失败 界面显示 图3.4任务级算法示意图 2.调用关系 1)界面模块调用任务模块 2)任务模块调用数据模块 3)数据模块调用界面模块显示 3.2系统流程图 系统顶层流程图如下图3.5所示。图3.6——图3.9为各模块详细系统流程 图。 11 事务 查询程序 订票程序 退票程序 系统数据库 火车站网上订票系统 相应信息 操作反馈 图3.5顶层系统流程 输入所符合用户 事务 查询程序 需车次需求的车 次信息 的重要 信息 系统数据库 图3.6车次信息查询系统流程图 符合用户 输入查 需求的订 事务 查询程序 询条件 票信息 系统数据库 图3.7订单信息查询系统流程图 输入订 操作反馈 订票程序 事务 票信息 系统数据库 图3.8订票系统流程图 12 输入退 操作反馈 事务 退票程序 票信息 系统数据库 图3.9退票系统流程图 第四章 系统的详细设计 4.1接口设计 4.1.1用户接口 用户通过界面接口实现参数的输入,进入相应的界面后输入提示的信息即可产生相应的任务。 4.1.2外部接口 接口通过一个数据转换器,将网络二进制数据流转换为一个合适的数据结构单位并添加到缓冲区中。 4.1.3内部接口 表4-1内部接口说明表 顶层模块 二级模块 接口 数据模块 底层数据操作模块 取出记录集,执行SQL语句 用户操作模块 对应数据库相关表操作 界面模块 界面模块 生成任务 缓冲区模块 生成批处理 4.1.4软件接口 本系统程序所使用的数据库来源于主机数据库,所以系统数据与主机数据库数据向一致。 4.1.5模块内部 模块以接受参数方式独立登陆主机数据库并且独立运行,返回数据包显示在界面上。 13 4.2过程设计 4.2.1程序流程图 本系统主界面为用户设计了三个功能操作以供选择:查询,订票,退票。另外,为方便用户,还将“退出系统”也单另列了出来,用户可以根据需要触发不同事件。其处理流程如图4.1所示。图4.2——图4.6反映了不同触发事件具体的处理流程。 1.系统用户权限的系统主处理流程 开始 登录框 登录,确定访问权限 主界面 N 选择订 票窗口 选择查询 N 窗口 Y Y 选择退 N 查询 票窗口 界面 订票 界面 Y 退票 查询 查询 界面 车次 订票 信息 信息 Y Y 订票 退票 退票 订票 N 14 N 退出 Y 图4.1系统用户权限的系统主程序流程图 2.新用户权限的系统主处理流程 开始 登录框 登录,确定访问权限 主界面 N 选择订 票窗口 选择查询 N 窗口 Y Y 查询 订票 界面 界面 查询 车次 信息 Y 订票 订票 15 退出 N Y 图4.2新用户权限的系统主程序流程图 3.车次信息查询处理流程 16 开始 查询 界面 N 查询车次信息 Y 用户输入要 查询条件 N 查询 Y 返回主页 读数据文件 输出查询结果 N 关闭窗口 Y 继续查询 车次信息 N 订票 Y Y N 订票 界面 订票 结束 图4.3车次信息查询程序流程图 4.订票处理流程 开始 17 订票 界面 图4.4订票程序流程图 5.订票信息查询处理流程 18 开始 查询 界面 查询订 N 票信息 Y 读数据文件 返回主页 Y 输出查询结果 主界面 N 关闭窗口 N 退票 Y 继续查询 Y Y 订票信息 退票 N 界面 退票 结束 图4.5订票信息查询模块程序流程图 6.退票模块处理流程 开始 19 退票 界面 修改数据文件 图4.6退票模块程序流程图 20 第五章 系统的实现与调试 5.1应用系统的开发及测试 5.1.1系统首页 图5.1系统首页 21 5.1.2产品说明 图5.2产品说明 5.1.3用户登录及访问权限 本系统设计要求用户通过登录框选择访问权限,登录系统。其中,用户须输入用户名和密码,以进入系统。未使用过本系统的用户选择注册会员,系统自动跳转至主界面。系统用户权限登录访问时,车次信息查询、订票信息查询、订票、退票等功能均可用。系统用户输入正确的用户名和密码,访问系统,得到其相应的权限。如图5.3-5.4。 22 图5.3登录框 系统用户输入错误的用户名或身份证号,系统拒绝其访问。如图5.5。 图5.5 出错提示 新用户在登录窗口选择“注册”单选钮,系统自动跳转到注册页面,并控制其访问权限,如图5.6所示。 图5.6新用户权限登录主窗体 5.1.4车次信息查询 对车次信息的查询,系统提供了车次信息,进行精确的查询,系统经过检索,返回符合 23 用户要求的车次,再由用户自行选择满意的车次。图5.7选择查询条件。 图5.7车次查询条件框 5.1.5订票信息查询 对于订票信息的查询,本系统只提供一种查询方式。由于用户在登录时已选择了访问权限,且输入了身份证号等确认具体身份的重要信息。故用户可以通过菜单选项直接查询自己的订票信息。该信息由系统自动返回,简便、快捷。 图5.16订票 5.1.6订票 系统用户可以通过两种方式进入到订票环节。一是在主界面的菜单选项中,直接选择“订票”服务,二是用户可以由车次查询界面,点击“订票”命令,直接跳转订票界面。新用户在填写订票信息之前,必须填写用户信息,以保证下次访问系统时的系统权限不受限制。订票信息中的订单号由系统提供。如果用户是从车次查询界面跳转至订票界面的,在填写订票信息时,车次的相关信息由系统自动提供。用户只需输入订票数,点击“下一步”完成订票交易。交易成功后,系统会弹出提示框,示意用户订票操作已成功。 新用户通过菜单,直接进入订票程序,如图5.18所示。首先点击新增,激活操作,填写用户信息。如图5.19所示。 24 图5.18订票信息界面 5.1.7退票 系统进入退票管理也是通过两个方法来实现,用户可以直接进入退票环节,也可以从订单查询环节进入。订票相关信息由系统自动提供。 图5.32系统自动返回退票后的信息 5.2部分代码 5.2.1登陆窗 <%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %> <%@ include file="../../iframe/head.jsp" %> <% String message = (String)request.getAttribute("message"); if(message == null){ message = ""; } if (!message.trim().equals("")){ out.println(""); } request.removeAttribute("message"); String yzm=code.getCheckCode(); %>
Login.shtml?method=PAGEUSERLOGIN method=post >

欢迎登陆<%=sysList.get(0).toString() %>

用户名: >
密 码:
27
验证码: <%=yzm %>
找回密码 注册会员

<%@ include file="../../iframe/foot.jsp"%> 5.2.2主界面 <%List list2=tb.getAllTrain(); if(list2.size()!=0){ for(int i = 0; i <%}}%>
序号 车辆路线 车次 开车时间 到站时间 坐位类型 票价 预定
<%=i+1 %> <%=list3.get(1).toString() %> <%=list3.get(2).toString() %> <%=list3.get(3).toString() %> <%=list3.get(4).toString() %> <%=list3.get(5).toString() %> <%=list3.get(6).toString() %> 预定
29 5.2.3车次查询条件选择窗口
路线信息查询
请选择路线:
5.2.5搜索车次信息 public List getOneTrain(String id){ String sql = "select * from train where id='"+id+"' "; DBO dbo=new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); while(rs.next()){ list.add(rs.getString(1)); list.add(rs.getString(2)); list.add(rs.getString(3)); list.add(rs.getString(4)); 30 list.add(rs.getString(5)); list.add(rs.getString(6)); list.add(rs.getString(7)); list.add(rs.getString(8)); } return list; }catch(Exception e){ e.printStackTrace(); return null; }finally{ dbo.close(); } } 5.2.6订票信息查询 public List getOneTrain(String id){ String sql = "select * from train where id='"+id+"' "; DBO dbo=new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); while(rs.next()){ list.add(rs.getString(1)); list.add(rs.getString(2)); list.add(rs.getString(3)); list.add(rs.getString(4)); list.add(rs.getString(5)); list.add(rs.getString(6)); list.add(rs.getString(7)); list.add(rs.getString(8)); } return list; }catch(Exception e){ e.printStackTrace(); return null; }finally{ dbo.close(); } } 31 5.2.7订票——用户信息 public int personReg(String username,String password,String type,String realname,String sex,String bir, String sheng,String city,String telphone,String email,String question,String answer,String lastip,int off){ password=MD5.MD5(password); String sql = "insert into member(username,password,type,regtime,ifuse,logintimes,lasttime,lastip)" + " values('"+username+"','"+password+"','"+type+"','"+date+"','"+off+"','0','"+dat e+"','"+lastip+"') "; DBO dbo = new DBO(); dbo.open(); try{ int i = dbo.executeUpdate(sql); if(i == 1){ rs = dbo.executeQuery("select id from member where username='"+username+"'"); rs.next(); int mid = rs.getInt(1); String sql2 = "insert into pmember(mid,realname,sex,bir,sheng,city,telphone,email,question,answer)" + "values('"+mid+"','"+realname+"','"+sex+"','"+bir+"','"+sheng+"','"+city+"' ,'"+telphone+"','"+email+"','"+question+"','"+answer+"') "; int j = dbo.executeUpdate(sql2); if(j == 1) return Constant.SUCCESS; else return Constant.SYSTEM_ERROR; } else{ return Constant.SYSTEM_ERROR; } }catch(Exception e){ return Constant.SYSTEM_ERROR; }finally{ dbo.close(); } } //某个人会员资料 public List getRegInfo(String username){ 32 String sql = "select * from pmember where mid=(select id from member where username='"+username+"') "; DBO dbo = new DBO(); list = new ArrayList(); dbo.open(); try{ rs = dbo.executeQuery(sql); rs.next(); list.add(rs.getInt("mid"));//0 list.add(rs.getString("realname"));//1 list.add(rs.getString("sex"));//2 list.add(rs.getString("bir"));//3 list.add(rs.getString("sheng"));//4 list.add(rs.getString("city"));//5 list.add(rs.getString("telphone"));//6 list.add(rs.getString("email"));//7 list.add(rs.getString("question"));//8 list.add(rs.getString("answer"));//9 return list; }catch(Exception e){ e.printStackTrace(); return list; }finally{ dbo.close(); } } //个人会员修改资料 public int uppersonReg(String username,String realname,String sex,String bir,String sheng,String city,String telphone,String email,String question,String answer){ String sql = "select id from member where username='"+username+"'"; DBO dbo = new DBO(); dbo.open(); try{ rs = dbo.executeQuery(sql); if(rs.next()){ int mid = rs.getInt(1); String sql2 = "update pmember set realname='"+realname+"',sex='"+sex+"',bir='"+bir+"',sheng='"+sheng+"',city='"+c ity+"',telphone='"+telphone+"'," + "email='"+email+"',question='"+question+"',answer='"+answer+"' where mid='"+mid+"' "; int i = dbo.executeUpdate(sql2); 33 if(i == 1) return Constant.SUCCESS; else return Constant.SYSTEM_ERROR; } else{ return Constant.SYSTEM_ERROR; } }catch(Exception e){ return Constant.SYSTEM_ERROR; }finally{ dbo.close(); } } 5.2.8订票——订票信息 <%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+p ath+"/"; String dir=sn.getDir(); %> 后台操作区 <% 34 String message = (String)request.getAttribute("message"); if(message == null){ message = ""; } if (!message.trim().equals("")){ out.println(""); } request.removeAttribute("message"); %> <% String username=(String)session.getAttribute("user"); if(username==null){ response.sendRedirect(path+"/error.jsp"); } else{ List list2=tb.getAllPrep(); %> <% if(list2.size()!=0){ for(int i = 0; i 35 <%}}%>
序号 车辆路线 车次 开车时间 到站时间 车票类型 票价 数量 付款情况 订票会员 订票时间 删除
<%=i+1 %><%=list3.get(1).toString() %> <%=list3.get(2).toString() %> <%=list3.get(3).toString() %> <%=list3.get(4).toString() %> <%=list3.get(5).toString() %> <%=list3.get(6).toString() %> <%=list3.get(7).toString() %> <%=list3.get(8).toString() %> <%=list3.get(9).toString() %> <%=list3.get(10).toString() %> 删除
<%} %> 结束语 二十一世纪是一个高速、快捷的年代。在这个高速发展的年代里,速度成了我们追求的目标;二是提高工作效率;三是降低成本。因此,办公自动化的高速度、高效率、高便捷、低成本便成了我们的目的,为此开发了这个火车站网上订票系统。本系统可以大大简化退票、订票、查询等十分繁琐的工作,简化办公环节,提高工作效率,而且易学、易用,满足客户需求。 这次系统的设计从最开始的可行性研究,需求分析,到系统的总体设计,详细设计,再到编码、测试等的一个整体过程,使我真正明白了要做一个软件的难度,特别是要做一个真正可用的软件,就更难了。在老师和同学的帮助下,我把以往所学的软件工程、数据库知识结合起来,利用JSP 开发工具,加上SQL Server2000数据库系统,完成了本次课程设计,尽量使它能满足各个方面的要求。当然,我的个人能力有限,还有很多不足的地方,敬请谅解。 在这次课程设计过程中我遇到了不少的难题,比如数据库操作问题,界面设计问题,函数使用与实现问题,消息处理问题等等。其中,最关键的是在最初对系统的需求分析做的不透彻,导致后续设计工作乃至编码时的修改工作量变大。以至于为了能按时完成设计任务,我一连度过了几个通宵。尤其,越接近结束,就越是时常出现问题。所以,通过这次课程设 36 计我深刻体会到软件工程还是必须学精通点、学透彻点。 通过这次课程设计,我学会了如何对所学课程综合运用,巩固了软件工程的一般规范,对数据库的使用也有了更进一步了解。总体来说,课程设计让我学了不少知识。 我认为课程设计是我们学习生涯中相当重要的一课,除了验证学生的学习成果外,也是训练一个人独立思考及解决问题的能力.在这里,我要感谢指导老师和同学在这次课程设计中对我的帮助。 参考文献 [1]孙卫琴,李洪成.《Tomcat 与 Java Web 开发技术详解》.电子工业出版社,2003年6月:1-205 [2]BruceEckel.《Java编程思想》. 机械工业出版社,2003年10月:1-378 [3]FLANAGAN.《Java技术手册》. 中国电力出版社,2002年6月:1-465 [4]孙一林,彭波.《Java数据库编程实例》. 清华大学出版社,2002年8月:30-210 [5]Lee Anne Phillips.《巧学活用HTML4》.电子工业出版社,2004年8月:1-319 [6]飞思科技产品研发中心.《JSP应用开发详解》.电子工业出版社,2003年9月:32-300 [7]耿祥义,张跃平.《JSP实用教程》. 清华大学出版社,2003年5月1日:1-354 [8]孙涌.《现代软件工程》.北京希望电子出版社,2003年8月:1-246 [9]萨师煊,王珊.《数据库系统概论》.高等教育出版社,2002年2月:3,460 [10]Brown等.《JSP编程指南(第二版)》. 电子工业出版社 ,2003年3月:1-268 [11]清宏计算机工作室.《JSP编程技巧》. 机械工业出版社, 2004年5月:1-410 [12]朱红,司光亚.《JSP Web编程指南》.电子工业出版社, 2001年9月:34-307 [13]赛奎春.《JSP工程应用与项目实践》. 机械工业出版社, 2002年8月:23-294 37 They both knew it. And if she hadn't won an ecology essay competition and a prize of places for two aboard Sea Shepherd, neither of them would be here. She rested her hand on Gary's shoulder and looked at him cheekily. "You may be a pain in the neck sometimes, but I'm glad you're coming with me." As Southampton slid astern, Sea Shepherd nosed into the thumping waters of the English Channel. At that moment the sun squinted through a crack in the cloud. On the horizon the sky's grey paint was peeling, revealing blue. A good omen? Gary followed Susan down the companionway. "See you at dinner," he said, before entering the cabin he shared with Norman. As one of the girls, Susan had Vanessa for a room-mate. Next door were Yves and Darren. Susan hesitated outside her cabin, fiddled with her cardigan, ran a comb through her hair. Then, head held high, she made her entrance. Vanessa wasn't there. Susan relaxed, smiling at herself. The smile faded fast. She's taken the bottom bunk! I was here first. Susan stared, glared at the fancy nightdress laid out on the pillow. Did she have the nerve to move it? No, not quite. Fuming, she started to unpack. Sweaters, T-shirts, jeans, shorts and a dress. She yanked open the wardrobe door. A row of eye-catching outfits hung neatly on hangers. "It's like a fashion store," Susan muttered, shoving the hangers aside to make space for her own clothes. In the bathroom she opened the mirror-fronted cabinet on the wall. It was crammed with bottles and jars. Perfume, shampoo, creams ... Susan slammed the cabinet shut and pulled a face in the glass. Meanwhile Gary was trying to make friends with Norman. Hard work. Norman proved to be a very serious young man, much given to using long words. Must've swallowed a dictionary, Gary thought. But he kept up the conversation. Then the studious teenager produced a pack of cards and proceeded to do a series of conjuring tricks that made Glly could almost smell his breath-mustard gas and roses. It was a wrong number. Billy hung up. There was a soft drink bottle on the windowsill. Its label boasted that it contained no nourishment whatsoever. The American fliers turned in their uniforms, became high school kids. And Hitler turned into a baby, Billy Pilgrim supposed. That wasn't in the movie. Billy was extrapolating. Everybody turned into a baby, and all humanity, without exception, conspired biologically to produce two perfect people named Adam and Eve, he supposed. Billy saw the war movies backwards then forwards-and then it was time to go out into his backyard to meet the flying saucer. Out he went, his blue and ivory feet crushing the wet salad of the lawn. He stopped, took a swig, of the dead champagne. It was like 7-Up. He would not raise his eyes to the sky, though he knew there was a flying saucer from Tralfamadore up there. He would see it soon enough, inside and out, and he would see, too, where it came from soon enough-soon enough. Overhead he heard the cry of what might have been a melodious owl, but it wasn't a melodious owl. It was a flying saucer from Tralfamadore, navigating in both space and time, therefore seeming to Billy Pilgrim to have come from nowhere all at once. Somewhere a big dog barked. The saucer was one hundred feet in diameter, with portholes around its rim. The light from the portholes was a pulsing purple. The only noise it made was the owl song. It ca-me down to hover over Billy, and to enclose him in a cylinder of pulsing in purple light. Now there was the sound of a seeming kiss as an airtight hatch in the bottom of the saucer was opened. Down snaked a ladder that was outlined in pretty lights like a Ferris wheel. Billy's will was paralyzed by a zap gun aimed at him from one of the portholes. It became imperative that he take hold of the bottom rung of the sinuous ladder, which he did. The rung was electrified, so that Billy's hands locked onto it hard. He was hauled into the airlock, and machinery closed the bottom door. Only then did the ladder, wound onto a reel in the airlock, let him go. Only then did Billy's brain start working again. There were two peepholes inside the airlock-with yellow eyes pressed to them. There was a speaker on the wall. The Tralfamadorians had no voice boxes. They communicated telepathicary. They were able to talk to Billy by means of a computer and a sort of electric organ which made every Earthling speech sound. 'Welcome aboard, Mr. Pilgrim,' said the loudspeaker. 'Any questions?' Billy licked his lips, thought a while, inquired at last: 'Why me? ' That is a very Earthling question to ask, Mr. Pilgrim. Why you? Why us for that matter? Why anything? Because this moment simply is. Have you ever seen bugs trapped in amber?' 'Yes.' Billy in fact, had a paperweight in his office which was a blob of polished amber with three ladybugs embedded in it. 38 'Well, here we are, Mr. Pilgrim, trapped in the amber of this moment. There is no why.' They introduced an anesthetic into Billy's atmosphere now, put him to sleep. They carded him to a cabin where he was strapped to a yellow Barca-Lounger which they had stolen from a Sears & Roebuck warehouse. The hold of the saucer was crammed with other stolen merchandise, which would be used to furnish Billy's artificial habitat in a zoo on Tralfamadore. The terrific acceleration of the saucer as it left Earth twisted Billy's slumbering body, distorted his face, dislodged him m time, sent him back to the war. When he regained consciousness, he wasn't on the flying saucer. He was in a boxcar crossing Germany again. Some people were rising from the floor of the car, and others were lying down. Billy planned to He down, too. It would be lovely to sleep. It was black in the car, and black outside the car, which seemed to be about two miles an hour. The car never seemed to go any faster than that. It was a long time between clicks, between joints in the track. There would be a click, and then a year would go by, and then there would be another click The train often stopped to let really important trains bawl and hurtle by. Another thing it did was stop on sidings near prisons, leaving a few cars there. It was creeping across all of Germany, growing shorter all the time. And Billy let himself down oh so gradually now, hanging onto the diagonal cross-brace in the comer in order to make himself seem nearly weightless to those he was joining on the floor. He knew it was important that he made himself nearly ghostlike when lying down. He had forgotten why, but a reminder soon came. 'Pilgrim,' said a person he was about to nestle with, 'is that you?' Billy didn't say anything, but nestled very politely, closed his eyes. 'God damn it' said the person. 'That is you, isn't it?' He sat up and explored Billy rudely with his hands. 'It's you, all right. Get the hell out of here.' Now Billy sat up, too-wretched, close to tears. 'Get out of here! I want to sleep!' 'Shut up,' said somebody else. 'I'll shut up when Pilgrim gets away from here.' So Billy stood up again, clung to the cross-brace. 'Where can I sleep?' he asked quietly. 'Not with me.' 'Not with me, you son of a bitch,' said somebody else. 'You yell. You kick.' 'I do?' "You're God damn right you do. And whimper.' 'I do?' 'Keep the hell away from here., Pilgrim.' And now there was an acrimonious madrigal, with parts sung in all quarters of the car. Nearly everybody seemingly, had an atrocity story of something Billy Pilgrim had done to him in his sleep. Everybody told Billy Pilgrim to keep the hell away. So Billy Pilgrim had to sleep standing up, or not sleep at all. And food had stopped coming in through the ventilators, and the days and nights were colder all the time. On the eighth day, the forty-year-old hobo said to Billy, 'This ain't bad. I can be comfortable anywhere.' 'You can?' said Billy. On the ninth day, the hobo died. So it goes. His last words were, 'You think this is bad? This ain't bad.' There was something about death and the ninth day. There was a death on the ninth day in the car ahead of Billy's too. Roland Weary died-of gangrene that had started in his mangled feet. So it goes. Weary, in his nearly continuous delirium, told again and again of the Three Musketeers, acknowledged that he was dying, gave many messages to be delivered to his family in Pittsburgh. Above all, he wanted to be avenged, so he said again and again the name of the person who had killed him. Everyone on the car learned the lesson well. very morning, and polish up the old-fashioned spoons, the fat silver teapot, and the glasses till they shone. Then she must dust the room, and what a trying job that was. Not a speck escaped Aunt March's eye, and all the furniture had claw legs and much carving, which was never dusted to suit. Then Polly had to be fed, the lap dog combed, and a dozen trips upstairs and down to get things or deliver orders, for the old lady was very lame and seldom left her big chair. After these tiresome labors, she must do her lessons, which was a daily trial of every virtue she possessed. Then she was allowed one hour for exercise or play, and didn't she enjoy it? Laurie came every day, and wheedled Aunt March till Amy was allowed to go out with him, when they walked and rode and had capital times. After dinner, she had to read aloud, and sit still while the old lady slept, which she usually did for an hour, as she dropped off over the first page. Then patchwork or towels appeared, and Amy sewed with outward meekness and inward rebellion till dusk, when she was allowed to amuse herself as she liked till teatime. The evenings were the worst of all, for Aunt March fell to telling long stories about her youth, which were so unutterably dull that Amy was always ready to 39 go to be, intending to cry over her hard fate, but usually going to sleep before she had squeezed out more than a tear or two. If it had not been for Laurie, and old Esther, the maid, she felt that she never could have got through that dreadful time. The parrot alone was enough to drive her distracted, for he soon felt that she did not admire him, and revenged himself by being as mischievous as possible. He pulled her hair whenever she came near him, upset his bread and milk to plague her when she had newly cleaned his cage, made Mop bark by pecking at him while Madam dozed, called her names before company, and behaved in all respects like an reprehensible old bird. Then she could not endure the dog, a fat, cross beast who snarled and yelped at her when she made his toilet, and who lay on his back with all his legs in the air and a most idiotic expression of countenance when he wanted something to eat, which was about a dozen times a day. The cook was bad-tempered, the old coachman was deaf, and Esther the only one who ever took any notice of the young lady. Esther was a Frenchwoman, who had lived with`Madame', as she called her mistress, for many years, and who rather tyrannized over the old lady, who could not get along without her. Her real name was Estelle, but Aunt March ordered her to change it, and she obeyed, on condition that she was never asked to change her religion. She took a fancy to Mademoiselle, and amused her very much with odd stories of her life in France, when Amy sat with her while she got up Madam's laces. She also allowed her to roam about the great house, and examine the curious and pretty things stored away in the big wardrobes and the ancient chests, for Aunt March hoarded like a magpie. Amy's chief delight was an Indian cabinet, full of queer drawers, little pigeonholes, and secret places, in which were kept all sorts of ornaments, some precious, some merely curious, all more or less antique. To examine and arrange these things gave Amy great satisfaction, especially the jewel cases, in which on velvet cushions reposed the ornaments which had adorned a belle forty years ago. There was the garnet set which Aunt March wore when she came out, the pearls her father gave her on her wedding day, her lover's diamonds, the jet mourning rings and pins, the queer lockets, with portraits of dead friends and weeping willows made of hair inside, the baby bracelets her one little daughter had worn, Uncle March's big watch, with the red seal so many childish hands had played with, and in a box all by itself lay Aunt March's wedding ring, too small now for her fat finger, but put carefully away like the most precious jewel of them all. "Which would Mademoiselle choose if she had her will?" asked Esther, wo always sat near to watch over and lock up the valuables. "I like the diamonds best, but there is no necklace among them, and I'm fond of necklaces, they are so becoming. I should choose this if I might," replied Amy, looking with great admiration at a string of gold and ebony beads from which hung a heavy cross of the same. "I, too, covet that, but not as a necklace. Ah, no! To me it is a rosary, and as such I should use it like a good catholic," said Esther, eyeing the handsome thing wistfully. "Is it meant to use as you use the string of good-smelling wooden beads hanging over your glass?" asked Amy. "Truly, yes, to pray with. It would be pleasing to the saints if one used so fine a rosary as this, instead of wearing it as a vain bijou." "You seem to take a great deal of comfort in your prayers, Esther, and always come down looking quiet and satisfied. I wish I could." "If Mademoiselle was a Catholic, she would find true comfort, but as that is not to be, it would be well if you went apart each day to meditate and pray, as did the good mistress whom I served before Madame. She had a little chapel, and in it found solacement for much trouble." "Would it be right for me to do so too?" asked Amy, who in her loneliness felt the need of help of some sort, and found that she was apt to forget her little book, now that Beth was not there to remind her of it. "It would be excellent and charming, and I shall gladly arrange the little dressing room for you if you like it. Say nothing to Madame, but when she sleeps go you and sit alone a while to think good thoughts, and pray the dear God preserve your sister." Esther was truly pious, and quite sincere in her advice, for she had an affectionate heart, and felt much for the sisters in their anxiety. Amy liked the idea, and gave her leave to arrange the light closet next her room, hoping it would do her good. "I wish I knew where all these pretty things would go when Aunt March dies," she said, as she slowly replaced the shining rosary and shut the jewel cases one by one. "To you and your sisters. I know it, Madame confides in me. I witnessed her will, and it is to be so," whispered Esther smiling. "How nice! But I wish she'd let us have them now. Procrastination is not agreeable," observed Amy, taking a last look at the diamonds. "It is too soon yet for the young ladies to wear these things. The first one who is affianced will have the pearls, Madame has said it, and I have a fancy that the little turquoise ring will be given to you when you go, for Madame approves your good behavior and charming manners." "Do you think so? Oh, I'll be a lamb, if I can only have that lovely ring! It's ever so much prettier than Kitty Bryant's. I do like Aunt March after all." And Amy tried on the blue ring with a delighted face and a firm resolve to earn it. From that day she was a model of obedience, and the old lady complacently admired the success of her training. Esther fitted up the closet with a little table, placed a footstool before it, and over it a picture taken from one of the shut-up rooms. She thought it was of no great value, but, being appropriate, she borrowed it, well knowing that Madame would never know it, nor care if she did. It was, however, a very valuable copy of one of the famous pictures of the world, and Amy's beauty-loving eyes were never tired of looking up at the sweet face of the Divine Mother, while her tender thoughts of her own were busy at her heart. On the table she laid her little testament and hymnbook, kept a vase always full of the best flowers Laurie brought her, and came every day to `sit alone' thinking good thoughts, and praying the dear God to preserve her sister. Esther had given her a rosary of black beads with a silver cross, but Amy hung it up and did not use it, feeling doubtful as to its fitness for Protestant prayers. The little girl was very sincere in all this, for being left alone outside the safe home nest, she felt the need of some kind hand to hold by so sorely that she instinctively turned to the strong and tender Friend, whose fatherly love most closely surrounds His little children. She missed her mother's help to understand and rule herself, but having been taught where to look, she did her best to find the way and walk in it confidingly. But Amy was a young pilgrim, and just now her burden seemed very heavy. She tried to forget herself, to keep cheerful, and be satisfied with doing right, though no one saw or praised her for it. In her firsteffort at being very, very good, she decided to make her will, as Aunt March had done, so that if she did fall ill and die, her possessions might be justly and generously divided. It cost her a pang 40 even to think of giving up the little treasures which in her eyes were as precious as the old lady's jewels. During one of her play hours she wrote out the important document as well as she could, with some help from Esther as to certain legal terms, and when the good-natured Frenchwoman had signed her name, Amy felt relieved and laid it by to show Laurie, whom she wanted as a second witness. As it was a rainy day, she went upstairs to amuse herself in one of the large chambers, and took Polly with her for company. In this room there was a wardrobe full of old-fashioned costumes with which Esther allowed her to play, and it was her favorite amusement to array herself in the faded brocades, and parade up and down before the long mirror, making stately curtsies, and sweeping her train about with a rustle which delighted her ears. So busy was she on this day that she did not hear Laurie's ring nor see his face peeping in at her as she gravely promenaded to and fro, flirting her fan and tossing her head, on which she wore a great pink turban, contrasting oddly with her blue brocade dress and yellow quilted petticoat. She was obliged to walk carefully, for she had on highheeled shoes, and, as Laurie told Jo afterward, it was a comical sight to see her mince along in her gay suit, "Oh, dear, how hard it does seem to take up our packs and go on," sighed Meg the morning after the party, for now the holidays were over, the week of merrymaking did not fit her for going on easily with the task she never liked. "I wish it was Christmas or New Year's all the time. Wouldn't it be fun?" answered Jo, yawning dismally. "We shouldn't enjoy ourselves half so much as we do now. But it does seem so nice to have little suppers and bouquets, and go to parties, and drive home, and read and rest, and not work. It's like other people, you know, and I always envy girls who do such things, I'm so fond of luxury," said Meg, trying to decide which of two shabby gowns was the least shabby. "Well, we can't have it, so don't let us grumble but shoulder our bundles and trudge along as cheerfully as Marmee does. I'm sure Aunt March is a regular Old Man of the Sea to me, but I suppose when I've learned to carry her without complaining, she will tumble off, or get so light that I shan't mind her." This idea tickled Jo's fancy and put her in good spirits, but Meg didn't brighten, for her burden, consisting of four spoiled children, seemed heavier than ever. She had not heart enough even to make herself pretty as usual by putting on a blue neck ribbon and dressing her hair in the most becoming way. "Where's the use of looking nice, when no one sees me but those cross midgets, and no one cares whether I'm pretty or not?" she muttered, shutting her drawer with a jerk. "I shall have to toil and moil all my days, with only little bits of fun now and then, and get old and ugly and sour, because I'm poor and can't enjoy my life as other girls do. It's a shame!" So Meg went down, wearing an injured look, and wasn't at all agreeable at breakfast time. Everyone seemed rather out of sorts and inclined to croak. Beth had a headache and lay on the sofa, trying to comfort herself with the cat and three kittens. Amy was fretting because her lessons were not learned, and she couldn't find her rubbers. Jo would whistle and make a great racket getting ready. Mrs. March was very busy trying to finish a letter, which must go at once, and Hannah had the grumps, for being up late didn't suit her. "There never was such a cross family!" cried Jo, losing her temper when she had upset an inkstand, broken both boot lacings, and sat down upon her hat. "You're the crossest person in it!" returned Amy, washing out the sum that was all wrong with the tears that had fallen on her slate. "Beth, if you don't keep these horrid cats down cellar I'll have tung at the fireplace, and for a moment she felt as much disappointed as she did long ago, when her little sock fell down because it was crammed so full of goodies. Then she remembered her mother's promise and, slipping her hand under her pillow, drew out a little crimson-covered book. She knew it very well, for it was that beautiful old story of the best life ever lived, and Jo felt that it was a true guidebook for any pilgrim going on a long journey. She woke Meg with a "Merry Christmas," and bade her see what was under her pillow. A green- covered book appeared, with the same picture inside, and a few words written by their mother, which made their one present very precious in their eyes. Presently Beth and Amy woke to rummage and find their little books also, one dove-colored, the other blue, and all sat looking at and talking about them, while the east grew rosy with the coming day. In spite of her small vanities, Margaret had a sweet and pious nature, which unconsciously influenced her sisters, especially Jo, who loved her very tenderly, and obeyed her because her advice was so gently given. "Girls," said Meg seriously, looking from the tumbled head beside her to the two little night-capped ones in the room beyond, "Mother wants us to read and love and mind these books, and we must begin at once. We used to be faithful about it, but since Father went away and all this war trouble unsettled us, we have neglected many things. You can do as you please, but I shall keep my book on the table here and read a little every morning as soon as I wake, for I know it will do me good and help me through the day." Then she opened her new book and began to read. Jo put her arm round her and, leaning cheek to cheek, read also, with the quiet expression so seldom seen on her restless face. "How good Meg is! Come, Amy, let's do as they do. I'll help you with the hard words, and they'' explain things if we don't understand," whispered Beth, very much impressed by the pretty books and her sisters, example. "I'm glad mine is blue," said Amy. and then the rooms were very still while the pages were softly turned, and the winter sunshine crept in to touch the bright heads and serious faces with a Christmas greeting. "Where is Mother?" asked Meg, as she and Jo ran down to thank her for their gifts, half an hour later. "Goodness only knows. some poor creeter came a-beggin', and your ma went straight off to see what was needed. There never was such a woman for givin' away vittles and drink, clothes and firin'," replied Hannah, who had lived with the family since Meg was born, and was considered by t and stalked out again. These turnovers were an institution, and the girls called them `muffs', for they had no others and found the hot pies very comforting to their hands on cold mornings. Hannah never forgot to make them, no matter how busy or grumpy she might be, for the walk was long and bleak. The poor things got no other lunch and were seldom home before two. "Cuddle your cats and get over your headache, Bethy. Goodbye, Marmee. We are a set of rascals this morning, but we'll come home regular angels. Now then, Meg!" And Jo tramped away, feeling that the pilgrims were not setting out as they ought to do. 41 They always looked back before turning the corner, for their mother was always at the window to nod and smile, and wave her hand to them. Somehow it seemed as if they couldn't have got through the day without that, for whatever their mood might be, the last glimpse of that motherly face was sure to affect them like sunshine. "If Marmee shook her fist instead of kissing her hand to us, it would serve us right, for more ungrateful wretches than we are were never seen," cried Jo, taking a remorseful satisfaction in the snowy walk and bitter wind. "Don't use such dreadful expressions," replied Meg from the depths of the veil in which she had shrouded herself like a nun sick of the world. "I like good strong words that mean something," replied Jo, catching her hat as it took a leap off her head preparatory to flying away altogether. "Call yourself any names you like, but I am neither a rascal nor a wretch and I don't choose to be called so." "You're a blighted being, and decidedly cross today because 42
本文档为【火车站网上订票系统—计算机毕业设计(论文)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_321635
暂无简介~
格式:doc
大小:364KB
软件:Word
页数:109
分类:工学
上传时间:2017-09-02
浏览量:19