Sie sind auf Seite 1von 44

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

A PROJECT ON Online Book Shopping (In ASP.net and SQL Server)

UNDER THE KIND SUPERVISION OF:

Ms. Priti Bala Mr. Arman Rasool Faridi Ms. Arshia Jalal

SUBMITTED BY: Abhishek Dubey 07-MCA -21 Gc-7072 CONTENTS


-1 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

1) ABSTRACT 2) ACKNOWLEDEMENT 3) INTRODUCTION 4) ABOUT FRONT END(ASP.Net) 5) FEASIBILITY STUDY 6) OVERVIEW OF THE PROJECT 7) DESCRIPTON OF TABLES 8) E-R DIAGRAM 9) NEED OF COMPUTERIZED SYSTEM 10) FORM-LAYOUT 11) CODING 12) SYSTEM TESTING 13) REFERENCES

3 4 5 6 8 9 12 13 14 15 20 41 42

ABSTRACT
-2 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

The e enormous growth of paper works almost in all the Government and private organization have created a lot of problem to staff members, rate of this growth is posing many problems to office Management and staff. Providing access to an ever growing corpus of information using manual methods has serious limitation. It is impossible for an shop/organization however big to collect and catalogue every thing that is useful material is difficult due to this volume of newly published of produced information on any subject.

Mostly information in shops, publishers or stores is handled manually. In such system it is very difficult task to get the information about all the papers or any material stored by office worker. This website ONLINE BOOK SHOPPING provides very quick and accurate information about the books as well new books, available etc and all the information related to books.

This can be used in any e-commerce organization or shopkeepers to manage their library as it can fulfill all the requirement of a standard book shop.

-3 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

ACKNOWLEDGEMENT

It is customary to preface such work as the present one without formal acknowledgement of guidance and help received from respected teachers but in fact these few words of thanks are not sufficient to express gratefulness to our teachers. Successful completion of a specified project work incorporates the contribution of numerous people. Many of the ideas that lead us to design and develop the ONLINE BOOK SHOPPING resulted from a distillation of the experience and opinions of many people. It is indeed a matter of great pleasure to record my great sense of gratitude towards my teacher Ms. Priti Bala, Mr. Arman Rasool Faridi and Ms. Arshia Jalal for their valuable help in completion of this project. I would also like to extend my thanks to honorable Chairman Mr. S. Maheshwari Department of Computer Science, AMU Aligarh for regular guidance and encouragement throughout my project. I am also very thankful to my class fellows for their mutual support and helping attitude.

(Abhishek Dubey)

-4 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

INTRODUCTION
With the advent of the computer and advance technology, it is said that todays modern and advancing world has entered into a computer age. Computer is a powerful tool that has accelerated, enhanced and improved greatly the process of development, planning and making in nearly all the fields. Today almost all organization has to computerized information and management system of their own, enabling them to utilize all their resources to the resulting in greater efficiency. The Bookshop Automation System is to automate all operations in a bookshop. Generally it includes the Order Processing, Stock Management and Accounts Management. Before automating a bookshop we have to understand the concept of automation. In automation of any operation we make a system which do work automatically as the respective events occurs, for which it is meant. There are the some common examples of the automation like that auto pilot system in the aircraft, automatic home systems (electric system, water system, fire alarm system, doors system etc). These are best examples of the automation systems. Here we are try to develop such type system which is provide the automation on the any type of the bookshop. That means a shop which has the type system which provides the facility to the customers of the shop to purchase the books from the shop without any complexity. For example any customer want to purchase any book from the shop than first of all customer just choose the stream of the book than he/she can see the more then one type of books there and than he/she can choose the specific book from there. And then purchase it by paying price on bookshop cash counter and receives its invoice. This website is a step forward towards online

computerization of book shop. It provides important role in providing the users with detailed and updated information about the regarding books available, soft copy, hard copy, details etc. This website can be accessed through the url

http://www.aspspider.net/OnlineBookShopping1. For this website ASP.Net


has been used as front-end and SQL SERVR 2005 as back-end. -5 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

Overview of .NET framework


The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives:

To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internetdistributed, or executed remotely.

To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistent across widely varying types of applications, applications. such as Windows-based applications and Web-based

To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.

The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical

-6 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.

Visual studio.NET
Visual Studio .NET is the tool for rapidly building enterprise-scale ASP Web applications and high performance desktop applications. Visual Studio includes component-based development tools, such as Visual C#, Visual Basic, and Visual C+ +, as well as a number of additional technologies to simplify team-based design, development, and deployment of your solutions. Visual Studio supports the .NET Framework, which provides a common language runtime and unified programming classes; ASP.NET uses these components to create ASP Web applications and XML Web services. Also included is the MSDN Library, which contains all the documentation for these development tools.

ASP.NET
ASP.NET makes application development much easier than it was with classic ASP, and hence it has dramatically improved developers' productivity. ASP.NET enables you to provide richer functionality to your Web applications by writing the least amount of code.The best part is that ASP.NET enables you to select any of the available .NET programming languages. So, unlike classic ASP, in which you had to depend on interpreted VBScript and JScript languages, ASP.NET provides a wide choice of programming languages. In addition to the usual Web applications, ASP.NET allows you to create other types, which enables you to extend your applications' reach to new customers and business partners. For example, XML Web services enable sharing of data across the Internet regardless of the operating system and the programming language

-7 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

BACK END

Feasibility Study:The viability of the system is checked. The check is done under the following heads. (A) Technical (B) Operational (C) Economical

Technical:This is a study with respect to the machines to be used for the new system. Whether with the hardware/software available with the user the new system can be developed or not. The user is to be told what new hardware/softwares are to be procured. The user is to be given a set of options from which best on is chosen. At times the user needs to be guided by the system team for such selection.

Operational:-Deals with the human aspect of the organization. It is seen whether with the existing manpower, the new system can be handled efficiently of not. If the users are not taken into confidence, resentment from them is inevitable. The users are to be convinced about the advantages of the new system.

Economical:It is seen whether the expenditure incurred for developing the new system will be cost effective or not. This basically involves the top level management of the company -8 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH who are the decision makers. At the end of the feasibility study, a report is prepared and submitted to the user for his approval. It is highly probable that the initial report does not come up to with in the possible limit till it is approved by the user. A repeated study is done till the system become feasible for both, the user and the system development team.

-9 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

OVERVIEW
Project is related to e-shopping of books which provides various facilities like search and purchasing of books. You can find here that soft copy of any book is available. The customer can search for a particular book or a magazine via the Book title, Author name ,Category or by the Copy Type(Soft/Hard). This online book store is an attempt to overcome the present inefficient and time consuming process of locating, reserving and purchasing quality reading materials available in the store. Currently, clients have to go through a time consuming process to perform aforementioned tasks which cause waste of labor and firms resources. Through our online book store solution, we provide an easy way of searching, reserving and purchasing books using latest web based technologies. Following is given a brief description: --

1. Purpose:
This project focuses attention on designing efficient and reliable software which controls the transactions of a bookshop. In real world, it tends to associate with automated systems as they provide many benefits than doing the same thing in manually. As above mentioned, here we have introduced a system which can be used to maintain a book shop. When we are concerning the manual process of a bookshop, the major problem is the waste of time. A customer has to waste his/her valuable time when he needs to buy a book as all the events such as searching, purchasing are done by members of the staff .In briefly, the manual process is very slow. But automation will reduce the time taken in the whole process. In a bookshop we should deal with a large store. Then person (storekeeper) has to maintain it with documents which are recorded by him. Therefore, there may be defective reports. Also company has to appointed more persons to complete the maintenance of the stationery. Then the company has to have an additional cost. As we familiar with this type of system at instance we will be able to have the results that we want. Communication with suppliers, customers and other related organizations will be more successful as the system is so fast. When the - 10 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH bookshop issues an item to a customer, all the stages of the transaction procedure will be facilitated by the system & it will be more accurate. The purpose of this project is to provide easy shopping facility online and easy selling facility to the merchants of all categories. It provides following facilities to 1. The system should have a mechanism to search the books available in the Book Store. Searches for books should be made category-wise, such as computer books, medical books and engineering books. The search mechanism will display the list of the books in a selected category. Online users will be able to check book details such as book name, book price, author name, publisher name and ISBN number from the search result list. 2. The system should have a mechanism to register new users. To buy books online, an online user will need to register himself with Book Store. A unique user name will be assigned after successful registration. Using the user name, a registered user will be able to shop for books online. User can also edit his account like edit profile, change password. User is able to delete his account if he wants. 3. The system should have a login mechanism to authenticate credentials of

registered users. Every registered user will have to login before buying books. 4. The system should maintain the details of book information, registered users information, bill information and payment information in a centralized database. The details of book information to be stored include book id, category name, book title, author, publisher, ISBN, book price and book description. The details of registered users information to be stored include user name, password, first name, last name, address, city, state, pin code, email and phone. The details of bill information to be stored include bill number, book id and book purchase date. The details of payment information to be stored include bill number, total bill amount, user name, credit card number and credit card type. 5. The system should have a mechanism to make online payments using credit cards. - 11 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

2.) Scope: The different areas where we can use this application are:
Any merchant can make use of it for providing information about author, content of the available books. Customers are provided with up to date information on the products available. The software will not provide the following facilities Responsibility of damages. The product cannot be changeable when once confirmed. Legal arguments should be settled through the courts individually. Settlement of miscalculations of the products as the database is filled with the consent of the merchant. The objective of this software is to provide easy assistance to both the customer as well as the merchant with proper database and information.

3.) Technology Used:


Front End: ASP.NET. Back End: SQL SERVER EXPRESS 2005

4.) Assumptions:
This application is used to convert the manual application to the online application. Customized data will be used in this application.

- 12 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

DESCRIPTION OF TABLES: -- According to the need for containing


information about Users and books, following tables have been created:--

1.) UsersDetails: -- This table contains details of users: Fields


Username Password FName LName Email Mobileno Sex Country State City Address

Width
Varchar(30) Varchar(15) Varchar(15) Varchar(15) Varchar(50) Numeric(18, 0) Varchar(6) Varchar(30) Varchar(30) Varchar(30) Varchar(50)

2.) BookDetails: -- This table contains details of a book and has following fields: Fields
BookId Isbnno Category Title Author Publisher Price Type Description

Width
Varchar(3) Varchar(11) Varchar(20) Varchar(50) Varchar(50) Varchar(50) Float Varchar(20) Varchar(50)

3.) PaymentDetails: -- This table contains information about the payment Fields
Billno TotalAmount Username CreditcardNo CreditcardType

Width
Numeric(5) Numeric(5,0) Varchar(30) Varchar(20) Varcher(10)

4) BillDetails:-- table contains information about the payment, book and username:
- 13 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

Fields
Billno BookId Username

Width
Numeric(5) Varchar(3) Varchar(30)

E-R DIAGRAM

- 14 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

NEED OF COMPUTERIZATION:
Now days each and every field of work need a computerized system due to the following limitations of a manual system: Delay in information retrieval. Problem in updating of current information Possible damage of paper carrying the information thereby chances of loosing valuable information. Considerable requirements. Suspect reliability and maintainability of data Secrecy of information may not be maintained due to visible facts on paper Problem in compilation of data in various sorting order to achieve the rerequired requiring complicated sorting is extremely inconvenient. time taken for report generation for periodic

IMPORTANCE OF COMPUTERIZED SYSTEM


Today each and every organization , department, institution, agency, company wants to make their system of work computerized, since a computerized system requires a minimum input and gives more output in minimum possible time. Computerized systems are of great importance due to easy retrieval and updation very quick response of any query report generation with less effort and high accuracy high secrecy and less chance of loss of data

SYSTEM IMPLEMENTATION:
The system has been developed and implemented on the following guidelines: This system is an interactive package. It is based on modular approach. The modular approach incorporates the flexibility in terms of modification of the system.

- 15 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH The system is designed in a user friendly manner so that even a novice user of the computer can handle it without much difficulty.

Form Layout

- 16 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

- 17 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

- 18 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

- 19 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

- 20 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

CODING
Default.aspx.cs
using using using using using using using using using using using System; System.Data; System.Configuration; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Data.SqlClient; System.Net.Mail;

public partial class _Default : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection(); protected void Page_Load(object sender, EventArgs e) { myConnection = new SqlConnection("Server=AMUF01CD24B46B\\SQLEXPRESS;trusted_connection=true;database=Abhishek"); lblError.Visible = false; } protected void Button1_Click(object sender, EventArgs e) { myConnection.Open(); HttpCookie username = new HttpCookie("username"); username.Expires.AddHours(5);

- 21 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


username.Value = TextBox1.Value; Response.Cookies.Add(username); HttpCookie password = new HttpCookie("password"); password.Expires.AddHours(5); password.Value = Password1.Value; Response.Cookies.Add(password); DataSet myDataset = new DataSet(); SqlDataAdapter myAdapter = new SqlDataAdapter("Select username,password from user_profile",myConnection); myAdapter.Fill(myDataset); int c1; c1 = myDataset.Tables[0].Rows.Count; for (int co = 0; co < c1 ; co++) if ((Convert.ToString(myDataset.Tables[0].Rows[co][0]) == TextBox1.Value & Convert.ToString(myDataset.Tables[0].Rows[co][1]) == Password1.Value)) { Response.Redirect("Welcomeuser.aspx"); Response.Redirect("Default.aspx"); } else { lblError.Visible = true; lblError.Text = "Incorrect Login Name or PassWord"; } myConnection.Close();

} protected void TextBox1_ServerChange(object sender, EventArgs e) { lblError.Visible = false; } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("Home.aspx"); } protected void LinkButton1_Click(object sender, EventArgs e) { Response.Redirect("Search.aspx"); } }

---------------------------------------------------------------------

Search.aspx.cs
using System; using System.Data; using System.Data.SqlClient;

- 22 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; //using System.Data.SqlClient; public partial class Search : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection("server=AMUF01CD24B46B\\SQLEXPRESS;Trusted_Connection=true;DataBase=Abhishek"); protected void Page_Load(object sender, EventArgs e) { DataSet myDataSet = new DataSet(); SqlDataAdapter myDataAdapter = new SqlDataAdapter(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.CommandText = "seacrhbook"; myCommand.Connection = myConnection; SqlParameter param1 = myCommand.Parameters.Add("@Param1", SqlDbType.VarChar, 30); param1.Value = DropDownList1.Text; myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet); DropDownList3.Items.Clear(); for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++) { DropDownList3.Items.Add(Convert.ToString(myDataSet.Tables [0].Rows[i][0])); } } protected void LinkButton1_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx"); } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("Fornew.aspx"); } protected void LinkButton3_Click(object sender, EventArgs e) { Response.Redirect("Search.aspx"); } protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) {

- 23 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


DataSet myDataSet = new DataSet(); SqlDataAdapter myDataAdapter = new SqlDataAdapter(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.CommandText = "seacrhbook"; myCommand.Connection = myConnection; SqlParameter param1 = myCommand.Parameters.Add("@Param1", SqlDbType.VarChar, 30); param1.Value = DropDownList1.Text; myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet); DropDownList3.Items.Clear(); for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++) { DropDownList3.Items.Add(Convert.ToString(myDataSet.Tables [0].Rows[i][0])); }

} protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { DataSet myDataSet1 = new DataSet(); SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); SqlCommand myCommand1 = new SqlCommand(); myCommand1.CommandType=CommandType.StoredProcedure; myCommand1.CommandText = "datagrid"; myCommand1.Connection = myConnection; SqlParameter param1 = myCommand1.Parameters.Add("@param1",SqlDbType.VarChar,50); param1.Value = DropDownList1.Text; SqlParameter param2 = myCommand1.Parameters.Add("@param2", SqlDbType.VarChar, 50); param2.Value = DropDownList3.Text; SqlParameter param3 = myCommand1.Parameters.Add("@param3", SqlDbType.VarChar, 50); param3.Value = DropDownList2.Text; myDataAdapter1.SelectCommand = myCommand1; myDataAdapter1.Fill(myDataSet1); GridView1.DataSource = myDataSet1; GridView1.DataBind(); GridView1.Visible = true; if (GridView1.Rows.Count == 0) {

- 24 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


Label6.Visible = true; Label6.Text = "Book Not Available."; } else { } } }

Label6.Visible = false;

---------------------------------------------------------------------

Formewuser.aspx.cs
using System; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data; public partial class Fornew : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection("server=AMUF01CD24B46B\\SQLEXPRESS;Trusted_Connection=True;DataBase=Abhishek"); protected void Page_Load(object sender, EventArgs e) { Button2.Visible = false; } protected void Button2_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx"); Response.Redirect("Fornew.aspx"); }

protected void Button1_Click(object sender, EventArgs e) { DataSet myDataset1 = new DataSet(); SqlDataAdapter myAdapter1 = new SqlDataAdapter("Select username from user_profile", myConnection); myAdapter1.Fill(myDataset1); int c1,flag=0; c1 = myDataset1.Tables[0].Rows.Count; for (int co = 0; co < c1; co++) { if (Convert.ToString(myDataset1.Tables[0].Rows[co][0]) == Text1.Value) { lblerror.Visible = true; lblerror.Text = "This Login Name is not available"; flag = 1; }

- 25 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


} if(flag==0) { DataSet myDataset = new DataSet(); SqlCommand myCommand = new SqlCommand(); myConnection.Open(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Connection = myConnection; myCommand.CommandText = "USER_INSERT";

SqlParameter myParameter1 = myCommand.Parameters.Add("@username", SqlDbType.VarChar, 30); myParameter1.Value = Text1.Value; SqlParameter myParameter2 = myCommand.Parameters.Add("@password", SqlDbType.VarChar, 15); myParameter2.Value = Text2.Value; SqlParameter myParameter3 = myCommand.Parameters.Add("@firstname", SqlDbType.VarChar, 15); myParameter3.Value = Text4.Value; SqlParameter myParameter4 = myCommand.Parameters.Add("@lastname", SqlDbType.VarChar, 15); myParameter4.Value = Text5.Value; SqlParameter myParameter5 = myCommand.Parameters.Add("@email", SqlDbType.VarChar, 15); myParameter5.Value = Text6.Value; SqlParameter myParameter6 = myCommand.Parameters.Add("@mobileno", SqlDbType.BigInt, 10); myParameter6.Value = Convert.ToInt64(Text7.Value); SqlParameter myParameter7 = myCommand.Parameters.Add("@sex", SqlDbType.VarChar, 6); myParameter7.Value = Convert.ToString(RadioButtonList1.SelectedItem); SqlParameter myParameter8 = myCommand.Parameters.Add("@country", SqlDbType.VarChar, 30); myParameter8.Value = Convert.ToString(DropDownList1.SelectedItem); SqlParameter myParameter9 = myCommand.Parameters.Add("@state", SqlDbType.VarChar, 30); myParameter9.Value = Convert.ToString(DropDownList2.SelectedItem); SqlParameter myParameter10 = myCommand.Parameters.Add("@city", SqlDbType.VarChar, 30); myParameter10.Value = Convert.ToString(DropDownList3.SelectedItem); SqlParameter myParameter11 = myCommand.Parameters.Add("@address", SqlDbType.VarChar, 50);

- 26 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


myParameter11.Value = Text8.Value; SqlDataAdapter myDataAdapter = new SqlDataAdapter(); myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataset); myConnection.Close(); Userlbl.Text = "Congratulations! You Have Been Registered Successfully..."; lblerror.Text = "Hello " + Text4.Value + " Thanks for registering"; Button2.Visible = true; Label1.Visible = false; Label2.Visible = false; Label3.Visible = false; Label4.Visible = false; Label5.Visible = false; Label6.Visible = false; Label7.Visible = false; Label8.Visible = false; Label9.Visible = false; Label10.Visible = false; Label11.Visible = false; Label12.Visible = false; Label13.Visible = false; Label14.Visible = false; Label15.Visible = false; Text1.Visible = false; Text2.Visible = false; Text3.Visible = false; Text4.Visible = false; Text5.Visible = false; Text6.Visible = false; Text7.Visible = false; Text8.Visible = false; DropDownList1.Visible = false; DropDownList2.Visible = false; DropDownList3.Visible = false; RadioButtonList1.Visible = false; Button1.Visible = false; Button2.Text = "Continue to"; } }

protected void LinkButton1_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx"); } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("Search.aspx"); } protected void LinkButton3_Click(object sender, EventArgs e) { Response.Redirect("Fornew.aspx"); }

- 27 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


protected void Text1_ServerChange(object sender, EventArgs e) { }

---------------------------------------------------------------------

Welcomeuser.aspx.cs
using using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Data.SqlClient;

public partial class Esit_profile : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection(); protected void Page_Load(object sender, EventArgs e) { myConnection=new SqlConnection("Server=AMUF01CD24B46B\\SQLEXPRESS;Trusted_Connection=True;Database=Abhishek"); HttpCookie username = Request.Cookies.Get("username"); TextBox1.Text = username.Value; Label8.Visible = false; Button1.Visible = false; Label4.Visible = false; TextBox3.Enabled = false; TextBox3.Visible = false; RequiredFieldValidator2.Enabled = false; Label5.Visible = false; TextBox4.Enabled = false; TextBox4.Visible = false; RequiredFieldValidator3.Enabled = false; CompareValidator1.Enabled = false; Label6.Visible = false; TextBox5.Enabled = false; TextBox5.Visible = false; RequiredFieldValidator4.Enabled = false; RegularExpressionValidator1.Enabled = false; Label9.Visible = false; TextBox6.Enabled = false; TextBox6.Visible = false; RegularExpressionValidator2.Enabled = false; Label10.Visible = false; TextBox7.Enabled = false;

- 28 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


TextBox7.Visible = false; RequiredFieldValidator5.Enabled = false; RegularExpressionValidator3.Enabled = false; Label11.Visible = false; TextBox8.Enabled = false; TextBox8.Visible = false; RegularExpressionValidator4.Enabled = false; RangeValidator1.Enabled = false; Label12.Visible = false; DropDownList1.Enabled=false; DropDownList1.Visible=false; RequiredFieldValidator6.Enabled=false; Label13.Visible = false; DropDownList2.Enabled = false; DropDownList2.Visible = false; RequiredFieldValidator7.Enabled = false; Label14.Visible = false; DropDownList3.Enabled = false; DropDownList3.Visible = false; RequiredFieldValidator8.Enabled = false; Label16.Visible = false; RadioButtonList1.Enabled = false; RadioButtonList1.Visible = false; RequiredFieldValidator9.Enabled = false; Label15.Visible = false; TextBox9.Enabled = false; TextBox9.Visible = false; RequiredFieldValidator9.Enabled = false; } protected void TextBox2_TextChanged(object sender, EventArgs e) {

DataSet myDataSet2 = new DataSet(); SqlCommand myCommand2 = new SqlCommand(); myCommand2.CommandType = CommandType.StoredProcedure; myCommand2.Connection = myConnection; myCommand2.CommandText = "USER_INFO_SHOW"; SqlParameter myParametera = myCommand2.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParametera.Value = TextBox1.Text; SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); myDataAdapter1.SelectCommand = myCommand2; myDataAdapter1.Fill(myDataSet2); if (TextBox2.Text == Convert.ToString(myDataSet2.Tables[0].Rows[0][1])) { DataSet myDataSet1 = new DataSet();

- 29 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Connection = myConnection; myCommand.CommandText = "USER_INFO_SHOW"; SqlParameter myParameter = myCommand.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParameter.Value = TextBox1.Text; SqlDataAdapter myDataAdapter = new SqlDataAdapter(); myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet1); TextBox5.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][2]); TextBox6.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][3]); TextBox7.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][4]); TextBox8.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][5]); TextBox9.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][10]); if (Convert.ToString(myDataSet1.Tables[0].Rows[0][6]) == "Male") { RadioButtonList1.SelectedIndex = 0; } else { RadioButtonList1.SelectedIndex = 1; } DropDownList1.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][7]); DropDownList2.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][8]); DropDownList3.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][9]); Label3.Visible = false; TextBox2.Enabled = false; TextBox2.Visible = false; RequiredFieldValidator1.Enabled = false; Label8.Visible = true; Button1.Visible = true; Label4.Visible = true; TextBox3.Enabled = true; TextBox3.Visible = true; RequiredFieldValidator2.Enabled = true; Label5.Visible = true; TextBox4.Enabled = true; TextBox4.Visible = true; RequiredFieldValidator3.Enabled = true; CompareValidator1.Enabled = true; Label6.Visible = true;

- 30 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


TextBox5.Enabled = true; TextBox5.Visible = true; RequiredFieldValidator4.Enabled = true; RegularExpressionValidator1.Enabled = true; Label9.Visible = true; TextBox6.Enabled = true; TextBox6.Visible = true; RegularExpressionValidator2.Enabled = true; Label10.Visible = true; TextBox7.Enabled = true; TextBox7.Visible = true; RequiredFieldValidator5.Enabled = true; RegularExpressionValidator3.Enabled = true; Label11.Visible = true; TextBox8.Enabled = true; TextBox8.Visible = true; RegularExpressionValidator4.Enabled = true; RangeValidator1.Enabled = true; Label12.Visible = true; DropDownList1.Enabled = true; DropDownList1.Visible = true; RequiredFieldValidator6.Enabled = true; Label13.Visible = true; DropDownList2.Enabled = true; DropDownList2.Visible = true; RequiredFieldValidator7.Enabled = true; Label14.Visible = true; DropDownList3.Enabled = true; DropDownList3.Visible = true; RequiredFieldValidator8.Enabled = true; Label16.Visible = true; RadioButtonList1.Enabled = true; RadioButtonList1.Visible = true; RequiredFieldValidator9.Enabled = true; Label15.Visible = true; TextBox9.Enabled = true; TextBox9.Visible = true; RequiredFieldValidator9.Enabled = true; Label17.Visible = false; } else { } } protected void Button1_Click(object sender, EventArgs e) { try {

Label17.Visible = true; Label17.Text = "your password do not match!Try again.";

- 31 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


myConnection.Open(); DataSet myDataset = new DataSet(); SqlCommand myCommand1 = new SqlCommand(); myCommand1.CommandType = CommandType.StoredProcedure; myCommand1.Connection = myConnection; myCommand1.CommandText = "USER_INFO_EDIT"; SqlParameter myParameter1 = myCommand1.Parameters.Add("@username", SqlDbType.NVarChar, 30); myParameter1.Value = TextBox1.Text; SqlParameter myParameter2 = myCommand1.Parameters.Add("@password", SqlDbType.NVarChar, 15); myParameter2.Value = TextBox3.Text; SqlParameter myParameter3 = myCommand1.Parameters.Add("@firstname", SqlDbType.NVarChar, 15); myParameter3.Value = TextBox5.Text; SqlParameter myParameter4 = myCommand1.Parameters.Add("@lastname", SqlDbType.NVarChar, 15); myParameter4.Value = TextBox6.Text; SqlParameter myParameter5 = myCommand1.Parameters.Add("@email", SqlDbType.NVarChar, 30); myParameter5.Value = TextBox7.Text; SqlParameter myParameter6 = myCommand1.Parameters.Add("@mobileno", SqlDbType.BigInt, 10); myParameter6.Value = Convert.ToInt64(TextBox8.Text); SqlParameter myParameter7 = myCommand1.Parameters.Add("@sex", SqlDbType.NVarChar, 6); myParameter7.Value = Convert.ToString(RadioButtonList1.SelectedItem); SqlParameter myParameter8 = myCommand1.Parameters.Add("@country", SqlDbType.NVarChar, 30); myParameter8.Value = Convert.ToString(DropDownList1.SelectedItem); SqlParameter myParameter9 = myCommand1.Parameters.Add("@state", SqlDbType.NVarChar, 30); myParameter9.Value = Convert.ToString(DropDownList2.SelectedItem); SqlParameter myParameter10 = myCommand1.Parameters.Add("@city", SqlDbType.NVarChar, 30); myParameter10.Value = Convert.ToString(DropDownList3.SelectedItem); SqlParameter myParameter11 = myCommand1.Parameters.Add("@address", SqlDbType.NVarChar, 50); myParameter11.Value = TextBox9.Text; SqlDataAdapter myDataAdapter = new SqlDataAdapter(); myDataAdapter.SelectCommand = myCommand1; myDataAdapter.Fill(myDataset); myConnection.Close(); Label7.Visible = false;

- 32 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


Label2.Visible = false; TextBox1.Visible = false; Label17.Visible = true; Label17.Text = "Congrulations!Your account has been modified successful."; } catch (Exception) { Label17.Visible = true; Label17.Text = "Please contact your system administrator."; } } protected void LinkButton4_Click(object sender, EventArgs e) { Response.Redirect("Edit Profile.aspx"); } protected void LinkButton5_Click(object sender, EventArgs e) { Response.Redirect("Delete Account.aspx"); } } ---------------------------------------------------------------------

Changepassword.aspx.cs
using using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Data.SqlClient;

public partial class Change_Password : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection(); protected void Page_Load(object sender, EventArgs e) { HttpCookie username = Request.Cookies.Get("username"); TextBox1.Text = username.Value; myConnection = new SqlConnection("Server=AMUF01CD24B46B\\SQLEXPRESS;Trusted_Connection=True;Database=Abhishek"); Label5.Visible = false; Label6.Visible = false; Label7.Visible = false; } protected void LinkButton7_Click(object sender, EventArgs e) { Response.Redirect("Change Password.aspx"); } protected void Button1_Click(object sender, EventArgs e)

- 33 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


{

HttpCookie password = Request.Cookies.Get("password"); DataSet myDataSet2 = new DataSet(); SqlCommand myCommand2 = new SqlCommand(); myCommand2.CommandType = CommandType.StoredProcedure; myCommand2.Connection = myConnection; myCommand2.CommandText = "USER_INFO_SHOW";

SqlParameter myParametera = myCommand2.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParametera.Value = TextBox1.Text; SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); myDataAdapter1.SelectCommand = myCommand2; myDataAdapter1.Fill(myDataSet2); if (TextBox2.Text == Convert.ToString(myDataSet2.Tables[0].Rows[0][1]) & TextBox2.Text != "") { if (TextBox3.Text != "") { try { myConnection.Open(); DataSet myDataset = new DataSet(); SqlDataAdapter myAdapter = new SqlDataAdapter(); SqlCommand myCommand = new SqlCommand(); myCommand.Connection = myConnection; myCommand.CommandType = CommandType.StoredProcedure; myCommand.CommandText = "USER_PASS_CHANGE"; SqlParameter myParameter1 = myCommand.Parameters.Add("@username", SqlDbType.NVarChar, 30); myParameter1.Value = TextBox1.Text; SqlParameter myParameter2 = myCommand.Parameters.Add("@password", SqlDbType.NVarChar, 15); myParameter2.Value = TextBox3.Text; password.Value = TextBox3.Text;

myAdapter.SelectCommand = myCommand; myAdapter.Fill(myDataset); myConnection.Close(); Label7.Visible = true; Label7.Text = "Your password has been changed successfully............................."; } catch (Exception) { Label7.Visible = true; Label7.Text = "Unable to change your password. Please try again"; } } else { Label6.Visible = true;

- 34 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


Label6.Text = "Please enter new password.";

} } else { }

Label5.Visible = true;

} protected void TextBox2_TextChanged(object sender, EventArgs e) { Label5.Visible = false; Label6.Visible = false; Label7.Visible = false; } protected void TextBox3_TextChanged(object sender, EventArgs e) { Label6.Visible = false; } protected void LinkButton1_Click(object sender, EventArgs e) { } }

---------------------------------------------------------------------

Deleteaccount.aspx.cs
using using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Data.SqlClient;

public partial class Delete_Account : System.Web.UI.Page { SqlConnection myConnection = new SqlConnection(); protected void Page_Load(object sender, EventArgs e) { myConnection = new SqlConnection("Server=AMUF01CD24B46B\\SQLEXPRESS;trusted_connection=true;database=Abhishek"); HttpCookie username = Request.Cookies.Get("Username"); Label12.Text = username.Value; //Label1.Visible = false; Label2.Visible = false; Label3.Visible = false; Label4.Visible = false; Label5.Visible = false;

- 35 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


Label6.Visible = false; Label7.Visible = false; Label8.Visible = false; Label9.Visible = false; Label11.Visible = false; //Label12.Visible = false; Label13.Visible = false; Label14.Visible = false; Label15.Visible = false; Label16.Visible = false; Label17.Visible = false; Label18.Visible = false; Label19.Visible = false; Label20.Visible = false; Label21.Visible = false; Label22.Visible = false; Button1.Visible = false; } protected void Button2_Click(object sender, EventArgs e) { DataSet myDataSet2 = new DataSet(); SqlCommand myCommand2 = new SqlCommand(); myCommand2.CommandType = CommandType.StoredProcedure; myCommand2.Connection = myConnection; myCommand2.CommandText = "USER_INFO_SHOW"; SqlParameter myParametera = myCommand2.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParametera.Value = Label12.Text; SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); myDataAdapter1.SelectCommand = myCommand2; myDataAdapter1.Fill(myDataSet2); HttpCookie password = Request.Cookies.Get("Password"); if (TextBox1.Text == Convert.ToString(myDataSet2.Tables[0].Rows[0][1])) { Label2.Visible = true; Label3.Visible = true; Label4.Visible = true; Label5.Visible = true; Label6.Visible = true; Label7.Visible = true; Label8.Visible = true; Label9.Visible = true; Label11.Visible = true; //Label12.Visible = false; Label13.Visible = true; Label14.Visible = true; Label15.Visible = true; Label16.Visible = true; Label17.Visible = true; Label18.Visible = true; Label19.Visible = true; Label20.Visible = true; Label21.Visible = true; Button1.Visible = true;

- 36 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


DataSet myDataSet1 = new DataSet(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Connection = myConnection; myCommand.CommandText = "USER_INFO_SHOW"; SqlParameter myParameter = myCommand.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParameter.Value = Label12.Text; SqlDataAdapter myDataAdapter = new SqlDataAdapter(); myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet1); Label13.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][2]); Label14.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][3]); Label15.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][4]); Label16.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][5]); Label21.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][10]); if (Convert.ToString(myDataSet1.Tables[0].Rows[0][6]) == "Male") { Label17.Text = "Male"; } else { Label17.Text = "Female"; } Label18.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][7]); Label19.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][8]); Label20.Text = Convert.ToString(myDataSet1.Tables[0].Rows[0][9]); Label10.Visible = false; TextBox1.Visible = false; Button2.Visible = false;

} else { }

Label22.Visible=true; Label22.Text="Your password is invalid.";

} protected void Button1_Click(object sender, EventArgs e) { DataSet myDataset1 = new DataSet(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure;

- 37 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


myCommand.Connection = myConnection; myCommand.CommandText = "USER_DELETE"; SqlParameter myParameter = myCommand.Parameters.Add("@username", SqlDbType.NVarChar, 30); myParameter.Value = Label12.Text; SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); myDataAdapter1.SelectCommand = myCommand; myDataAdapter1.Fill(myDataset1); Response.Redirect("Home.aspx");

} protected void TextBox1_TextChanged(object sender, EventArgs e) { Label22.Visible = false; }

---------------------------------------------------------------------

Usersearch.aspx.cs
using using using using using using using using using using using using System; System.Data; System.Configuration; System.Collections; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls; System.Data.SqlClient; System.Net.Mail;

public partial class Usersearch : System.Web.UI.Page { HttpCookie isbn = new HttpCookie("isbn");

SqlConnection myConnection = new SqlConnection("server=AMUF01CD24B46B\\SQLEXPRESS;Trusted_Connection=true;DataBase=Abhishek"); protected void Page_Load(object sender, EventArgs e) { HttpCookie username = Request.Cookies.Get("username"); DataSet myDataSet2 = new DataSet(); SqlCommand myCommand2 = new SqlCommand(); myCommand2.CommandType = CommandType.StoredProcedure; myCommand2.Connection = myConnection; myCommand2.CommandText = "USER_INFO_SHOW"; SqlParameter myParametera = myCommand2.Parameters.Add("@SEARCH", SqlDbType.VarChar, 50); myParametera.Value = username.Value;

- 38 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); myDataAdapter1.SelectCommand = myCommand2; myDataAdapter1.Fill(myDataSet2); Label1.Text= Convert.ToString(myDataSet2.Tables[0].Rows[0] [2]); Label4.Visible = false; Label5.Visible = false; TextBox1.Visible = false; DropDownList4.Visible = false; Button2.Visible = false; Label6.Visible = false; Button3.Visible = false; DataSet myDataSet = new DataSet(); SqlDataAdapter myDataAdapter = new SqlDataAdapter(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.CommandText = "seacrhbook"; myCommand.Connection = myConnection; SqlParameter param1 = myCommand.Parameters.Add("@Param1", SqlDbType.VarChar, 30); param1.Value = DropDownList1.Text; myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet); DropDownList3.Items.Clear(); //DropDownList3.DataSource = myDataSet; //DropDownList3.DataTextField= //DropDownList3.DataBind(); for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++) { DropDownList3.Items.Add(Convert.ToString(myDataSet.Tables [0].Rows[i][0])); } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { DataSet myDataSet = new DataSet(); SqlDataAdapter myDataAdapter = new SqlDataAdapter(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandType = CommandType.StoredProcedure; myCommand.CommandText = "seacrhbook"; myCommand.Connection = myConnection; SqlParameter param1 = myCommand.Parameters.Add("@Param1", SqlDbType.VarChar, 30); param1.Value = DropDownList1.Text; myDataAdapter.SelectCommand = myCommand; myDataAdapter.Fill(myDataSet); DropDownList3.Items.Clear(); //DropDownList3.DataSource = myDataSet; //DropDownList3.DataTextField= //DropDownList3.DataBind();

- 39 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++) { DropDownList3.Items.Add(Convert.ToString(myDataSet.Tables [0].Rows[i][0])); } if (DropDownList1.SelectedValue == "Author") DropDownList3.DataTextField = "Author"; else if (DropDownList1.SelectedValue == "Title") DropDownList3.DataTextField = "Title"; else if (DropDownList1.SelectedValue == "Category") DropDownList3.DataTextField = "Category"; else if (DropDownList1.SelectedValue == "Publisher") DropDownList3.DataTextField = "Publisher";

protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { // GridView1.Visible = false; //int i=GridView1.SelectedIndex; isbn.Value = Convert.ToString(GridView1.SelectedRow.Cells[1].Text); //Label1.Text = isbn.Value; Label4.Visible = true; Label5.Visible = true; TextBox1.Visible = true; DropDownList4.Visible = true; Button2.Visible = true; GridView1.Visible = false; } protected void Button2_Click(object sender, EventArgs e) { Label4.Visible = true; Label5.Visible = true; TextBox1.Visible = true; DropDownList4.Visible = true; Button2.Visible = true; Label6.Visible = true; if ((TextBox1.Text == "") & Convert.ToString(DropDownList4.SelectedValue) == "-select-") { Label6.Text = "Please enter card no and card type."; } else if ((TextBox1.Text == "") || Convert.ToString(DropDownList4.SelectedItem) == "-select-") { Label6.Text = "Please enter card no. or card type."; } else if (Convert.ToInt64(TextBox1.Text) < 1000000000 || Convert.ToInt64(TextBox1.Text) > 9999999999) { Label6.Text = "Please enter valid card no.";

- 40 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


} else {

Label6.Text = "Your transaction have been successfully!"; Button3.Visible = true; DropDownList1.Visible = false; DropDownList2.Visible = false; DropDownList3.Visible = false; DropDownList4.Visible = false; TextBox1.Visible = false; Label5.Visible = false; Label4.Visible = false; Label2.Visible = false; Label3.Visible = false; Button2.Visible = false; Button1.Visible = false; GridView1.Visible = false; if (Convert.ToString(GridView1.SelectedRow.Cells[7].Text) == "Soft Copy") { Response.Redirect(Convert.ToString(GridView1.Selected Row.Cells[9].Text)); }

} } protected void Button3_Click(object sender, EventArgs e) { Response.Redirect("Usersearch.aspx"); } protected void Button1_Click(object sender, EventArgs e) { DataSet myDataSet1 = new DataSet(); SqlDataAdapter myDataAdapter1 = new SqlDataAdapter(); SqlCommand myCommand1 = new SqlCommand(); myCommand1.CommandType = CommandType.StoredProcedure; myCommand1.CommandText = "datagrid"; myCommand1.Connection = myConnection; SqlParameter param1 = myCommand1.Parameters.Add("@param1", SqlDbType.VarChar, 50); param1.Value = Convert.ToString(DropDownList1.SelectedItem); SqlParameter param2 = myCommand1.Parameters.Add("@param2", SqlDbType.VarChar, 50); param2.Value = Convert.ToString(DropDownList3.SelectedItem); SqlParameter param3 = myCommand1.Parameters.Add("@param3", SqlDbType.VarChar, 50); param3.Value = Convert.ToString(DropDownList2.SelectedItem); myDataAdapter1.SelectCommand = myCommand1; myDataAdapter1.Fill(myDataSet1); GridView1.DataSource = myDataSet1; //GridView1.DataSource = SqlDataSource3; GridView1.DataBind(); GridView1.Visible = true; if (GridView1.Rows.Count == 0)

- 41 www.aspspider.net/OnlineBookShoping1

MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH


{ } else { } } }

Label6.Visible = true; Label6.Text = "Book Not Available.";

Label6.Visible = false;

System Testing
Although a separate phase is allotted in the SDLC for testing the system, it is to be understood that the testing takes place throughout the system development in some form or the other Generally half of the budget of the total budget is spent on Testing. Testing is generally carried out under the following phases. (A) Preparation of Testing (B) Conduct of Test (C) Evaluation of the Test Results

Testing Strategies:There are many methods to test a system. However, the prime objective of all these methods is to find out errors present in the system. Some of the commonly used strategies for testing are discussed below. (a) Alpha Testing (b) Beta Testing (c) Unit Testing (d) Integrated Testing

Alpha Testing:Simulated data are generated by the programmer and the system is tested for the correctness of the result produced. The data used might have no meaning of their own. - 42 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH However, the nature, length and other properties have to the same as declared in the specifications.

Beta Testing:Instead of simulated data, the actual data are taken for testing. While alpha Testing is done at developers place and the beta testing id done at the users place. It is done by the user to ensure that the testing is unbiased and satisfactory.

Unit Testing:The programs are tested separately, independent of each other. Since the check is done at the program level, it is also called Program Testing. Cases are made individually for different programs. Testing is done either from the lowermost level to the uppermost level known as Bottom Up Testing or the other way around known as Top Down Testing.

Integration Testing:Individually tested programs do not give any assurance that they will be working well when they put together. On the contrary, all errors related to integration emerge here, which were till now undiscovered. Errors at this stage occur mainly due to non compatibility of data amongst the programs.

REFERENCES

Black Book by Holzmer.


Visual Studio Professional 2005 by Wrox publication. ASP.NET, by NIIT.
- 43 www.aspspider.net/OnlineBookShoping1 MCA V

DEPARTMENT OF COMPUTER SCIENCE, AMU, ALIGARH

Complete reference of SQL SERVER Evan Bay Ross (DBMS)

- 44 www.aspspider.net/OnlineBookShoping1

MCA V

Das könnte Ihnen auch gefallen