233
Project Report Online Shopping Cart (Implemented in ASP.Net (Code Behind C#), SQL SERVER 2008) A PROJECT REPORT SUBMITTED TO INDIRA GANDHI NATIONAL OPEN UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF BACHELOR’S IN COMPUTER APPLICATIONS (BCA) SUBMITTED BY JAIMEEN GOPALBHAI AGRAWAL (BCA-122625863) UNDER THE GUIDENCE OF Pujan Patel(B.E.I.T.) INDIRA GANDHI NATIONAL OPEN UNIVERSITY SCHOOL OF COMPUTER AND INFORMATION SCIENCES INDIRA GANDHI NATIONAL OPEN UNIVERSITY

Jaimeen Agrawal Final Docs

Embed Size (px)

DESCRIPTION

Project

Citation preview

Project Report

Project Report

Online Shopping Cart (Implemented in ASP.Net (Code Behind C#), SQL SERVER 2008)

A PROJECT REPORT SUBMITTED TO INDIRA GANDHI NATIONAL OPEN UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF

BACHELORS IN COMPUTER APPLICATIONS(BCA)

SUBMITTED BYJAIMEEN GOPALBHAI AGRAWAL(BCA-122625863)UNDER THE GUIDENCE OFPujan Patel(B.E.I.T.)INDIRA GANDHI NATIONAL OPEN UNIVERSITY

SCHOOL OF COMPUTER AND INFORMATION SCIENCESINDIRA GANDHI NATIONAL OPEN UNIVERSITYMAIDAN GARHI, NEW DELHI 110 068. 2015

ACKNOWLEDGEMENT

I am greatly pleased to take this opportunity to acknowledge the co-operation and assistance of few people without whom this endeavor would not have been a success.Firstly, I am indebted to my guide for having shown confidence in me, and giving me an opportunity to debut in the world of Software Engineering under his aegis. Also, he has been extremely patient in the initial phase of the work and has given me ample opportunity to learn and imbibe the rudiments of the subject.Further, I would like to express my gratitude towards all staff of Company for their co-operation in all required matters. I am greatly thankful to my project partner who has helped me in completion of this project directly or indirectly.

Date: 25/04/2015 (JAIMEEN GOPALBHAI AGRAWAL)Place: VADODARA

Index

Sr. No.TopicPage No.

1Introduction & Objectives of the Project.

Introduction & Objectives.

Definition

2Feasibility Study

Technical Feasibility

Economical Feasibility

Operational Feasibility

Legal Feasibility

Financial Feasibility

3Software Engineering Paradigm Applied

Introduction to Software

Software Development Life Cycle

Meaning of Spiral Model

Spiral Model

Analysis

Design

Testing

Implementation

4Technology & Operation System

.Net Framework

Framework Architecture

Common Language Specification

Common Language Runtime

Introduction of Asp.Net

Introduction of Asp.Net(C#)

Introduction of Sql Server

Data Access Layer

5Software And Hardware Requirement Specifications

Software Requirement

Hardware Requirement

6Analysis

Data Flow Diagrams

E-R Diagrams

System Flow Diagram

Process Logic

Data Dictionary (Tables)

Screen Shots

Testcases

7Coding

8Coding Efficiency

9Coding Optimization

10Validation Checks

11Testing

System Testing

Integration Testing

Unit Testing

White Box Testing

Black Box Testing

Acceptance Testing

12Implementation & Maintenance

System Security

Security Measures

Cost Estimation

13Reports

14Chart And Project Schedule

15Future Scope of the Project

16Bibliography

17Synopsis

1. Introduction

On-Line Shopping System is a web-based project which is made for remote-shopping or shopping through Internet. As the technology is being advanced the way of life is changing accordance. Now a days we can place the order for any thing from our home. There is no need to go the shop of the things we want. The order can be placed online through Internet. The payment, the confirmation of purchasing; we can do every thing we want. Now we can think that how the days have been changed with time. People had to stand in rows to wait there terms to buy a particular thing from a popular shop. But what is happening now a days; we can extremely surprise that those things can be available on the door-step in few hours.

People had to suffer the rush of the market when they went for shopping. They used to think hundred times to buy any thing having the sufficient money for shopping. The problem was the rush; the quarrel at the time of buying the things. But the advancement of technology brought the new way for shopping. The way of shopping was completely changed with the coming of Internet Technology. People have to fill a simple form on the internet to place their order on any popular shop or shopping-mall for the thing they want to buy. Now they can place their order from the home.

This project entitled On-Line Shopping is an implementation of the above description. It means, it implements the E-shopping or in other word shopping through Internet. It lets the user to place their order online for any article.

3:Objective

Today the internet and its boom have created a new economic scenario that not only stresses on the classical concept of the product but also on the modern concept of service. It is this level of service that dictates whether a commercial venture will succeed or not in the market. To provide a high accessibility of service we will design the online shopping website, so that potential customers need not go to a physical shop to buy products or services. There are several objective of this websites are following given bellows. This site is gives all the information about the e-shopping to provide better service for the customer. It provides the facility to the customers who want to shop on-line due to lock of time. It provides facility to the customer to payment by the cash and cheque and DD also. Its providing the full details about the product and related information about the product like cost, size etc. With the help of it we can save the time and money also. It provides the remote shopping by the cash, or DD, or Debit card also. It provides better security and good delivery service to the customer.

2. Feasibility Study

Feasibility study is a process to check possibilities of system development. It is a method to check various different requirements and availability of financial & technical resources.

Before starting the process various parameters must be checked like:

Estimated finance is there or not? The man power to operate the system is there or not? The man power is trained or not?

All the above conditions must be satisfied to start the project. This is why in depth analysis of feasibility is carried out.

There are three different ways feasibility can be tested

1) Technical Feasibility2) Economic Feasibility3) Operational Feasibility.4) Financial feasibility5) Legal feasibility

Technical Feasibility:

It is basically used to see existing computer, hardware and software etc., weather it is sufficient or additional equipments are required? Minimum System Requirement is such that it can be affordable by of the user who is having

computer. All the user requires is compatible browser and .net framework installed so our system is fully technical feasible.

Economic Feasibility:

In Economic feasibility, analysis of the cost of the system is carried out. The system should be only developed if it is going to give returned the current manual system user can get the price only by purchasing the newspapers. In addition if he/she wants to see archives of particular equity then he has to refer to all the old newspapers. For research reports he has to buy another magazine. So Instead of buying no of magazines user has to just go online and with a single click he can get whatever information he wants. So our project of online share news passes the test of Economic feasibility.

Operational Feasibility:

Once the system is designed there must be trained and expert operator. If there are not trained they should give training according to the needs of the system.

From the users perspective our system fully operational feasible as it just requires some knowledge of computer. Operators only need add daily prices of various equities and there are enough validations available so operator does not require any special technical knowledge. So our system also passes the test of operational feasibility.

Legal Feasibility

Determines whether the proposed system conflicts with legal requirements, e.g. a data processing system must comply with the local Data Protection Acts.

Financial feasibilityIn case of a new project, financial viability can be judged on the following parameters: Total estimated cost of the project Financing of the project in terms of its capital structure, debt equity ratio and promoter's share of total cost Existing investment by the promoter in any other business Projected cash flow and profitability

Final Conclusion of the Feasibility StudyFinally, from the whole study it can be concluded that the system is technically feasible, initially if we see then the initial cost is high but by studying economical feasibility with improved level services, customer may be attracted towards the Star Placement Services and ultimately that is our aim . Other feasibility aspects are satisfied with considering certain risk factor, which is always present in any proposed system project.After completing the feasibility study I described the whole study and presented the report of the study to the Chief Manager of Starnet Services.We discussed about dates to start the real specification of the system and the designing days and further details. We discussed roughly about the model of the actual software system, how it could take place etc.

3. Software Engineering Paradigm Applied

Introduction to Software What is exactly meant by software? I was asked by one of the official of the Starnet Servicesin the meeting. Lets first define the term software. Computer software is the product that software engineers design and build. It encompasses programs that execute within a computer of any size and architecture, documents that encompass hard copy and virtual forms, and data that combine numbers and text but also includes representation of pictorial, video, and audio information. Software Engineer builds it, and virtually everyone in the industrialized world uses it either directly or indirectly. Because it affects nearly every aspect of our lives and has become pervasive in our commerce, our culture, and our everyday activities. We build computer software like we build any successful product, by applying a process that leads to a high quality result that meets the needs of the people who will use the product. We apply a software engineering approach. From the point of view of a software engineer; the work product is the programs, documents, and data that are computer software. But from the users point of view, the work product is the resultant information that somehow makes the users world, User privileges better. Software is both a product and a vehicle for delivering a product.

Software Applications

System SoftwareSystem software is a collection of programs written to service other program, e.g. COMPLIER, EDITORS, AND FILE MANAGEMENT UTILITIES, OS COMPONENTS, DRIVERS, etc.

Real-Time softwareSoftware that monitors or analyzes or controls real-world events as they occur is called real time. Elements of real-time software include a data gathering component that collects and formats information from an external environment, an analysis component that transforms information as required by the application, a control/output component that responds to the external environment and a monitoring component that coordinates all other components so that real response can be maintained.

Business SoftwareBusiness information processing is the largest single software application area. Discrete systems (e.g. PAYROLL, ACCOUNTS RECEIVABLE/PAYABLE, INVENTORY, SMBS)

Engineering and Scientific SoftwareEngineering and scientific software have been characterized by number crunching algorithms. Application range from astronomy to volcanology, from automotive stress analysis to space shuttle orbital dynamics, and from molecular biology to automated manufacturing.

Embedded softwareIntelligent products have become commonplace in nearly every consumer and industrial market. Embedded software resides in read-only memory and is used to control products and systems for the consumer and industrial markets, e.g. keypad control for a microwave oven, so we can say that they can perform very limited and esoteric functions.

Personal computer softwareThe personal computer software market has burgeoned over the past two decades. Word processing, spreadsheets, computer graphics, multimedia, entertainment, personal and business financial applications, external network, and database access are only a few of hundreds of applications.

Web-based software The web pages retrieved by a browser are software incorporates executable instructions (e.g. CGI, HTML, PERL, JAVA, ASP), and data (e.g. hypertext and a variety of visual and audio formats)

Artificial intelligence software Artificial intelligence (AI) software makes use of nonnumeric algorithms to solve complex problems that are not amenable to computation or straightforward analysis. Expert systems, pattern recognition (image and voice), artificial neural networks, theorem proving, and game playing are representatives of applications within this category. This proposed project could be put in the category of BUSINESS APPLICATION SOFTWARE.

Software Development life cycle

The systems development life cycle (SDLC) is a conceptual model used inproject managementthat describes the stages involved in an information system development project, from an initial feasibility study through maintenance of the completed application.Various SDLC methodologies have been developed to guide the processes involved, including thewaterfall model(which was the original SDLC method); rapid application development (RAD); joint application development (JAD); the fountain model; thespiral model; build and fix; andsynchronize-and-stabilize. Frequently, several models are combined into some sort of hybrid methodology. Documentation is crucial regardless of the type of model chosen or devised for any application, and is usually done in parallel with the development process. Some methods work better for specific types of projects, but in the final analysis, the most important factor for the success of a project may be how closely the particular plan was followed.

Spiral Model

The spiral model, also known as the spiral lifecycle model, is a systems development lifecycle (SDLC) model used in information technology (IT). This model of development combines the features of the prototyping model and thewaterfall model. The spiral model is favored for large, expensive, and complicated projects.

Meaning of Spiral Model

Asoftware life-cyclemodel which supposes incremental development, using the waterfallfor each step, with the aim of managing risk. In the spiral model, developers define and implement feature in order of decreasing priority.

The steps in the spiral model can be generalized as follows:The new system requirements are defined in as much detail as possible. This usually involves interviewing a number of users representing all the external or internal users and other aspects of the existing system.

SPIRAL MODEL

A preliminary design is created for the new system.

A first prototype of the new system is constructed from the preliminary design. This is usually a scaled-down system, and represents an approximation of the characteristics of the final product.

A second prototype is evolved by a fourfold procedure: (1) evaluating the first prototype in terms of its strengths, weaknesses, and risks; (2) defining the requirements of the second prototype; (3) planning and designing the second prototype; (4) constructing and testing the second prototype.

At the customer's option, the entire project can be aborted if the risk is deemed too great. Risk factors might involve development cost overruns, operating-cost miscalculation, or any other factor that could, in the customer's judgment, result in a less-than-satisfactory final product.

System AnalysisThe goal ofsystem analysisis to determine where the problem is in an attempt to fix the system. This step involvesbreaking downthe system in different pieces to analyze the situation, analyzing project goals, breaking down what needs to be created and attempting to engage users so that definite requirements can be defined.Requirements analysissometimes requires individuals/teams from client as well as service provider sides to get detailed and accurate requirements; often there has to be a lot of communication to and from to understand these requirements. Requirement gathering is the most crucial aspect as many times communication gaps arise in this phase and this leads to validation errors and bugs in the software program.

DesignInsystems designthe design functions and operations are described in detail, including screen layouts, business rules, process diagrams and other documentation. The output of this stage will describe the new system as a collection of modules or subsystems.The design stage takes as its initial input the requirements identified in the approved requirements document. For each requirement, a set of one or more design elements will be produced as a result of interviews, workshops, and/or prototype efforts.Design elements describe the desired software features in detail, and generally include functional hierarchy diagrams, screen layout diagrams, tables of business rules, business process diagrams, pseudo code, and a complete entity-relationship diagram with a full data dictionary. These design elements are intended to describe the software in sufficient detail that skilled programmers may develop the software with minimal additional input design.

TestingThe code is tested at various levels insoftware testing. Unit, system and user acceptance testings often performed. This is a grey area as many different opinions exist as to what the stages of testing are and how much if any iteration occurs. Iteration is not generally part of the waterfall model, but usually some occur at this stage. In the testing phase, the whole system is tested one by one

Following are the types of testing:1. White Box Testing2. Black Box Testing

White Box TestingWhite-box testingis a method of testing software that tests internal structures or workings of an application, as opposed to its functionality (i.e.black-box testing). In white-box testing an internal perspective of the system, as well as programming skills, are required and used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs. This is analogous to testing nodes in a circuit, e.g.in-circuit testing(ICT).

While white-box testing can be applied at theunit,integrationandsystemlevels of the software testingprocess, it is usually done at the unit level. It can test paths within a unit, paths between units during integration, and between subsystems during a system level test. Though this method of test design can uncover many errors or problems, it might not detect unimplemented parts of the specification or missing requirements.Black Box testingBlock Box Testing is a method oftesting that tests the functionality of an application as opposed to its internal structures or workings (see white). Specific knowledge of the application's code/internal structure and programming knowledge in general is not required. Test cases are built around specifications and requirements, i.e., what the application is supposed to do. It uses external descriptions of the software, including specifications, requirements, and designs to derive test cases. These tests can be functional or non-functional, though usually functional. The test designer selects valid and invalid inputs and determines the correct output. There is no knowledge of the test object's internal structure.

ImplementationIn this phase the designs are translated into code. Computer programs are written using a conventional programming language or an application generator. Programming tools like Compilers, Interpreters, and Debuggers are used to generate the code. Different high level programming languages like C, C++, Pascal, and Java are used for coding. With respect to the type of application, the right programming language is chosen

4.Technology And Operation System

The .Net Framework A frame work is commonly thought of as a set of class libraries that aid in the development of applications. The .net framework is more than just a set of classes. The .net framework is targeted by compliers using a wide variety of applications. Including everything from small components that run on handheld devices to large Microsoft ASP.ET application that span web farms, where multiple web serves act together to improve the performance fault tolerance of a web site. The .NET framework is responsible for providing a basic platform that these applications can share. This basic platform includes a runtimes set of services that oversee the execution of applications. A key responsibility of the runtime is to manage execution so that software written by different programming languages uses classes and other types safely.

Microsoft .Net Framework Architecture Microsoft's .NET Framework is comprised of two main components - the Common Language Runtime (CLR) and the .NET Framework class libraries. The CLR is the real foundation of the .NET Framework. It is the execution engine for all .NET applications. Every target computer requires the CLR to successfully run a .NET application that uses the .NET Framework.

The main features of CLR include: Automatic Memory Management Thread Management Code Compilation & Execution

Code Verification High level of security Remoting Structured Exception Handling Interoperability between Managed and Unmanaged code. Integration with Microsoft Office System

All .NET applications are compiled into Intermediate Language code (MSIL). When executed on the CLR, MSIL is converted into native machine code specific to the operating platform. This process is done by a Just in Time (JIT) compiler. The code executed by the CLR is called as Managed Code. This code is type safe and thoroughly checked by the CLR before being deployed. The .NET runtime also provides a facility to incorporate existing COM components and DLL's into a .NET application. Code that is not controlled by the CLR is called Unmanaged Code.

The .NET Framework is further comprised of Common Type System (CTS) and Common Language Specification (CLS). The CTS defines the common data types used by .NET programming languages. The CTS tells you how to represent characters and numbers in a program. The CLS represents the guidelines defined by for the .NET Framework. These specifications are normally used by the compiler developers and are available for all languages, which target the .NET Framework.

Net architecture

Common Language Specification

To fully interact with other objects regardless of the language they were implemented in, objects must expose to callers only those features that are common to all the languages they must interoperate with. For this reason, the Common Language Specification (CLS), which is a set of basic language features needed by many applications, has been defined. The CLS rules define a subset of the Common Type System; that is, all the rules that apply to the common type system apply to the CLS, except where stricter rules are defined in the CLS. The CLS helps enhance and ensure language interoperability by defining a set of features that developer can rely on to be available in a wide variety of languages. The CLS also establishes requirements for CLS compliance; these help you determine whether your managed code conforms to the CLS and to what extent a given tool supports the development of managed code that uses CLS features.

If your component uses only CLS features in the API that it exposes to other code (including derived classes), the component is guaranteed to be accessible from any programming language that supports the CLS. Components that adhere to the CLS rules and use only the features included in the CLS are said to be CLS-compliant components.

The CLS was designed to be large enough to include the language constructs that are commonly needed by developers, yet small enough that most languages are able to support it. In addition, any language constructs that makes it impossible to rapidly verify the type safety of code was excluded from the CLS so that all CLS-compliant languages can produce verifiable code if they choose to do so.

Common Language Runtime

The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. The CLR runs a form of byte code called the Microsoft Intermediate Language (MSIL), Microsoft's implementation of the Common Intermediate Language.

Developers using the CLR write code in a high level language such as C#. At compile-time, a .NET compiler converts such code into MSIL (Microsoft Intermediate Language) code. At runtime, the CLR's just-in-time compiler (JIT compiler) converts the MSIL code into code native to the operating system. Alternatively, the MSIL code can be compiled to native code in a separate step prior to runtime. This speeds up all later runs of the software as the MSIL-to-native compilation is no longer necessary.

Although some other implementations of the Common Language Infrastructure run on non-Windows operating systems, the CLR runs on Microsoft Windows operating systems.

The virtual machine aspect of the CLR allows programmers to ignore many details of the specific CPU that will execute the program. The CLR also provides other important services, including the following: Memory management Thread management Exception handling Garbage collection Security

Introduction to ASP.NET

Although in C# Language, .NET is a powerful but simple language aimed primarily at developers creating web applications for the Microsoft .NET platform. It inherits many of the best features of C++ but with some of the inconsistencies and anachronisms removed, resulting in cleaner and logical language. C# also contains a variety of useful new innovations that accelerate application development, especially when used in conjunction with Microsoft Visual Studio .NET.The Common Language Runtime provides the services that are needed for executing any application thats developed with one of the .NET languages. This is possible because all of the .NET languages compile to a common Intermediate Language. The CLR also provides the common type system that defines that data types that are used by all the .Net languages. That way, you can use same data types regardless of what.NET language youre using to develop your application.

Microsoft ASP.NET( C # )

Microsoft ASP.NET( C # ) is one of the most well known languages for the front-end programming. It provides a Rapid Application Development environment to the developers. It provides supports for the ODBC (Open Database Connectivity) and RDO data access methods, which can be used as a powerful development tools. It also supports ActiveX Data Objects (ADO) access methods, which is useful in creating a web page, and writing DHTML applications. It has such tools that any programmer can have an attractive screens which he imagines. It is the most widely used languages and is more flexible. Also one can have the desired properties of the various commands to create textboxs, labels, used in the screens. It also has the facility to create menu.

Microsoft ASP.NET(C #) is based on Visual Studio.NET that was developed in early 70s. Visual Studio .Net comes in several varieties including the following:

Microsoft, realizing that ASP does possess some significant shortcomings, developed ASP.net. ASP.net is a set of components that provide developers with a framework with which to implement complex functionality. Two of the major improvements of ASP.net over traditional ASP are scalability and availability. ASP.net is scalable in that it provides state services that can be utilized to manage session variables across multiple web services in a server farm. Additionally, ASP.net possesses a high performance process model that can detect application failures and recover from them. We use the fundamentals of programming with C# using Visual Studio .NET and .NET framework.

The project is the starting point for authoring applications, components &services in Visual Studio.NET 2008.It eats as a container that manages your source code, data connections & references. A project is organized as part of a solution, which can contain multiple projects that are independent of each other. C# project file has .asproj extension whereas solution file has .sln extension.

In order to write code against an external component, your project must first contain a reference to it. A reference can be made to the following types of component.(1) .NET class libraries or assemblies(2) COM components(3) Other class libraries of projects in the same solution(4) XML web services

Features of ASP.NET:(1) Component Infrastructure.(2) Language Integration.(3) Internet Interoperation.(4) Simple Development.(5) Simple Deployment.(6) Reliability.(7) Security

Introduction to Microsoft SQL Server

Microsoft SQL Server enhances the performance, reliability, and scalability provided by earlier releases of SQL Server by making the processes of developing applications, managing systems, and replicating data easier than ever.

All of data processing is involved with the operations of storing and retrieving data. A database, such as Microsoft SQL Server, is designed as the central repository for all the data of an organization. The crucial nature of data to any organization underlines the importance of the method used to store it and enable its later retrieval.

Microsoft SQL Server uses features similar to those found in other databases and some features that are unique. Most of these additional features are made possible by SQL Servers tight integration with the Windows NT operating system. SQL Server contains the data storage options and the capability to store and process the same volume of data as a mainframe or minicomputer.

Like most mainframe or minicomputer databases, SQL Server is a Database that has seen an evolution from its introduction in the mid-1960s until today. Microsofts SQL Server is founded in the mature and powerful relational model, currently the preferred model for data storage and retrieval.

Unlike mainframe and minicomputer databases, a server database is accessed by users--called clients--from other computer systems rather than from input/output devices, such asterminals. Mechanisms must be in place for SQL Server to solve problems that arise from theaccess of data from perhaps Hundreds of computer systems, each of which can processportions of the database independently from the data on the server. Within the framework of aclient/server

database, a server database also requires integration with communication components of the server in order to enable connections with client systems.

SQL server also contains many of the front-end tools of PC databases that traditionallyhavent been available as part of either mainframe or minicomputer databases. In addition tousing a dialect of Structured Query Language (SQL), GUI applications can be used for the storage, retrieval, and administration of the database.

Data Access Layer:

When working with data one option is to embed the data-specific logic directly into the presentation layer. This may take the form of writing ADO.NET code in the ASP.NET page's code portion or using the SqlDataSource control from the markup portion. creating a connection to the database, issuing SELECT, INSERT, UPDATE, and DELETE commands, and so on should be located in the DAL.The presentation layer should not contain any references to such data access code, but should instead make calls into the DAL for any and all data requests. I have created data access layer for Fill() and Get() methods. Get is done by two ways.

GetStory(),which will return information about the success story or user who met by this site. GetMessage(), which will return information about a message for particular type of membership.

These methods, when invoked, will connect to the database, issue the appropriate query, and return the results. These methods could simply return a Dataset or Data Reader populated by the database query, but ideally these results should be returned using strongly-typed objects.

In strongly-typed Data Table, will have each of its columns implemented as properties, resulting in code that looks like: DataTable .Rows [index].column Name.

Figure illustrates the workflow between the different layers of an application that uses Typed Datasets.

To retrieve the data to populate the Data Table, I used a Table Adapter class, which functions as my Data Access Layer. For our story Data Table, the Table Adapter is containing the methods Getstory(), Getstorybyid(memberid), and so on that I can invoke from the presentation layer. The Data Tables role is to serve as the strongly-typed objects used to pass data between the layers.

I have a Typed Dataset with a single Data Table (message) and a strongly-typed Data Adapter class (FmsgTableAdapter,PmsgTableAdpter) with a GetMessage() method.

In my application I have used pattern for inserting, updating, and deleting data, this pattern involves creating methods that, when invoked, issue an INSERT, UPDATE, or DELETE command to the database that operates on a single database

record. Such methods are typically passed in a series of scalar values (integers, strings, Booleans, Date Times, and so on) that correspond to the values to insert, update, or delete. The patterns use the Table Adapters Insert Command, Update Command, and Delete Command properties to issue their INSERT, UPDATE, and DELETE commands to the database.

Figure Each Insert, Update, and Delete Request Is Sent to the Database Immediately.

5.SOFTWARE AND HARDWAREE REQUIREMENT SPECIFICATIONS

System ImplementationThe system was initially implemented in only one computer on trial basis. First, dummy data was fed & the testing was done. All the validations & constraints in the system were checked & tested for dummy data so that the system will not give any error in future. It satisfies the needs of the users.

After the successful & smooth running, the system is ready for the final installation or implementation on other computers.

The system was implemented in parallel to the old system to test whether the system is able to perform the required task with required accuracy. After near about 15 days the new system was completely in use.

Hardware and software require

Hardware

Pentium 2.90 Ghz. Or higher microprocessor 320 GB or More Disk Space 4 GB Ram DVD Driver. Mouse Keyboard Printer

Software

Microsoft Word. (MS Agent), MS-Visio, net Frame works, MS-Sql Server express edition.

Window platformAny Windows operating system

Details of Hardware and Software used

Details of Hardware Used

Pentium 2.90 Ghz.. 320 GB Hard Disk. 4 GB RAM.

Software Used

Application Package used is Microsoft ASP.NET( C # ) Database Package: Microsoft SQL Server 2008. Othe tools: Microsoft VISIO (UML modeling) MS-WORD

Window Platform

Operating System: Windows 00 / NT/window XP

6. Analysis

Data Flow Diagram

After the conclusion of interviews of officials and observations from Preliminary Investigation, Feasibility Study and Software Requirement Specifications was signed. I had to draw the Functional Specifications from Data Flow Diagram techniques, to start designing the system.

What is a Data Flow Diagram? Data flow diagrams illustrate how data is processed by a system in terms of I/O.

Data Flow Diagram Notations You can use two different types of notations on your data flow diagrams: Yourdon & Coad or Gane & Sarson. Process: A process transforms incoming data flow into outgoing data flow.

: Yourdon & Coad Process: Gane & Sarson Process

Data Flow Diagram Layers Draw data flow diagrams in several nested layers. A single process node on a high level diagram can be expanded to show a more detailed data flow diagram. Draw the context diagram

The nesting of data flow layers Context Diagrams: A context diagram is a top level (also known as Level 0) data flow diagram. It only contains one process node (process 0) that generalizes the DFD.

Data Flow DiagramDFD at 0 Level:

1 Level DFD:

2 Level DFD:

Entity - Relationship Diagram:-

Process Logic Process logic is concerned with how the system interact with users and fulfill there requirements? Being a web based system; user of this system can easily access this system through Internet. It provides various functionalities, attracts the user to use it, and makes the user comfortable to work on it. Before providing access to the manipulating authorities, it first demands for user name and password based on user type. If the name and password entered are correct then one can enter the admin menu and can change any contents from this place. Note that it also works as a public website where one can see the information based on the purpose to access this website. There is no need for authentication here, because they has to only access the site not change or update any content and they also cannot change it because they have no authority to change. Here user finds various menus and sub menus and can select any one of them as there requirement. Let I explain the process logic of admin module that how one can perform the task of administrator. First one has to give user name and password which should be checked by the system on the basis of information stored in the database. SYSTEM FLOW CHART

Data Dictionary

Database is collection of data that can be treated as single unit. ThisSingle or individual unit is called table. In relational database system Table is combination of rows and columns which show records and fields Respectively. After great efforts we determine the main entities, there attribute and relationship among them. After determining all these entities, we design the table structure as follows:

Login Table:

S.RField NameData TypeSizeValidation

1.S.No (auto-increment)Integer5

2.U_name Varchar20Primary Key

3.PasswordVarchar 20

Employee Details Table:

S.RField NameData TypeSizeValidation

1.E_IdVarchar20Primary key

2. E_NameVarchar20

3.J_dateDate

4.SexVarchar6

5.Address Varchar50

6.Phone NoInteger 10

7.DOBDate

8.SalaryInteger10

9.SpecializationVarchar20

Category Table:

S.RField NameData TypeSizeValidation

1.Category idInteger5

2.NameVarchar20Primary Key

Sub-Category Table:

S.RField NameData TypeSizeValidation

1.Sub-Category idInteger5

2.NameVarchar20Primary Key

3Category IdInteger5

Customer Service Table:

S.RField NameData type SizeValidation

1.First NameVarchar20Primary key

2.Middle NameVarchar20

3. Last NameVarchar20

4.AddressVarchar300

5.Contact_noInteger12

6.GenderVarchar10

7Birth DateInteger20

8User NameVarchar20

9PasswordVarchar20

10QuestionVarchar500

11AnswerVarchar1000

Purchase Table:

S.RField NameData type SizeValidation

1.Pur_idVarchar10Primary key

2.ItemNameVarchar300

3. RateVarchar100

4.Item_categoryVarchar300

5.QuantityInteger 5

6.DateDatetime

Advertisement Table:

S.RField NameData type SizeValidation

1.Ad_idVarchar10Primary key

2.Ad_nameVarchar30

3. ImageVarchar79

4.Ad_start_datedateTime

5.ad_end_datedateTime

6.Comp_nameVarchar89

7.AddressVarchar78

8.Contact_noVarchar12

9.EmailVarchar78

Payment Table:

S.RField NameData TypeSizeValidation

1.P_idVarchar20Primary key

2. P_nameVarchar200

3.P_dateDate

4.Cust_nameVarchar67

5.Pay_modeVarchar50

6.CashInteger 10

7.DDInteger23

Product Tracking Table:

S.RField NameData TypeSizeValidation

1.P_idVarchar20Primary key

2. Cust_nameVarchar200

3.Delvr_dateDate

4.AmountVarchar67

5.Contact_noVarchar50

6.AddressVarchar100

7.EmailVarchar56

Country Table:

S.RField NameData TypeSizeValidation

1Country idVarcher20Primary key

2Country nameVarchar50

3Country AliasVarchar50

State Table:S.RField NameData TypeSizeValidation

1StateIdVarchar20Primary key

2StateNameVarchar20

3CountryIDVarchar20

S.RField NameData TypeSizeValidation

1State IdVarchar20Primary key

2State NameVarchar20

3Country IDVarchar20

City Table:S.RField NameData TypeSizeValidation

1City IdVarchar20Primary key

2City NameVarchar20

3State IDVarchar20

Screen Shots

AdminAdmin Change Password Form:

Admin Forgot Password Form:

Advertise Form:

Category Master Form:

City Master Form:

Coutry Form:

Employee Form:

Admin Login Form:

ForgotPassword:

Payment Form:

Product Form:

Product Track Form:

Purchase Form:

State Master Form:

SubCategory Form:

User Master Form:

UserCustomer Registrition Form:

Change Password Form:

(Password Change Succefully)

(password Does not match)

Forgot Password Form:

User Login Form:

Welcome Page Form:

SubCategory Form:

Product Form:

ProductDetailsForm:

Test Cases Of Admin Side

Test CaseForm NameStepDetails

Login

Login Form

jaimeen1.UserName:

2.Password:

Login

Expected Result:

1. If UserNAme and Password Is Incorrect than the User cant Login into the System.2. If UserName and Password is Correct than the User will Go on the Welcome PageUserName And Password CorrectTest CaseForm NameStepDetails

Actor Master

Actor Master Form

Abhishek1.Actor Name

Expected Result:If a enter

Test CaseForm NameStepDetails

Sub Category Master

Sub Category Master Form

Telivison1.Sub Category Name

Electronics2.Category Name

Expected Result:Test CaseForm NameStepDetails

Change Password

ChangePasswordForm1. If Current Password Is Incorrect2. New Password and Confirm Password is Incorrect3. If all Fields are Correct

Expected Results:Here Firstly the User has to Login Correctly than Only he/she can Change Password1. If Current Password entered does not match than a message is Shown.2. If after inserting correct userpassword the newpassword and confirm password should match.3. If Newpassword and ConfirmPassword both matches than after clicking onthePassword will Successfully change

Test Cases OfUser Side

Test CaseForm NameStepDetails

Register User

Register User Master1. If in mobile No. field instead of number anything else is inserted.2. If in Dropdown box the User wanted field is not there.3. If all Data are Entered Correctly.

1. If Mobile No. Field is not entered correctlt than a message will shown as:

2. If in Qualification the required qualification is not there as per the user Qualification than selected Other option from Dropdown box a textbox is visible in that he/she can write his/her Qualification.

3. If all fields are inserted than the will be submitted Successfully.

Test CaseForm NameStepDetails

Forgot Password

ForgotPasswordForm1. On entering UserName and Clicking on Forgorpassword Link.2. Password Shown if Emailid and Username is Correct.

Expected Results:1. On entering Username and Clicking on Forgot Password Link the User can get his/her Password.2. If UserName or Password is not Correct than a Message is Thrown.

7. Coding

Admin-Admin ChangePassword:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_AdminChangePassword : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString()); }publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}publicvoid ClearData() { txtunm.Text = ""; txtcupsw.Text = ""; txtnepsw.Text = ""; }

protectedvoid btnchange_Click(object sender, EventArgs e) {try {

if (txtnepsw.Text == txtrepsw.Text) {SqlCommand cmd = newSqlCommand("UpdateChangePsw", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@UserName", SqlDbType.VarChar); parm.Value = txtunm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Password", SqlDbType.VarChar); parm.Value = txtcupsw.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ChangePassword", SqlDbType.VarChar); parm.Value = txtnepsw.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password SuccessFuly Changed"); ClearData(); CloseConnection(); }else { LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password Does Not Match"); }

}

catch (Exception ex) { } }}

AdminForgot Password:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_AdminForgotPassword : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString());

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}publicvoid clearData() { txtunm.Text = ""; txtemail.Text = ""; }

protectedvoid btnsubmit_Click(object sender, EventArgs e) {try {SqlCommand cmd = newSqlCommand("ReadForgotPsw", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@UserName", SqlDbType.VarChar); parm.Value = txtunm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Email", SqlDbType.VarChar); OpenConnection();SqlDataReader dr = cmd.ExecuteReader();if (dr.HasRows) {while (dr.Read()) { lnkpassword.Text = dr["Password"].ToString(); } }else { lnkpassword.Text = "UserName/ContactNo Wrong"; } dr.Close(); clearData(); CloseConnection();

}catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); }

}

}

Advertise:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Advertise : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString());

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertAd", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@AdvertiseName", SqlDbType.VarChar); parm.Value = txtadnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Image", SqlDbType.VarChar); parm.Value = FileUpload1.FileName; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@AdStart", SqlDbType.Date); parm.Value = txtadsdt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@AdEnd", SqlDbType.Date); parm.Value = txtadedt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CompanyName", SqlDbType.VarChar); parm.Value = txtconm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Address", SqlDbType.VarChar); parm.Value = txtadd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ContactNo", SqlDbType.NChar); parm.Value = txtcnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Email", SqlDbType.VarChar); parm.Value = txtemail.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); ClearFields(); cmd.Dispose(); CloseConnection(); }

}

publicvoid ClearFields() { txtadnm.Text = "";//FileUpload1.FileName =""; txtadsdt.Text =""; txtadedt.Text=""; txtconm.Text=""; txtadd.Text=""; txtcnm.Text=""; txtemail.Text = "";

}

}

CategoryMaster:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_CategoryMaster : System.Web.UI.Page{

publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString()); BindControl();

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadCategory", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader Dr = cmd.ExecuteReader();

Gridview2.DataSource= Dr; Gridview2.DataBind();

Dr.Close(); cmd.Dispose(); CloseConnection(); }publicvoid ClearData() { txtcatnm.Text=""; txtcatnm.Focus();

}

protectedvoid Gridview2_RowCommand(object sender, GridViewCommandEventArgs e) {int index = Convert.ToInt32(e.CommandArgument);GridViewRow raw = Gridview2.Rows[index];

if(e.CommandName == "EditButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["catid"] = id; SqlCommand cmd = newSqlCommand("SelectCategory",con); cmd.CommandType= CommandType.StoredProcedure;

SqlParameter parm= newSqlParameter("@Categoryid",SqlDbType.Int); parm.Value = id; parm.Direction= ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection();SqlDataReader dr= cmd.ExecuteReader();while(dr.Read()) { txtcatnm.Text = dr["CategoryName"].ToString(); }

dr.Close(); cmd.Dispose(); Btnsubmit.Text = "Update"; CloseConnection(); }

if (e.CommandName == "DeleteButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["Catid"] = id;

SqlCommand cmd = newSqlCommand("DeleteCategory", con); cmd.CommandType = CommandType.StoredProcedure;SqlParameter parm = newSqlParameter("@CategoryId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery();

//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");

cmd.Dispose(); BindControl(); ClearData(); CloseConnection();

} }protectedvoid Btnsubmit_Click1(object sender, EventArgs e) {if (Btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertCategory", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CategoryName", SqlDbType.VarChar); parm.Value = txtcatnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl();

ClearData(); cmd.Dispose(); CloseConnection(); }else {SqlCommand cmd = newSqlCommand("UpdateCategory", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CategoryId", SqlDbType.Int); parm.Value = ViewState["catid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CategoryName", SqlDbType.VarChar); parm.Value = txtcatnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection();

cmd.ExecuteNonQuery(); BindControl();// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated Successfully"); ClearData(); cmd.Dispose(); CloseConnection(); Btnsubmit.Text = "Submit";

}

}

protectedvoid Gridview2_RowCreated(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.DataRow) {LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit"); lnkEdit.CommandArgument = e.Row.RowIndex.ToString();

LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete"); lnkDelete.CommandArgument = e.Row.RowIndex.ToString(); } } }

City Master:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_CityMaster : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) {if (!IsPostBack) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["Shopping"].ToString()); BindCityName(); BindControl(); } }publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadCity", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader dr = cmd.ExecuteReader();

GridView1.DataSource = dr; GridView1.DataBind();

dr.Close(); cmd.Dispose(); CloseConnection(); }

publicvoid ClearData() { txtcnm.Text = "";

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertCity", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CityName", SqlDbType.VarChar); parm.Value = txtcnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@StateId", SqlDbType.Int); parm.Value = DropDownList1.SelectedValue ; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl(); ClearData(); cmd.Dispose(); CloseConnection();

}

else {SqlCommand cmd = newSqlCommand("UpdateCity", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@City_Name", SqlDbType.VarChar); parm.Value = txtcnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@State_Id", SqlDbType.Int); parm.Value= DropDownList1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl();// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated Successfully"); ClearData(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit";

} }

publicvoid BindCityName() {SqlCommand cmd = newSqlCommand("ReadCity", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader dr = cmd.ExecuteReader(); DropDownList1.DataSource = dr; DropDownList1.DataTextField = "City_Name"; DropDownList1.DataValueField = "City_Id"; DropDownList1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection();

}

protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.DataRow) {LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit"); lnkEdit.CommandArgument = e.Row.RowIndex.ToString();

LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete"); lnkDelete.CommandArgument = e.Row.RowIndex.ToString(); }

}protectedvoid GridView1_RowCommand(object sender, GridViewCommandEventArgs e) {int index = Convert.ToInt32(e.CommandArgument);GridViewRow raw = GridView1.Rows[index];

if (e.CommandName == "EditButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["Cid"] = id;SqlCommand cmd = newSqlCommand("SelectCity", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@City_Id", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection();SqlDataReader dr = cmd.ExecuteReader();while (dr.Read()) { txtcnm.Text = dr["City_Name"].ToString(); }

dr.Close(); cmd.Dispose(); btnsubmit.Text = "Update"; CloseConnection(); }

if (e.CommandName == "DeleteButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["Cid"] = id;

SqlCommand cmd = newSqlCommand("DeleteCity", con); cmd.CommandType = CommandType.StoredProcedure;SqlParameter parm = newSqlParameter("@City_Id", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery();

//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");

cmd.Dispose(); BindControl(); ClearData(); CloseConnection();

}

}

protectedvoid DropDownList1_SelectedIndexChanged(object sender, EventArgs e) {

}}

Country Master:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_CountryMaster : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString()); BindControl();

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadCountry", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader Dr = cmd.ExecuteReader();

GridView1.DataSource = Dr; GridView1.DataBind();

Dr.Close(); cmd.Dispose(); CloseConnection(); }publicvoid ClearData() { txtcnm.Text = ""; txtcali.Text="";

}

protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.DataRow) {LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit"); lnkEdit.CommandArgument = e.Row.RowIndex.ToString();

LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete"); lnkDelete.CommandArgument = e.Row.RowIndex.ToString(); }

}protectedvoid GridView1_RowCommand(object sender, GridViewCommandEventArgs e) {

int index = Convert.ToInt32(e.CommandArgument);GridViewRow raw = GridView1.Rows[index];

if (e.CommandName == "EditButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["cid"] = id;SqlCommand cmd = newSqlCommand("SelectCountry", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection();SqlDataReader dr = cmd.ExecuteReader();while (dr.Read()) { txtcnm.Text = dr["Country_Name"].ToString(); txtcali.Text = dr["Country_Alias"].ToString(); }

dr.Close(); cmd.Dispose(); btnsubmit.Text = "Update"; CloseConnection(); }

if (e.CommandName == "DeleteButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["cid"] = id;

SqlCommand cmd = newSqlCommand("DeleteCountry", con); cmd.CommandType = CommandType.StoredProcedure;SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery();

//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");

cmd.Dispose(); BindControl(); ClearData(); CloseConnection();

}

}protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertCountry", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CountryName", SqlDbType.VarChar); parm.Value = txtcnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CountryAlias", SqlDbType.VarChar); parm.Value = txtcali.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl();

ClearData(); cmd.Dispose(); CloseConnection(); }else {SqlCommand cmd = newSqlCommand("UpdateCountry", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int); parm.Value = ViewState["cid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CountryName", SqlDbType.VarChar); parm.Value = txtcnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CountryAlias", SqlDbType.VarChar); parm.Value = txtcali.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl();// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated Successfully"); ClearData(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit";

}

}}

Employee:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Employee : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString());

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertEmployee", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@EmployeeName", SqlDbType.VarChar); parm.Value = txtenm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@JoinedDate", SqlDbType.Date); parm.Value = txtjodt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Sex", SqlDbType.VarChar); parm.Value = DropDownList1.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Address", SqlDbType.VarChar); parm.Value = txtadd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PhoneNo", SqlDbType.NChar); parm.Value = txtphnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@DOB", SqlDbType.Date); parm.Value = txtdob.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Salary", SqlDbType.Int); parm.Value = txtsal.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Specialization", SqlDbType.VarChar); parm.Value = txtspec.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); ClearFields(); cmd.Dispose(); CloseConnection();

} }

protectedvoid ClearFields() { txtenm.Text = ""; txtjodt.Text = ""; DropDownList1.SelectedValue = ""; txtadd.Text = ""; txtphnm.Text = ""; txtdob.Text = ""; txtsal.Text = ""; txtspec.Text = "";

}

protectedvoid btnreset_Click1(object sender, EventArgs e) { ClearFields(); }}

Admin Login:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Login : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) {try { con = newSqlConnection(ConfigurationManager.ConnectionStrings["Shopping"].ToString()); OpenConnection();

CloseConnection(); }catch (Exception ex) { lblMessage.Text = ex.Message.ToString(); } }

publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }

publicvoid CloseConnection() {

con.Close();

}

protectedvoid btnlogin_Click(object sender, EventArgs e) {try {string strg = "select * from UserMaster where UserName='" + TextBox1.Text + "' and Password='" + TextBox2.Text + "'";SqlCommand cmd = newSqlCommand(strg, con); OpenConnection();SqlDataReader dr = cmd.ExecuteReader();if (dr.Read() == true) { Session["UserName"] = btnlogin.Text; Response.Redirect("WelcomePage.aspx"); }else { lblMessage.Text = "UserName and Password Does Not Match"; }

dr.Close(); cmd.Dispose(); CloseConnection();

}catch (Exception ex) { lblMessage.Text = ex.Message.ToString();

} }

protectedvoid btnreset_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; }

protectedvoid TextBox1_TextChanged(object sender, EventArgs e) {

}protectedvoid LinkButton1_Click(object sender, EventArgs e) { Session.Abandon(); Response.Redirect("AdminForgotPassword.aspx");

}}

Payment:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Payment : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString()); }

publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadPayment", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader Dr = cmd.ExecuteReader();

GridView1.DataSource = Dr; GridView1.DataBind();

Dr.Close(); cmd.Dispose(); CloseConnection(); }publicvoid ClearFields() { txtpaynm.Text = ""; txtpaydt.Text = ""; txtcusnm.Text = ""; txtpaymode.Text = ""; txtcash.Text = ""; txtdd.Text = "";

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertPayment", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@PaymentName", SqlDbType.VarChar); parm.Value = txtpaynm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PaymentDate", SqlDbType.Date); parm.Value = txtpaydt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CustomerName", SqlDbType.VarChar); parm.Value = txtcash.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PaymentMode", SqlDbType.VarChar); parm.Value = txtpaymode.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Cash", SqlDbType.Int); parm.Value = txtcash.Text; parm.Direction = ParameterDirection.Input;

parm = newSqlParameter("@DD", SqlDbType.Int); parm.Value = txtdd.Text; parm.Direction = ParameterDirection.Input;

cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); BindControl(); ClearFields(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Payment Method Is Submitted Successfully"); cmd.Dispose(); CloseConnection(); }

else {SqlCommand cmd = newSqlCommand("UpdatePayment", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int); parm.Value = ViewState["pid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PaymentName", SqlDbType.VarChar); parm.Value = txtpaynm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PaymentDate", SqlDbType.Date); parm.Value = txtpaydt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@CustomerName", SqlDbType.VarChar); parm.Value = txtcusnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PaymentMode", SqlDbType.VarChar); parm.Value = txtpaymode.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Cash", SqlDbType.Int); parm.Value = txtcash.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@DD", SqlDbType.Int); parm.Value = txtdd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl(); ClearFields(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated Successfully"); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit";

}

}protectedvoid btncancel_Click(object sender, EventArgs e) { ClearFields();

}

protectedvoid GridView1_RowCommand(object sender, GridViewCommandEventArgs e) {int index = Convert.ToInt32(e.CommandArgument);GridViewRow raw = GridView1.Rows[index];

if (e.CommandName == "EditButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["pid"] = id;SqlCommand cmd = newSqlCommand("SelectPayment", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection();SqlDataReader dr = cmd.ExecuteReader();while (dr.Read()) { txtpaynm.Text = dr["Payment_Name"].ToString(); txtpaydt.Text = dr["Payment_Date"].ToString(); txtcusnm.Text = dr["Customer_Name"].ToString(); txtpaymode.Text = dr["Payment_Mode"].ToString(); txtcash.Text = dr["Cash"].ToString(); txtdd.Text = dr["DD"].ToString(); }

dr.Close(); cmd.Dispose(); btnsubmit.Text = "Update"; CloseConnection(); }

if (e.CommandName == "DeleteButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["pid"] = id;

SqlCommand cmd = newSqlCommand("deletePayment", con); cmd.CommandType = CommandType.StoredProcedure;SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery();

LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");

cmd.Dispose(); BindControl(); ClearFields(); CloseConnection();

}

}protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.DataRow) {LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit"); lnkEdit.CommandArgument = e.Row.RowIndex.ToString();

LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete"); lnkDelete.CommandArgument = e.Row.RowIndex.ToString(); }

}

}

Product :using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Product : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString());

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadProduct", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader Dr = cmd.ExecuteReader();

GridView2.DataSource = Dr; GridView2.DataBind();

Dr.Close(); cmd.Dispose(); CloseConnection(); }publicvoid ClearFields() { txtpnm.Text = ""; txtprodis.Text = ""; txtquan.Text = ""; txtpp.Text = "";

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {

if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertProduct", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@ProductName", SqlDbType.VarChar); parm.Value = txtpnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PImage", SqlDbType.VarChar); parm.Value = FileUpload1.FileName; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ProDiscription", SqlDbType.VarChar); parm.Value = txtprodis.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Category", SqlDbType.VarChar); parm.Value = DropDownList1.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@SubCategory", SqlDbType.VarChar); parm.Value = DropDownList2.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Quantity", SqlDbType.Int); parm.Value = txtquan.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ProductPrice", SqlDbType.Int); parm.Value = txtpp.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl();

ClearFields(); cmd.Dispose(); CloseConnection(); }else {SqlCommand cmd = newSqlCommand("UpdateProduct", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@ProductId", SqlDbType.Int); parm.Value = ViewState["pid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ProductName", SqlDbType.VarChar); parm.Value = txtpnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@PImage", SqlDbType.VarChar); parm.Value = FileUpload1.FileName ; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ProDiscription", SqlDbType.VarChar); parm.Value = txtprodis.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Category", SqlDbType.VarChar); parm.Value = DropDownList1.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@SubCategory", SqlDbType.VarChar); parm.Value = DropDownList2.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Quantity", SqlDbType.Int); parm.Value = txtquan.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ProductPrice", SqlDbType.Int); parm.Value = txtpp.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated Successfully"); ClearFields(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit";

}

}

protectedvoid btncancel_Click(object sender, EventArgs e) { ClearFields(); }protectedvoid GridView2_RowCommand1(object sender, GridViewCommandEventArgs e) {int index = Convert.ToInt32(e.CommandArgument);GridViewRow raw = GridView2.Rows[index];

if (e.CommandName == "EditButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["pid"] = id;SqlCommand cmd = newSqlCommand("SelectProduct", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@ProductId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection();SqlDataReader dr = cmd.ExecuteReader();while (dr.Read()) { txtpnm.Text = dr["Product_Name"].ToString(); txtprodis.Text = dr["Pro_Discription"].ToString(); txtquan.Text = dr["Quantity"].ToString(); txtpp.Text = dr["Product_Price"].ToString(); }

dr.Close(); cmd.Dispose(); btnsubmit.Text = "Update"; CloseConnection(); }

if (e.CommandName == "DeleteButton") {int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["pid"] = id;

SqlCommand cmd = newSqlCommand("deleteProduct", con); cmd.CommandType = CommandType.StoredProcedure;SqlParameter parm = newSqlParameter("@ProductId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery();

LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");

cmd.Dispose(); BindControl(); ClearFields(); CloseConnection();

}

}protectedvoid GridView2_RowCreated1(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.DataRow) {LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit"); lnkEdit.CommandArgument = e.Row.RowIndex.ToString();

LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete"); lnkDelete.CommandArgument = e.Row.RowIndex.ToString(); }

}

}

Purchase:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;

publicpartialclassAdmin_Purchase : System.Web.UI.Page{publicstaticSqlConnection con;protectedvoid Page_Load(object sender, EventArgs e) { con = newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString());

}publicvoid OpenConnection() {if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); }publicvoid CloseConnection() {

con.Close();

}

publicvoid BindControl() {SqlCommand cmd = newSqlCommand("ReadPurchase", con); cmd.CommandType = CommandType.StoredProcedure;

OpenConnection();SqlDataReader Dr = cmd.ExecuteReader();

GridView1.DataSource = Dr; GridView1.DataBind();

Dr.Close(); cmd.Dispose(); CloseConnection(); }publicvoid ClearFields() { txtitem.Text = ""; txtrate.Text = ""; txtquan.Text = ""; txtitemcat.Text = ""; txtdate.Text = "";

}

protectedvoid btnsubmit_Click(object sender, EventArgs e) {if (btnsubmit.Text == "Submit") {SqlCommand cmd = newSqlCommand("InsertPurchase", con); cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm = newSqlParameter("@ItemName", SqlDbType.VarChar); parm.Value = txtitem.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Rate", SqlDbType.VarChar); parm.Value = txtrate.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@ItemCategory", SqlDbType.VarChar); parm.Value = txtitemcat.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Quantity", SqlDbType.Int); parm.Value = txtquan.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

parm = newSqlParameter("@Date", SqlDbType.Date); parm.Value = txtdate.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);

OpenConnection(); cmd.ExecuteNonQuery(); BindControl(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Submited Successfully"); ClearField