求在线购物的ASP.NET代码,最好是Code Behind的

km168 2003-11-21 10:40:52
如题
...全文
35 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
chegan 2003-11-24
  • 打赏
  • 举报
回复
http://www.asp.net/Default.aspx?tabindex=7&tabid=41
有一些例子,可以参考。
km168 2003-11-23
  • 打赏
  • 举报
回复
装完以后打开:

显示“解决方案看起来是受原代码管理,但无法找到它的绑定信息。保存解决方案的原代码管理设置的MSSCCPRJ.SCC文件或其他项可能已被删除。由于无法自动恢复这些缺少的信息,缺少绑定的项目将被视为不受源代码管理”。

点“确定”后,

又显示“项目似乎处于源代码管理下,但此计算机上没有安装原代码管理提供程序。对此项目将禁用原代码管理集成”

怎么办?
km168 2003-11-23
  • 打赏
  • 举报
回复
up
km168 2003-11-22
  • 打赏
  • 举报
回复
哪里能下载PetShop代码?
loulanlouzhu 2003-11-22
  • 打赏
  • 举报
回复
http://download.microsoft.com/download/.netframesdk/petshop/2.0/NT5XP/EN-US/petshop.msi


===弯弯的月亮小小的船,小小的船,两头尖,我在小小的船里坐,只看见闪闪
的星星蓝蓝的天.

===本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
asp111222 2003-11-21
  • 打赏
  • 举报
回复
using System;
using System.Collections;

//References to PetShop specific libraries
//PetShop busines entity library
using PetShop.Model;

namespace PetShop.BLL {

/// <summary>
/// An object to represent a customer's shopping cart
/// </summary>
[Serializable]
public class Cart : IEnumerable {

/// <summary>
/// Internal storage for a cart
/// </summary>
private ArrayList _items = new ArrayList();

private decimal _total=0;

/// <summary>
/// Returns an enumerator for the cart items in a cart
/// </summary>
/// <returns></returns>
public IEnumerator GetEnumerator() {
return _items.GetEnumerator();
}

// Properties
public decimal Total {
get { return _total; }
set { _total = value; }
}

/// <summary>
/// Returns number of items in cart
/// </summary>
public int Count {
get { return _items.Count; }
}

/// <summary>
/// Return CartItem representation of object at a given address
/// </summary>
public CartItemInfo this[int index] {
get { return (CartItemInfo)_items[index]; }
}

/// <summary>
/// Add an item to the cart
/// </summary>
/// <param name="ItemId">ItemId of item to add</param>
public void Add(string ItemId) {
foreach (CartItemInfo cartItem in _items) {
if (ItemId == cartItem.ItemId) {
cartItem.Quantity++;
cartItem.InStock = (GetInStock(ItemId) - cartItem.Quantity) >= 0 ? true : false;
_total = _total+(cartItem.Price*cartItem.Quantity);
return;
}
}

Item item = new Item();

ItemInfo data = item.GetItem(ItemId);
CartItemInfo newItem = new CartItemInfo(ItemId,data.Name, (data.Quantity >= 1), 1, (decimal)data.Price);
_items.Add(newItem);
_total = _total+(data.Price);
}

/// <summary>
/// Remove item from the cart based on itemId
/// </summary>
/// <param name="itemId">ItemId of item to remove</param>
public void Remove(string itemId) {
foreach (CartItemInfo item in _items) {
if (itemId == item.ItemId) {
_items.Remove(item);
_total = _total-(item.Price*item.Quantity);
return;
}
}
}

/// <summary>
/// Removes item from cart at specific index
/// </summary>
/// <param name="index">Element number of item to remove</param>
public void RemoveAt(int index) {
CartItemInfo item = (CartItemInfo)_items[index];
_total = _total-(item.Price*item.Quantity);
_items.RemoveAt(index);

}

/// <summary>
/// Returs internal array list of cart items
/// </summary>
/// <returns></returns>
public ArrayList GetCartItems() {
return _items;
}

/// <summary>
/// Method to convert internal array of cart items to order line items
/// </summary>
/// <returns>New array list of order line items</returns>
public ArrayList GetOrderLineItems() {

ArrayList orderLineItems = new ArrayList();

int lineNum = 1;

foreach (CartItemInfo item in _items) {

LineItemInfo lineItem = new LineItemInfo(item.ItemId, item.Name, lineNum, item.Quantity, item.Price);
orderLineItems.Add(lineItem);
lineNum++;
}

return orderLineItems;
}


/// <summary>
/// Internal method to get the stock level of an item
/// </summary>
/// <param name="ItemId">Unique identifier of item to get stock level of</param>
/// <returns></returns>
private int GetInStock(string ItemId){
Inventory inventory = new Inventory();

return inventory.CurrentQuantityInStock(ItemId);
}
}
}
asp111222 2003-11-21
  • 打赏
  • 举报
回复
PetShop
webdiyer 2003-11-21
  • 打赏
  • 举报
回复
PetShop
或者
Duwamish

都是精典
loulanlouzhu 2003-11-21
  • 打赏
  • 举报
回复
参见vs.net自带duwamish例子!


===弯弯的月亮小小的船,小小的船,两头尖,我在小小的船里坐,只看见闪闪
的星星蓝蓝的天.


===本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
上篇 ASP.NET应用与开发基础 第1章 ASP.NET概论 1.1 ASP.NET简介 1.1.1 从.NET谈起 1.1.2 动态网站设计技术 1.1.3 ASP.NET的介绍 1.1.4 ASP.NET和ASP的对比 1.2 运行环境配置 1.2.1 ASP.NET运行环境介绍 1.2.2 lis的安装和配置 1.2.3 安装Microsoft.NET Framework SDK 1.2.4 Visual Studio.NET的简介 1.3 从HelloWorld开始 1.3.1 用HTML编写的Hello World程序 1.3.2 用C#编写的Hello World程序 1.4 小结 1.5 习题 第2章 ASP.NET语言基础 2.1 C#言简介 2.2 一个简单的程序 .2.3 C#中的数据类型 2.3.1 整型 2.3.2 浮点型 2.3.3 布尔型 2.3.4 字符型 2.3.5 预定义引用类型 2.4 C#中的变量和常量 2.4.1 变量声明和赋值 2.4.2 定义常量 2.4.3 枚举类型 2.5 C#中的操作符与表达式 2.5.1 赋值运算符 2.5.2 算术运算符 2.5.3 比较运算符 2.5.4 布尔逻辑运算符 2.5.5 位运算符 2.6 C#中的控制语句 2.6.1 选择语句 2.6.2 循环语句 2.7 C#中的类机制简介 2.8 小结 2.9 习题 第3章 Web Form 3.1 Web Form概述 3.1.1 什么是Web Form 3.1.2 Web Form的组成 3.1.3 第一个Web Form程序 3.1.4 让Web Form支持中文 3.2 Web Form语法知识 3.2.1 aspx文件的构成 3.2.2 服务器控件(Server Controls) 3.2.3 Web Form的Code-Behind代码组织方式 3.3 Web Form页面处理 3.3.1 页面处理内部过程 3.3.2 页面的一次往返处理 3.3.3 页面重建 3.4 声明和使用服务器控件 3.4.1 声明服务器控件 3.4.2 响应服务器控件 3.5 小结 3.6 习题 第4章 服务器控件 4.1 常用的HTML控件 4.1.1 表单控件 4.1.2 表格控件 4.1.3 其他控件 4.2 Web控件 4.2.1 Label控件 4.2.2 Button控件 4.2.3 CheckBox和CheckBoxList控件 4.2.4 RadioButton和RadioButtonList控件 4.2.5 Image控件和ImageButton控件 4.2.6 HyperLink和LinkButton控件 4.2.7 DropDownList和ListBox控件 4.2.8 Panel控件 4.2.9 TextBox控件 4.2.10 Table控件、TableRow控件及TableCel!控件 4.2.11 高级控件 4.3 验证控件 4.3.1 验证控件概述 4.3.2 验证控件的类型 4.3.3 验证技术的综合应用 4.4 用户控件 4.4.1 用户控件概述 4.4.2 用户控件中定义属性 4.4.3 用户控件中的事件处理 4.4.4 从Web Form页面到用户控件 4.5 小结 4.6 习题 中篇 ASP.NET应用与开发的核心内容 第5章 AD0.NET数据库连接 5.1 ADO.NET基本概念 5.1.1 ADO.NET对象模型 5.1.2 ADO.NET对比ADO 5.2 ADO.NET数据库连接概述 5.3 使用Connection对象 5.4 使用Command和DataReader对象 5.4.1 Command对象 5.4.2 DataReader对象 5.4.3 使用Command对象实现存储过程访问 5.5 使用DataSet对象 5.5.1 DataTableCollection对象 5.5.2 DataRelationCollection对象 5.5.3 ExtendedProperties对象 5.5.4 使用DataSet对象获取数据 5.5.5 使用DataSet 5.5.6 使用DataTable 5.6 使用DataAdapter对象 5.7 小结 5.8 习题 第6章 ADO.NET数据管理与数据控件 6.1 SQL操作 6.1.1 数据查询 6.1.2 数据更新 6.2 数据绑定技术 6.3 DmaGdd控件 6.3.1 在DataGfid中显示数据 6.3.2 为DataGrid添加多功能列 6.4 Repeater控件 6.5 DataList控件 6.6 小结 6.7 习题 第7章 跟踪调试ASP,NET程序 7.1 错误的种类 7.2 跟踪ASP.NET程序 7.2.1 页面级的跟踪 7.2.2 应用程序级的跟踪 7.3 调试ASP.NET程序 7.3.1 调试ASP.NET程序 7.3.2 设置断点 7.4 小结 7.5 习题 第8章 ASP.NET应用程序 8.1 什么是应用程序 8.2 ASP.NET配置文件概述 8.2.1 什么是配置文件 8.2.2 ASP.NET程序配置文件格式 8.2.3 配置文件的内容格式 8.3 ASP.NET应用程序中的用户状态管理 8.3.1 Global.asax文件概述 8.3.2 Application对象事件 8.3.3 Session对象事件 8.3.4 其他几种客户端的用户状态管理方法 8.3.5 本小节提示 8.4 ASP.NETHTFP运行情况 8.4.1 HTFP运行情况介绍 8.4.2 HTFP处理程序 8.5 小结 8.6 习题 第9章 ASP.NET与XML 9.1 XML简介 9.1.1 什么是标记语言 9.1.2 HTML的弊病 9.1.3 什么是XML 9.2 XML基本语法 9.2.1 语法的基本要和概念 9.2.2 文件 9.2.3 XML文件的逻辑结构 9.2.4 XML文件的物理结构 9.3 操作XML 9.3.1 XML控件 9.3.2 XmlTextReader 9.3.3 XmlTextWriter 9.3.4 XML DOM 9.3.5 XmlDataDOcument 9.3.6 DataSet 9.4 小结 9.5 习题 第10章 web service 10.1 Web Service简介 10.2 一个简单的Web Service程序 10.3 Web Service支持的数据类型 10.4 建立Web Service 10.5 使用Web Service 10.6 使用Session和Application对象 10.7 小结 10.8 习题 下篇 ASP.NET在实际中的应用与YF发 第11章 留言板的实现 11.1 系统功能及结构描述 11.2 数据库的实现 11.3 各功能模块的具体实现 11.4 小结 11.5 习题 第12章 网上书店开发实例 12.1 网上书店的系统设计 12.2 网上书店的数据库设计 12.3 网上书店的实现 12.3.1 实现用户登录 12.3.2 实现用户注册 12.3.3 实现分类浏览 12.3.4 实现按名搜索 12.3.5 查看图书介绍 12.3.6 购物车及购买 12.3.7 客户订单管理 12.3.8 新书入库 12.3.9 封面上载 12.3.10 库存管理 12.4 小结
上篇ASP.NET应用与开发基础 第1章ASP.NET概论 1.1ASP.NET简介 1.1.1从.NET谈起 1.1.2动态网站设计技术 1.1.3ASP.NET的介绍 1.1.4ASP.NET和ASP的对比 1.2运行环境配置 1.2.1ASP.NET运行环境介绍 1.2.21lS的安装和配置 1.2.3安装Microsoft.NETFrameworkSDK 1.2.4VisualStudio.NET的简介 1.3从HelloWorld开始 1.3.1用HTML编写的HelloWorld程序 1.3.2用C#编写的HelloWorld程序 1.4小结 1.5习题 第2章ASP.NET语言基础 2.1C#语言简介 2.2一个简单的程序 2.3C#中的数据类型 2.3.1整型 2.3.2浮点型 2.3.3布尔型 2.3.4字符型 2.3.5预定义引用类型 2.4C#中的变量和常量 2.4.1变量声明和赋值 2.4.2定义常量 2.4.3枚举类型 2.5C#中的操作符与表达式 2.5.1赋值运算符 2.5.2算术运算符 2.5.3比较运算符 2.5.4布尔逻辑运算符 2.5.5位运算符 2.6C#中的控制语句 2.6.1选择语句 2.6.2循环语句 2.7C#中的类机制简介 2.8小结 2.9习题 第3章WebForm 3.1WebForm概述 3.1.1什么是WebForm 3.1.2WebForm的组成 3.1.3第一个WebForm程序 3.1.4让WebForm支持中文 3.2WebForm语法知识 3.2.1aspx文件的构成 3.2.2服务器控件(ServerControls) 3.2.3WebForm的Code-Behind代码组织方式 3.3WebForm页面处理 3.3.1页面处理内部过程 3.3.2页面的一次往返处理 3.3.3页面重建 3.4声明和使用服务器控件 3.4.1声明服务器控件 3.4.2响应服务器控件 3.5小结 3.6习题 第4章服务器控件 4.1常用的HTML控件 4.1.1表单控件 4.1.2表格控件 4.1.3其他控件 4.2Web控件 4.2.1Label控件 4.2.2Button控件 4.2.3CheckBox和CheckBoxList控件 4.2.4RadioButton和RadioButtonList控件 4.2.51mage控件和ImageButton控件 4.2.6HyperLink和LinkButton控件 4.2.7DropDownList和ListBox控件 4.2.8Panel控件 4.2.9TextBox控件 4.2.10Table控件、TableRow控件及TableCell控件 4.2.11高级控件 4.3验证控件 4.3.1验证控件概述 4.3.2验证控件的类型 4.3.3验证技术的综合应用 4.4用户控件 4.4.1用户控件概述 4.4.2用户控件中定义属性 4.4.3用户控件中的事件处理 4.4.4从WebForm页面到用户控件 4.5小结 4.6习题 中篇ASP.NET应用与开发的核心内容 第5章AD0.NET数据库连接 5.1ADO.NET基本概念 5.1.1ADO.NET对象模型 5.1.2ADO.NET对比ADO 5.2ADO.NET数据库连接概述 5.3使用Connection对象 5.4使用Command和DataReader对象 5.4.1Command对象 5.4.2DataReader对象 5.4.3使用Command对象实现存储过程访问 5.5使用DataSet对象 5.5.1DataTableCollection对象 5.5.2DataRelationCollection对象 5.5.3ExtendedProperties对象 5.5.4使用DataSet对象获取数据 5.5.5使用DataSet 5.5.6使用DataTable 5.6使用DataAdapter对象 5.7小结 5.8习题 第6章AD0.NET数据管理与数据控件 6.1SQL操作 6.1.1数据查询 6.1.2数据更新 6.2数据绑定技术 6.3DataGrid控件 6.3.1在DataGrid中显示数据 6.3.2为DataGrid添加多功能列 6.4Repeater控件 6.5DataList控件 6.6小结 6.7习题 第7章跟踪调试ASP.NET程序 7.1错误的种类 7.2跟踪ASP.NET程序 7.2.1页面级的跟踪 7.2.2应用程序级的跟踪 7.3调试ASP.NET程序 7.3.1调试ASP.NET程序 7.3.2设置断点 7.4小结 7.5习题 第8章ASP.NET应用程序 8.1什么是应用程序 8.2ASP.NET配置文件概述 8.2.1什么是配置文件 8.2.2ASP.NET程序配置文件格式 8.2.3配置文件的内容格式 8.3ASP.NET应用程序中的用户状态管理 8.3.1Global.asax文件概述 8.3.2Application对象事件 8.3.3Session对象事件 8.3.4其他几种客户端的用户状态管理方法 8.3.5本小节提示 8.4ASP.NETHTFP运行情况 8.4.1HTYP运行‘晴况介绍 8.4.2HTFP处理程序 8.5小结 8.6习题 第9章ASP.NET与XML 9.1XML简介 9.1.1什么是标记语言 9.1.2HTML的弊病 9.1.3什么是XML 9.2XML基本语法 9.2.1语法的基本要和概念 9.2.2文件 9.2.3XML文件的逻辑结构 9.2.4XML文件的物理结构 9.3操作XML 9.3.1XML控件 9.3.2XmlTextReader. 9.3.3XmlTextWriter 9.3.4XMLDOM 9.3.5XmlDataDocument 9.3.6DataSet 9.4小结 9.5习题 第10章WebSeMce 10.1WebService简介 10.2一个简单的WebService程序 10.3WebService支持的数据类型 10.4建立WebService 10.5使用WebService 10.6使用Session和Application对象 10.7小结 10.8习题 下篇ASP.NET在实际中的应用与开发 第11章留言板的实现 11.1系统功能及结构描述 11.2数据库的实现 11.3各功能模块的具体实现 11.4小结 11.5习题 第12章网上书店开发实例 12.1网上书店的系统设计 12.2网上书店的数据库设计 12.3网上书店的实现 12.3.1实现用户登录 12.3.2实现用户注册 12.3.3实现分类浏览 12.3.4实现按名搜索 12.3.5查看图书介绍 12.3.6购物车及购买 12.3.7客户订单管理 12.3.8新书入库 12.3.9封面上载 12.3.10库存管理 12.4小结
Beginning ASP.NET 4 in VB 2010 The most up-to-date and comprehensive introductory ASP.NET book you’ll find on any shelf, Beginning ASP.NET 4 in VB 2010 guides you through Microsoft’s latest technology for building dynamic web sites. This book will enable you to build dynamic web pages on the fly, and assumes only the most basic knowledge of Visual Basic. The book provides exhaustive coverage of ASP.NET, guiding you from your first steps right up to the most advanced techniques, such as querying databases from within a web page and tuning your site for optimal performance. Within these pages, you’ll find tips for best practices and comprehensive discussions of key database and XML principles you need to know in order to be effective with ASP.NET. The book also emphasizes the invaluable coding techniques of object orientation and code-behind, which will start you off on the track to building real-world web sites right from the beginning—rather than just faking it with simplified coding practices. By the time you’ve finished the book, you will have mastered the core techniques and have all the knowledge you need to begin work as a professional ASP.NET developer. What you’ll learn * How to build well-structured ASP.NET applications from the first principles, including how to incorporate data from databases, XML files, web services, and other services. * A solid understanding of key ASP.NET concepts such as master pages, themes, state management, and error handling, and of which techniques work best in which situations. * How to improve the user experience of your pages through the use of ASP.NET AJAX and Silverlight to increase interactivity and provide input validation. Author Information Matthew MacDonald Matthew MacDonald is an author, educator, and MCSD developer who has a passion for emerging technologies. He is a regular writer for developer journals such as Inside Visual Basic, ASPToday, and Hardcore Visual Studio .NET, and he's the author of several books about programming with .NET, including User Interfaces in VB .NET: Windows Forms and Custom Controls, The Book of VB .NET, and .NET Distributed Applications. In a dimly remembered past life, he studied English literature and theoretical physics. Send e-mail to him with praise, condemnation, and everything in between, to p2p@prosetech.com.

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧