Shopping Cart using C#.NET, Web Forms and SQL...
来源:百度文库 编辑:神马文学网 时间:2024/04/26 23:03:30
Introduction
This application is a Shopping Cart where users can select items and place an order. I have added the features of login, and adding new users if user does not exist. Validations are performed wherever needed like email format validation, zipcode etc.
Fig. 1
Database: For the purpose, I have used the NorthWind database and SQL Server.
The two main tables used are:
Products table Order Details table.
I have used two classes:
public class CartRow{public string id;public string name;public string price;public string items;};public class Cart{public System.Collections.ArrayList list = new ArrayList(20);};
The two main web-forms are Main.aspx and CheckOut.aspx. Main.aspx contains a grid showing all items present in the products table along with the price per unit and the quantity per unit. Fig 1 shows the Main.aspx page, where user can select items from the products grid (left). As he selects an item, it is added to his cart and the item is displayed in the right panel. The total price is displayed in the label above. As the user adds more items to his cart, the recalculated price is shown. Upon clicking the clear cart button, the cart gets empty.
If the user now wants to finalize the order and presses the CheckOut button, he is redirected to the Login.aspx page (Fig 2). I have set the default username as “user” for the sample and password is “u”.
Fig 2.
And finally, the user is asked to enter the Credit Card number, billing PIN code and his email address. It does the client side validations and then confirms the order placed by sending a mail to the user as shown in (Fig 3).
And the order is finalized. For more advanced shopping cart, this information plus the item information has to be stored in some database.
Fig 3
About Shruti Shrivastava
I have done Master’s in Computer Science. Also I am Microsoft Certified Application Developer (MCAD .NET). I am working with Visual C# .NET since two years. Currently I am looking for a job as C# Developer. You can reach me at shru27@hotmail.com. Clickhere to view Shruti Shrivastava's online profile.
Other popular ASP.NET articles:
ASP.NET Popup Control Highly customizable JavaScript popup control for web page wrapped in ASP.NET custom control.
NHibernate Best Practices with ASP.NET, 1.2nd Ed. This article describes best practices for leveraging the benefits of NHibernate 1.2, ASP.NET, generics, and unit testing together.
Role-based Security with Forms Authentication Provides insight and tips on using role-based (groups) Forms Authentication in ASP.NET, which has only partial support for roles.
A Session Data Management Tool Introducing a .NET web service to manage session data for multiple applications
This application is a Shopping Cart where users can select items and place an order. I have added the features of login, and adding new users if user does not exist. Validations are performed wherever needed like email format validation, zipcode etc.
Fig. 1
Database: For the purpose, I have used the NorthWind database and SQL Server.
The two main tables used are:
Products table Order Details table.
I have used two classes:
public class CartRow{public string id;public string name;public string price;public string items;};public class Cart{public System.Collections.ArrayList list = new ArrayList(20);};
The two main web-forms are Main.aspx and CheckOut.aspx. Main.aspx contains a grid showing all items present in the products table along with the price per unit and the quantity per unit. Fig 1 shows the Main.aspx page, where user can select items from the products grid (left). As he selects an item, it is added to his cart and the item is displayed in the right panel. The total price is displayed in the label above. As the user adds more items to his cart, the recalculated price is shown. Upon clicking the clear cart button, the cart gets empty.
If the user now wants to finalize the order and presses the CheckOut button, he is redirected to the Login.aspx page (Fig 2). I have set the default username as “user” for the sample and password is “u”.
Fig 2.
And finally, the user is asked to enter the Credit Card number, billing PIN code and his email address. It does the client side validations and then confirms the order placed by sending a mail to the user as shown in (Fig 3).
And the order is finalized. For more advanced shopping cart, this information plus the item information has to be stored in some database.
Fig 3
About Shruti Shrivastava
I have done Master’s in Computer Science. Also I am Microsoft Certified Application Developer (MCAD .NET). I am working with Visual C# .NET since two years. Currently I am looking for a job as C# Developer. You can reach me at shru27@hotmail.com. Clickhere to view Shruti Shrivastava's online profile.
Other popular ASP.NET articles:
ASP.NET Popup Control Highly customizable JavaScript popup control for web page wrapped in ASP.NET custom control.
NHibernate Best Practices with ASP.NET, 1.2nd Ed. This article describes best practices for leveraging the benefits of NHibernate 1.2, ASP.NET, generics, and unit testing together.
Role-based Security with Forms Authentication Provides insight and tips on using role-based (groups) Forms Authentication in ASP.NET, which has only partial support for roles.
A Session Data Management Tool Introducing a .NET web service to manage session data for multiple applications
Shopping Cart using C#.NET, Web Forms and SQL...
Debugging ""C"" And ""C++"" Programs Using ""gdb""
Building And Using Static And Shared ""C"" Libraries
Hacked By MosyAnsar - Using Subversion with Visual Studio and .NET
关于ASP.NET Web Forms和ASP.NET MVC技术之争论
ASP.NET: Selectively Enable Form Validation When Using ASP.NET Web Controls -- MSDN Magazine, April
XML in .NET: .NET Framework XML Classes and C...
blyberg.net Taking advantage of Web and Library 2.0
C#Using用法
如何保存SQL的money类型数据。 .NET技术 / VB.NET - CSDN社区 c...
Online shopping and the Harry Potter effect
Online shopping and the Harry Potter effect
Understanding and Using SWOT Analysis
Understanding and Using SWOT Analysis
敏捷软件开发11个原则 - (Java/C/Php/C /.NET) (OS,DB,Web,Net,Graph,Game) - CSDN博客
也谈C#.NET防止SQL注入式攻击 - jacky73 - 博客园
ASP和HTML表单 (ASP and HTML Forms)
Backup and Restore MySQL Database Using mysql...
Web 2.0 And Web 1.0
Semantic Web and Web 2.0
Semantic Web and Web 2.0
Using XML Validation Framework with Web Services
Selective Validation Using ASP.NET Validation Controls
.Net Expression Evaluator using DynamicMethod (转CodeProject)