[电子商务]课程设计论文

《电子商务》课程设计论文

宠物之家

班 级:06计算机信息管理

姓 名:李姿楠 指导教师:张欣

2 009年01月

摘 要

本网站利用Internet网络电子商务新技术,采用Microsoft ASP.Net/sql网络数据库解决方案,实现了基于B/S模式的电子商务管理。凭借web服务器和客户的浏览器,利用电子工具高效率、低成本的特点,为客户提供交易平台,在Internet上发布商业信息,商品广告,使用户可以查阅商品、搜索商品、订购商品,为客户提供全天候的、更好、更快的商务活动空间,实现网上交易的基本功能。网站依据目前商业网站的设计原则,以网上交易功能为主的电子商务网站。

本文首先介绍了网上购物系统的现状及开发背景,然后论述了系统的设

计目标,系统需求和总体设计方案,较详细的论述了系统的详细设计和实现。最后,本文对网上购物系统进行了系统检测并提出了还需要改进的问题。

本系统主要为用户提供了会员注册,购物车管理,商品搜索,用户资料修改等功能,为管理员提供了商品管理,用户信息管理等功能。在设计方面,本系统采用B/S三层结构,同时使用asp.net技术进行动态页面的设计,后台数据库选用SQL数据库。

关键词:电子商务,网站,数据库,ASP.net

目录

第一章 导言…………………………………………………………………………….4 1.1 创建网上购物系统的背景及目的……………………………………………………..4 1.2 网上购物系统简介………………………………………………………………………..4 1.3 怎样使用网上购物系统………………………………………………………………………4

第二章 网上购物系统分析……………………………………………………………….4 2.1网上购物系统平台的设计目标„„„„„„„„„„„„„„„„„„„„„„„„„4 2.2网上购物系统的可行性分析„„„„„„„„„„„„„„„„„„„„„„„„„5 2.3网站的深入调查„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„5 2.4网站设计的特点„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 2.5网站开发的设计思想„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 2.6系统设计的总体规则„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 第三章 网上购物系统的功能需求设计„„„„„„„„„„„„„„„„„„„„„„6 3.1分析网上购物系统的功能需求„„„„„„„„„„„„„„„„„„„„„„„„.6 3.2平台功能模块的设计„„„„„„„„„„„„„„„„„„„„„„„„„„„„7. 3.3系统流程分析………………………………………………………………………………….8 3.3.1.前台购物分析及用例建模……………………………………………………………8 3.3.2后台管理订单分析……………………………………………………………………………14 3.3.3 商品管理分析……………………………………………………………………………………………17 3.3.4 后台管理其他用例…………………………………………………………………………18 第四章 第五章

结束语…………………………………………………………………………………24 心得体会„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„24

参考资料…………………………………………………………………………………24 附录:……………………………………………………………………………………………24

第一章 导言

1.1 创建网上购物系统的背景及目的

计算机是人类最伟大的发明之一,尤其近年来其发展迅速,广泛应用于各个领域。 从以往采用电子管作为基本器件的计算机时代到大规模及超大规模集成电路计算机时代,微型计算机由此诞生 。功耗,体积,价格等的大幅下降,使得人们更加将其充分利用到工作,生活的各个方面。当今,人们的交流已越来越多,要求信息的传送速度更快,传送范围更广,“信息高速公路”也就应运而生了。其中,Internet已拥有了数千万个用户,通过Internet我们就可以与全世界来联网。对于当中各种各样的信息,人们都可以通过网络来共享和使用。比如网上购物,我们可以把它当作一个虚拟的市场销售中心,每个人都可以在这个网络上享受所提供的服务,购买所需物品,这样既节约了时间,又满足了需求。尤其是人们的生活速度越来越快,没有大量的时间花费在商场购物。网上购物的出现,使这一问题迎刃而解。 1.2 网上购物系统简介

网络购物系统一般是由学生开发,傻瓜型网上开店程序。使用者无需任何专业网络知识,即可建立一个自己的功能强的的网上商城。对于常见的产品发布,订单处理等操作都有现成的WEB在线管理,开店者登录后台管理即可进行商品维护和订单管理。 1.3 怎样使用网上购物系统

购物系统必须结合主机和域名才能使用,所以使用网络购物系统必须要有自己的域名和主机,您也可以把自己的电脑做服务器进行测试

第二章 网上购物系统分析

系统分析是平台开发的一个不可缺少的环节,为了能够使本系统更好、更完善地被设计出来,就必须先进行调查研究。在系统调查的基础上,对新系统的功能进行细致的分析,从而才能够开发出完整的系统设计。

2.1网上购物系统平台的设计目标

本平台利用现在比较广泛的ASP.NET和SQL数据库的架构实现的,进行系统分析,为将来进一步的实施打下一个坚实的技术基础。从而实现信息化,规范化,系统化,网络化的平台,具有较好的适应性和推广性。

此系统分为前台管理和后台管理。前台管理是友好的操作界面,供用户浏览、查询使用。包括:浏览商品、查询商品、购物车、用户维护等功能;后台管理是提供给管理员的,其中包括:

商品管理、用户管理、订单管理等。使管理员从繁琐的手工操作中解脱出来,并提高了办公效率。

2.2网上购物系统的可行性分析

随着计算机技术的发展和网络人口的增加,网络世界也越来越广博,越来越丰富,电子商务已经成为网上的一股潮流。我们相信要不了太长有时间,顾客就可以在网络世界上获得他们在现实世界上可以获得的所有商品和服务。

可行性研究是为了弄清楚系统开发的项目是不是可以实现和值得进行研究的过程,实际上是一次大大简化系统分析和系统设计的过程,所以,进行可执行性的分析是非常必要的,也是很重要的,经过最初的设计目标和进行的市场调查得出以下四点的可行性分析: 1.经济可行性:即实现这个平台设计有没有什么经济效益? 2.

技术可行性:即现有的技术能否开发该平台,会有哪些困难。 本系统采用asp.net代码和sql数据库的架构实现的,技术成熟。

3.

运行可行性:即该平台规定的运行方式是否可行。

我们这个系统提供了足够的吞吐量和响应时间,性能是可以保证的。同时,系统向最终用户及管理人员提供了及时的,相关的,正确的和有用格式

的信息。并且,系统最大的使用了可用资源,提供了足够的服务等级和能力减少业务成本,增加网站经济收益。为了防止欺骗和盗用用户的信息资料,本系统提供了足够的控制。

2.3网站的深入调查

经过以上的初步调查和研究,并且确定了该平台的可行性,并决定开发本平台,为了能够对现行的平台内容进行充分了解,使所要开发的平台更具有实用性和适应性,设计出该平台功能如下:

1. 能够完成用户基本信息录入的注册和用户基本信息的个人前台与后台管理。 2. 能够完成管理员对网站的商品资料(添加商品类别、商品添加、商品管理)、商品交易

(外理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)的功能。

3. 能过商品的名称,商品的分类进行搜索。

4. 能够通过查看购物车对所选商品进行确定、挑选,通过定单查询对支付费用进行确定。

经过前一阶段的调查与研究分析,我们已确定了该平台设计的主要功能,对每个功能模块也作了具体描述,下面就来具体分析该平台的设计特点与具体思想。

2.4网站设计的特点

我所设计和开发的网上购物平台是经过很长时间的调查和分析才开始具体实施的,它的主要特点是改变了以往的购物只能过现实的商场才能达到的结果,采用Wed技术,借助于Internet互联网广泛应用技术,达到资源共享,提高以往购物的局限性,缩短人们的时间和提高工作效率,具有较好的交互性,从而实现信息化,规范化,系统化,网络化的平台,使整个购物活动过程简单、方便、易行。 2.5网站开发的设计思想

网上购物平台主要是对后台管理和前台操作。后台管理是管理员对本网站

的维护,通过商品资料(添加商品类别、商品添加、商品管理)、商品交易(处理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)等功能达到对网站的管理。前台操作是用户登录到本网站,可以进行用户注册,通过网站的新品速递、商品热卖、商品分类或电子商品搜索功能,找到自己想要买的商品,装入购物车,提交定单进行购买。

2.6系统设计的总体规则

无论哪个网站都要有它自己的设计规则。该平台也一样,它的主要设计规则有:

简单性:在实现平台的功能的同时,尽量让平台操作简单易懂,这对于一个网站来说是

非常重要的。

针对性:该平台设计是网上购物系统及后台管理的定向开发设计,所以具有专业突出和

很强的针对性。

实用性:该平台能完成商品展示和管理员管理的基本信息,具有良好的实用性。

第三章 网上购物系统的功能需求设计

3.1分析网上购物系统的功能需求

对于网上购物,我们总结出该平台需要完成的一些具体功能,分析如下:

1. 用户管理 能够完成用户最基本的信息录入的注册和用户基本信息的个人前台与

后台管理。

2. 管理员管理 能够完成管理员对网站的商品资料(添加商品类别、、商品添加、商

品管理)、商品交易(外理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)的功能。

3. 搜索功能 通过电子商品的名称,商品的分类进行搜索。

4. 查询功能 能够通过查看购物车对所选商品进行确定、挑选,通过定单查询对支

付费用进行确定。

3.2平台功能模块的设计

网上购物系统平台主要包括四大功能模块,用户管理、网站布局、管理员管理、搜索等功能模块。其中用户管理模块,主要包括用户注册、用户修改等功能;管理员管理主要包括商品资料(添加商品类别、商品添加、商品管理)、商品交易、会员管理、操作管理(管理员添加、管理员审查、管理员退出)等功能;搜索主要包括(商品名称、商品类别)。

网上购物系统平台功能总体模块图3.2.1 3.3系统流程分析

本系统分为前台购物流程和后台订单处理流程 3.3.1.前台购物分析及用例建模

前台购物流程图

形象的流程图 用例1:查看商品

前置条件:空。 参与者:客户

目的:让客户了解商品信息

综述:1 浏览商品:客户进入此系统能看到我们网站网页的各种商品 2搜索商品:根据自己所感兴趣的商品进行搜索,并输入 相应条件,系统响应客户请求,显示搜索结 果。客户查看商品,如果满意可把商品放入

购物车并下订单。

代替过程:2.1 如客户对商品不满意,可以继续进行搜索

2.2 如果客户没注册并登陆则不能进入购物车,则进入用例2。

用例2 注册 参与者:客户

前置条件:有意要在本站购买商品但未注册的客户。 目的:进行注册,登录成为网站会员

综述:客户在购买商品前要先进行注册,成为网站会员。

1.客户提交注册申请,系统提供注册表(客户注册简化)。 2.客户填写注册表信息,按下提交按钮,提交。 3.系统验证客户信息并存储,显示注册成功。

4.注册成功后客户收到网站邮件提醒,邮件内容管理员后台自定义。管理员客户后台自定义会员等级和折扣,注册成功默认为普通会员,并存入数据库。 5.系统提醒客户市登陆当前所在网页还是登陆网站首页。 替代过程:

– 3.1 如果注册失败,则返回上一部继续注册。

• 3.1如果用户名,密码等必要信息没填或填写格式与系统 要求不符,系统提醒用户完善,更改客户资料。

注册流程图(用例4)

用例3 登录 参与者:客户

前置条件:客户已经完成注册。 目的:进入购物系统网页 综述:

1.客户填写信息及密码(支持密码保护问题及答案。客户可以通过回答问题重新设定

密码,密码加密格式MD5)

2.系统验证信息,查询客户是否存在,如果存在,核对其输入密码是否正确,如果正

确,系统取得用户名和密码,并将客户ID存入数据库中。 3.登录成功,显示客户网页信息。

替代过程:未登录注册用户必须先登录,若登录失败,是由于客户输入错误密码,系统允许客户重新输入密码,有三次机会。

用户登录流程图(用例5)

用例4 去购物车 参与者:客户

前置条件:已登陆本站的用户,查看网站显示的商品信息,有意购买,则用例开始。 目的:通过购物车,对所选商品进行确定。不仅能重复选购产品,也可以对选购的产品、数量进行修改,并向系统下订单。 综述:

– 1 进入用户界面,开始搜索,查看商品。页面显示一个搜索表格,客户输入要搜索的商品信息,系统根据其输入的商品,并根据管理商品数据库里的信息,生成商品查询信息反馈给客户,并及时更新数据库。(用例1)

– 2 客户选择商品,系统把商品保存在购物车中(保存购物车中各个项目的信息)。

– 3 如果客户对挑选到购物车 中的商品满意,通过自定义标签执行选择把商品添加到购物车 中;如果不满意,则执行删除;如果客户想对所选商品进行修改的话,返回到继续购物.系统及时把修改信息反馈到购物车。

– 4 客户对其所选的商品确定后,生成订单。 系统接受订

后,进行订单验证,进入后台管理用例2

替代过程:若购物车内的商品无法增、减,请客户返回首页,重新登录。

1.1若客户输入的商品该网站没有,系统响应后生成信息显示给客户。系统可以向客户推荐规格相近的产品,若客户不满意则发出email响应,系统接收后生成信息,记录下订购产品的信息并标记,生成采购单。 采购商品,并确定入库,系统更新商品数据库。

购物车流程图(用例6) • • • • • – – –

用例5 付款 参与者:客户

前置条件:用例2, 3,4已执行,该用例开始。 目的:完成购买 综述:

客户选择付款方式,系统接受 客户选择送货方式,系统接受

客户需要时可以要求打印结帐单,系统响应.

• • • • • –

用例6 订单查看 参与者:客户

前置条件:用例1,3,4,5已执行,该用例开始。 目的:维护客户自身利益,优化网站 综述:

客户可以在线随时查看订单状态,订单是否结帐等,客户若是对已下订单的商品不满意,可以申请订单修改,系统受理信息。

替代过程:客户购买商品出现订单错误或对本网站有意见等,可提交一份定单投诉,要如实填

写投诉报告

3.3.2后台管理订单分析

后台购物流程图

用例1 身份识别 参与者: 后台管理员 前置条件:空

目的:进入后台管理网页 综述:

1. 管理员填写信息及密码

2.系统验证信息,查询管理员是否存在,如果存在,核对其输入密码是否正确,如果正确,系统取得用户名和密码,并将客户ID存入数据库中。 3.登录成功

替代过程:若登录失败,是由于客户输入错误密码,系统允许客户重新输入密码.。

用例2 订单受理 参与者:后台管理员

前置条件:系统接收到客户的订单,用例开始 目的:确保客户订单为有效订单,能顺利发货 综述:

1.接受客户订单后验证用户订单

(1)后台管理员验证客户信息:验证客户身份、帐号、信誉度和付款方式 (2) 后台管理员验证订单商品:对于每个被订购的产品, 验证产品编号并检查

产品是否在库存中,记录订购产品的信息。并对订单进行分类。

替代过程:

2. (1)若客户信用状态表明其拖欠付款,系统则发出一个“订单拒绝“给客户。

2.(2)如果产品编号无效则给客户发送一个通知,要求他们提交一个有效的产

品编号.如果订购的产品缺货,则记录下订购产品的信息并标记,生成采购单。采购商品,并确定入库,系统更新商品数据库。

用例3 订单发货 参与者:后台管理人员

前置条件:客户信息验证无误,仓库内客户所要货物 目的:根据所创建的销售单,销售人员将商品运送给客户。

综述:1创建销售单: 根据客户的有效定货单,创建一个销售单,并存入数据库。 2发货:根据用户提交的运送信息,将商品运送给客户。把发货信息通过email

通知客户,同时,仓库系统更新数据库商品数量。

用例4 订单结帐 参与者:后台管理人员

目的:结算订单,后台完成交易

综述:检查用户帐号及付款金额,若金额无误,将付款成功信息通知客户,并将客户交

付金额存入数据库。

替代过程: 若金额不足或款未到,向用户发送通知。

3.3.3 商品管理分析

对商品进行管理也是后台管理的一个重要组成部分。商品管理是否规范,合理也成为评判一个购物网站的重要标准。

用例 5创建商品信息库 参与者 后台管理员

目的 根据商品的类别等信息将商品分类规划,以便管理员对商品信息进行处理 综述 管理人员根据商品号,商品名等信息对商品信息进行更改,访问,核实操作.

用例6处理商品 参与者:后台管理人员

目的:不断更新仓库中商品的数量及种类,吸引顾客

综述:1添加商品:当用户订购的商品缺货时,管理人员记录商品编号,添加商品。根据客户对商品信息的评论,添加热卖商品,最新商品数量扩大热卖,最新商品种类。

2更改、删除商品:通过对仓库商品的调查,删除过期商品。对于过季,销售情况不佳的商品,进行降价处理及各种促销方式,系统用户页面显示管理员更改的最新信息。

3.3.4 后台管理其他用例 用例 7 处理客户反馈信息 参与者:后台管理人员

综述:完善留言簿功能,添加管理员回复功能,能更好的回答解决用户的问题。

用例 9 分类统计数据流量 参与者:后台管理人员

目的:通过对数据流量统计,完善各类数据库

综述:按小时,按日,按周,按月统计流量信息。访问来路统计,IP地址 , 地区。

订单管理用例图

商品管理用例图

后台其他用例图

我们根据网上购物系统需求功能分析,将系统用例建摸.下面,我们用CRC卡协助设计寻找和确定网上购物系统的对象类

前台购物系统和后台管理系统进行操作的对象主要是商品和用户订单,并且用户对页面显示商品的操作主要是通过对购物车进行控制的。因此我们不妨建一个购物车类,它的职责就是用户完成增加商品且删除,修改其所选已存在购物车的商品.这些商品信息暂时存储在一个存储类中,当信息确认后,将其传递到库存中.

后 台 订 单 用 例 关 系 图

前 台 购 物 系 统 用 力 图 关 系 图

商 品 管 理 用 例 关 系 图

网上购物系统是一个较为庞大的系统,我们仅仅显示系统的主要目标或最为重要的书橱和输入的数据流。

网上购物系统上下文数据流图

第四章 结束语

通过一个学期的努力,终于实现了一个电子商务网站的基本功能,基本完成了预期的目标。

利用网页做为后台数据库管理也是本系统特别之处,不但制作方便,交互性强,而且有利于日后的网站扩长和功能增加。但是,这只能对数据进行简单的管理,并不满足复杂数据库的需要,这时就需要开发后台数据库管理程序。

另外,由于客观条件的限制和知识的有限,本系统未能提供完整商务网站功能,例如网上支付、

数据加密、网络安全、电子账户等功能。但是这些我们已经意识到了,并在系统中预留了其功能接口,只要条件成熟,稍加修改就能投入使用。

第五章 心得体会

在课程设计的日子里,我真的学到了很多,也巩固了以往许多知识.虽然每天都要面对有大的或小的问题,这样其实我

很开心,我也有信心把设计做好!因为我有我的信念:我不怕问题的到来,因为问题总是可以得到解决的!

参考资料

附录:

程序的截图如下:

程序的代码如下: 登陆:Imports System.IO

Imports System.data

Imports System.Data.SqlClient

Public Class denglu

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button Protected WithEvents Button2 As System.Web.UI.WebControls.Button Protected WithEvents Button3 As System.Web.UI.WebControls.Button Protected WithEvents username As System.Web.UI.WebControls.TextBox Protected WithEvents password As System.Web.UI.WebControls.TextBox Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。 '不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的 '不要使用代码编辑器修改它。 InitializeComponent() End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e System.EventArgs) Handles MyBase.Load

'在此处放置初始化页的用户代码 End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e System.EventArgs) Handles Button1.Click

Response.Redirect(

As

As

As

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button2.Click

Dim

conn

=

New

SqlConnection(

conn.Open() Dim str As String

str =

Pwd='

Dim cmd As New SqlCommand(str, conn) Dim dr As SqlDataReader dr = cmd.ExecuteReader If (dr.Read()) Then

Session(

message.Text = Session(

message.Text =

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button3.Click

Response.Redirect(

End Class

主页:Imports System.Data Imports System.Data.SqlClient

Public Class WebForm2

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents yhm As System.Web.UI.WebControls.TextBox

Protected WithEvents mm As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents Button2 As System.Web.UI.WebControls.Button

Protected WithEvents Button3 As System.Web.UI.WebControls.Button

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents DataList1 As System.Web.UI.WebControls.DataList

Protected WithEvents lblStatus As System.Web.UI.WebControls.Label

Protected WithEvents intPageSize As System.Web.UI.WebControls.Label

Protected WithEvents intRecordCount As System.Web.UI.WebControls.Label

Protected WithEvents intCurrIndex As System.Web.UI.WebControls.Label

Protected WithEvents hrefFirst As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefPrevious As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefNext As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefLast As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents Mylist As System.Web.UI.WebControls.DataList

Protected WithEvents username As System.Web.UI.WebControls.TextBox

Protected WithEvents password As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not IsPostBack Then

intPageSize.Text =

intCurrIndex.Text =

Call binddata()

End If

Dim conn As New SqlConnection(

Dim strsql As String

strsql =

Dim cmd As New SqlCommand(strsql, conn)

conn.Open()

Dim adp As New SqlDataAdapter(cmd)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim conn = New SqlConnection(

conn.Open()

Dim str As String

str =

Dim cmd As New SqlCommand(str, conn)

Dim dr As SqlDataReader

dr = cmd.ExecuteReader

If (dr.Read()) Then

Session(

message.Text = Session(

Else

message.Text =

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Response.Redirect(

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Response.Redirect(

End Sub

Public Sub BindData()

Dim conn As New SqlConnection(

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

If Not Page.IsPostBack() Then

adp.Fill(ds)

intRecordCount.Text = CStr(ds.Tables(0).Rows.Count)

ds = Nothing

ds = New DataSet

End If

adp.Fill(ds, CInt(intCurrIndex.Text), CInt(intPageSize.Text),

Mylist.DataSource = ds.Tables(0).DefaultView

Mylist.DataBind()

conn.Close()

PrintStatus()

End Sub

Public Sub ShowFirst_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefFirst.ServerClick

intCurrIndex.Text =

BindData()

End Sub

Public Sub ShowPrevious_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefPrevious.ServerClick

intCurrIndex.Text = CStr(CInt(intCurrIndex.Text) - CInt(intPageSize.Text))

If CInt(intCurrIndex.Text)

intCurrIndex.Text =

End If

BindData()

End Sub

Public Sub ShowNext_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefNext.ServerClick

If CInt(CInt(intCurrIndex.Text) + CInt(intPageSize.Text))

intCurrIndex.Text = CStr(CInt(intCurrIndex.Text) + CInt(intPageSize.Text))

End If

BindData()

End Sub

Public Sub ShowLast_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefLast.ServerClick

Dim tmpInt As Integer

tmpInt = CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)

If tmpInt > 0 Then

intCurrIndex.Text = CStr(CInt(intRecordCount.Text) - tmpInt)

Else

intCurrIndex.Text = CStr(CInt(intRecordCount.Text) - CInt(intPageSize.Text)) End If

BindData()

End Sub

Private Sub PrintStatus()

lblStatus.Text =

lblStatus.Text +=

lblStatus.Text += CStr(CInt(CInt(intCurrIndex.Text) \ CInt(intPageSize.Text) + 1))

lblStatus.Text +=

If

(CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)) > 0 And

CInt(intRecordCount.Text) > CInt(intPageSize.Text) Then

lblStatus.Text += CStr(CInt(CInt(intRecordCount.Text) \ CInt(intPageSize.Text) +

1))

ElseIf CInt(intRecordCount.Text)

lblStatus.Text +=

Else

lblStatus.Text += CStr(CInt(intRecordCount.Text) \ CInt(intPageSize.Text))

End If

lblStatus.Text +=

End Sub

Private Sub Mylist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mylist.SelectedIndexChanged

End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

End Sub

End Class

订单查询:Imports System.Data

Imports System.Data.SqlClient

Public Class ddcx

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents message1 As System.Web.UI.WebControls.Label

Protected WithEvents order As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Session(

Response.Redirect(

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn As New SqlConnection(

conn.Open()

Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then

dr.Close()

TextBox1.Text =

Dim sqlstr2 =

from Prod.P_discount,Prod.P_price,Basket.P_name,Basket.P_id,Basket.B_count,Basket.P_cash

Basket, Prod where O_number=

Dim adp As New SqlDataAdapter(sqlstr2, conn)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

Else

dr.Close()

Dim sqlstr3 =

from Prod.P_discount,Prod.P_price,Basket.P_name,Basket.P_id,Basket.B_count,Basket.P_cash

Basket, Prod where O_number=

Dim adp As New SqlDataAdapter(sqlstr3, conn)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

message.Text =

End If

End Sub

End Class

商品管理:Imports System.Data

Imports System.Data.SqlClient

Public Class glsp

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents prodgrid As System.Web.UI.WebControls.DataGrid

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink3 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink4 As System.Web.UI.WebControls.HyperLink

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Dim conn As New SqlConnection(

If Not IsPostBack Then

Call BindData()

End If

End Sub

Sub BindData()

Dim adp As New SqlDataAdapter(

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

End Sub

Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand DataGrid1.EditItemIndex = CInt(e.Item.ItemIndex)

Call BindData()

End Sub

Private Sub DataGrid1_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.CancelCommand DataGrid1.EditItemIndex = -1

Call BindData()

End Sub

Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim exp As Exception

Try

conn.Open()

cmd.ExecuteNonQuery()

conn.Close()

Catch exp

message.Text =

End Try

End Sub

Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand Dim txtP_typeid, txtP_type As TextBox

txtP_typeid = e.Item.Cells(3).Controls(0)

txtP_type = e.Item.Cells(4).Controls(0)

Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim exp As Exception

Try

conn.Open()

cmd.ExecuteNonQuery()

conn.Close()

Catch exp

Label2.Text =

End Try

DataGrid1.EditItemIndex = -1

Call BindData()

End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

End Sub

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)

DataGrid1.PageIndexChanged

DataGrid1.CurrentPageIndex = e.NewPageIndex

End Sub

End Class

管理员登陆:

Imports System.IO

Imports System.data

Imports System.Data.SqlClient

Public Class guanliyuandelu

Handles

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents username As System.Web.UI.WebControls.TextBox

Protected WithEvents password As System.Web.UI.WebControls.TextBox

Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

Handles MyBase.Load

'在此处放置初始化页的用户代码

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn = New SqlConnection(

conn.Open()

Dim str As String

str =

Dim cmd As New SqlCommand(str, conn)

Dim dr As SqlDataReader

dr = cmd.ExecuteReader

If (dr.Read()) Then

Session(

Response.Redirect(

Else

message.Text =

End If

End Sub

End Class

购物车:

Imports System.Data

Imports System.Data.SqlClient

Public Class gwc

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents txtquantity As System.Web.UI.WebControls.TextBox

Protected WithEvents Label7 As System.Web.UI.WebControls.Label

Protected WithEvents lbp_discount As System.Web.UI.WebControls.Label

Protected WithEvents lbp_price As System.Web.UI.WebControls.Label

Protected WithEvents lbptype As System.Web.UI.WebControls.Label

Protected WithEvents lbp_id As System.Web.UI.WebControls.Label

Protected WithEvents lbp_name As System.Web.UI.WebControls.Label

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Table1 As System.Web.UI.HtmlControls.HtmlTable

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents message2 As System.Web.UI.WebControls.Label

Protected WithEvents message3 As System.Web.UI.WebControls.Label

Protected WithEvents message4 As System.Web.UI.WebControls.Label

Protected WithEvents message5 As System.Web.UI.WebControls.Label

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim conn As New SqlConnection(

conn.Open()

If Session(

Response.Redirect(

Else

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

message.Text =

message2.Text =

message3.Text =

message4.Text =

message5.Text =

conn.Close()

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn As New SqlConnection(

If CStr(Session(

Dim sqlstr1 =

Session(

Dim cmd1 As New SqlCommand(sqlstr1, conn)

conn.Open()

cmd1.ExecuteNonQuery()

conn.Close()

End If

Dim sqlstr2 =

Dim adp2 As New SqlDataAdapter(sqlstr2, conn)

Dim ds2 As New DataSet

adp2.Fill(ds2,

Dim dr2 As DataRow

dr2 = ds2.Tables(

Session(

conn.Close()

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

Dim c_quantity As Integer

c_quantity = CInt(TextBox1.Text)

values('

Dim c_discount, total As Long

c_discount = CSng(dr(

total = c_quantity * c_discount

Dim c_pname = CStr(dr(

Dim sqlstr3 =

Dim cmd As New SqlCommand(sqlstr3, conn)

conn.Open()

' Response.Write(

cmd.ExecuteNonQuery()

conn.Close()

Response.Redirect(

End Sub

End Class

回复列表:

Imports System.Data

Imports System.Data.SqlClient

Public Class hfly

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

Protected WithEvents Label4 As System.Web.UI.WebControls.Label

Protected WithEvents Subject As System.Web.UI.WebControls.TextBox

Protected WithEvents Label5 As System.Web.UI.WebControls.Label

Protected WithEvents Name As System.Web.UI.WebControls.TextBox

Protected WithEvents Label6 As System.Web.UI.WebControls.Label

Protected WithEvents Email As System.Web.UI.WebControls.TextBox

Protected WithEvents Label7 As System.Web.UI.WebControls.Label

Protected WithEvents Content As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents Button2 As System.Web.UI.WebControls.Button

Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox4 As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Dim conn As New SqlConnection(

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim messageid = Request(

Dim strsql =

Dim adp As New SqlDataAdapter(strsql, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

TextBox1.Text =

i = dr(

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

Dim strsql2 =

Dim ds2 As New DataSet

adp2.Fill(ds2,

DataGrid2.DataSource = ds2.Tables(

DataGrid2.DataBind()

conn.Close()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

《电子商务》课程设计论文

宠物之家

班 级:06计算机信息管理

姓 名:李姿楠 指导教师:张欣

2 009年01月

摘 要

本网站利用Internet网络电子商务新技术,采用Microsoft ASP.Net/sql网络数据库解决方案,实现了基于B/S模式的电子商务管理。凭借web服务器和客户的浏览器,利用电子工具高效率、低成本的特点,为客户提供交易平台,在Internet上发布商业信息,商品广告,使用户可以查阅商品、搜索商品、订购商品,为客户提供全天候的、更好、更快的商务活动空间,实现网上交易的基本功能。网站依据目前商业网站的设计原则,以网上交易功能为主的电子商务网站。

本文首先介绍了网上购物系统的现状及开发背景,然后论述了系统的设

计目标,系统需求和总体设计方案,较详细的论述了系统的详细设计和实现。最后,本文对网上购物系统进行了系统检测并提出了还需要改进的问题。

本系统主要为用户提供了会员注册,购物车管理,商品搜索,用户资料修改等功能,为管理员提供了商品管理,用户信息管理等功能。在设计方面,本系统采用B/S三层结构,同时使用asp.net技术进行动态页面的设计,后台数据库选用SQL数据库。

关键词:电子商务,网站,数据库,ASP.net

目录

第一章 导言…………………………………………………………………………….4 1.1 创建网上购物系统的背景及目的……………………………………………………..4 1.2 网上购物系统简介………………………………………………………………………..4 1.3 怎样使用网上购物系统………………………………………………………………………4

第二章 网上购物系统分析……………………………………………………………….4 2.1网上购物系统平台的设计目标„„„„„„„„„„„„„„„„„„„„„„„„„4 2.2网上购物系统的可行性分析„„„„„„„„„„„„„„„„„„„„„„„„„5 2.3网站的深入调查„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„5 2.4网站设计的特点„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 2.5网站开发的设计思想„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 2.6系统设计的总体规则„„„„„„„„„„„„„„„„„„„„„„„„„„„„6 第三章 网上购物系统的功能需求设计„„„„„„„„„„„„„„„„„„„„„„6 3.1分析网上购物系统的功能需求„„„„„„„„„„„„„„„„„„„„„„„„.6 3.2平台功能模块的设计„„„„„„„„„„„„„„„„„„„„„„„„„„„„7. 3.3系统流程分析………………………………………………………………………………….8 3.3.1.前台购物分析及用例建模……………………………………………………………8 3.3.2后台管理订单分析……………………………………………………………………………14 3.3.3 商品管理分析……………………………………………………………………………………………17 3.3.4 后台管理其他用例…………………………………………………………………………18 第四章 第五章

结束语…………………………………………………………………………………24 心得体会„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„24

参考资料…………………………………………………………………………………24 附录:……………………………………………………………………………………………24

第一章 导言

1.1 创建网上购物系统的背景及目的

计算机是人类最伟大的发明之一,尤其近年来其发展迅速,广泛应用于各个领域。 从以往采用电子管作为基本器件的计算机时代到大规模及超大规模集成电路计算机时代,微型计算机由此诞生 。功耗,体积,价格等的大幅下降,使得人们更加将其充分利用到工作,生活的各个方面。当今,人们的交流已越来越多,要求信息的传送速度更快,传送范围更广,“信息高速公路”也就应运而生了。其中,Internet已拥有了数千万个用户,通过Internet我们就可以与全世界来联网。对于当中各种各样的信息,人们都可以通过网络来共享和使用。比如网上购物,我们可以把它当作一个虚拟的市场销售中心,每个人都可以在这个网络上享受所提供的服务,购买所需物品,这样既节约了时间,又满足了需求。尤其是人们的生活速度越来越快,没有大量的时间花费在商场购物。网上购物的出现,使这一问题迎刃而解。 1.2 网上购物系统简介

网络购物系统一般是由学生开发,傻瓜型网上开店程序。使用者无需任何专业网络知识,即可建立一个自己的功能强的的网上商城。对于常见的产品发布,订单处理等操作都有现成的WEB在线管理,开店者登录后台管理即可进行商品维护和订单管理。 1.3 怎样使用网上购物系统

购物系统必须结合主机和域名才能使用,所以使用网络购物系统必须要有自己的域名和主机,您也可以把自己的电脑做服务器进行测试

第二章 网上购物系统分析

系统分析是平台开发的一个不可缺少的环节,为了能够使本系统更好、更完善地被设计出来,就必须先进行调查研究。在系统调查的基础上,对新系统的功能进行细致的分析,从而才能够开发出完整的系统设计。

2.1网上购物系统平台的设计目标

本平台利用现在比较广泛的ASP.NET和SQL数据库的架构实现的,进行系统分析,为将来进一步的实施打下一个坚实的技术基础。从而实现信息化,规范化,系统化,网络化的平台,具有较好的适应性和推广性。

此系统分为前台管理和后台管理。前台管理是友好的操作界面,供用户浏览、查询使用。包括:浏览商品、查询商品、购物车、用户维护等功能;后台管理是提供给管理员的,其中包括:

商品管理、用户管理、订单管理等。使管理员从繁琐的手工操作中解脱出来,并提高了办公效率。

2.2网上购物系统的可行性分析

随着计算机技术的发展和网络人口的增加,网络世界也越来越广博,越来越丰富,电子商务已经成为网上的一股潮流。我们相信要不了太长有时间,顾客就可以在网络世界上获得他们在现实世界上可以获得的所有商品和服务。

可行性研究是为了弄清楚系统开发的项目是不是可以实现和值得进行研究的过程,实际上是一次大大简化系统分析和系统设计的过程,所以,进行可执行性的分析是非常必要的,也是很重要的,经过最初的设计目标和进行的市场调查得出以下四点的可行性分析: 1.经济可行性:即实现这个平台设计有没有什么经济效益? 2.

技术可行性:即现有的技术能否开发该平台,会有哪些困难。 本系统采用asp.net代码和sql数据库的架构实现的,技术成熟。

3.

运行可行性:即该平台规定的运行方式是否可行。

我们这个系统提供了足够的吞吐量和响应时间,性能是可以保证的。同时,系统向最终用户及管理人员提供了及时的,相关的,正确的和有用格式

的信息。并且,系统最大的使用了可用资源,提供了足够的服务等级和能力减少业务成本,增加网站经济收益。为了防止欺骗和盗用用户的信息资料,本系统提供了足够的控制。

2.3网站的深入调查

经过以上的初步调查和研究,并且确定了该平台的可行性,并决定开发本平台,为了能够对现行的平台内容进行充分了解,使所要开发的平台更具有实用性和适应性,设计出该平台功能如下:

1. 能够完成用户基本信息录入的注册和用户基本信息的个人前台与后台管理。 2. 能够完成管理员对网站的商品资料(添加商品类别、商品添加、商品管理)、商品交易

(外理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)的功能。

3. 能过商品的名称,商品的分类进行搜索。

4. 能够通过查看购物车对所选商品进行确定、挑选,通过定单查询对支付费用进行确定。

经过前一阶段的调查与研究分析,我们已确定了该平台设计的主要功能,对每个功能模块也作了具体描述,下面就来具体分析该平台的设计特点与具体思想。

2.4网站设计的特点

我所设计和开发的网上购物平台是经过很长时间的调查和分析才开始具体实施的,它的主要特点是改变了以往的购物只能过现实的商场才能达到的结果,采用Wed技术,借助于Internet互联网广泛应用技术,达到资源共享,提高以往购物的局限性,缩短人们的时间和提高工作效率,具有较好的交互性,从而实现信息化,规范化,系统化,网络化的平台,使整个购物活动过程简单、方便、易行。 2.5网站开发的设计思想

网上购物平台主要是对后台管理和前台操作。后台管理是管理员对本网站

的维护,通过商品资料(添加商品类别、商品添加、商品管理)、商品交易(处理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)等功能达到对网站的管理。前台操作是用户登录到本网站,可以进行用户注册,通过网站的新品速递、商品热卖、商品分类或电子商品搜索功能,找到自己想要买的商品,装入购物车,提交定单进行购买。

2.6系统设计的总体规则

无论哪个网站都要有它自己的设计规则。该平台也一样,它的主要设计规则有:

简单性:在实现平台的功能的同时,尽量让平台操作简单易懂,这对于一个网站来说是

非常重要的。

针对性:该平台设计是网上购物系统及后台管理的定向开发设计,所以具有专业突出和

很强的针对性。

实用性:该平台能完成商品展示和管理员管理的基本信息,具有良好的实用性。

第三章 网上购物系统的功能需求设计

3.1分析网上购物系统的功能需求

对于网上购物,我们总结出该平台需要完成的一些具体功能,分析如下:

1. 用户管理 能够完成用户最基本的信息录入的注册和用户基本信息的个人前台与

后台管理。

2. 管理员管理 能够完成管理员对网站的商品资料(添加商品类别、、商品添加、商

品管理)、商品交易(外理订单、发货查询)、会员管理(会员审查)、操作管理(管理员添加、管理员审查、管理员退出)的功能。

3. 搜索功能 通过电子商品的名称,商品的分类进行搜索。

4. 查询功能 能够通过查看购物车对所选商品进行确定、挑选,通过定单查询对支

付费用进行确定。

3.2平台功能模块的设计

网上购物系统平台主要包括四大功能模块,用户管理、网站布局、管理员管理、搜索等功能模块。其中用户管理模块,主要包括用户注册、用户修改等功能;管理员管理主要包括商品资料(添加商品类别、商品添加、商品管理)、商品交易、会员管理、操作管理(管理员添加、管理员审查、管理员退出)等功能;搜索主要包括(商品名称、商品类别)。

网上购物系统平台功能总体模块图3.2.1 3.3系统流程分析

本系统分为前台购物流程和后台订单处理流程 3.3.1.前台购物分析及用例建模

前台购物流程图

形象的流程图 用例1:查看商品

前置条件:空。 参与者:客户

目的:让客户了解商品信息

综述:1 浏览商品:客户进入此系统能看到我们网站网页的各种商品 2搜索商品:根据自己所感兴趣的商品进行搜索,并输入 相应条件,系统响应客户请求,显示搜索结 果。客户查看商品,如果满意可把商品放入

购物车并下订单。

代替过程:2.1 如客户对商品不满意,可以继续进行搜索

2.2 如果客户没注册并登陆则不能进入购物车,则进入用例2。

用例2 注册 参与者:客户

前置条件:有意要在本站购买商品但未注册的客户。 目的:进行注册,登录成为网站会员

综述:客户在购买商品前要先进行注册,成为网站会员。

1.客户提交注册申请,系统提供注册表(客户注册简化)。 2.客户填写注册表信息,按下提交按钮,提交。 3.系统验证客户信息并存储,显示注册成功。

4.注册成功后客户收到网站邮件提醒,邮件内容管理员后台自定义。管理员客户后台自定义会员等级和折扣,注册成功默认为普通会员,并存入数据库。 5.系统提醒客户市登陆当前所在网页还是登陆网站首页。 替代过程:

– 3.1 如果注册失败,则返回上一部继续注册。

• 3.1如果用户名,密码等必要信息没填或填写格式与系统 要求不符,系统提醒用户完善,更改客户资料。

注册流程图(用例4)

用例3 登录 参与者:客户

前置条件:客户已经完成注册。 目的:进入购物系统网页 综述:

1.客户填写信息及密码(支持密码保护问题及答案。客户可以通过回答问题重新设定

密码,密码加密格式MD5)

2.系统验证信息,查询客户是否存在,如果存在,核对其输入密码是否正确,如果正

确,系统取得用户名和密码,并将客户ID存入数据库中。 3.登录成功,显示客户网页信息。

替代过程:未登录注册用户必须先登录,若登录失败,是由于客户输入错误密码,系统允许客户重新输入密码,有三次机会。

用户登录流程图(用例5)

用例4 去购物车 参与者:客户

前置条件:已登陆本站的用户,查看网站显示的商品信息,有意购买,则用例开始。 目的:通过购物车,对所选商品进行确定。不仅能重复选购产品,也可以对选购的产品、数量进行修改,并向系统下订单。 综述:

– 1 进入用户界面,开始搜索,查看商品。页面显示一个搜索表格,客户输入要搜索的商品信息,系统根据其输入的商品,并根据管理商品数据库里的信息,生成商品查询信息反馈给客户,并及时更新数据库。(用例1)

– 2 客户选择商品,系统把商品保存在购物车中(保存购物车中各个项目的信息)。

– 3 如果客户对挑选到购物车 中的商品满意,通过自定义标签执行选择把商品添加到购物车 中;如果不满意,则执行删除;如果客户想对所选商品进行修改的话,返回到继续购物.系统及时把修改信息反馈到购物车。

– 4 客户对其所选的商品确定后,生成订单。 系统接受订

后,进行订单验证,进入后台管理用例2

替代过程:若购物车内的商品无法增、减,请客户返回首页,重新登录。

1.1若客户输入的商品该网站没有,系统响应后生成信息显示给客户。系统可以向客户推荐规格相近的产品,若客户不满意则发出email响应,系统接收后生成信息,记录下订购产品的信息并标记,生成采购单。 采购商品,并确定入库,系统更新商品数据库。

购物车流程图(用例6) • • • • • – – –

用例5 付款 参与者:客户

前置条件:用例2, 3,4已执行,该用例开始。 目的:完成购买 综述:

客户选择付款方式,系统接受 客户选择送货方式,系统接受

客户需要时可以要求打印结帐单,系统响应.

• • • • • –

用例6 订单查看 参与者:客户

前置条件:用例1,3,4,5已执行,该用例开始。 目的:维护客户自身利益,优化网站 综述:

客户可以在线随时查看订单状态,订单是否结帐等,客户若是对已下订单的商品不满意,可以申请订单修改,系统受理信息。

替代过程:客户购买商品出现订单错误或对本网站有意见等,可提交一份定单投诉,要如实填

写投诉报告

3.3.2后台管理订单分析

后台购物流程图

用例1 身份识别 参与者: 后台管理员 前置条件:空

目的:进入后台管理网页 综述:

1. 管理员填写信息及密码

2.系统验证信息,查询管理员是否存在,如果存在,核对其输入密码是否正确,如果正确,系统取得用户名和密码,并将客户ID存入数据库中。 3.登录成功

替代过程:若登录失败,是由于客户输入错误密码,系统允许客户重新输入密码.。

用例2 订单受理 参与者:后台管理员

前置条件:系统接收到客户的订单,用例开始 目的:确保客户订单为有效订单,能顺利发货 综述:

1.接受客户订单后验证用户订单

(1)后台管理员验证客户信息:验证客户身份、帐号、信誉度和付款方式 (2) 后台管理员验证订单商品:对于每个被订购的产品, 验证产品编号并检查

产品是否在库存中,记录订购产品的信息。并对订单进行分类。

替代过程:

2. (1)若客户信用状态表明其拖欠付款,系统则发出一个“订单拒绝“给客户。

2.(2)如果产品编号无效则给客户发送一个通知,要求他们提交一个有效的产

品编号.如果订购的产品缺货,则记录下订购产品的信息并标记,生成采购单。采购商品,并确定入库,系统更新商品数据库。

用例3 订单发货 参与者:后台管理人员

前置条件:客户信息验证无误,仓库内客户所要货物 目的:根据所创建的销售单,销售人员将商品运送给客户。

综述:1创建销售单: 根据客户的有效定货单,创建一个销售单,并存入数据库。 2发货:根据用户提交的运送信息,将商品运送给客户。把发货信息通过email

通知客户,同时,仓库系统更新数据库商品数量。

用例4 订单结帐 参与者:后台管理人员

目的:结算订单,后台完成交易

综述:检查用户帐号及付款金额,若金额无误,将付款成功信息通知客户,并将客户交

付金额存入数据库。

替代过程: 若金额不足或款未到,向用户发送通知。

3.3.3 商品管理分析

对商品进行管理也是后台管理的一个重要组成部分。商品管理是否规范,合理也成为评判一个购物网站的重要标准。

用例 5创建商品信息库 参与者 后台管理员

目的 根据商品的类别等信息将商品分类规划,以便管理员对商品信息进行处理 综述 管理人员根据商品号,商品名等信息对商品信息进行更改,访问,核实操作.

用例6处理商品 参与者:后台管理人员

目的:不断更新仓库中商品的数量及种类,吸引顾客

综述:1添加商品:当用户订购的商品缺货时,管理人员记录商品编号,添加商品。根据客户对商品信息的评论,添加热卖商品,最新商品数量扩大热卖,最新商品种类。

2更改、删除商品:通过对仓库商品的调查,删除过期商品。对于过季,销售情况不佳的商品,进行降价处理及各种促销方式,系统用户页面显示管理员更改的最新信息。

3.3.4 后台管理其他用例 用例 7 处理客户反馈信息 参与者:后台管理人员

综述:完善留言簿功能,添加管理员回复功能,能更好的回答解决用户的问题。

用例 9 分类统计数据流量 参与者:后台管理人员

目的:通过对数据流量统计,完善各类数据库

综述:按小时,按日,按周,按月统计流量信息。访问来路统计,IP地址 , 地区。

订单管理用例图

商品管理用例图

后台其他用例图

我们根据网上购物系统需求功能分析,将系统用例建摸.下面,我们用CRC卡协助设计寻找和确定网上购物系统的对象类

前台购物系统和后台管理系统进行操作的对象主要是商品和用户订单,并且用户对页面显示商品的操作主要是通过对购物车进行控制的。因此我们不妨建一个购物车类,它的职责就是用户完成增加商品且删除,修改其所选已存在购物车的商品.这些商品信息暂时存储在一个存储类中,当信息确认后,将其传递到库存中.

后 台 订 单 用 例 关 系 图

前 台 购 物 系 统 用 力 图 关 系 图

商 品 管 理 用 例 关 系 图

网上购物系统是一个较为庞大的系统,我们仅仅显示系统的主要目标或最为重要的书橱和输入的数据流。

网上购物系统上下文数据流图

第四章 结束语

通过一个学期的努力,终于实现了一个电子商务网站的基本功能,基本完成了预期的目标。

利用网页做为后台数据库管理也是本系统特别之处,不但制作方便,交互性强,而且有利于日后的网站扩长和功能增加。但是,这只能对数据进行简单的管理,并不满足复杂数据库的需要,这时就需要开发后台数据库管理程序。

另外,由于客观条件的限制和知识的有限,本系统未能提供完整商务网站功能,例如网上支付、

数据加密、网络安全、电子账户等功能。但是这些我们已经意识到了,并在系统中预留了其功能接口,只要条件成熟,稍加修改就能投入使用。

第五章 心得体会

在课程设计的日子里,我真的学到了很多,也巩固了以往许多知识.虽然每天都要面对有大的或小的问题,这样其实我

很开心,我也有信心把设计做好!因为我有我的信念:我不怕问题的到来,因为问题总是可以得到解决的!

参考资料

附录:

程序的截图如下:

程序的代码如下: 登陆:Imports System.IO

Imports System.data

Imports System.Data.SqlClient

Public Class denglu

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button Protected WithEvents Button2 As System.Web.UI.WebControls.Button Protected WithEvents Button3 As System.Web.UI.WebControls.Button Protected WithEvents username As System.Web.UI.WebControls.TextBox Protected WithEvents password As System.Web.UI.WebControls.TextBox Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。 '不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的 '不要使用代码编辑器修改它。 InitializeComponent() End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e System.EventArgs) Handles MyBase.Load

'在此处放置初始化页的用户代码 End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e System.EventArgs) Handles Button1.Click

Response.Redirect(

As

As

As

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button2.Click

Dim

conn

=

New

SqlConnection(

conn.Open() Dim str As String

str =

Pwd='

Dim cmd As New SqlCommand(str, conn) Dim dr As SqlDataReader dr = cmd.ExecuteReader If (dr.Read()) Then

Session(

message.Text = Session(

message.Text =

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button3.Click

Response.Redirect(

End Class

主页:Imports System.Data Imports System.Data.SqlClient

Public Class WebForm2

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents yhm As System.Web.UI.WebControls.TextBox

Protected WithEvents mm As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents Button2 As System.Web.UI.WebControls.Button

Protected WithEvents Button3 As System.Web.UI.WebControls.Button

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents DataList1 As System.Web.UI.WebControls.DataList

Protected WithEvents lblStatus As System.Web.UI.WebControls.Label

Protected WithEvents intPageSize As System.Web.UI.WebControls.Label

Protected WithEvents intRecordCount As System.Web.UI.WebControls.Label

Protected WithEvents intCurrIndex As System.Web.UI.WebControls.Label

Protected WithEvents hrefFirst As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefPrevious As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefNext As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents hrefLast As System.Web.UI.HtmlControls.HtmlAnchor

Protected WithEvents Mylist As System.Web.UI.WebControls.DataList

Protected WithEvents username As System.Web.UI.WebControls.TextBox

Protected WithEvents password As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not IsPostBack Then

intPageSize.Text =

intCurrIndex.Text =

Call binddata()

End If

Dim conn As New SqlConnection(

Dim strsql As String

strsql =

Dim cmd As New SqlCommand(strsql, conn)

conn.Open()

Dim adp As New SqlDataAdapter(cmd)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim conn = New SqlConnection(

conn.Open()

Dim str As String

str =

Dim cmd As New SqlCommand(str, conn)

Dim dr As SqlDataReader

dr = cmd.ExecuteReader

If (dr.Read()) Then

Session(

message.Text = Session(

Else

message.Text =

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Response.Redirect(

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Response.Redirect(

End Sub

Public Sub BindData()

Dim conn As New SqlConnection(

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

If Not Page.IsPostBack() Then

adp.Fill(ds)

intRecordCount.Text = CStr(ds.Tables(0).Rows.Count)

ds = Nothing

ds = New DataSet

End If

adp.Fill(ds, CInt(intCurrIndex.Text), CInt(intPageSize.Text),

Mylist.DataSource = ds.Tables(0).DefaultView

Mylist.DataBind()

conn.Close()

PrintStatus()

End Sub

Public Sub ShowFirst_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefFirst.ServerClick

intCurrIndex.Text =

BindData()

End Sub

Public Sub ShowPrevious_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefPrevious.ServerClick

intCurrIndex.Text = CStr(CInt(intCurrIndex.Text) - CInt(intPageSize.Text))

If CInt(intCurrIndex.Text)

intCurrIndex.Text =

End If

BindData()

End Sub

Public Sub ShowNext_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefNext.ServerClick

If CInt(CInt(intCurrIndex.Text) + CInt(intPageSize.Text))

intCurrIndex.Text = CStr(CInt(intCurrIndex.Text) + CInt(intPageSize.Text))

End If

BindData()

End Sub

Public Sub ShowLast_click(ByVal s As Object, ByVal e As EventArgs) Handles hrefLast.ServerClick

Dim tmpInt As Integer

tmpInt = CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)

If tmpInt > 0 Then

intCurrIndex.Text = CStr(CInt(intRecordCount.Text) - tmpInt)

Else

intCurrIndex.Text = CStr(CInt(intRecordCount.Text) - CInt(intPageSize.Text)) End If

BindData()

End Sub

Private Sub PrintStatus()

lblStatus.Text =

lblStatus.Text +=

lblStatus.Text += CStr(CInt(CInt(intCurrIndex.Text) \ CInt(intPageSize.Text) + 1))

lblStatus.Text +=

If

(CInt(intRecordCount.Text) Mod CInt(intPageSize.Text)) > 0 And

CInt(intRecordCount.Text) > CInt(intPageSize.Text) Then

lblStatus.Text += CStr(CInt(CInt(intRecordCount.Text) \ CInt(intPageSize.Text) +

1))

ElseIf CInt(intRecordCount.Text)

lblStatus.Text +=

Else

lblStatus.Text += CStr(CInt(intRecordCount.Text) \ CInt(intPageSize.Text))

End If

lblStatus.Text +=

End Sub

Private Sub Mylist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mylist.SelectedIndexChanged

End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

End Sub

End Class

订单查询:Imports System.Data

Imports System.Data.SqlClient

Public Class ddcx

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents message1 As System.Web.UI.WebControls.Label

Protected WithEvents order As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Session(

Response.Redirect(

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn As New SqlConnection(

conn.Open()

Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then

dr.Close()

TextBox1.Text =

Dim sqlstr2 =

from Prod.P_discount,Prod.P_price,Basket.P_name,Basket.P_id,Basket.B_count,Basket.P_cash

Basket, Prod where O_number=

Dim adp As New SqlDataAdapter(sqlstr2, conn)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

Else

dr.Close()

Dim sqlstr3 =

from Prod.P_discount,Prod.P_price,Basket.P_name,Basket.P_id,Basket.B_count,Basket.P_cash

Basket, Prod where O_number=

Dim adp As New SqlDataAdapter(sqlstr3, conn)

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

message.Text =

End If

End Sub

End Class

商品管理:Imports System.Data

Imports System.Data.SqlClient

Public Class glsp

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents prodgrid As System.Web.UI.WebControls.DataGrid

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink3 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink4 As System.Web.UI.WebControls.HyperLink

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Dim conn As New SqlConnection(

If Not IsPostBack Then

Call BindData()

End If

End Sub

Sub BindData()

Dim adp As New SqlDataAdapter(

Dim ds As New DataSet

adp.Fill(ds,

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

End Sub

Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand DataGrid1.EditItemIndex = CInt(e.Item.ItemIndex)

Call BindData()

End Sub

Private Sub DataGrid1_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.CancelCommand DataGrid1.EditItemIndex = -1

Call BindData()

End Sub

Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim exp As Exception

Try

conn.Open()

cmd.ExecuteNonQuery()

conn.Close()

Catch exp

message.Text =

End Try

End Sub

Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand Dim txtP_typeid, txtP_type As TextBox

txtP_typeid = e.Item.Cells(3).Controls(0)

txtP_type = e.Item.Cells(4).Controls(0)

Dim strsql =

Dim cmd As New SqlCommand(strsql, conn)

Dim exp As Exception

Try

conn.Open()

cmd.ExecuteNonQuery()

conn.Close()

Catch exp

Label2.Text =

End Try

DataGrid1.EditItemIndex = -1

Call BindData()

End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

End Sub

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)

DataGrid1.PageIndexChanged

DataGrid1.CurrentPageIndex = e.NewPageIndex

End Sub

End Class

管理员登陆:

Imports System.IO

Imports System.data

Imports System.Data.SqlClient

Public Class guanliyuandelu

Handles

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents username As System.Web.UI.WebControls.TextBox

Protected WithEvents password As System.Web.UI.WebControls.TextBox

Protected WithEvents message As System.Web.UI.WebControls.Label

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

Handles MyBase.Load

'在此处放置初始化页的用户代码

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn = New SqlConnection(

conn.Open()

Dim str As String

str =

Dim cmd As New SqlCommand(str, conn)

Dim dr As SqlDataReader

dr = cmd.ExecuteReader

If (dr.Read()) Then

Session(

Response.Redirect(

Else

message.Text =

End If

End Sub

End Class

购物车:

Imports System.Data

Imports System.Data.SqlClient

Public Class gwc

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents txtquantity As System.Web.UI.WebControls.TextBox

Protected WithEvents Label7 As System.Web.UI.WebControls.Label

Protected WithEvents lbp_discount As System.Web.UI.WebControls.Label

Protected WithEvents lbp_price As System.Web.UI.WebControls.Label

Protected WithEvents lbptype As System.Web.UI.WebControls.Label

Protected WithEvents lbp_id As System.Web.UI.WebControls.Label

Protected WithEvents lbp_name As System.Web.UI.WebControls.Label

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents Table1 As System.Web.UI.HtmlControls.HtmlTable

Protected WithEvents message As System.Web.UI.WebControls.Label

Protected WithEvents message2 As System.Web.UI.WebControls.Label

Protected WithEvents message3 As System.Web.UI.WebControls.Label

Protected WithEvents message4 As System.Web.UI.WebControls.Label

Protected WithEvents message5 As System.Web.UI.WebControls.Label

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim conn As New SqlConnection(

conn.Open()

If Session(

Response.Redirect(

Else

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

message.Text =

message2.Text =

message3.Text =

message4.Text =

message5.Text =

conn.Close()

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim conn As New SqlConnection(

If CStr(Session(

Dim sqlstr1 =

Session(

Dim cmd1 As New SqlCommand(sqlstr1, conn)

conn.Open()

cmd1.ExecuteNonQuery()

conn.Close()

End If

Dim sqlstr2 =

Dim adp2 As New SqlDataAdapter(sqlstr2, conn)

Dim ds2 As New DataSet

adp2.Fill(ds2,

Dim dr2 As DataRow

dr2 = ds2.Tables(

Session(

conn.Close()

Dim sqlstr =

Dim adp As New SqlDataAdapter(sqlstr, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

Dim c_quantity As Integer

c_quantity = CInt(TextBox1.Text)

values('

Dim c_discount, total As Long

c_discount = CSng(dr(

total = c_quantity * c_discount

Dim c_pname = CStr(dr(

Dim sqlstr3 =

Dim cmd As New SqlCommand(sqlstr3, conn)

conn.Open()

' Response.Write(

cmd.ExecuteNonQuery()

conn.Close()

Response.Redirect(

End Sub

End Class

回复列表:

Imports System.Data

Imports System.Data.SqlClient

Public Class hfly

Inherits System.Web.UI.Page

#Region

'该调用是 Web 窗体设计器所必需的。

Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label2 As System.Web.UI.WebControls.Label

Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

Protected WithEvents Label4 As System.Web.UI.WebControls.Label

Protected WithEvents Subject As System.Web.UI.WebControls.TextBox

Protected WithEvents Label5 As System.Web.UI.WebControls.Label

Protected WithEvents Name As System.Web.UI.WebControls.TextBox

Protected WithEvents Label6 As System.Web.UI.WebControls.Label

Protected WithEvents Email As System.Web.UI.WebControls.TextBox

Protected WithEvents Label7 As System.Web.UI.WebControls.Label

Protected WithEvents Content As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.WebControls.Button

Protected WithEvents Button2 As System.Web.UI.WebControls.Button

Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox

Protected WithEvents TextBox4 As System.Web.UI.WebControls.TextBox

'注意: 以下占位符声明是 Web 窗体设计器所必需的。

'不要删除或移动它。

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: 此方法调用是 Web 窗体设计器所必需的

'不要使用代码编辑器修改它。

InitializeComponent()

End Sub

#End Region

Dim conn As New SqlConnection(

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim messageid = Request(

Dim strsql =

Dim adp As New SqlDataAdapter(strsql, conn)

Dim ds As New DataSet

adp.Fill(ds,

Dim dr As DataRow

dr = ds.Tables(

TextBox1.Text =

i = dr(

DataGrid1.DataSource = ds.Tables(

DataGrid1.DataBind()

Dim strsql2 =

Dim ds2 As New DataSet

adp2.Fill(ds2,

DataGrid2.DataSource = ds2.Tables(

DataGrid2.DataBind()

conn.Close()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


相关内容

  • 大学专业课程设置与毕业去向(一)
  • 大学专业课程设置与毕业去向(一) 经济贸易系 报关与国际货运专业 培养目标 本专业培养拥护党的基本路线,适应生产.建设.管理.服务第一线需要,德.智.体.美.劳全面发展,具有报关与国际货运专业的知识,掌握物流管理专业的技能,拥有物流管理专业的能力,适应物流管理专业工作的高等技术应用性专门人才. 职业 ...

  • [电子设计自动化(EDA)]课程论文题目及要求
  • <电子设计自动化(EDA)>课程论文题目及要求 一.论文题目: 设计一个以FPGA为主要部件的能实现一定功能的系统,完成一篇<基于FPGA的×××系统设计>课程论文. 二.论文格式和内容要求: 1. 封面: 1 <电子设计自动化(EDA)>课程论文 题目:基于FP ...

  • 电子商务类专业教学质量国家标准征求意见稿
  • 电子商务类专业教学质量 国家标准 (征求意见稿) 教育部高等学校电子商务类专业教学指导委员会 2014年9月2日 目 录 1.概述..................................................................................... ...

  • 我校电工电子技术课程设计论文
  • 谈我校的电工电子技术课程设计 摘要:为了巩固.深化和扩展学生的理论知识,并运用所学的理论知识和技能解决实际问题的能力及其基本工程素质,我校电工电子实验中心针对各工科类专业统一开设了"电工电子技术课程设计"这门课程.本文主要介绍了我校"电工电子技术课程设计"课程 ...

  • 教育技术学硕士毕业论文题目参考
  • 教育技术学硕士毕业论文题目参考(-)() 教育技术学硕士毕业论文题目参考(2002-2006) (3) 河北大学74 1 网络博客促进教师专业化发展研究 赵可云 河北大学 2006-07-08 2006 硕士 2 任务驱动法在中小学信息技术教学中的应用研究 郑莉平 河北大学 2006-07-08 2 ...

  • 电子商务专业毕业设计(论文)实施方案
  • 电子商务专业毕业设计(论文)实施方案 根据教学计划规定和专业实践教学安排,结合本系的实际情况,特制定珠海电大电子商务专业毕业生毕业设计(论文)实施方案. 一.撰写毕业设计(论文)的目的与意义 毕业设计(论文)是学生整个学习过程中一个极其重要的教学环节,是综合考察学生运用所学知识分析问题.解决问题能力 ...

  • 武汉大学信息安全培养方向
  • 计算机学院信息安全专业本科人才培养方案 一.专业代码.名称专业代码:071205w专业名称:信息安全二.专业培养目标 信息安全专业旨在培养能够从事计算机.通信.电子信息.电子商务技术.电子金融.电子政务.军事等领域的信息安全研究.应用.开发.管理等方面的高级技术人才.三.专业特色和培养要求 当今时代 ...

  • 八年级实用文体写作的解释
  • ⏹ ⏹ ⏹ ⏹ 掌握NE5000E/80E/40E产品的体系结构 掌握NE5000E/80E/40E的单板构成 掌握NE5000E/80E/40E换板操作 了解NE5000E/80E/40E升级操作 <实用文体写作> 第一部分 大纲说明 一.课程性质及教学目的和要求 <实用文体写作 ...

  • 高校教师工作手册样本
  • 湖南电子科技职业学院 教师工作手册 20 -20 学年第 学期 系 部 教 研 室 教 师 姓 名 技 术 职 称 年 月 日 填 表 说 明 1.按照具体落实情况,客观反映各项工作,实事求是地填写各种表格的规定栏目. 2.及时填写,以免遗忘或疏漏. 3.填写内容要求准确.简明扼要. 4.定期交教研 ...

  • 科技文献检索_课程论文
  • 09物理学 汪筠(0908410043) 关于"基于FPGA技术设计电子钟表电路"的科技文 献检索 [摘要] 本文从科研及毕业论文的角度,首先阐述了文献检索的概念及重要意义,然后通过对有关"基于FPGA技术设计电子钟表电路"的科技文献的检索,并对检索过程.结果 ...