1. A Mini Project
On
COMPUTERIZED BILLING SYSTEM FOR WATER PLANT
Master of Computer Applications (MCA)
Submitted By
ADDURI KALYAN
(Reg No: 1223715102)
Under the guidance of
Smt. Dr. K.VEDAVATHI
Professor
Department of Computer Science
GITAM Institute of Science
GITAM University
Visakhapatnam-530 045, A.P.
(2016 – 2017)
2. CERTIFICATE
This is to certify that the Mini Project entitled COMPUTERIZED BILLING SYSTEM FOR
WATER PLANT is the bonafied work done by Adduri.Kalyan, Reg No. 1223715102 during
2016-2017 in partial fulfillment of the requirement of the 3rd Semester Mini Project of Master
of Computer Applications, in GitamUniversity, Visakhapatnam, under my supervision and
guidance.
Signature Signature
(Internal Guide) (HOD)
3. 1. Introduction
1.1 Introduction to project:
The project titled “A Computerized Billing System for Water Plant” presents an easy
way to maintain customer data and generate bill to the customer. In the existing system the
delivery of water can takes place by personally going to the water plant or the can may be
delivered at the door steps of the customer. This transaction deals with paying money to the
authorized person of the plant. The customer can also avail the card facility, where the
company issues a monthly card for the amount paid by the customer in advance. Maintaining
this information is a tedious task. The loss of information with the office of the plant or loss
of card by the customer will create inconvenience to the authority. This inconvenience may
be overcome by maintaining customer data in electronic form. With this proposed system the
company will overcome against loss of customer data and also speedup the bill generation
task.
1.2 Purpose of the System:
The purpose of the system is to create the new customer by admin and a unique ID is
generated for every customer. The water bottles purchased by customer are stored in the
system and the bill is generated for every customer without any paper work. The
administrator can search and generate a report on every customer. Our proposed system has
the following advantages.
User Friendly Interface
Fast Access To Database
Less Error
More Storage Capacity
Search Facility
Look And Feel Environment
Quick Transaction
1.3 Existing System:
If you want to take a water bottle in a plant we have to go to water bottle plant and we have
to get the bottle manually by giving money every time. Sometimes this is a time consuming
process when there are lot of customers. There is no guarantee for security if the card given
by the owner of the plant is lost.
And another problem is exact money change where we have to wait for a lot of time when
there are number of customers.
4. 1.4 ProposedSystem:
Proposed system is a ‘Computerized Billing System’. Through our software, administrator
can create the new customer and a unique ID is generated for every customer. The water
bottles purchased by customer are stored in the system and the bill is generated for every
customer without any paper work. The administrator can search and generate a report to
every customer.
2. SYSTEM ANALYSES
2.1 Study of the System:
2.2 Modules of the System:
The proposed system consists of six modules:
1. Administrator Login module
2. Customer Information Entry module
3. Customer Search module
4. Customer Update module
5. Admin Update module
6. Billing System module
3. REQUIREMENT ANALYSIS
3.1 SYSTEM REQUIREMENT
Requirements Analysis is the process of studying and analyzing the problem present in the
System. In requirement gathering and analysis, the goal of requirement analysis and gathering
is to collect the information from the administrator regarding the work he wants to get from
the system. This phased leads to in completeness of the project.
5. Functional Requirements:
Functional requirements define the fundamental actions that must take place in the software
in accepting and processing the inputs and in processing and generating the outputs.
REQ-1: The administrator must have a valid login to access the system. A failed login will
alert the administrator with an error message.
REQ-2: The administrator will create the new customer in the system.
REQ-3: The administrator can generate bill to the customer.
REQ-4: The administrator can search and generate a report on every customer.
REQ-5: The administrator can update the customer information.
Non Functional Requirements:
The following have been identified as the key non-functional requirements that are necessary
to ensure that the application is both technically and fundamentally sound.
3.1 SYSTEM SPECIFICATIONS:
Hardware specifications:
Processor : Intel p4
RAM : 512MB RAM
Hard disk : 20GB or more
Software specifications:
Operating system : Windows, Vista
Programming Language : Asp.net C#
Database : SQL SERVER
3.2 OVERVIEW OF FRONT END:
ASP.NET is a web development platform, which provides a programming
model, a comprehensive software infrastructure and various services required to build up
robust web applications for PC, as well as mobile devices.
6. ASP.NET works on top of the HTTP protocol, and uses the HTTP commands and
policies to set a browser-to-server bilateral communication and cooperation.ASP.NET is a
part of Microsoft .Net platform. ASP.NET applications are compiled codes.
Extensible and reusable components or objects present in .Net framework. These codes can
use the entire hierarchy of classes in .Net framework.
The ASP.NET application codes can be written in any of the following languages:
C#
Visual Basic.Net
Jscript
J#
ASP.NET is used to produce interactive, data-driven web applications over the internet. It
consists of a large number of controls such as text boxes, buttons, and labels for assembling,
configuring, and manipulating code to create HTML pages.
ASP.NET LIFE CYCLE:
The ASP.NET life cycle could be divided into two groups:
Application Life Cycle
Page Life Cycle
Application Life Cycle:
The application life cycle has the following stages:
User makes a request for accessing application resource, a page. Browser sends this request
to the web server.
A unified pipeline receives the first request and the following events take place:
An object of the class Application Manager is created.
An object of the class Hosting Environment is created to provide information
regarding the resources.
Top level items in the application are compiled.
Response objects are created. The application objects such as HttpContext, HttpRequest
and HttpResponse are created and initialized.
7. Page Life Cycle:
When a page is requested, it is loaded into the server memory, processed, and sent to the
browser. Then it is unloaded from the memory. At each of these steps, methods and events
are available, which could be overridden according to the need of the application. In other
words, you can write your own code to override the default code.
The Page class creates a hierarchical tree of all the controls on the page. All the components
on the page, except the directives, are part of this control tree. You can see the control tree
by adding trace= "true" to the page directive. We will cover page directives and tracing
under 'directives' and 'event handling'.
The page life cycle phases are:
Initialization
Instantiation of the controls on the page
Restoration and maintenance of the state
Execution of the event handler codes
Page rendering
Understanding the page cycle helps in writing codes for making some specific thing happen
at any stage of the page life cycle. It also helps in writing custom controls and initializing
them at right time, populate their properties with view-state data and run control behavior
code.
Asp.net web controls:
The Web controls reside in the System.Web.UI.WebControls namespace, which is available
to all Web Forms pages automatically. They provide a range of functionality, from simple
data entry to complex data validation.
Two classesare consideredtobe base classesof ASP.NETservercontrols:
System.Web.UI.Control andSystem.Web.UI.WebControls.WebControl.Webcontrolsfallintoeight
categories:input,display,action,selection,databound,rich,validation,theyhave properties,
methods,andeventsthatcan be accessedat run time fromcode runningonthe server.
The following are the web controls of Asp.net:
Label
Button
Text Box
8. Dropdown list
List Box
Check box
Radio Button
Image Button
Tree View
Calendar
ERROR HANDLING TECHNIQUES:
Error handling in ASP.NET has three aspects:
Tracing - tracing the program execution at page level or application level.
Error handling - handling standard errors or custom errors at page level or
application level.
Debugging - stepping through the program, setting break points to analyze the code.
SECURITY:
Implementing security in a site has the following aspects:
Authentication: It is the process of ensuring the user's identity and
authenticity.
ASP.NET allows four types of authentications:
o Windows Authentication
o Forms Authentication
o Passport Authentication
o Custom Authentication
Authorization: It is the process of defining and allotting specific roles to
specific users.
Confidentiality: It involves encrypting the channel between the client
browser and the web server.
Integrity: It involves maintaining the integrity of data. For example,
implementing digital signature.
9. CONFIGURATION:
The behavior of an ASP.NET application is affected by different settings in the
configuration files:
machine.Config
web.config
The machine.config file contains default and the machine-specific value for all supported
settings. The machine settings are controlled by the system administrator and applications
are generally not given access to this file.
An application however, can override the default values by creating web.config files in its
roots folder. The web.config file is a subset of the machine.config file.
If the application contains child directories, it can define a web.config file for each folder.
Scope of each configuration file is determined in a hierarchical top-down manner.
Any web.config file can locally extend, restrict, or override any settings defined on the
upper level.
Visual Studio generates a default web.config file for each project. An application can
execute without a web.config file, however, you cannot debug an application without a
web.config file.
ARCHITECTURE AND DESIGN PROCESS:
The following aspects when you review the architecture and design of your application:
Deployment and infrastructure: You review the design of your application in
relation to the target deployment environment and any associated restrictions that
might be imposed by company or institutional policies.
Performance and scalability frame: Pay particular attention to the design
approaches you have adopted for those areas that most commonly exhibit
performance bottlenecks. This guide refers to these collectively as the performance
and scalability frame.
Layer by layer analysis: You walk through the logical layers of your application and
examine the performance characteristics of the various technologies that you have
used within each layer. For example, ASP.NET in the presentation layer; Web
services, Enterprise Services, and Microsoft®.NET remoting within the business
layer; and Microsoft SQL Server™ within the data access layer.
10. COMPILATION OF CODE:
In order for application code to service requests by users, ASP.NET must first
compile the code into one or more assemblies. Assemblies are files that have the file name
extension .dll.
You can write ASP.NET code in many different languages, such as Visual Basic, C#,
J#, and others. When the code is compiled, it is translated into a language-independent and
CPU-independent representation called Microsoft Intermediate Language (MSIL).
At run time, MSIL runs in the context of the .NET Framework, which translates MSIL into
CPU-specific instructions for the processor on the computer running the application.
There are many benefits to compiling application code including:
Performance Compiled code is much faster than scripting languages such as ECMA Script
or VBScript because it is a closer representation to machine code and does not require
additional parsing.
Security Compiled code is more difficult to reverse engineer than non-compiled source
code because it lacks the readability and abstraction of a high-level language. Additionally,
11. there are obfuscation tools that make compiled code even more resistant to reverse
engineering.
Stability Code is checked at compile time for syntax errors, type safety, and other problems.
By catching these errors at build-time you can eliminate many errors in your code.
Interoperability Because MSIL code supports any .NET language, you can use assemblies
that were originally written in other languages in your code. For example, if you are writing
an ASP.NET Web page in C#, you can add a reference to a .dll file was that written in Visual
Basic.
3.3 Overview of the Back End:
A database in SQL Server is made up of a collection of tables that stores a specific set of
structured data. A table contains a collection of rows, also referred to as records or tuples, and
columns, also referred to as attributes. Each column in the table is designed to store a certain
type of information, for example, dates, names, dollar amounts, and numbers.
A computer can have one or more than one instance of SQL Server installed. Each instance
of SQL Server can contain one or many databases. Within a database, there are one or many
12. object ownership groups called schemas. Within each schema there are database objects such
as tables, views, and stored procedures. Some objects such as certificates and asymmetric
keys are contained within the database, but are not contained within a schema. SQL Server
databases are stored in the file system in files. Files can be grouped into file Groups. When
people gain access to an instance of SQL Server they are identified as a login. When people
gain access to a database they are identified as a database user. A database user can be based
on a login. If contained databases are enabled, a database user can be created that is not based
on a login.
ASP.NET provides many options for storing, retrieving, and displaying data.
There are several SQL Server editions to choose from:
SQL Server Express. The entry-level, free edition of SQL Server.
SQL Server Express Local DB. A special execution mode of SQL Server Express that
enables you to work with databases as .mdf files. Typically, Local DB database files
are kept in the App_Data folder of a web project. (The user instance feature in SQL
Server Express also enables you to work with .mdf files, but the user instance feature
is deprecated; therefore, Local DB is recommended for working with .mdf files.)
In Visual Studio 2010 and earlier versions, SQL Server Express is installed by default
with Visual Studio; in Visual Studio 2012 Local DB is installed by default with
Visual Studio. Local DB is recommended for web development but not for production
web applications because it is not designed to work with IIS.
SQL Server Developer Edition. Has all the features of Enterprise edition but is
licensed only for development and testing, not for production.
SQL Server (full editions)
Several full editions are available: Enterprise, Business Intelligence, Standard, and
Web.
Windows Azure SQL Database. The cloud edition of SQL Server, formerly known as
SQL Azure.
SQL Server Compact 4.0. A free, lightweight database engine that you can use in
ASP.NET web applications for both development and production.
SQL Server Compact uses a different database engine and .NET data provider than
the other editions. SQL Server Management Studio (SSMS) and SQL Server Data
Tools (SSDT) don’t work with SQL Server Compact 4.0.
You don't have to use the same edition of SQL Server in development that you use in
production. The choice of SQL Server edition for development depends on your
development environment and the edition you choose for your production database:
If you're using Visual Studio 2012, and your production database is SQL Database or
a full edition of SQL Server, the default choice for development is LocalDB. This is
the default choice because LocalDB is installed with Visual Studio 2012 by default.
If you're using Visual Studio 2010 or WebMatrix, and your production database is
SQL Database or a full edition of SQL Server, the default choice for development is
SQL Server Express. This is the default choice because SQL Server Express 2008 is
13. installed with Visual Studio 2010 by default, and LocalDB doesn't work with
WebMatrix.
If your production database is SQL Server Compact, use SQL Server Compact for
development.
Exceptions that might dictate a different choice for development include the following:
If you want to use IIS as your development web server in Visual Studio 2012, use
SQL Server Express instead of LocalDB. You will have to install SQL Server
Express, because it is not installed with Visual Studio 2012 by default.
If there are features of the edition you use in production that aren't available in
LocalDB or SQL Server Express, use Developer Edition or the same edition that you
use in production.
If you want to enable multiple developers to work on the same Visual Studio web
project, with some of them using Visual Studio 2010 and some of them using Visual
Studio 2012
Creating a LocalData Base File:
Open Solution Explorer and right click on your project
Now Click on Add select New Item Sql Server Data Base.
Now Data Source wizard will open. Configure data source and click on
finish
Now local data base will create under App_Data folder of your project.
The local data base file has the extension of .mdf i.e. local database
4. FEASIBILITY REPORT
4.1 Technical Feasibility
4.2 Economical Feasibility
4.3 Operational Feasibility
5. DATA FLOW DIAGRAM
5.1 Introduction:
Data Flow Diagram (DFD) provides a visual representation of the flow of information (i.e. data)
within a system. By drawing a Data Flow Diagram, we can tell the information provided by and
14. delivered to someone who takes part in system processes, the information needed in order to
complete the processes and the information needed to be stored and accessed.
Context DFD
A context diagram is a data flow diagram that only shows the top level, otherwise known as Level
0. At this level, there is only one visible process node that represents the functions of a complete
system in regards to how it interacts with external entities. Some of the benefits of a Context
Diagram are:
Shows the overview of the boundaries of a system
No technical knowledge is required to understand with the simple notation
Simple to draw, amend and elaborate as its limited notation
The figure below shows a context Data Flow Diagram that is drawn for a COMPUTERIZED
BILLING SYSTEM FOR WATER BOTTLE PLANT. It contains a process (shape) that represents
the system to model, in this case, the "Computerized Billing System". It also shows the
participants who will interact with the system, called the external entities. In this example, Admin
is the entity who will interact with the system. In between the process and the external entities,
there are data flow (connectors) that indicate the existence of information exchange between the
entities and the system.
5.2 Level 0 DFD (Context level DFD)
5.3 Level-1 DFD -Administrator
5.4 Level-1 DFD –User
6. ENTITYRELATIONSHIP DIAGRAMS (ER)
7. DATABASE DESIGNS
7.1 Introduction
7.2 Normalized Database Tables
8. SAMPLE SCREEN SHOTS
30. // LOGINPAGE C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace ComputerizedBillingSystem
{
public partial class loginpage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("Select * from admin where
username='"+TextBox1.Text+"'and password='"+TextBox2.Text+"'",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if(dt.Rows.Count>0)
{
Response.Redirect("Home.aspx");
}
else
{
Label1.Visible = true;
Label1.Text = "UserName/Password is wrong";
}
}
catch(Exception ee)
{
Response.Write(ee.Message);
38. //CUSTOMER INFORMATION ENTRY C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace ComputerizedBillingSystem
{
public partial class registeruser : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].ConnectionString);
string custid= "122";
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
GenerateAutoId();
}
}
private void GenerateAutoId()
39. {
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("select count(custid) from register", con);
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
i++;
TextBox1.Text = custid+i.ToString();
}
private void clearfields()
{
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].ConnectionString);
con.Open();
40. SqlCommand com = new SqlCommand("insert into
register(custid,custname,DoorNo,StreetName,mobile)values('"+TextBox1.Text+"','"+TextBo
x2.Text+"','"+TextBox3.Text+"','"+TextBox4.Text+"','"+TextBox5.Text+"')", con);
com.ExecuteNonQuery();
Label1.Visible = true;
Label1.Text = "Customer Data Inserted Successfully";
int val= 0;
SqlCommand com1 = new SqlCommand("insert into
Billdetails(Cid,Qty,Total)values("+TextBox1.Text+","+val+" ,"+val+")", con);
com1.ExecuteNonQuery();
con.Close();
GenerateAutoId();
clearfields();
}
catch (Exception ee)
{
Response.Write(ee.Message);
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx");
}
}
}
48. //CUSTOMER SEARCH C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace ComputerizedBillingSystem
{
public partial class search : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
49. SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].ConnectionString);
con.Open();
SqlCommand com = new SqlCommand("Select custid,custname,mobile from
register where custid='" + TextBox1.Text + "' or mobile='" + TextBox3.Text + "' ", con);
SqlDataAdapter da = new SqlDataAdapter(com);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
GridView1.Visible = true;
Label1.Visible = false;
Label2.Visible = true;
Label2.Text = "SEARCH SUCCESSFUL";
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();
}
else
{
GridView1.Visible = false;
Label1.Visible = true;
Label2.Visible = false;
Label1.Text = "RECORD NOT FOUND";
}
}
60. <td class="auto-style2"></td>
</tr>
</table>
</form>
</body>
</html>
//BILL PAYLATER C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace ComputerizedBillingSystem
{
public partial class BillPayLater : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private void clearfields()
{
76. </tr>
</table>
</form>
</body>
</html>
//BILL PAYNOW C#
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.Configuration;
using System.Data;
namespace ComputerizedBillingSystem
{
public partial class BillPayNow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
81. }
protected void Button3_Click(object sender, EventArgs e)
{
RequiredFieldValidator4.Visible = true;
int dqty;
int cost;
int ctot = 0;
int dtot, dtot2;
int totqty, cqty;
try
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["adminconn"].Conne
ctionString);
con.Open();
SqlCommand cmd1 = new SqlCommand("select Qty,Total from
Billdetails where Cid=" + TextBox1.Text + "", con);
SqlDataReader dr = cmd1.ExecuteReader();
while (dr.Read())
{
cost= Convert.ToInt32(TextBox5.Text);
94. <td class="auto-style3">
</td>
<td class="auto-style5">
<asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Size="Medium"
ForeColor="Green" Text="Label" Visible="False"></asp:Label>
</td>
<td class="auto-style2"></td>
</tr>
</table>
</form>
</body>
</html>
//BILL PAYNOW C#
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.Configuration;
using System.Data;
namespace ComputerizedBillingSystem
{
public partial class BillPayNow : System.Web.UI.Page
104. Session["ctrl"] = Panel1;
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script
language=javascript>windows.open('Print.aspx','PrintMe','height=300px,width=300px,scrollb
ars=1');</script>");
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl)
/* For Direct print
PrintHelper.PrintWebControl(Panel1);*/
}
}
}
//PRINTER HELPER CLASS FILE .CS
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
using System.Web.SessionState;
public class PrintHelper
{
105. public PrintHelper()
{
}
public static void PrintWebControl(Control ctrl)
{
PrintWebControl(ctrl, string.Empty);
}
public static void PrintWebControl(Control ctrl, string Script)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new
System.Web.UI.HtmlTextWriter(stringWrite);
if (ctrl is WebControl)
{
Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
}
Page pg = new Page();
pg.EnableEventValidation = false;
if (Script != string.Empty)
{
pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
}
HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");