You are on page 1of 44

CHAPTER-1

INTRODUCTION

In modern era, computers have made everything under one roof and have knit the world together. Because of IT revolution computers have been made the core element in every place. Computerization has become an eventical one for people who prefer speedy and ease of access. Human beings are liable to make mistakes and the output usually depends on the efficiency of the persons involved. But computers could usually generate efficient which varies upon the person operating the system. This project entitled Online Web Mart System For Jewellery is designed to maintain the jewel items sales activities. This system keeps track of all sales activities and also details about customers and product items. This project is developed using Microsoft Visual Studio as front end and MS SQL Server 2005 as back end.

1.1 Problem Description In this modern competitive world marketing a product of a company is very difficult task. They have to tackle the competitors, dealers and customers. In every stage of marketing the product, the company should have to plan perfectly. Otherwise they cannot able to market their products successfully. Nowadays, Internet becomes one of the most popular media to reach the customer directly and market our products to the customers directly. 1.2 Project Objective This project Online Web Mart System For Jewellery is an online shopping center, through which consumer can buy the jeweler products online. Users of this site can use this site not only for buying the products but they can get full information about all of the jeweler products. Wide range of product categories makes it easier. The steps involved in placing order for consumer products are as follows. Users first view the categories list, and then they can view the particular product details with image facility. They view the product image in large and small size. They can get the prize and all mandatory details. If they choose one product to buy, then they add that product to cart by using Add to cart link. They can view the cart whenever they want. Shopping cart has all the products which were chosen by the user. It displays the Name of the product, quantity, price per quantity, total price, for purchased products. It also has the removes from cart buttons to delete the products in the shopping cart. After purchase the products user provide the payment details to the supplier. They must fill up the form in the payment module. Here they give the payment mode, address for communication, name, etc. through this information payment is transferred for the purchased products. The seller can remotely upload the product image and specification so that the administrator of the site can place it at the showcase online. The buyer can select the product and confirm the order by giving their details.

CHAPTER-2
SYSTEM ANALYSIS 2.1 Existing System To market the products in such distance, the company has to appoint dealers and they have to monitor their products will slash down. Payment tracking is also a tedious job in the manual marketing. The company has to keep track of the manpower requirement, their work details, payment details and have to deploy more employees in this regard. To overcome these kind problems, the company is decided to market through Internet. 2.2 Proposed System This project Online Web Mart System for Jewellery is an online shopping, through which we can buy the products online. The users of this site can use this site not only for buying the products but they can get full information about all of the consumer products. Wide range of product categories makes it easier. The idea of this site is to have a central hub for users to buy their products. The administrator can remotely upload the product image and specifications of the site. The buyer can select the product and confirm the order by giving their details. The payment can also be made online. The admin has privileges to view the reports about the site and based on the information gathered the sites business part can be enhanced.

CHAPTER-3
SYSTEM SPECIFICATION 3.1 Hardware Specification Processor RAM Hard Disk 1.44 MB FDD 52X CD ROM 14 LCD Monitor 104 Keys Keyboard : : : Intel Pentium D CPU 3.00 GHZ 1 GB 80 GB

3.2 Software Specification Front end Back end Frame work Code behind file : : : : Microsoft Visual Studio .NET 2008 MS SQL Server 2005 ASP.NET C#

Operating System : WINDOWS 2007

CHAPTER-4
SOFTWARE DESCRIPTION 4.1 Front End Description Introduction To ASP.NET ASP.NET is the part of the .Net framework. ASP.NET, the latest version of Active Server Pages, is Microsofts technology for building dynamic, databasedriven websites. Active Server Pages is one of the most popular languages for building scalable, interactive Web sites. Several of the highest traffic Web sites on the Internet employs Active Server Pages.ASP.NET represents a radical departure from previous versions of Active Server Pages. Features of ASP.NET ASP.NET uses compiled code for written in Common Language Runtime languages such as Visual Basic and C#. ASP.NET pages are built out of server-side controls. Web server enables us to represent and program against Hypertext Markup Language (HTML) elements using an intuitive object model. ASP.NET includes a new technology called Web Services. It is used to access methods and properties and transfer database data across the Internet. ASP.NET is the part of Microsofts .Net framework. Anyone can access

thousands of .Net classes in the code that enable us to perform wondrously diverse tasks as generating images on-the fly and saving an array to a file. ASP.NET includes page and data caching mechanisms that enable us to easily and dramatically improve the performance of the Web site.

.Net Framework The .NET Framework is the infrastructure for the new Microsoft .NET Platform. The .NET framework is a common environment for building, deploying, and running web applications and Web Services. The .NET Framework contains a Common language runtime and common class libraries like ADO.NET, ASP.NET and Windows Forms to provide advanced standard services that can be integrated into a variety of computer systems. The .NET Framework provides a feature-rich application environment, simplified development and easy integration between a numbers of different development languages. The .NET Framework is language neutral. Currently is supports C++, C#, Visual Basic, and Jscript (The Microsoft version of JavaScript).Microsofts Visual Studio.NET is a common development environment for the new .NET Framework. Asp.Net Controls Asp.Net Contains a large set of HTML controls. Almost all HTML elements on page can be defined as ASP.Net control objects that can be controlled by scripts.Asp.Net also contains a new set of object oriented input controls, like programmable list boxes and validation controls .A new data grid control supports sorting ,data paging ,and everything that is expect by others from a dataset control.

4.2 Back End Description SQL SERVER is client/server Relational Database Management System that uses Transact-SQL to send request between a client and SQL server. The Microsoft SQL Server 2005 Database Engine is the core service for storing, processing, and securing data. The Database Engine provides controlled access and rapid transaction processing to meet the requirements of the most demanding data consuming applications within your enterprise. The Database Engine also provides rich support for sustaining high availability. A client/server database system is made up of two components: Programs that provide an interface for client-based users to access data. The database structure that manages and stores the data on the server. For example, if you use Microsoft SQL Server 2005 to create a checking account application, you must set up a database structure to manage the account transaction data and an application that acts as the user interface to the database. This allows users to access checking account information. Creating a database to serve your business needs requires an understanding of how to design, create, and maintain each of these components to make sure that your database performs optimally. Data Definition Language Data definition language (DDL) statements are SQL stataements that support the definition or declaration of database objects; for example, CREATE TABLE, DROP TABLE and ALTER TABLE.

Only the members of the sysadmin, dbcreator, dbowner, or db_ddladmin role can execute DDL Statements by default. If multiple user accounts create objects, the

sysadmin and dbowner roles can use the SETUSER function to impersonate another user or the sp_ changeobjectowner system procedure to change the owner of an object. Data Manipulation Language DML Statements are used to change data or retrieve information. DML statements include:

SELECT INSERT UPDATE DELETE By default, only the members of the sysadmin, dbcreator, dbowner or

db_datawriter role can execute DML statements.

CHAPTER-5
PROJECT DESCRIPTION 5.1 Overview of the project Online Web Mart For Jewellery Shopping is an advanced software application for enterprises that wish to exploit the opportunities of the World Wide Web through the deployment of advanced E-Shopping mall. The platform supports a set of generic services such as multiple catalogues, products, shopping carts and order management that can be fully customized to support any business requirement. Here create the E-Shopping application for jewelry mart. Products are our main module in which user can get the information about the jewel items. Here Jewels are categorized as Necklaces, Rings, Earrings, Bangles, Sets These are all present al links as well as provide the images. By selecting link and images, the information about the corresponding category models will be displayed from the database along with the picture. From that information, user can select the product and add it to their shopping cart. At any time they can view their Shopping Cart and delete or add products in the Cart. After finishing the selection of all the products, customer must be login to view their cart items and they will be lead to the page of Payment Tracking System. Here Customer must give their payment details. After getting the credit card number will be checked for the originality of the number. After that it will be verified with the bank database with information given by the customer. Once all the verifications are done, then only the customer order will registered. After registering customer, the goods will be delivered to the customer in short period.

5.2 Modules 1. Administrator 2. Registration

3. Shopping 4. Check out 5.2.1 Modules Description Administrator In this module administrator can maintain a database for the clients who are doing purchase products from the company and their details such as client name, address, product details, quantity. These details are used for future references. The administrator can remotely upload the product image and specification so that the site can place it at the showcase online. The buyer can select the product and confirm the order by giving their details. The payment can also be made online. The admin has privileges to view the reports about the site and based on the information gathered the sites business part can be enhanced. Registration Customers are required to register on the website before they can do the shopping. The website also provides several features for the non-registered user. In Registration module the customer can register their information like name, address, Pin code, contact number, email-id, etc. Shopping In this module product catalog are displayed to the end users or customers. Images of the products are very important for online purchasing. So those in the product catalog products are displayed with images and additional information. If they choose one product to buy, then they add that product to cart by using Add to cart link. They can view the cart whenever they want. Shopping cart has all the products which were chosen by the user. It displays the Name of the product, quantity, price per quantity, total price, for purchased products. It also has the add cart and removes from cart buttons to add and delete the products in the shopping cart.
10

Checkout After purchase the products user provide the payment details to the supplier. They must fill up the form in the payment module. Here they give the payment mode, address for communication, name, etc. through this information payment is transferred for the purchased products.

11

5.3 Data Flow Diagram

Level 0

Jewels Item Order

CLIENT

ONLINE JEWELLERY SHOPPING

Item Delivered

PRODUCT DELIVERY

CENTRLISED DATABASE

Context Level DFD

12

Level 1

Get Personal Get Personal Details Details New user New user

Order Details

product details

CLIENT

Old Validation user Validation User User

View View products products Retrieval Product

order

Receive Receive orders orders

Online Orders

13

Level 2

Admin Client Payment Payment

Retrival

Storage

View details

Bank DataBase

Retrival

Customer Payment Details

14

5.4 Database Design A collection of interrelated datasets stored together and controlled by a specific scheme for efficient management of information. A consistent and specified set of procedures used for building, maintaining, accessing, and interrogating from a database.

Table Name Purpose

: User Table : Registration

Primary Key : ID S .NO FIELD NAME 1. 2. ID USER NAME Int nvarchar(50) Id of the customer User name of the customer Password authentication Email Id of the customer Address customer Name customer Phone number Type of the Customer of the of the for Primary Key TYPE DESCRIPTION CONSTRAINT

3.

PASSWORD

nvarchar(50)

4.

EMAIL

nvarchar(50)

5.

ADDRESS

nvarchar(50)

6. 7. 8.

NAME PHONE USER TYPE

nvarchar(50) nvarchar(50) nvarchar(50)

15

Table Name Purpose Primary Key

: Product Table : Product Details : ProductID

S.NO 1. 2. 3.

FIELD NAME ProductID ProductName ProductDescript ion ProductShortDe scription Price Category ProductImage ProductImageT humb

TYPE Int nvarchar(50) nvarchar(2000)

DESCRIPTION Id of the product Name of the product Description product Short description about

CONSTRAINT Primary Key

4. 5. 6. 7. 8.

nvarchar(500) Float nvarchar(50) nvarchar(500) nvarchar(50)

about product Product price Product category Product Image Product Thumb Image

16

Table Name Purpose

: Shopping Cart : Shopping Product Details

Primary Key : ShoppingID

S.NO 1.

FIELD NAME ShoppingID

TYPE Int

DESCRIPTION Id of the Shopping product Product Number User ID Sales Status Quantity product of ID

CONSTRAINT Primary Key

2. 3. 4. 5.

ProductIDNo UserID SalesStatus Qty

nvarchar(50) nvarchar(2000) nvarchar(500) Int

Table Name Purpose Primary Key S.NO 1.

: Order Table : Product orders : SerialNumber FIELD NAME SerialNumber TYPE Int DESCRIPTION Serial No of the Shopping product Name customer Amount of the CONSTRAINT Primary Key

2. 3.

UserName Amount

nvarchar(50) Float

17

Table Name Purpose Primary Key S.NO 1.

: ReviewTable : Product Reviews : ReviewID FIELD NAME ReviewID TYPE Int DESCRIPTION ReviewID of the Shopping product Name customer Review ProductID of the CONSTRAINT Primary Key

2. 3. 4.

Username Review ProductID

nvarchar(50) nvarchar(50) nvarchar(50)

Table Name Purpose

: BankTable : BankDetails

S.NO 1.

FIELD NAME Cardnumber

TYPE nchar(10)

DESCRIPTION Customer number Amount customer of the card

CONSTRAINT

2.

Amount

Float

18

5.5 Input Design Input design is the most important part of the overall system design, which requires very careful attention. Often the collection of input data is the most expensive part of the system. Input design is concentrated on estimating what the inputs are and how often is to be arranged collected etc. Some of the inputs used in this project are: Customer details Purpose: This form is used to maintain customer details, Jewel item details, bank details. View Reviews Purpose: This form is used to Review all the orders from customers Sales Orders Purpose: This form is used to record sales order and is used to determine process The order on the input screen, how frequently the data are to be

5.6 Output Design Computer output is most important and direct source of information to the user. Efficient and intelligible output design should improve the systems relationship with the user and help in decision making. Output from the computer system is required to communicate the result of processing to the user and to provide permanent copy of

these results for later consultation. While designing the output, the type of output, concern format, frequency response etc have been taken into consideration. Some of the outputs used in this project are: Customer details Report is generated to maintain all customer details. In this report customer code, customer name, address, city, email are displayed. Shopping carts Report is generated to maintain all item details. In this report item code, item name, item purchase rate, item category are displayed.

19

CHAPTER-6
SYSTEM TESTING System Testing is an important stage in any system development life cycle. Testing is a process of executing a program with the intention of finding errors. The importance of software testing and its implications with respect to software quality cannot be overemphasized. Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding. A good test case is one that has a high probability of finding a yet undiscovered error. Testing is the set of activities that can be planned in advance and conducted systematically. Different test conditions should be thoroughly checked and the bugs detected should be fixed. The testing strategies formed by the user are performed to prove that the software is free and clear from errors. To do this, there are many ways of testing the systems reliability, completeness and maintainability.

6.1 Unit Testing Unit testing, also known as component testing refers to tests that verify the functionality of a specific section of code, usually at the function level. The unit testing is the initial level and also the development level testing method for all software development process. This testing technique is applied on the small component of the system. In this project ONLINE WEB MART SYSTEM FOR JEWELLERY, each phase thought of a module. There are so many modules like admin, registration, shopping, and checkout. Each module has been tested by giving different set of inputs when developing each as well as finishing the development so that module works without any error. 6.2 Integration Testing The integration is the main process in the software development life cycle. Integration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing. Objectives are used to take unit test modules and built program structure that has been directed by design. After integration the project works successfully.
20

6.3 Validation Testing Validation testing can be defined in many ways, but a simple definition is that can be reasonably expected by the customer. After validation test has been conducted, one of two possible conditions exists. The functions or performance characteristics confirm to specification and are accepted. A deviation from specification is uncovered and a deficiency list is created. Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily.

21

CHAPTER-7
SYSTEM IMPLEMENTATION

Implementation is the state in the system where the theoretical design is turned into a working system. The most crucial stage in achieving a new successful system and in giving confidence on the new system for the users that will work efficiently and effectively. The system can be implemented only after thorough testing is done and if found to work according to the specification. It involves careful planning, investigation of the current system and its constraints on implementation, design of methods to achieve the changeover, an evaluation of changeover methods apart from planning. Two major tasks of preparing the implementation are education, training of the users and testing the systems. System analysis and design efforts will be more for complex systems beings implemented. Based on policies of individuals organization an implementation coordinating committee has been appointed.

The implementation process begins with preparing a plan for the implementation system. According to this plan, the other activities are to be carried out. In this plan, discussion has been made regarding the equipment, resources and how to test the activities. Thus a clear plan is preparing for the activities.

EQUIPMENT ACQUISITION According to the above plan, the necessary equipment has to be acquired to implement the new system. Prime Tech has all the hardware requirements for installing and maintaining the package.

PROGRAM CODE PREPARATION One of the most important development activities is the code of programming. The system DFDs and other channels are converted to modular programs. They have to be complied, tested and debugged.

22

USER MANUALS Once planning has been completed the major effort of the computer department is to ensure that the user department consists of education and trained staff, as the system becomes more complex. The success of a system depends upon how they are operated and used. Thus the quality of training, the personnel is connected to the success of the system.

23

CHAPTER-8
CONCLUSION AND FUTURE ENCHANCEMENT 8.1 Conclusion This application gives an easier way to shop the things from the home itself. The customer can select wide range of Jewel items like Necklaces, Rings, Earrings, etc. through online. The customers can view the product specification along with its picture to get a clear view of the product. This application makes shopping easy and quicker. It will increase the sales of jewels item; it will be very useful to get more customers. This will elaborate the range of marketing area. This web application will be more helpful to the shop as well as the customers. 8.2 Future Enhancement The system has been developed successfully since change is a way of life new requirements may arise in future.

The modules that we have developed are easy to understand to the users. So we can easily maintain the system. If we want to do some modification in future also its easy to make. After some years the user requirement will change so according to that we can update this system. Like we can change the reports design or we can add lots of modules. In Future, we will give privilege customer for some discounts for improving our sales. May be the user want to add some fields in some particular modules then according to the customer requirements we can later.

Software Enhancement Flexibility

24

CHAPTER9 BIBLIOGRAPHY

Book References: 1.Abhijit Jano, ASP.NET 4.0: a beginner guide , Tata McGrawHill Publishing (2010). 2. Abraham Silberth, Introduction to database system concepts, Macmillian Publishing ltd.

Online References:

1.http://asp.net.microsoft.com

2.http://www.academictutorials.com/asp/asp-introduction.asp

3.http://en.wikipedia.org

25

APPENDIX

9.1 Source Code Login.aspx.cs


using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // Data source control that works with Sql databases SqlDataSource sds = new SqlDataSource();

// Get configuration

connection

string

from

application's

default

sds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();

// Create parameters with specified names and values sds.SelectParameters.Add("Username", this.TextBox1.Text); sds.SelectParameters.Add("Password", this.TextBox2.Text); TypeCode.String, TypeCode.String,

26

// Set the SQL string to retrieve data from the underlying database sds.SelectCommand = "SELECT * FROM [UserTable] WHERE [Username] = @Username AND [Password] = @Password";

// Retrieve data DataView dv (DataView)sds.Select(DataSourceSelectArguments.Empty); =

// Display error message and return if the number of record is zero if (dv.Count == 0) { this.Label1.ForeColor = System.Drawing.Color.Red; this.Label1.Text = "Login Failed!"; return; }

// Create session variables this.Session["Username"] = dv[0].Row["Username"].ToString(); this.Session["UserType"] = dv[0].Row["UserType"].ToString();

// Redirect to respective page based on user type if (this.Session["UserType"].ToString().Equals("user")) Response.Redirect("MainPageUsers.aspx"); else if (this.Session["UserType"].ToString().Equals("admin")) Response.Redirect("MainPageAdmin.aspx");

} }

27

Register new user.aspx.cs


using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class registernewuser : System.Web.UI.Page { protected void Button1_Click(object sender, EventArgs e) { SqlDataSource sds = new SqlDataSource(); sds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); sds.SelectParameters.Add("Username", this.txtUserName.Text); sds.SelectParameters.Add("Email", this.txtEmail1.Text); TypeCode.String, TypeCode.String,

sds.SelectCommand = "SELECT * FROM [UserTable] WHERE [Username] = @Username OR [Email] = @Email"; DataView dv (DataView)sds.Select(DataSourceSelectArguments.Empty); if (dv.Count != 0) { this.Label1.ForeColor = System.Drawing.Color.Red; this.Label1.Text = "The user already Exist!"; return; } else { this.SqlDataSource1.Insert(); this.Label1.Text = "New User Profile has been created you can login now"; Button1.Enabled = false; =

28

txtAddress.Enabled = false; txtEmail1.Enabled = false; txtEmail2.Enabled = false; txtName.Enabled = false; txtpassportNumber.Enabled = false; txtPassword1.Enabled = false; txtpassword2.Enabled = false; txtUserName.Enabled = false; } } protected void Page_Load(object sender, EventArgs e) {

} protected void ImageClickEventArgs e) { } }

ImageButton1_Click(object

sender,

Admin add new item


using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class AdminPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { btnInsert.Visible = false; // btnsaveProduct.Visible = false; } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { // MultiView1.ActiveViewIndex = RadioButtonList1.SelectedIndex; }

29

protected void btnsaveProduct_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { FileUpload1.SaveAs("D:/Code/jewelshop/Uploadedpix/" FileUpload1.FileName); lblFullSizeImage.Text = FileUpload1.FileName; } if (FileUpload2.HasFile) { FileUpload2.SaveAs("D:/Code/jewelshop/Thumbnails/" FileUpload2.FileName); }

lblThumbSizeImage.Text = FileUpload2.FileName; btnsaveProduct.Visible = true; SqlDataSource1.Insert(); this.lblAddingNewItem.Text = "Item Has Been Added into the Database"; btnsaveProduct.Visible = false; btnInsert.Visible = true; txtPrice.Enabled = false; txtShortDescription.Enabled = false; txtProductDescription.Enabled = false; txtProductName.Enabled = false; dropCatInsert.Enabled = false; } protected void btnInsert_Click(object sender, EventArgs e) { txtPrice.Text = ""; txtProductDescription.Text = ""; txtProductName.Text = ""; txtPrice.Enabled = true; txtProductDescription.Enabled = true; txtProductName.Enabled = true; btnsaveProduct.Visible = true; dropCatInsert.Enabled = true; } protected void LinkButton1_Click(object sender, EventArgs e) { } protected void LinkButton2_Click(object sender, EventArgs e) { } protected EventArgs e) { void DropSearchItems_SelectedIndexChanged(object sender,

30

} }

Admin master page.aspx.cs


using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Xml.Linq;

public partial class MasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (Session["UserType"] == null !Session["UserType"].Equals("admin")) Response.Redirect("Default.aspx"); } protected void LinkButton1_Click(object sender, EventArgs e) { Session.Abandon(); Response.Redirect("MainPage.aspx"); } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("login.aspx"); } }

||

31

Admin Sales Maintains.aspx.cs


using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class AdminSalesMaintenance : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { MultiView1.ActiveViewIndex = RadioButtonList1.SelectedIndex; } protected void FormView2_ItemUpdated(object FormViewUpdatedEventArgs e) { this.GridView3.DataBind(); } protected void FormView3_ItemUpdated(object FormViewUpdatedEventArgs e) { this.GridView2.DataBind(); } } sender,

sender,

32

Default2.aspx.cs
using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { SqlDataSource sds = new SqlDataSource(); sds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();

// Create parameters with specified names and values sds.SelectParameters.Add("cardno", this.TextBox1.Text); sds.SelectParameters.Add("amount", this.TextBox4.Text); TypeCode.String, TypeCode.Double,

// Set the SQL string to retrieve data from the underlying database sds.SelectCommand = "SELECT * FROM [bank] WHERE [cardnumber] = @cardno AND [amount] >= @amount";

// Retrieve data DataView dv (DataView)sds.Select(DataSourceSelectArguments.Empty); =

33

// Display error message and return if the number of record is zero if (dv.Count == 0) { this.Label5.ForeColor = System.Drawing.Color.Red; this.Label5.Text = "Insufficent Fund!"; return; } else { this.Label5.ForeColor = System.Drawing.Color.Red; this.Label5.Text = "Payment Made Successfully!"; return; } } protected void Button2_Click(object sender, EventArgs e) { Response.Redirect("MainPage.aspx"); } }

34

DiscriptionPurchase.aspx.cs

using using using using using using using using using using using using

System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class test2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { this.lblusernam.Text = this.Session["Username"].ToString(); lblItem.Visible = false; Linklogin.Visible = false;

if (Session["UserType"] == null) { Linklogin.Visible = true;

//

btnAddToCart.Visible = false; lblItem.Visible = false; Label1.Visible = false; } if (Request.QueryString["ProductID"] != null) { string ProductID; ProductID = Request.QueryString["ProductID"].ToString();

string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); System.Data.SqlClient.SqlConnection conn System.Data.SqlClient.SqlConnection(connectionString); System.Data.SqlClient.SqlCommand cmd conn.CreateCommand(); = new =

35

cmd.CommandText = "SELECT ProductID='" + ProductID + "'"; conn.Open();

FROM

[ProductTable]

where

System.Data.SqlClient.SqlDataReader cmd.ExecuteReader(); this.lblProductID.Text = ""; while (dr.Read()) {

dr

this.lblProductID.Text = dr["ProductID"].ToString(); this.lblDescription.Text dr["productDescription"].ToString(); this.lblPrice.Text = dr["Price"].ToString(); this.lblProductName.Text dr["ProductName"].ToString(); this.Image2.ImageUrl = dr["ProductImage"].ToString(); Image2.ImageUrl = "uploadedpix/" dr["ProductImage"].ToString(); } dr.Close(); conn.Close(); } else Response.Redirect("UserMainPage.aspx"); } protected void Button1_Click(object sender, EventArgs e) { // txtAddress.Visible = true; btnAddToCart.Visible = true; Label1.Visible = true; } protected void btnAddToCart_Click(object sender, EventArgs e) { SqlDataSource1.Insert(); btnAddToCart.Visible = false; lblItem.Visible = true; Label1.Visible = false; } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("login.aspx"); } }

= = +

//

//

36

ViewReviews.aspx.cs
using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

public partial class ViewReviews : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { } protected void FormView2_ItemUpdated(object FormViewUpdatedEventArgs e) { this.GridView1.DataBind(); } } sender,

37

9.2 Screen Shots Main Page

Search for Items

38

Search by Category

Product Description

39

Register New User

Login

40

Add To Chart

Shopping cart

41

Make payment

Admin Login

42

View/Modify user account

Open Orders

43

Adding New Item

Modify Items

44

You might also like