this print for content only—size & color not accurate spine = 1.205" 640 page countPro ASP.NET 2.0 E-Commerce in C# 2005 Dear Reader, Throughout my many years of developing e-commerce ap
Trang 1this print for content only—size & color not accurate spine = 1.205" 640 page count
Pro ASP.NET 2.0 E-Commerce
in C# 2005
Dear Reader, Throughout my many years of developing e-commerce applications, I have encountered countless problems and solutions that I have always wanted to share with my fellow developers This book is the product of those experiences
Pro ASP.NET 2.0 E-Commerce in C# 2005 discusses all the decisions you
have to make when designing and developing an ASP.NET 2.0 e-commerce application for a client, from gathering the requirements to deploying the application Because e-commerce is often a vague concept, it can be hard at first to pin down exactly what is involved in a successful solution To overcome this problem, I have created a fictitious company, Little Italy Vineyards, that I use
as a case study throughout this book Using this real-world approach, I show you how to turn e-commerce concepts into code
After you have read this book and followed the case study from beginning to end, you will have a solid understanding of how to develop a professional ASP.NET 2.0 e-commerce application that is scalable and secure Specifically, you will learn about the finer points of application architecture, about how to set up your Visual Studio 2005 project correctly, and about how to obtain and install the SSL certificates you will need I cover the software engineering decisions extensively, as you might expect, but I also cover all the business elements you need to know to develop and maintain a successful e-commerce application that will fulfill your client’s expectations
Thank you for reading; I wish you every success in your development efforts
Paul Sarknas
Author of
Beginning Visual Web
Developer 2005 Express:
From Novice to Professional
Co-Author
ASP to ASP.NET Migration
Handbook: Concepts and
Strategies for Successful
Migration
US $59.99
Shelve in
Microsoft/.NET
User level:
Intermediate–Advanced
Sarknas
Paul Sarknas
Pro
ASP.NET 2.0 E-Commerce
ISBN 1-59059-724-9
9 781590 597248
5 5 9 9 9
6 89253 59724 8
Companion eBook Available
Learn the secrets behind a successful ASP.NET 2.0 e-commerce solution.
www.apress.com
www.littleitalyvineyards.com
SOURCE CODE ONLINE
Companion eBook
See last page for details
on $10 eBook version
RELATED TITLES
Pro
in C#
2005
Trang 2Pro ASP.NET 2.0 E-Commerce in C# 2005
Paul Sarknas
Trang 3Pro ASP.NET 2.0 E-Commerce in C# 2005
Copyright © 2006 by Paul Sarknas
All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher
ISBN-13 (pbk): 978-1-59059-724-8
ISBN-10 (pbk): 1-59059-724-9
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark
Lead Editor: Ewan Buckingham
Technical Reviewer: Fabio Claudio Ferracchiati
Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Keir Thomas, Matt Wade
Project Manager: Kylie Johnston
Copy Edit Manager: Nicole Flores
Copy Editor: Kim Wimpsett
Assistant Production Director: Kari Brooks-Copony
Production Editor: Kelly Winquist
Compositor/Artist: Kinetic Publishing Services, LLC
Proofreader: Lori Bring
Indexer: Brenda Miller
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA
94710 Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com The information in this book is distributed on an “as is” basis, without warranty Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work
The source code for this book is available to readers at http://www.apress.com in the Source Code/Download section
Trang 4Contents at a Glance
iii
About the Author xv
About the Technical Reviewer xvii
Introduction xix
PART 1 ■ ■ ■ The Basics ■ CHAPTER 1 Introducing E-commerce Systems 3
■ CHAPTER 2 Introducing the Microsoft Tools 7
■ CHAPTER 3 Exploring the Company Background for the Case Study 13
PART 2 ■ ■ ■ The Business Aspects ■ CHAPTER 4 Gathering the Requirements 19
■ CHAPTER 5 Turning Sales into Profits 27
■ CHAPTER 6 Examining the Risks 31
PART 3 ■ ■ ■ The Project Plan and Design ■ CHAPTER 7 Modeling Objects with UML 39
■ CHAPTER 8 Designing the Database with SQL Server 2005 55
■ CHAPTER 9 Using Visual Studio 2005 91
PART 4 ■ ■ ■ Architecture ■ CHAPTER 10 Building the Complete System Architecture 111
■ CHAPTER 11 Creating the Common Objects 115
■ CHAPTER 12 Creating the Data Access Layer 131
■ CHAPTER 13 Creating the Business Logic Layer 151
■ CHAPTER 14 Exploring Your Integration Options 173
■ CHAPTER 15 Creating the Presentation Layer 191
Trang 5PART 5 ■ ■ ■ Core Development
■ CHAPTER 16 Developing the Product Catalog 223
■ CHAPTER 17 Building the Shopping Cart 269
■ CHAPTER 18 Integrating the PayPal SDK 321
■ CHAPTER 19 Implementing the Checkout Process 347
■ CHAPTER 20 Processing the Payment 375
■ CHAPTER 21 Creating the Administrator’s Control Panel 433
■ CHAPTER 22 Building the Customer’s Account 475
PART 6 ■ ■ ■ Order Fulfillment and Promotion ■ CHAPTER 23 Managing the Orders 501
■ CHAPTER 24 Promoting the Site and Upselling 533
■ CHAPTER 25 Accessing the Money from the Credit Card Transaction 567
PART 7 ■ ■ ■ Deployment ■ CHAPTER 26 Exploring Your Compilation and Deployment Options 575
■ CHAPTER 27 Configuring the Production Environment 583
PART 8 ■ ■ ■ Aftercare ■ CHAPTER 28 Supporting and Maintaining the Application 601
■ INDEX 609
Trang 6solution file, creating, 92
source code See code; exercises
SQL caching invalidation, 604
SQL injection attacks, 34
SQL Server 2005, 8, 55–89
SQL Server 2005 Express, 56
SQL Server jobs, deleting abandoned
shopping carts and, 314 SQL Server Management Studio, 55
SQLHelper class, 165
SSL (Secure Sockets Layer) certificates, 8, 33,
590–596 Starkowicz, Eric, 191
State field, 75
stored procedures, 34, 224–228
StoredProcedure class, 142, 165, 274
SubmissionError property, 389, 422
SubmitOrder() method, 422
subscriptions, 24
supply and demand, 31
support, 601–607
symbols, for activity diagrams, 40
system architecture, 111–114
business logic layer and, 151 data access layer and, 131 system boundaries, 47
system downtime, 32
■ T
T-SQL (Transact-SQL), 8
Table Script
Address table, 76 ContactInformation table, 77 EndUser table, 73
EndUserType table, 74 OrderDetails table, 70 Orders table, 68 OrderStatus table, 71 Product Category table, 65 ProductImages table, 66 ShoppingCart table, 79 tables, 59–79, 87
Tax property, 496
test certificates
configuring, 342 creating, 336 incorporating into web projects, 344
textShippedDate text box, 523 tiers, 111
tilde (~), 495 tools, 7–11 ASPNET_REGSQL, 605 Class Designer, 8 NET Framework 2.0, 8 SQL Server Management Studio, 55 traffic-monitoring, 601
Visio, 8
Visual Studio 2005 See Visual Studio 2005
tracking orders, 23 TrackingNumber field, 68 traffic, monitoring, 601 Transact-SQL (T-SQL), 8 TransactionBase class, 427 TransactionID field, 67
transactions See processing payments
try/catch statements, 190 type inserts, 87
TypeName field, 74
■ U
UI (user interface), design/layout for, 191 UML (Unified Modeling Language), 8, 39–54 uniform resource locator (URL), specifying for PayPal, 580
UnsubscribeCustomer() method, 566 updating
orders, 518–524 products, 457–468 shopping cart, 300–313 upselling, 28, 533–543 URL (uniform resource locator), specifying for PayPal, 580
use cases, 46 user accounts, creating, 350–365, 475–498 user interface (UI), design/layout for, 191 UserData property, 555
users See customers
Utilities class, 180
■ V
Visio (Microsoft), 8, 39 Visual Studio 2005 (Microsoft), 7, 91–108 business logic layer, implementing into, 154
Trang 7Default.aspx web form and, 199 refactoring within, 126–130 Visual Studio 2005 Class Designer tool, 8
VPN connections, 597
■ W
warnings, resolving, 575
web forms, creating, 198–220
web pages
creating, 198–220 master page and, 192–198 Web project, 95, 99
web references, adding to projects, 181
web servers, IIS and, 585
web services, 181–187 Web.config file, finalizing, 597 WebLog Expert tool, 601
website See e-commerce application wine business case study See Little Italy
Vineyards case study Wine of the Month Club, 24, 29 Winery web page, 202
■ X
XML data, 113
■ Z
ZIP code, 75