114
AUTOMATED SYSTEM FOR HOME APPLIANCES ABSTRACT This project titled “Automated System for Home Appliances” is designed to automate the functions of day to day activities in a Home Appliances Shop. This project provides an integrated and fully customized system for complete management of Home Appliances in a Shop . With this project the management can easily track the customer details, fast moving products, stock details and management, product catalogue and much more using a comprehensive user friendly approach. This project has been implemented in Dot net Web based platform with asp.net and vb.net as front end and SQL server as backend. The design has been implemented based on Software Design Principles. Main Modules of the system: Customer Management Product catalogue Management Stock Management Sales Management Reports 1

Home App

Embed Size (px)

DESCRIPTION

fgfhgcdtubcnbfhgf

Citation preview

Mobile Showroom Maintenance

AUTOMATED SYSTEM FOR HOME APPLIANCES

ABSTRACT

This project titled Automated System for Home Appliances is designed to automate the functions of day to day activities in a Home Appliances Shop.This project provides an integrated and fully customized system for complete management of Home Appliances in a Shop . With this project the management can easily track the customer details, fast moving products, stock details and management, product catalogue and much more using a comprehensive user friendly approach.This project has been implemented in Dot net Web based platform with asp.net and vb.net as front end and SQL server as backend. The design has been implemented based on Software Design Principles.Main Modules of the system: Customer Management Product catalogue Management Stock Management Sales Management Reports

PROBLEM DEFINITION

Automated System for Home Appliances is aimed to provide an excellent Management of resource. The main goal of this project is to increase the efficiency and decrease the manual entries. It allows the customers to know the status of their resume/application instantly.This Project helps in saving time, human power and any one can know information about the jobs. This system will help to reduce the mistakes and also allows any future updation.

PROBLEM DOMAIN

The activities are to be done to do this system is to analyse the system and to known about the existing and proposed systems.System models are used to gain precision and to avoid the ambiguities often found in the natural languages system description modeling technique used in system analyse is avoids ambiguity by using precise modeling constructors and process description. It describes the requirements of the system. This includes finding how the system works and what is does. It also include systems problems and what the end-users require of any new or change system.

2. SYSTEM ANALYSIS

A series of discussion was held among the authorities concerned with the existing system. Periodic reviews with duty offers were held to monitor the progress, give proper guidance and direction whenever necessary.

1. Existing System

The existing system carried out manually. Lot of registers and paper files are maintained to store the information. Due to lot of paper work, retrieval of information is very difficult. This process is very time consuming and monotonous which leads to human errors. Due to paper work storage overheads increases.

2. Proposed SystemSQL Server 2000/ASP.Net with operating system windows NT is used on proposed system. We convert the existing system into computerized system as accurate and the data can be stored sequentially. The time consuming is low and processing is speedily.Proper updating modifications can be easily done by issuing the proposed system. Reports in Automated System for Home Appliances can be verified easily whenever necessary computerized reports are better than manually prepared reports. Using the menu-selected information can be selected easily.

Main Features of the Proposed System

Data accuracy can be achieved by using proper validations and error detection mechanisms. Speed processing and easy retrieval of data. Proper and regular updating of various files. Complex document can be generated easily and quickly. A variety of useful reports can be generated

3. REQUIREMENT ANALYSIS

Requirement Analysis is done in order to under stand the problem the software system is to solve. The problem could be automating an existing manual process, developing a new automated system, or a combination of the two. For large systems that have many features, and that need to perform may different tasks, understanding the requirement of the system is a major task. The emphasis in requirements analysis is on identifying what is needed from the system, not how the system will achieve its goals.

3.1 HARDWARE & SOFTWARE SPECIFICATION

(a)Hardware:

The configuration of the system on which the package is developed is as follows:(1) Processor : 866 MHz Pentium III or higher . (2) Monitor : VGA or SVGA Color. (3) Hard disk : 80 GB (4) Ram : 512 MB (5) Key Board : 104 Keys (6) Mouse : Any (7) Printer : Any

(b)Software: (1) Operating system : Windows XP. (2) Front End Tool : ASP.Net with VB.Net (3) Back End Tool : SQL Server 2005

3.2. Feasibility StudyThe feasibility study is necessary to determine whether the proposed system feasible considering the technical, operational and economical factors. By having a detailed feasible study the Maintenance will have a clear-cut view of the proposed system with the benefits and drawbacks.

All projects are feasible given unlimited resources and infinite time! Unfortunately, the development of computer-based system or product is more likely plagued by a scarcity of resources and difficult delivery dates. It is both necessary and prudent to evaluate the feasibility of a project at the earliest possible time.

3.2.1. Technical Feasibility:

The project Mobile Showroom Maintenance System is technically feasibility because of the below mentioned feature. The project was developed in SQL Server 2000 and ASP.Net with graphical user interface. It provides the high level of reliability, availability and compatibility.

3.2.2. Economical Feasibility:

Since the proposed system is an integral part of the decentralized computerization of total organizational transactions, it is worth to purchase the hardware needed. Thus the proposed system is economically feasible.

3.3.3. Operation FeasibilitySince the Proposed system is easy to use and there is not any necessary to train the users to adopt new system. Any user with a little bit knowledge of computers can handle the system.

There is no resistance from users to the proposed system. The proposed system provides better service to the employee and maintenance. The proposed system reduces the work efforts.

Conclusion of Feasibility StudyThe proposed system is economically, technically, operationally feasible. So the proposed system is accepted.3.3 Development MethodologySystems Development Life cycle (SDLC) or sometimes just (SLC) is defined by the U.S. Department of Justice as software development process, although it it also a distinct process independent of software or to their information technology considerations.It is used by a systems analyst to develop an information system, including requirements, validation, training, and user ownership through investigation, analysis, design, implementation and maintenance. SDLC is also known as information systems development or application development.An SDLC should result in a high quality system that meets or exceeds customer expectations, within time and cost estimates, works effectively and efficiently in the current and planned information technology infrastructure, and is cheap to maintain and cost-effective to enhance.

SDLC is a systematic approach to problem solving and is composed of several phases, each comprising multiple steps: The software concept-identifies and defines a need for the new system. A requirement analysis-analyzes the information needs of the end users The architectural design-creates a blueprint for the design with the necessary specifications for the hardware, software, people and data resources. Coding and debugging creates and programs the final system System testing evaluates the systems actual functionality in relation to expected or intended functionality.

ImplementationTestingEvaluationor

Feasibility StudyAnalysisDesignDevelopmentImplementationMaintenanceor

Feasibility StudyAnalysisDesignImplementationMaintenanceor

Feasibility StudyAnalysisDesignDevelopmentTestingImplementationMaintenanceor

Analysis(Including Feasibility Study)DesignDevelopmentImplementationEvaluationor

Feasibility StudyAnalysisDesignImplementationTestingEvaluationMaintenance

ImplementationTestingSystem DesignRequirement AnalysisMaintenance

Fig: SDLC LIFE CYCLE

4. SYSTEM DESIGN

Introduction

In developing a design a system, it is advisable for all proposals to be bill from top to bottom that are most beneficial to the college. The purpose of the preliminary design is to evaluate project requests. In detailed study, the collection of details to complexity, describe the system initial and internal issues involved in the design process.

The data that analysts collect during preliminary design through two primary methods, they are submitting titles and selecting titles. The technical issues usually raised during the feasibility design like does that necessary technology exists to do what better analysis to design transition, design of data base interaction design for data communications.

The design of an information system produces the details that state how a system will meet the requirements identifiers during systems analysis. Systems design process by identifying reports and other outputs the system will produce the system design, which also describes the data be entered or input, calculated values or storage of required data into files or database.

Although the review of a user developed application may not take long, this process allows a project selection to keep abreast of the applications that are under development and see how project requests, regardless of their origin, must be evaluated for their operations, technical and economical factors will influence the preliminary design.

The documents containing the design specifications portray the design in different ways. The preliminary design is responsible for providing programmers with complete and clearly outlined software specifications.

Design ProcessSoftware design is an interactive process through which the requirements are translated into a blue print for constructing the software.The three characteristics that serve as a guide for the evolution of good design of a software design are as follows. The design must implement all of the explicit requirements contained in the analysis model and it must accommodate all of the implicit requirements of customer. The design must be readable, understandable guide for those who generates code and for those who test and subsequently maintain the software. The design should provide a complete picture of the software addressing the data functional and behavioral domains from an implementation perspective. The guidance for the evolutions of the quality of the design representations are: A design should exhibit a hierarchical organization that makes intelligent Use of control among elements of software. A design should be modular that is software should be logically partitioned into elements that perform specific functions and sub functions. A design should contain both data and procedural abstractions. A design should lead modules that exhibit independent functional Characteristics.

Design Principles

Software design is both a process and a model. The design process set of steps that enable the designer to describe all aspects of the software to be built.The design model is the equivalent of an architects plan for a house. It begins by representing the totally of the thing to be built, and slowly refines the thing that guide for consulting each design.Basic design principles that enable the software engineer to navigate the design processes are: The design process should not suffer from Tunnel Vision The design should be traceable to the analysis model. The design principles should not reinvent the wheel. The design should minimize the intellectual distance between the software and the problem as it exists in the real world. The design should exhibit uniformity and integrity. The design should be structured be structured to accommodate changes.

4.1 Database DesignDatabases are normally implemented by using a package called a Data Base Maintenance System (DBMS). Each particular DBMS has somewhat unique characteristics, and so such, general techniques for the design of database are limited. One of the most useful methods of analyzing the data required by the system for the data dictionary has developed from research into relational database, particularly the work.This method of analyzing data is calledNormalization. Unnormalized data are converted into normalized data by three stages. Each stage has a procedure to follow.

4.1.1. Normalization

Normalization is the process of simplifying the relationship between data elements in a record. Through this technique, a collection of data in a record structure is replaced by successive record structures that are simples and more predictable and therefore more manageable.Normalization is the formal approach, which examines data and group data item. Together in a form that is better able to accommodate future changes and to minimize the impact of that change on that application.

Normalization is carried out of the following reasons: To structure the Mobile Showroom details data so that any persistent relationship between entities can be represented. To permit simple retrieval of Mobile Showroom Maintenance System data in response to query and report requests. To simplify the maintenance of the Mobile Showroom Maintenance System data through updates insertions and deletions. To reduce the need to restructure are recognize the data when new application requirement arise. This attempt to remove redundant data, avoid data inconsistencies and prevent update anomalies. This results in a simpler or more natural data model. A normalized database more clearly reflects the natural entities and a relationship in the real world. Relational database theory outlines five normal forms of which three normal forms are used in this project. The rules and methods of first three normal forms are given below:

First Normal Form

A relation in is 1NF if the intersection of any column and row contains only one value(no repeating groups).

Methods:

Identify suitable primary key from a pool of un normalized data. Remove any item that repeats within a single value of this key to another relation bringing within them. The Primary key to form part of a new composite key in the new relation.

Second Normal Form

A table in 2NF is also in 1NF if the values in every column are functionally dependent on the complete primary key.

Methods:

For every relation within a single data item making up the primary key, this rule should always be true. For those with a compound key examines every column and determines whether its value depends upon the whole of the compound key or just some of the part it. Remove those that depends only a part of the key to new relation with that part as the primary key.

Third Normal Form

Columns are not transitively dependent on the primary key. A relation is 2NF is also in 3NF if the values in every non-key column are not transitively depend on the primary key.

Methods:

Examine every non-key column and question its relationship with every other non-key column. It for a value for column there is only on value for column B, remove both columns to a separate relation and mark the question unique as a primary key. A Mobile Showroom Maintenance System databases tables involved here needs normalization technique so that it should be flexible to Oracle and store the value in it. So the third normal form is applied and all the tables are normalized according to that. This system supports 3 normal forms.

Data Modeling

The information flow defined as a process of the business modeling is refined into set of data objects that are needed to support the business. The characteristics(called attributes) of each object are identified and relationships between these objects are defined.

Process Modeling

The data objects defined in the data-modeling phase are transformed to achieve the information flow necessary to implement a business function. Processing description are created for addition, modifying, deleting or retrieving a data project.

4.1.2. TABLE STRUCTURE:

Login: Admin_detField NameData TypeConstraints

User_nameVarcharNot Null

PasswordVarcharNot Null

Customer Management:

Field NameData TypeConstraint

CIDNumberPK

C NameVarcharnot null

C AddressVarchar,,

C Selected ItemVarchar,,

P IDNumberPK

Product PriceNumber,,

Phone numberNumberNot Null

E-mailVarchar2Not null

Product cottage management:

File NameData typeConstraint

PIDNumberPK

P ItemVarcharNot Null

PriceNumberNot Null

Stock Management:

Field NameData TypeConstraint

PIDNumberFK

P ItemVarcharNot Null

No. Of ItemsNumberNot Null

Product ReorderNumberNot Null

Sales Management:

Field NameData typeConstraint

PidNumberFK

No. Of ItemsVarcharNot Null

No of ProductsVarcharlNot NUll

PriceNunberNot Null

No of customersNumberNot Null

User_reg:

Field NameData TypeConstraint

UserNameVarcharNot Null

PassWordVarcharNotNull

ConfirmPasswordVarcharNot Null

4.4 Architecture Design

HOME

Admin

User

Registration

Customer

Product Reports

Product

Stock Reports

StockSalesReports

4.5 Data Flow Diagram

DATA FLOW DIAGRAM(DFD) is one of the most important modeling tools. It is used to model the system components. These components are the system process, the process an external entity that interacts with the system, uses the data and the information flows in the system.

DFD shows how the information moves through the system and how it is modified by the a series of transactions. It is a graphical technique that depicts information flow and that information that is applied as data moves from input to output.

DFD is also known as bubble chart. DFD may be used to represent the system that any level of abstraction DFDs may be partitioned into levels that represents increasing information flow and functional details.

A level 0 DFD, also called as the context diagram represents the entire system as single module with input and output indicated by incoming and outgoing arrows respectively. Additional process and information flow paths are represented as the level 0 DFDE is portioned to reveal more details. The context diagrams for the project management system are shown in the figure.

A level 1 DFD, also called as top-level DFD represents the system major module and data stores. The other level will sow each module in the top-level DFD in more detailed fashion. The top-level and other level DFDs for our system are shown below.

A data flow diagram is graphic description of portion of a system. It consists of data flows, process, sources, destinations, and data stores all are described from the view point of the data it processes with just a few symbols. Data flow Diagrams powerful enough to show parallel activities.

Data flow diagram describes the system independently of how it is actually implemented, that is, they show that takes, place, rather than how an activity is accomplished.

Advantages

Users easily understand these simple notations. Users can make suggestions for modifications. If analysis wants to review the overall system late, they use the higher level over view diagram. However, if they are interested in studying one particular process, they use data flow diagram for that low level process. DFD [Data Flow Diagrams]:

Notations:

DATA FLOW: Data move in specific directions from an source to a destination.

PROCESS: People, procedures or a device that produces data the physical component is not identified.

SORUCE OR DESTINATION OF DATA:

DATA STORAGE: Here the data referenced by a process in the system.

Context Level DFD:

CONTEXT LEVEL DIAGRAM DFD FOR PROJECT NAME.

Product catalogue ManagementStock ManagementSales ManagementLogin

Automated System for Home Appliance

Customer Management

CUSTOMER MANAGEMENT:-

Browse

C Selected ItemP IDCNAMECADDRESSCIDSaveCreate

Save to customer management form

PRODUCT CATALOGUE MANAGEMENT:

BROWSE

CREATEPID

PRICE

PITEM

SAVE

Save to Product Catalogue database

STOCK MANAGEMENT:

BROWSE

PID

Number of ItemsCREATE

PITEM

SAVE

Save to Stock Management database

SALES MANAGEMENT:

BROWSE

Number of Products

CREATE

Number of ItemsPID

Number of customers

SAVE

Save to Sales database

4.6 ER-DIAGRAMS

The entity Relationship Diagram(ERD) depicts the relationship between the data objects. The ERD is the notation that is used to conduct the date modeling activity the attributes of each data object noted is the ERD can be described resign a data object descriptions. The set of primary components that are identified by the ERD are

Data Object Relationships Attributes Various types of indicators.

The primary purpose of the ERD is to represent data objects and their relationships.

Notations:

Represents Entity

Represents Attributes

Represents Primary Key

Represents Relationships

Represents Links

Represents Aggregation

Represents Specialization and Generalization

ER-Diagram

CSELECTED ITEMS

PIDCADDRESSADDRESSC NAMESALESADMINSALES DETAILSPRODUCTCUSTOMER

Stock

NOOF ITEMSPIDNo. of ItemsPITEMNO.OF PRODUCTSPIDSTOCKHOME APPLIEDNO.OF CUSTOMERSPRODUCT PRICECIDPRODUCT DETAILSPRICEPITEMPID

5. CODINGLogin coding

Login Page

Imports System.DataImports System.Data.SqlClientPartial Class _Default Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand Dim strstatus As Integer Dim dr As SqlDataReader

Protected Sub btnlogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.Click Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) If (ddl_role.SelectedItem.Text = "-Select Role-") Then Response.Write("alert('Select your role')") tbUsername.Text = "" tbPassword.Text = "" Else

If (ddl_role.SelectedItem.Text = "Admin") Then Int(strstatus = 0) cmd = New SqlCommand("select * from dbo.Admin_det where Username='" + tbUsername.Text + "' and Password='" + tbPassword.Text + "'", cn) cn.Open() 'Dim dr As New SqlDataReader

dr = cmd.ExecuteReader() If (dr.Read()) Then Session("Status") = strstatus.ToString() Response.Redirect("Mainmenu.aspx?Status=0") tbUsername.Text = "" tbPassword.Text = "" Else

Response.Write("alert('Invalid Username or Password')") tbUsername.Text = "" tbPassword.Text = "" End If cn.Close() End If End If

'End If

If (ddl_role.SelectedItem.Text = "User") Then Int(strstatus = 1) cmd = New SqlCommand("Select Count(*) from dbo.User_det where Username='" + tbUsername.Text + "' and Password='" + tbPassword.Text + "'", cn) cn.Open() 'Dim vResult As New Integer 'Int(vResult = Convert.ToInt32(cmd.ExecuteScalar())) dr = cmd.ExecuteReader() If (dr.Read()) Then

Session("Status") = strstatus.ToString() Session("Username") = tbUsername.Text Response.Redirect("Mainmenu.aspx?Status=1") 'Else 'End If Response.Write("alert('Invalid Username or Password')") tbUsername.Text = "" tbPassword.Text = "" End If cn.Close() End If 'End If End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) End Sub

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Response.Redirect("User_det.aspx") End SubEnd Class

Main Menu

Partial Class Mainmenu Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim strstatus As Integer strstatus = Convert.ToInt32(Request.QueryString("Status")) If (strstatus = 0) Then btncustomer.Enabled = True btnproduct.Enabled = True btnstock.Enabled = True btnsales.Enabled = True btnreports.Enabled = True 'btnback.Enabled = True Else btncustomer.Enabled = True btnproduct.Enabled = True btnstock.Enabled = True btnsales.Enabled = True btnreports.Enabled = True 'btnback.Enabled = True End If End Sub

Protected Sub btncustomer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btncustomer.Click Response.Redirect("Customer_det.aspx") End Sub

Protected Sub btnproduct_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnproduct.Click Response.Redirect("Product.aspx") End Sub

Protected Sub btnstock_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnstock.Click Response.Redirect("Stock.aspx") End Sub

Protected Sub btnsales_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsales.Click Response.Redirect("Sales.aspx") End Sub

Protected Sub btnreports_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnreports.Click Response.Redirect("Reports.aspx") End Sub

Protected Sub lklogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lklogout.Click Response.Redirect("Default.aspx") End SubEnd Class

Customer Details

Imports System.DataImports System.Data.SqlClient

Partial Class Customer_det Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand

Protected Sub btnadd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnadd.Click Try Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cmd = New SqlCommand("insert into cust_det(CustomerId,ProductId,CustomerName,Address,SelectedItem,ProductPrice,PhoneNumber,EmailId) values ('" + txtcustomerid.Text + "','" + txtproductid.Text + "','" + txtcustomername.Text + "','" + txtaddress.Text + "','" + ddl_item.SelectedItem.Text + "','" + txtproductprice.Text + "','" + txtphno.Text + "','" + txtemail.Text + "')", cn) cn.Open() cmd.ExecuteNonQuery() cn.Close() Response.Write("alert('Application Successfully Saved')") Catch ex As Exception Response.Write("alert('Already Exists')") End Try

End Sub

Protected Sub btnclear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnclear.Click Response.Redirect("Customer_det.aspx") End Sub

Protected Sub btnbill_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnbill.Click Response.Redirect("Bill_det.aspx") End Sub

Protected Sub ibback1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibback1.Click Response.Redirect("Mainmenu.aspx") End Sub

Protected Sub ibnext_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibnext.Click Response.Redirect("Reports.aspx") End Sub

Protected Sub ddl_item_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_item.SelectedIndexChanged If (ddl_item.SelectedIndex = 1) Then 'txtproductid.Text = "1" txtproductprice.Text = "1000.00" ElseIf (ddl_item.SelectedIndex = 2) Then ' txtproductid.Text = "2" txtproductprice.Text = "6000.00" ElseIf (ddl_item.SelectedIndex = 3) Then ' txtproductid.Text = "3" txtproductprice.Text = "2000.00" ElseIf (ddl_item.SelectedIndex = 4) Then 'txtproductid.Text = "4" txtproductprice.Text = "4000.00" ElseIf (ddl_item.SelectedIndex = 5) Then ' txtproductid.Text = "5" txtproductprice.Text = "1500.00" ElseIf (ddl_item.SelectedIndex = 6) Then 'txtproductid.Text = "6" txtproductprice.Text = "500.00" ElseIf (ddl_item.SelectedIndex = 7) Then 'txtproductid.Text = "7" txtproductprice.Text = "2000.00" End If End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) Dim ProductId As Integer Dim cmdProductId As New SqlCommand cmdProductId = New SqlCommand("select Max(ProductId)+1 from dbo.cust_det", cn) 'SqlCommand cmdRationCardNo = new SqlCommand("select Max(RationCardNo)+1 from cust_det", cn); cn.Open() ProductId = Convert.ToInt32(cmdProductId.ExecuteScalar()) cn.Close() txtproductid.Text = Convert.ToString(ProductId) 'tbdate.Text = System.DateTime.Now.ToShortDateString(); End SubEnd Class

Product Details Code

Imports System.DataImports System.Data.SqlClient

Partial Class Product Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand 'Dim dr As New SqlDataReader Dim ds As New DataSet Dim da As New SqlDataAdapter Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cmd = New SqlCommand("insert into Product_det(ProductId,ProductItem,ProductPrice) values ('" + txtproductid.Text + "','" + ddl_item.SelectedItem.Text + "','" + txtproductprice.Text + "')", cn) cn.Open() cmd.ExecuteNonQuery() cn.Close() Response.Write("alert('Application Successfully Saved')") End Sub

Protected Sub ddl_item_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_item.SelectedIndexChanged

If (ddl_item.SelectedIndex = 1) Then txtproductid.Text = "1" txtproductprice.Text = "1000.00" ElseIf (ddl_item.SelectedIndex = 2) Then txtproductid.Text = "2" txtproductprice.Text = "6000.00" ElseIf (ddl_item.SelectedIndex = 3) Then txtproductid.Text = "3" txtproductprice.Text = "2000.00" ElseIf (ddl_item.SelectedIndex = 4) Then txtproductid.Text = "4" txtproductprice.Text = "4000.00" ElseIf (ddl_item.SelectedIndex = 5) Then txtproductid.Text = "5" txtproductprice.Text = "1500.00" ElseIf (ddl_item.SelectedIndex = 6) Then txtproductid.Text = "6" txtproductprice.Text = "500.00" ElseIf (ddl_item.SelectedIndex = 7) Then txtproductid.Text = "7" txtproductprice.Text = "2000.00" End If

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (IsPostBack = "False") Then Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cn.Open() ds = New DataSet() da = New SqlDataAdapter("select SelectedItem from dbo.Cust_det", cn) da.Fill(ds) ddl_item.DataSource = ds ddl_item.DataTextField = "SelectedItem" ddl_item.DataValueField = "SelectedItem" ddl_item.DataBind() End If End Sub

Protected Sub btnclear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnclear.Click Response.Redirect("Product.aspx") End Sub

Protected Sub ibback_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibback.Click Response.Redirect("Mainmenu.aspx") End Sub

Protected Sub ibnext_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibnext.Click Response.Redirect("Reports.aspx") End Sub

Protected Sub btnreports_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnreports.Click Response.Redirect("Product_rep.aspx") End SubEnd Class

Sales Code

Imports System.DataImports System.Data.SqlClientPartial Class Sales Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand Dim da As New SqlDataAdapter Dim ds As New DataSet

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cmd = New SqlCommand("insert into dbo.Sales_det(ProductId,NoofItemsSold,NoofCustomers,TotalPrice) values ('" + ddl_Pid.SelectedItem.Text + "','" + txtNumberOfItemsSold.Text + "','" + txtNumberOfCustomers.Text + "','" + txttotalprice.Text + "')", cn) cn.Open() cmd.ExecuteNonQuery() cn.Close() Response.Write("alert('Application Successfully Saved')") End Sub

Protected Sub ddl_Pid_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_Pid.SelectedIndexChanged 'If (ddl_Pid.SelectedItem.Text = "Select") Then Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cn.Open() da = New SqlDataAdapter("Select SelectedItem from dbo.Cust_det where ProductId ='" + ddl_Pid.SelectedItem.Text + "'", cn) Dim ds As New DataSet() da.Fill(ds) txtNumberOfItemsSold.Text = ds.Tables(0).Rows(0)("SelectedItem").ToString() txtNumberOfItemsSold.DataBind() 'txttotalprice.DataBind() Dim da1 As New SqlDataAdapter Dim ds1 As New DataSet

da1 = New SqlDataAdapter("select count(*) CustomerId from dbo.Cust_det where SelectedItem='" + txtNumberOfItemsSold.Text + "'", cn) da1.Fill(ds1) txtNumberOfCustomers.Text = ds1.Tables(0).Rows(0)("CustomerId").ToString()

Dim da2 As New SqlDataAdapter Dim ds2 As New DataSet

da2 = New SqlDataAdapter("select ProductPrice from dbo.Cust_det where SelectedItem='" + txtNumberOfItemsSold.Text + "'", cn) da2.Fill(ds2) Dim b, n As New Integer txtNumberOfCustomers.Text = ds1.Tables(0).Rows(0)("CustomerId").ToString() txttotalprice.Text = b txttotalprice.Text = Convert.ToDouble(Val(b) + Val(b)) txttotalprice.Text = ds2.Tables(0).Rows(0)("ProductPrice").ToString() cn.Close()

'End If End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (IsPostBack = "False") Then Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cn.Open() ds = New DataSet() da = New SqlDataAdapter("select ProductId from dbo.Cust_det", cn) da.Fill(ds) ddl_Pid.DataSource = ds ddl_Pid.DataTextField = "ProductId" ddl_Pid.DataValueField = "ProductId" ddl_Pid.DataBind()

Dim da1 As New SqlDataAdapter Dim ds1 As New DataSet

da1 = New SqlDataAdapter("select count(*) CustomerId from dbo.Cust_det where CustomerId='" + txtNumberOfCustomers.Text + "'", cn) da1.Fill(ds1) txtNumberOfCustomers.Text = ds1.Tables(0).Rows(0)("CustomerId").ToString() cn.Close() End If

End Sub

Protected Sub txtNumberOfCustomers_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtNumberOfCustomers.TextChanged

Dim b As Integer b = Convert.ToInt32(txtNumberOfCustomers.Text) + Convert.ToInt32(txtNumberOfCustomers.Text) End Sub

Protected Sub ButtonClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonClear.Click Response.Redirect("Sales.aspx") End Sub

Protected Sub ibback_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibback.Click Response.Redirect("Mainmenu.aspx") End Sub

Protected Sub ibnext_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibnext.Click Response.Redirect("Reports.aspx") End Sub

Protected Sub txttotalprice_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txttotalprice.TextChanged Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cn.Open() ds = New DataSet() da = New SqlDataAdapter("select CustomerId from dbo.Cust_det", cn) da.Fill(ds) txtNumberOfCustomers.DataBind() ddl_Pid.DataSource = ds ddl_Pid.DataTextField = "CustomerId" ddl_Pid.DataValueField = "CustomerId" ddl_Pid.DataBind() Dim b As Integer b = Convert.ToInt32(txtNumberOfCustomers.Text) + Convert.ToInt32(txtNumberOfCustomers.Text) End Sub

End Class

Stock Code

Imports System.DataImports System.Data.SqlClientPartial Class Stock Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand

Protected Sub ddl_item_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_item.SelectedIndexChanged If (ddl_item.SelectedIndex = 1) Then txtproductid.Text = "1" 'txtproductprice.Text = "1000.00"

ElseIf (ddl_item.SelectedIndex = 2) Then txtproductid.Text = "2" 'txtproductprice.Text = "6000.00" ElseIf (ddl_item.SelectedIndex = 3) Then txtproductid.Text = "3" 'txtproductprice.Text = "2000.00" ElseIf (ddl_item.SelectedIndex = 4) Then txtproductid.Text = "4" 'txtproductprice.Text = "4000.00" ElseIf (ddl_item.SelectedIndex = 5) Then txtproductid.Text = "5" 'txtproductprice.Text = "1500.00" ElseIf (ddl_item.SelectedIndex = 6) Then txtproductid.Text = "6" 'txtproductprice.Text = "500.00" ElseIf (ddl_item.SelectedIndex = 7) Then txtproductid.Text = "7" 'txtproductprice.Text = "2000.00" 'Else End If If (ddl_item.SelectedItem.Text = "Select") Then Dim connection1 As String connection1 = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection1) cn.Open()

Dim da3 As New SqlDataAdapter da3 = New SqlDataAdapter("Select NoofItems from dbo.Stock_det where ProductId ='" + ddl_item.SelectedItem.Text + "'", cn) Dim ds As New DataSet() da3.Fill(ds) txtnoofitems.Text = ds.Tables(0).Rows(0)("SelectedItem").ToString() txtnoofitems.DataBind() End If Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) cn.Open() Dim da2 As New SqlDataAdapter Dim ds2 As New DataSet Dim a As Integer a = Val(txtnoofitems.Text) + Val(txtreorderstock.Text) txtnoofitems.Text = a da2 = New SqlDataAdapter("select count (*)NoofItems from dbo.Stock_det where ProductItem='" + ddl_item.SelectedItem.Text + "'", cn) da2.Fill(ds2) txtnoofitems.Text = ds2.Tables(0).Rows(0)("NoofItems").ToString() txtreorderstock.Text = "" txtnoofitems.DataBind() End Sub

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection) Dim a As Integer a = Val(txtnoofitems.Text) + Val(txtreorderstock.Text) txtnoofitems.Text = a cmd = New SqlCommand("insert into dbo.Stock_det values ('" + ddl_item.SelectedItem.Text + "','" + txtproductid.Text + "','" + txtnoofitems.Text + "','" + txtreorderstock.Text + "')", cn) cn.Open() cmd.ExecuteNonQuery() cn.Close() Response.Write("alert('Application Successfully Saved')") End Sub

Protected Sub btnclear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnclear.Click Response.Redirect("Stock.aspx") End Sub

Protected Sub ibback_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibback.Click Response.Redirect("Mainmenu.aspx") End Sub

Protected Sub ibnext_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibnext.Click Response.Redirect("Reports.aspx") End SubEnd Class

User Registration Code

Imports System.DataImports System.Data.SqlClient

Partial Class User_det Inherits System.Web.UI.Page Dim cn As New SqlConnection Dim cmd As New SqlCommand 'Dim dr As New SqlDataReader

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click Dim connection As String connection = ConfigurationManager.ConnectionStrings("conn").ToString() cn = New SqlConnection(connection)

cmd = New SqlCommand("insert into dbo.User_det values ('" + txtusername.Text + "','" + txtpassword.Text + "','" + txtcpassword.Text + "')", cn) cn.Open() cmd.ExecuteNonQuery()

Response.Write("alert('Application successfully Saved')") cn.Close() Response.Redirect("Default.aspx") ' End If End Sub

Protected Sub btnclear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnclear.Click Response.Redirect("User_det.aspx") End Sub

Protected Sub lklogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lklogout.Click Response.Redirect("Default.aspx")

End SubEnd Class

6. FORMS

7. SYSTEM TESTING

Testing is the process of exercising or evaluating a system or system component by manual or automated means to verify that it satisfies specified requirements. Testing is a process of executing program with the intent of finding errors. A good test case is one that has highly probability of finding an error. A successful test case is one that detects an as yet undiscovered error.

Testing involves operation of a system or application under controlled conditions and evaluating the results. The controlled conditions should include both normal and abnormal conditions. Testing should d intentionally attempt to make things go wrong to determine if things happen when they shouldnt or things dont happen when they should.

Testing Objective:

1. Testing is a process of executing a program with the intent of finding an error.2. A good test case is one that has a high probability of finding an as yet undiscovered error.3. A successful test is one that uncovers an as yet undercover error

Secondary benefits includes

1. Demonstrates the software functions appear to be working according to specifications.2. That performance requirements appear to have been met.3. Data collected during testing provides a good indication of software reliability and some indication of software quality.

Levels of Testing

In order to uncover the errors present in different phases we have the concept oflevels of testing. The basic levels of testing are as shown below Client Needs

Acceptance TestingSystem TestingIntegration TestingUnit Testing Requirements Design

Code

7.1 Test case design

To have a comprehensive testing scheme the test must cover all methods or a good majority of them all the services of your system must be checked by at least one test.To test a system you must construct some test input cases, and then describe how the output will look. Next, perform the tests and compare the outcome with the expected outcome the objectives of testing are:

1. Testing is the process of executing a program with the intent of finding errors.1. A good test case is the one that as a high probability of detecting an as yet undiscovered error.1. A successful test case is the one that detects an as ye undiscovered error. If testing is conducted successfully it will uncover errors in software, Testing cannot show the absences of defects are present. It can only show that software defects are present.

7.1.1 White Box Testing Knowing the internal working of a product, tests can be conducted to ensure that all gears mesh, that is, that internal operation performs according to specifications and all internal components have been adequately exercised.

It is predicted on close examinations of procedural detail logical providing test cases that exercise specific sets of conditions and/or loops tests paths through the software. Basis path testing is a white box testing technique. The basis path method enables the test case designer to derive a logical complexity of a procedural design and use this measure as a guide for defining as basis set of execution paths.

We used white box testing for proper execution of loops, functions in the advocate assistant system.

7.1.2 Black Box Testing Black box testing allows to tests that are conducted at the software interface. These are used to demonstrate the software functions operational that input is properly accepted and the output is correctly produced, at the same time searching for error.

In this system, we checked by using sample input for setting proper output and this works and black box testing was used.

7. 2 Testing Strategies

A strategy for software testing must accommodate low level tests that are necessary to verify that a small source code segment has been correctly implemented as well as high level tests that validate major system functions against customer requirements. A strategy must provide guidance for the practitioner.

Different Testing strategies

7.2.1 Unit Testing

Unit testing focuses verification efforts in smallest unit of software design the module. Using the procedural design description as a guide, important control paths are tested uncover error with in the boundary of the module. The relative complexity of the tests and uncovered errors is limited by the constrained scope established for unit testing, the unit test is normally a white box testing oriented and the step can conducted in parallel for multiple modules.

1. Unit test considerations1. Unit test procedures

7.2.2 Integration Testing

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing. There are two types of integration testing:

1. Top-Down Integration: Top down integration is an incremental approach to construction of program structures. Modules are integrated by moving down wards throw the control hierarchy beginning with the main control module.

1. Bottom-Up Integration: Bottom up integration as its name implies, begins construction and testing with automatic modules.

1. Regression Testing: In this contest of an integration test strategy, regression testing is the re execution of some subset of test that have already been conducted to ensure that changes have not propagate unintended side effects.

7.2.3System Testing

The following testing strategies have to be followed by the programmers during the development and the coding phase of the project. Develop each unit separately and then perform Unit Test for proper functioning. During this check whether the unit is properly functional using some of the following methods.

Condition TestingProperly exercise the logical conditions in a program module. Avoid Boolean operator errors, variable error, parenthesis errors, relational operators errors and arithmetic errors as far as possible.

Data Flow TestingThis test is to be carried out as follows. Select test paths of program according to locations of definitions and uses of variable in the program. Now, consider the selected flow one by one and test it to proper functioning.

Loop TestingLoop testing is to be performed on all types of the loops, nested loops, concatenated loops and unconditional loops. Simple loops may not have errors but even then they dont leave them untested. Properly dry run and examine the nested loops, concatenated and unstructured ones.Once you complete development of the units, the next step is to integrate these units as a package. During integration of these units, perform integration testing and regression testing so that integration of these units may not create any problems. Repeat this entire test as recursive activity so that there is minimum possibility of error. These tests are to be carried out by the programmer of the project.Any engineering product can be tested in one of two ways:White Box Testing: This testing is also called as glass box testing. In this testing, by knowing the specified function that a product has been designed to perform test can be conducted that demonstrates each function is fully operation at the same time searching for errors in each function. It is a test case design method that uses the control structure of the procedural design to derive test cases. Basis path testing is a white box testing.

Basis Path Testing:1. Flow graph notation1. Cyclomatic Complexity1. Deriving test cases1. Graph matrices

Control Structure Testing:1. Condition testing1. Data flow testing1. Loop testing Black Box Testing: In this testing by knowing the internal operation of a product, tests can be conducted to ensure that all gears mesh, that is the internal operation performs according to specification and all internal components have been adequately exercised. It fundamentally focuses on the functional requirements of the software.The steps involved in black box test case design are:1. Graph based testing methods1. Equivalence partitioning1. Boundary value analysis1. Comparison testing

7.2.4 Validation Testing

At the culmination of integration testing, software is completely assembled as a package; interfacing errors have been uncovered and corrected, and a final series of software tests validation testing may begin. Validation can be fined in many ways, but a simple definition is that validation succeeds when software functions in a manner that can be reasonably expected by the customer.Reasonable expectation is defined in the software requirement specification a document that describes all user-visible attributes of the software. The specification contains a section titled Validation Criteria. Information contained in that section forms the basis for a validation testing approach.

7.2.5 ALPHA AND BETA TESTING

It is virtually impossible for a software developer to foresee how the customer will really use a program. Instructions for use may be misinterpreted; strange combination of data may be regularly used; and output that seemed clear to the tester may be unintelligible to a user in the field.

When custom software is built for one customer, a series of acceptance tests are conducted to enable the customer to validate all requirements. Conducted by the end user rather than the system developer, an acceptance test can range from an informal test drive to a planned and systematically executed series of tests.

8. SYSTEM IMPLEMENTATION

Implementation is the process of having systems personnel check out and put new equipment into use, train users, install the new application depending on the size of the organization that will be involved in using the application and the risk associated with its use, systems developers may choose to test the operation in only one area of the firm, say in one department or with only one or two persons. Sometimes they will run the old and new systems together to compare the results. In still other situation, developers will stop using the old system one-day and begin using the new one the next.Once installed, applications are often used for many years. However, both the organization and the users will change, and the environment will be different over weeks and months. Therefore, the application will undoubtedly have to be maintained; modifications and changes will be made to the software, files, or procedures to meet emerging user requirements. Since organization systems and the business environment undergo continual change, the information systems should keep pace. In this sense, implementation is ongoing process.Evaluation of the system is performed to identify its strengths and weakness. The actual evaluation can occur along any of the following dimensions.Operational Evaluation: assessment of the manner in which the system functions, including ease of use, response time, suitability of information formats, overall reliability, and level of utilization.Organization Impact: Identification and measurement of benefits to the organization in such areas as financial concerns operational efficiency, and competitive impact. Includes impact on internal and external information flows.User Manager Assessment: Evaluation of the attitudes of senior and user mangers within the organization, as well as end-users.Development Performance: Evaluation of the development process in accordance with such yardsticks as overall development time and effort, conformance to budgets and standards, and other project management criteria. Includes assessment of development methods and tools.

Overview of ASP.NET with VB .NetThe purpose of this tutorial is to provide you with a brief introduction to ASP.NET MVC views, view data, and HTML Helpers. By the end of this tutorial, you should understand how to create new views, pass data from a controller to a view, and use HTML Helpers to generate content in a view.Understanding ViewsFor ASP.NET or Active Server Pages, ASP.NET MVC does not include anything that directly corresponds to a page. In an ASP.NET MVC application, there is not a page on disk that corresponds to the path in the URL that you type into the address bar of your browser. The closest thing to a page in an ASP.NET MVC application is something called a view.ASP.NET MVC application, incoming browser requests are mapped to controller actions. A controller action might return a view. However, a controller action might perform some other type of action such as redirecting you to another controller action.Listing 1 contains a simple controller named the HomeController. The HomeController exposes two controller actions named Index() and Details(). Listing 1 HomeController.csusing System.Web.Mvc;

namespace MvcApplication1.Controllers{ [HandleError] public class HomeController : Controller { public ActionResult Index() { return View(); }

public ActionResult Details() { return RedirectToAction("Index"); } }}

You can invoke the first action, the Index() action, by typing the following URL into your browser address bar:/Home/IndexYou can invoke the second action, the Details() action, by typing this address into your browser:/Home/DetailsThe Index() action returns a view. Most actions that you create will return views. However, an action can return other types of action results. For example, the Details() action returns a RedirectToActionResult that redirects incoming request to the Index() action.The Index() action contains the following single line of code:View(); This line of code returns a view that must be located at the following path on your web server:\Views\Home\Index.aspxThe path to the view is inferred from the name of the controller and the name of the controller action.If you prefer, you can be explicit about the view. The following line of code returns a view named Fred:View(Fred); When this line of code is executed, a view is returned from the following path:\Views\Home\Fred.aspxIf you plan to create unit tests for your ASP.NET MVC application then it is a good idea to be explicit about view names. That way, you can create a unit test to verify that the expected view was returned by a controller action.Adding Content to a ViewA view is a standard (X)HTML document that can contain scripts. You use scripts to add dynamic content to a view.For example, the view in Listing 2 displays the current date and time.Listing 2 \Views\Home\Index.aspx

Index

The current date and time is

Notice that the body of the HTML page in Listing 2 contains the following script: You use the script delimiters to mark the beginning and end of a script. This script is written in C#. It displays the current date and time by calling the Response.Write() method to render content to the browser. The script delimiters can be used to execute one or more statements.Since you call Response.Write() so often, Microsoft provides you with a shortcut for calling the Response.Write() method. The view in Listing 3 uses the delimiters as a shortcut for calling Response.Write().Listing 3 Views\Home\Index2.aspx

Index

The current date and time is

You can use any .NET language to generate dynamic content in a view. Normally, youll use either Visual Basic .NET or C# to write your controllers and views. Using HTML Helpers to Generate View ContentTo make it easier to add content to a view, you can take advantage of something called an HTML Helper. An HTML Helper, typically, is a method that generates a string. You can use HTML Helpers to generate standard HTML elements such as textboxes, links, dropdown lists, and list boxes.For example, the view in Listing 4 takes advantage of three HTML Helpers -- the BeginForm(), the TextBox() and Password() helpers -- to generate a Login form (see Figure 1).Using View Data to Pass Data to a ViewYou use view data to pass data from a controller to a view. Think of view data like a package that you send through the mail. All data passed from a controller to a view must be sent using this package. For example, the controller in Listing 6 adds a message to view data.SummaryThis tutorial provided a brief introduction to ASP.NET MVC views, view data, and HTML Helpers. In the first section, you learned how to add new views to your project. You learned that you must add a view to the right folder in order to call it from a particular controller. Next, we discussed the topic of HTML Helpers. You learned how HTML Helpers enable you to easily generate standard HTML content. Finally, you learned how to take advantage of view data to pass data from a controller to a view.ASP.NET MVC Overview (VB.Net)The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.

MVC is a standard design pattern that many developers are familiar with. Some types of Web applications will benefit from the MVC framework. Others will continue to use the traditional ASP.NET application pattern that is based on Web Forms and postbacks. Other types of Web applications will combine the two approaches; neither approach excludes the other.

The MVC framework includes the following components:

Figure 01: Invoking a controller action that expects a parameter value Models. Model objects are the parts of the application that implement the logic for the application's data domain. Often, model objects retrieve and store model state in a database. For example, a Product object might retrieve information from a database, operate on it, and then write updated information back to a Products table in SQL Server.

In small applications, the model is often a conceptual separation instead of a physical one. For example, if the application only reads a data set and sends it to the view, the application does not have a physical model layer and associated classes. In that case, the data set takes on the role of a model object. Views. Views are the components that display the application's user interface (UI). Typically, this UI is created from the model data. An example would be an edit view of a Products table that displays text boxes, drop-down lists, and check boxes based on the current state of a Products object.

Controllers. Controllers are the components that handle user interaction, work with the model, and ultimately select a view to render that displays UI. In an MVC application, the view only displays information; the controller handles and responds to user input and interaction. For example, the controller handles query-string values, and passes these values to the model, which in turn queries the database by using the values.

The MVC pattern helps you create applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. The pattern specifies where each kind of logic should be located in the application. The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model. This separation helps you manage complexity when you build an application, because it enables you to focus on one aspect of the implementation at a time. For example, you can focus on the view without depending on the business logic.

In addition to managing complexity, the MVC pattern makes it easier to test applications than it is to test a Web Forms-based ASP.NET Web application. For example, in a Web Forms-based ASP.NET Web application, a single class is used both to display output and to respond to user input. Writing automated tests for Web Forms-based ASP.NET applications can be complex, because to test an individual page, you must instantiate the page class, all its child controls, and additional dependent classes in the application. Because so many classes are instantiated to run the page, it can be hard to write tests that focus exclusively on individual parts of the application. Tests for Web Forms-based ASP.NET applications can therefore be more difficult to implement than tests in an MVC application. Moreover, tests in a Web Forms-based ASP.NET application require a Web server. The MVC framework decouples the components and makes heavy use of interfaces, which makes it possible to test individual components in isolation from the rest of the framework.

The loose coupling between the three main components of an MVC application also promotes parallel development. For instance, one developer can work on the view, a second developer can work on the controller logic, and a third developer can focus on the business logic in the model. Deciding When to Create an MVC ApplicationYou must consider carefully whether to implement a Web application by using either the ASP.NET MVC framework or the ASP.NET Web Forms model. The MVC framework does not replace the Web Forms model; you can use either framework for Web applications. (If you have existing Web Forms-based applications, these continue to work exactly as they always have.)

Before you decide to use the MVC framework or the Web Forms model for a specific Web site, weigh the advantages of each approach. Advantages of an MVC-Based Web ApplicationThe ASP.NET MVC framework offers the following advantages: It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application. It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information on the MSDN Web site. It provides better support for test-driven development (TDD). It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.

Advantages of a Web Forms-Based Web ApplicationThe Web Forms-based framework offers the following advantages: It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development. The Web Forms-based application provides dozens of events that are supported in hundreds of server controls. It uses a Page Controller pattern that adds functionality to individual pages. For more information on the MSDN Web site. It uses view state or server-based forms, which can make managing state information easier. It works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development. In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than the MVC model.

ASP.NET: Accessing Data with SqlServerIntroduction: When working with classic asp we had ADO, object model for communication with the database. Microsoft.NET has introduced ADO.NET components that lets the developer communicate with the database more efficiently and easily. In this article we will see how we can make use of the ADO.NET classes to perform different operations on the database.

ADO. NET Classes:ADO .NET classes are put in the System.data namespace. You can access the classes using the following code:

using System.Data.SqlClient;

using System.Data.Odbc;

using System.Data.OleDb;

using System.Data.Oracle;

Different classes are used for different purpose.

System.Data.SqlClient: This class is used to communicate with the Sql Server database. The database can be version 7.0 or version 2005.

System.Data.SqlClient: This class is used to perform operations on the MySQL databases.

System.Data.OleDb: This class is used to perform operations on the Access Database.

System.Data.Oracle: This class is used to perform operations on the Oracle database.

In this article we will focus on the Sql Server 2000 database and hence we will be using System.Data.SqlClient namespace to perform different operations on the Sql Server 2000 Database. Making the Database Connection :

Let's see how we can make a database connection. There are several ways of making a database connection. You can simple drag and drop the database connection on the asp.net web form and the connection will be made. Let's see how we can do that:

Open you Visual Studio.NET and start a new asp.net web application. In the toolbox you will see a tab called data. Click on the tab and it will dropdown showing various ADO objects. Drag and Drop the SqlConnection object on the screen. As soon as you drop the connection object you will see it at the bottom of the screen.

Right click on the connection object and select properties. In the properties you can see the property named "ConnectionString". When you click on it will take you to a wizard where you can select your database. In this article I will be using Northwind database which can be found in every Sql Server 2005 database.

Once you select the database, test your connection by clicking on the Test connection button. If the connection is correct a message box will pop saying that the connection has been tested and connection is right.Problems using this approach of making the connection String: As you have just seen that we just dragged and dropped the connection string on the screen and the new connection to the database was made in seconds. This approach should never be used since if in the future you change your connection string you will have to change every where in the application.Using Web.config to store the connection String:As you can see above that you can make your connection string with just one line. Take a look at the "key" represents the keyword that we will use to refer to it in our application.

"value" contains the connection string.

"database" contains the name of the database which in this case is Northwind.

I have to point out that saving the connection string like this is not secure. Usually you store the connection string after encrypting it. I will not perform encryption in this article and keep the article simple enough.

Accessing database from webpage:Now you have added the connection string in the web.config file. Let's see some code that we can use to access the database. We want to load some data from the database when the page is loaded for the first time.

private void Page_Load(object sender, System.EventArgs e)

{

if(!Page.IsPostBack)

{

string connectionString = (string) ConfigurationSettings.AppSettings["ConnectionString"]

SqlConnection myConnection = new SqlConnection(connectionString)

SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM Categories",myConnection)

DataSet ds = new DataSet()

ad.Fill(ds,"Categories")

myDataGrid.DataSource = ds

myDataGrid.DataBind()

}

}

First, we check that if it's not a postback we load data. For this example to work you need to add the namespace: using System.Configuration; Let's see what is going on here:

1) string connectionString receives the string from the web.config file which is referred by the "ConnectionString" key we set in the web.config file.

2) We make the object of the SqlConnection class which deals with SQL Server databases.

3) We made the data adapter object. Data adapter is a kind of connection to the database. In the data adapter object we specify that what we want from the database. In this case we want all the rows of the Categories table. NOTE:

Always use stored procedures for accessing the data. Accessing or running Ad-hoc queries are dangerous as they are open for SQL Injections.

4) Next we made an instance of the DataSet class. DataSet will contain the result of the SqlDataAdapter even if the database connection is not made.

5) Later, we filled the dataset with the data using dataadapter.

6) And finally we assigns the datagrid to the dataset and binds it on the screen.

Pretty simple right?

Lets see if we can improve the code above: private void Page_Load(object sender, System.EventArgs e)

{

if(!Page.IsPostBack)

{

string connectionString = (string) ConfigurationSettings.AppSettings["ConnectionString"];

SqlConnection myConnection = new SqlConnection(connectionString);

SqlDataReader reader = null;

SqlCommand myCommand = new SqlCommand("GetData",myConnection);

myCommand.CommandType = CommandType.StoredProcedure;

try

{

myConnection.Open();

reader = myCommand.ExecuteReader();

myDataGrid.DataSource = reader;

myDataGrid.DataBind();

}

catch(Exception ex)

{

// Catches and logs the exception

}

finally

{

reader.Close();

myConnection.Close();

}

}

}

In the code above we are using the SqlCommand object and stored procedure. You might have noted SqlDataReader, if you want to merely iterate through the database rows and select them its best to use SqlDataReader since its much faster than DataSet

OVERVIEW OF SQL SERVER 2005:In this tutorial you will learn about SQL Server 2005 Architecture, Whats New in SQL Server 2005Enhancements for Data Base Administrators. indexing capabilities, peer to peer model of replication, Table and index partitioning, snapshot isolation, Replication monitor tool, security model, Encryption capabilities, Secure computing, A new application framework, SQL Server Express Manager (XM), Business Intelligence in SQL Server 2005, Integration services, Analysis Services, Data mining, Reporting services, Windows Server System Common Engineering Roadmap, Introduction The innumerable data challenges faced by modern day organizations have leveraged the need for faster and more data driven decisions. The drive is to increase productivity, flexibility of human resources, to reduce overall investments in technology while scaling the infrastructure to meet the growing demand for information that enable informed mission critical decisions. The release of SQL Server 2000 was one of the corner stones of Microsofts strategy for the back office. Its integration with the .NET family of server applications has gone a long way in establishing SQL server as one of the most robust servers for enterprise database management. MSSQL Server 2005 is truly the next generation data management and analysis solution that is built for scalability, availability, analysis and security of data. The increasing ease with which database applications can be built has reduced the complexities of deploying and managing database applications. Data can now be shared across platforms, applications and devices making it possible to network internal and external systems seamlessly. Performance, availability, scalability and security are now available for lower costs. It is now a secure, reliable and productive platform for enterprise data and business intelligence tools. SQL Server 2005 has a number of tools to help the Database Administrator and the Developer. The relational database engine has been improved to give better performance and support for both structured and unstructured (XML) data. The Replication services include services for distributed or mobile data processing applications. It provides for high systems availability, scalable concurrency with secondary data stores, enterprise reporting solutions and integration with heterogeneous systems such as Oracle databases. The deployment of scalable, personalized, timely information updates through web based applications has been made possible with the advanced Notification capabilities of the SQL Server 2005. The extraction, transformation and load process has been further enhanced and online analytical processing render rapid, sophisticated analysis of large and complex data sets using multidimensional storage. The Reporting services features have been honed up to create comprehensive solutions for managing, creating and delivering traditional and paper oriented reports or interactive, web based reports. Management tools for database management and tuning have been fine tuned to integrate with Microsoft operations manager and Microsoft System Management Server. The data access protocols reduce the time taken for integrating data in the SQL server with existing systems. A number of development tools have been provided and integrated with Microsoft Visual Studio to provide an end to end application development capability. With SQL Server 2005 customers will now be able to leverage data assets to get more value from their data by using the reporting, analysis and data mining functionalities embedded in the software. The Business Intelligence capabilities are integrated to the Microsoft Office System, to enable transmission of mission critical business information across the organization. The complexity of developing, deploying and managing line of business and analytical applications has been greatly reduced by use of a flexible development environment and automated tools for database management. Finally, the cost of ownership has been reduced by a focus on ease of use and integrated approach. Whats New in SQL Server 2005Enhancements for Data Base Administrators. SQL Server 2005 has a single management console that enables data base Administrators monitor, manage and tune all databases and services. The SQL Management Object(SMO) is an extensible management infrastructure can be easily programmed. It exposes all the management functionalities of the SQL Server and is implemented as a Microsoft .NET Framework assembly. The primary purpose of the SMO is to automate administrative tasks such as retrieving configuration settings, creating new databases, applying T-SQL scripts, Creating SQL Server Agent jobs and so on. The users can customize or extend the management environment and build additional tools and functions to extend the capabilities that come packaged in the box. It is in short more reliable, scalable than Distributed Management Objects(DMO). The SQL Server Management Studio is a one point access to a number of services the relational database, the Integration services, Analysis services, Reporting services, Notification Services and SQL Mobile. Using this interface DBAs can author or execute a query, view server objects, manage an object, monitor system activity or even seek online help. As it is integrated with source control, scheduling of SQL Server Agent jobs also becomes possible. Daily maintenance and operation tasks can be monitored. Administrators can now proactively monitor and tune the server using the Dynamic Management Views (DMVs). There are more than 70 new measures of internal database performance and resource usage. One of the major concerns of the database administrator is to ensure continuous availability of data. Database mirroring, failover clustering, snapshots or fast recovery would be areas he would be concerned with. SQL Server 2005 allows continuous streaming of the transaction log from a source server to a destination server which takes over seamlessly in the case of failure of the primary server. Support for server clustering has been extended to Analysis services, Notification Services and SQL Server replication and the number of nodes has also been increased to eight. Instant, read only views of the database can be created using snapshots. These provide a stable view without the time or storage overhead normally required in these instances. The snapshot pages are added automatically as and when the pages are modified. Hence quick recovery becomes possible. This ability is further enhanced with the fast recovery option which enables users connect with a recovering database after a transaction has been rolled forward. Running server connections can be accessed using the dedicated administrator connection even when the server refuses to respond. As a result diagnostic functions or T-SQL statements can be executed to troubleshoot problems on a server. The sysadmin fixed server role is activated by the members and can be accessed using the SQLCMD command prompt utility remotely or locally. The indexing capabilities of the SQL Server 2005 have been greatly enhanced. Indexes can be created, rebuilt or dropped online without disturbing existing indexes. This online indexing capability allows parallel processing, concurrent modifications to the table in the database or clustered index data or any other associated indexes. Additionally the online restore option improves the availability of data even when restore operations are being performed. The peer to peer model of replication enables synchronization of transactions with an identical peer database. This further improves availability. Enhancements that ensure scalability include table partitioning, snapshot isolation, and 64 bit support. This improves query performance. Table and index partitioning eases the management of large databases by dividing the whole into manageable chunks. The concept is not new to the SQL Server, but the partitioning of tables horizontally across file groups in the database is new. The partitioning can be made for gigabytes and terabytes and more. The snapshot isolation feature allows users access the last row that was committed by providing a transactional and consistent view of the database. It makes for increased data availability for read only applications; it allows non blocking read only operations in OLTP environment; it automatically detects conflicts in write transactions and makes for simplified migration of applications from Oracle to SQL Server. The Replication monitor tool defines a new standard for managing complex data replication operations. Its interface is intuitive and has a number of data metrics that are useful. The new SQL Server 2005 is optimized for the Intel Itanium processor and takes advantage of the advanced memory capabilities for essential resources such as buffer pools, caches and sort heaps. This reduces the need to perform multiple I/O operations and makes for greater processing capacity without the disadvantage of I/O latency. The support for 32 bid applications is retained while 64 bit capabilities have been introduced to make the migration smooth and efficient. The security model of the database platform now provides more precise and flexible control for ensuring security of data. It enforces passwords for authentication, provides granularity in terms of specifying permissions in the authorization space and separates owners and schemas for the manager. The Encryption capabilities of the database have been integrated with the management infrastructure for centralization of security assurance and server policy. Secure computing measures have been put in place to enable deployment of a secure environment. Confidentiality, integrity and availability of data and systems is the primary focus at every stage of the software life cyclefrom design to delivery and maintenance. A new application framework with Service Broker, Notification Services, Server Mobile and Server Express has been introduced. The Service Broker is a distributed application that provides reliable asynchronous messaging at the database to data base level. Notification services helps in development and deployment of applications that generate and send personalized notifications to a wide variety of devices based on preferences specified by the application user. SQL Server Mobile edition enables the creation of a mobile edition database on the desktop or device directly from SQL Server Management Studio. The schema can be manipulated locally or remotely. SQL Server Express Manager (XM) is a free Query Editor tool that is available for download and allows for easy database management and query analysis capabilities. Business Intelligence in SQL Server 2005 is scalable, comprehensive and comes with a number of reporting capabilities. Both basic and innovative kinds of analytical applications can be built from end to end. The Integration services are a redesigned enterprise ETL platform that enables users integrate and analyze data from multiple heterogeneous sources. Significantly, SQL Server 2005 goes beyond traditional services and supports Web services and XML and out of the box services through SSIS to bring analytics to the data without persisting data, Data mining and text mining in data flow for data quality and data cleansing. Analysis Services provides a unified and integrated view of the business data by using the Unified Dimensional Model which is mapped to a host of heterogeneous back end data sources. User friendly descriptions and navigation hierarchies make it a pleasure to use. The Data mining and Intelligence technology is designed to build complex analytical models and integrate such models to the business operations. The rich set of tools, APIs and algorithms provides customized data driven solutions to a broad range of business data mining requirements. Reporting services is a server based BI platform managed via Web Services. Reports can be delivered in multiple formats interactively. Relational and OLAP Reports comes with an inbuilt query editorsSQL Query Editor and MDX Query Editor. The reports can be built together or separately. The Report builder feature has been newly introduced to enable BI users to create customized reports that rides on the Microsoft Office paradigms of Excel and PowerPoint and has a clickonce feature that enables it to be deployed via a browser. Windows Server System Common Engineering Roadmap defines a standard set of capabilities of the server system such as common patch management, Watson Support and tools such as Microsoft Baseline Security Analyzer for delivery of a consistent and predictable experience for the Administrator. It creates a set of services that can be implemented across all Windows platforms and raises the bar on server infrastructure by ensuring that security, reliability, manageability and flexibility are taken into consideration. It adopts services oriented architecture and integrates with .NET to connect people, systems and devices through software. It focuses on delivering systems that are focused on dynamic operations building and monitoring. Its corner stone is trustworthy computing. 16 specifications have been defined for application throughout the Windows Server System. Microsoft proposes to add further specifications at regular intervals to address customer requirements. SQL Server 2005 as described above comes with significant advances in the areas of enterprise data management, developer productivity and business intelligence. It helps leverage data assets, increase productivity, reduces information technology complexity and reduces the overall cost of ownership.

9. SYSTEM MAINTENANCE9. 1 User Manual

System Installation

To Install the system, copy all the form files, ASP.NET files, to the hard disk and also import the relevant table into the hard disk. To start operation of the system, clock on START, which displays a popup menu. The menu contains program files, clock on program file to get a popup menu. Click on the Visual Studio 2005 and then click on Visual Basic 2005 icon. This will loop the ASP.NET software and the MAIN MENU of Automated System for Home Appliances.System will be displayed. Since the system being menu driven, it carries the user through various operations he wants to perform from this point on wards.

Behind the Screen

The software Automated System for Home Appliances is developed for the customer records and preparation of bills for customer, it has bee