Sei sulla pagina 1di 68

GOERNMENT POLYTECHNIC MUMBAI

(AN AUTONOMOUS INSTITUTE)


49, KHERWADI, ALIYAWAR JUNG MARG,

BANDRA (E), MUMBAI – 400 051

CERTIFICATE
This is to certify that the following student have successfully & satisfactorily
completed the project “Company Billing System”& presented its report in the
partial fulfillment of requirements for Diploma in Computer Engineering from
Govt. Polytechnic Mumbai under the guidance of respective project guide, in the
year 2009-2010.
Enrollment No. Name of the Student

0702030 ShubhangiKhude

0702038 Manoj M. Naik

0702041 Vishal S. Nivate

0702043 Pooja S. Palvi

0702044 Dipika G. Parsharam

Date: /

Project Guide Head ofthe


Department

(Miss. A. A. Patil ) (Mrs. D. D.


Chande)

1
External Examiner Principal

(Mr. D. P. Nathe)

INDEX
SR.NO TOPIC PAGE NO
1 Acknowledgement 3

2 Introduction 4

3 Requirement Analysis 6

4 Project Planning 10

5 Software & Hardware Requirement 12

6 System Design 20

7 Table Design 23

8 Forms Layout 33

9 Coding 39

10 Testing 57

11 Future Scope 61

12 Bibliography 63

13 Conclusion 65

2
ACKNOWLEDEMENT
Throughout this session, we are lucky to have people who
made invaluable suggestion to improve our self.
This is a great opportunity to express our qualities and
indebtness for the personal involvement and to Ms. A. A. Patil of
Computer Department. We would like to thank her for her
suggestions and encouragement.

We would like to thank Mrs. D. D. Chande, H.O.D. of


Computer Department for providing the necessary facilities
during the period of working on this project.

We are also thankful for all teaching and non – teaching


staff of Computer Engg. Department. Last but not least we are very
much thankful to our classmates who directly or indirectly help us
for completion of this project.
We got an opportunity to study different languages &
software
That weren’t included in our syllabus and it is a big challenge as well
as good experience to develop our skill that will be very helpful in
our future.

3
INTRODUCTION

4
INTRODUCTION
Any companies need an effective & accurate billing system to able to
assure their revenue. The billing process involves receiving billing records
from various networks, determining the billing rates associated with the
billing records, calculating the cost for each billing record, aggregating these
records periodically to generate invoices, sending invoices to the customer,
and collecting payments received from the customer.

Billing System is very complex starting that generates usage to the


billing system to usage collection, mediation, rating, and invoicing. To simplify
the process I will introduce a simple system. The system user navigates
through the company product and asks to the company about the various
services and he decided to order one of the available services. He sends a
purchase order to the company with the selected services. Billing is depend on
the customer type means direct payment and pre-payment. Depend on the
billing type, collect payment and adjust customer balance.

Features and Benefits Of this project


Easy to use and interactive interface

Affordable purchase order management solution

Creating various records in proper manner

Maximum reliability with single user interface

Facilitate with password protected feature

Backup and restore facility

5
Generating reports

Keep outstanding and complete purchase order records

Save time and efforts to organizing the records

REQUIREMENT
ANALYSIS

6
Requirement Analysis
 Recognition of need

This is a user request to enhance an existing system. The main objective


is to determine whether the request is valid and feasible before a
recommendation is given.

 Feasibility Study:-

A feasibility study is a test of system proposal according to its workability,


impact on theorganization, ability to meet user needs & effective use of
resources.

 The feasibility study includes:


1. TECHNICAL FEASIBILITY -:
The software can be build with the following minimal requirement
like WindowsXP, Windows 2000, VB.net, SQL Server etc.

2. OPERATIONAL FEASIBILITY-:
The project once built will incorporate all the necessary features
That will closely represent the real world object.

3. ECONOMIC FEASIBILITY -:
As the system can be built using minimum requirement, here is very
lessfinancial Input by the software developers. It does not require lots of
funds andobviously of great benefit to the user

7
STUDY & ANALYSIS -:

OBJECTIVES-:

Because of proper graphics design it makes simpler to access anywhere


and toperform wherever you want. The main objective of this system is to
enhance reliability,scalability and availability of the database. It makes user to
specify the requirementunambiguously which means input to be mentioned
properly. It can properly maintain theproduct, item etc.

SCOPE-:

After development of this software it will have more scope. Complete


accountingtool helps you to manage various Accounting Records (Company
account, Customer,Vendor, Item, Stock, Sales/purchase order records and Tax
information etc.) MaintainCompany Inventory and Invoicing System (Advance
report generation), and generatesappropriate reports (Final report, Account
report, Sale, Purchase and Production reportetc).The application is developed
in VB.Net so “Company Billing System” is one of the highperformance
application software.

Design:

The most creative & challenging phase of system life cycle is system design.
The termdescribes a final system & the process by which it is developed. It
refers to the technicalspecification that will apply in implementing the
candidate system. It also includesconstruction of program & program testing.
Design includes the windows application pagedesign. Data input design,
processing design, database design & various other designs. Theprocess

8
design & data input design done using flow chart & E-R diagram whereas
databasedesign is done using SQL table & form design is done by using VB.net

Implementation:

Implementation phase is less creative than design stage. It is primarily


concern with user training, Site preparation & file conversion. When
candidate system is link to terminals or remote site, the telecommunication
networks & test of the network along with the system are also included under
implementation.

Post Implementation & maintenance:

After the installation phase is completed & user staff is adjusted to the
changes created by the candidate system, evaluation & maintenance begin.
Like any system. There is an aging process that requires periodic maintenance
of hardware & software. If the new information is inconsistence with design
specification, then changes have to the made. Hardware also requires periodic
maintenance to keep in tune with design specification. The importance of
maintenance is to continue to bring the new system to standard

9
PROJECT PLANNING

10
Project Planning:
After gathering the required information from, the next important step
was to decide the structure of the project.

The number of forms that would be provided, the aspect of user


friendly interface, Numbers of table and view required and other issues were
considered.

With proper planning techniques the following points were agreed upon:
1. Separate forms for data entry.

2. Facility for viewing data about costumer, vendor and item.

3. Separate forms for creating Order, Delivery, Invoice and payment.

4. Four main tables for storing information, and other to store Purchase Order,

Invoice and payment transaction information.

5. Creating a backup for database

11
SOFTWARE
AND
HARDWARE
REQUIREMENT
12
Software and Hardware
Requirements
Software Requirements:

1. VB.net

2. SQL server

Hardware Requirement:-

Processor: Pentium class and equivalent processor

Memory Space: 256MB RAM 25 Mb free spaces (for installation)

Framework: Microsoft .Net framework

Operating System: Windows VISTA (Starter, Home Basic, Home


Premium, Business, Enterprise, Ultimate), Windows XP (Home,
Professional, Media Center), Windows 2003, Windows 2000, Windows 98,
Windows NT, Windows ME.

13
Minimum Software Requirement:-
In this software we use the VB.Net for front end and MS-Access or SQL
Server user for back end. Now many software are available but we use

Only use this software because of the following features.

 Vb. Net
Visual Basic .NET provides the easiest, most productive language and
tool for rapidly building Windows and Web applications. Visual Basic .NET
comes with enhanced visual designers, increased application performance,
and a powerful integrated development environment (IDE). It also
supports creation of applications for wireless, Internet-enabled hand-held
devices. The following are the features of Visual Basic .NET with .NET
Framework 1.0 and Visual Basic .NET 2003 with .NET Framework 1.1. This
also answers why should I use Visual Basic .NET, what can I do with it?

 Powerful Windows-based Applications

Visual Basic .NET comes with features such as a powerful new forms
designer, an in-place menu editor, and automatic control anchoring and
docking. Visual Basic .NET delivers new productivity features for building
more robust applications easily and quickly. With an improved integrated
development environment (IDE) and a significantly reduced startup time,
Visual Basic .NET offers fast, automatic formatting of code as you type,
improved IntelliSense, an enhanced object browser and XML designer, and
much more.

14
 Building Web-based Applications

With Visual Basic .NET we can create Web applications using the shared
Web Forms Designer and the familiar "drag and drop" feature. You can
double-click and write code to respond to events. Visual Basic .NET 2003
comes with an enhanced HTML Editor for working with complex Web
pages. We can also use IntelliSense technology and tag completion, or
choose the WYSIWYG editor for visual authoring of interactive Web
applications.

 Simplified Deployment

With Visual Basic .NET we can build applications more rapidly and deploy
and maintain them with efficiency. Visual Basic .NET 2003 and .NET
Framework 1.1 makes "DLL Hell" a thing of the past. Side-by-side
versioning enables multiple versions of the same component to live safely
on the same machine so that applications can use a specific version of a
component. XCOPY-deployment and Web auto-download of Windows-
based applications combine the simplicity of Web page deployment and
maintenance with the power of rich, responsive Windows-based
applications.

 Powerful, Flexible, Simplified Data Access

You can tackle any data access scenario easily with ADO.NET and ADO data
access. The flexibility of ADO.NET enables data binding to any database, as
well as classes, collections, and arrays, and provides true XML
representation of data. Seamless access to ADO enables simple data access

15
for connected data binding scenarios. Using ADO.NET, Visual Basic .NET
can gain high-speed access to MS SQL Server, Oracle, DB2, Microsoft
Access, and more.

 Improved Coding

You can code faster and more effectively. A multitude of enhancements to


the code editor, including enhanced IntelliSense, smart listing of code for
greater readability and a background compiler for real-time notification of
syntax errors transforms into a rapid application development (RAD)
coding machine.

 Direct Access to the Platform

Visual Basic developers can have full access to the capabilities available
in .NET Framework 1.1. Developers can easily program system services
including the event log, performance counters and file system. The new
Windows Service project template enables to build real Microsoft Windows NT
Services. Programming against Windows Services and creating new Windows Services
is not available in Visual Basic .NET Standard, it requires Visual Studio 2003
Professional, or higher.

 Full Object-Oriented Constructs

You can create reusable, enterprise-class code using full object-oriented


constructs. Language features include full implementation inheritance,
encapsulation, abstraction and polymorphism. Structured exception
handling provides a global error handler and eliminates spaghetti code.

 XML Web Services

XML Web services enable you to call components running on any platform
using open Internet protocols. Working with XML Web services is easier
where enhancements simplify the discovery and consumption of XML Web
services that are located within any firewall. XML Web services can be built

16
as easily as you would build any class in Visual Basic 6.0. The XML Web
service project template builds all underlying Web service infrastructure.

 Mobile Applications

Visual Basic .NET 2003 and the .NET Framework 1.1 offer integrated
support for developing mobile Web applications for more than 200
Internet-enabled mobile devices. These new features give developers a
single, mobile Web interface and programming model to support a broad
range of Web devices, including WML 1.1 for WAP—enabled cellular
phones, compact HTML (cHTML) for i-Mode phones, and HTML for Pocket
PC, handheld devices, and pagers. Please note, Pocket PC programming is
not available in Visual Basic .NET Standard, it requires Visual Studio 2003
Professional, or higher.

 COM Interoperability

You can maintain your existing code without the need to recode. COM
interoperability enables you to leverage your existing code assets and
offers seamless bi-directional communication between Visual Basic 6.0 and
Visual Basic .NET applications.

 Reuse Existing Investments

You can reuse all your existing ActiveX Controls. Windows Forms in Visual
Basic .NET 2003 provide a robust container for existing ActiveX controls. In
addition, full support for existing ADO code and data binding enable a
smooth transition to Visual Basic .NET 2003.

 Upgrade Wizard

You upgrade your code to receive all of the benefits of Visual Basic .NET
2003. The Visual Basic .NET Upgrade Wizard, available in Visual Basic .NET
17
2003 Standard Edition, and higher, upgrades up to 95 percent of existing
Visual Basic code and forms to Visual Basic .NET with new support for Web
classes and User Controls.

 SQL Server
 T-SQL (Transaction SQL) enhancements
T-SQL is the native set-based RDBMS programming language offering
high-performance data access. It now incorporates many new features
including error handling via the TRY and CATCH paradigm, Common Table
Expressions (CTEs), which return a record set in a statement, and the
ability to shift columns to rows and vice versa with the PIVOT and
UNPIVOT commands.

 CLR (Common Language Runtime)


The next major enhancement in SQL Server 2005 is the integration of a
.NET compliant language such as C#, ASP.NET or VB.NET to build objects
(stored procedures, triggers, functions, etc.). This enables you to
execute .NET code in the DBMS to take advantage of the .NET functionality.
It is expected to replace extended stored procedures in the SQL Server
2000 environment as well as expand the traditional relational engine
capabilities.

 Service Broker
The Service Broker handles messaging between a sender and receiver in a
loosely coupled manner. A message is sent, processed and responded to,
completing the transaction. This greatly expands the capabilities of data-
driven applications to meet workflow or custom business needs.

18
 Data encryption
SQL Server 2000 had no documented or publicly supported functions to
encrypt data in a table natively. Organizations had to rely on third-party
products to address this need. SQL Server 2005 has native cap

SYSTEM DESIGN

19
Logging In to Software
To login into software you must fill user name and password.
Employee cannot change user name and password.
Main Form

As the login succeeds, the main form will appear on the screen
This form is the MDI form.
It includes different menus:-

1) New
2) Sale
3) Purchase
4) Explore
5) Reports
6) Setting

A) The New Menu contains four forms-


1) Customer
2) Vendor
3) Item

B) The Sale Menu contains following forms-


1) Quote
2) Delivery Order
3) Invoice
4) Receipt
C) The Purchase Menu Contains Following Forms-

20
1) Purchase Order
2) Purchase Delivery
3) Purchase Invoice
4) Vendor Payment

D) The Explore Menu Contains Following Forms-


1) Reports
2) Customer List
3) Vendor List
4) Item List
5) Bank Account List
E) The Report Menu Contains Following Forms-
1) Quote Report
2) Delivery Report
3) Invoice Report
4) Receipt Report

F) The Setting Menu Contains Following Forms-


1) Company Setup
2) Security Option
3) Backup/Restore

21
TABLE DESIGN

22
Bank Account Details:
FIELD NAME DATA SIZE
TYPE
1. Account_Name Varchar 50
2. Account_Number Varchar 50
3. Bank_Name Varchar 50
4. Branch Varchar 50

Client:
FIELD NAME DATA SIZE
TYPE
1. Client_Code Bigint -
2. Client_Name Varchar 50
3. Company_Name Varchar 50
4. Address Varchar 50
5. City Varchar 50
6. State Varchar 50
7. Zip Nchar 10
8. Country Varchar 50
9. Email Varchar 50
10. Phone Nchar 10
11. Mobile Nchar 10
12. Fax Nchar 10

23
13. Remarks Varchar 50

Client Receipt Header:


FIELD NAME DATA SIZE
TYPE
1. InvoiceID Bigint -
2. Address Varchar 200
3. Total Money -
4. Payment Money -

Client Receipt Main:


FIELD NAME DATA SIZE
TYPE
1. Client_Code Varchar 50
2. Client_Name Varchar 100
3. Company_Name Varchar 100
4. Address Varchar 100
5. Phone Varchar 50
6. Account_Code Varchar 50
7. Account_Number Varchar 10
8. Bank_Name Varchar 50
9. Branch_Name Varchar 50

24
company_details:
FIELD NAME DATA SIZE
TYPE
1. company_name Varchar 50
2. subtitle Varchar 50
3. reg_no Varchar 50
4. billing_address Varchar 50
5. city Varchar 50
6. state Varchar 50
7. zip Varchar 50
8. country Varchar 50
9. email Varchar 50
10. phone Varchar 50
11. mobile Varchar 50
12. fax Varchar 50
13. website Varchar 50
14. a_country Varchar 50
15. a_stat Varchar 50
16. state_tax Varchar 50
17. country_tax Varchar 50
18. city_tax Varchar 50
19. total_tax Varchar 50
20. state_rate Decimal (18, 0)
21. country_rate Decimal (18, 0)

25
22. city_rate Decimal (18, 0)
23. total_rate Decimal (18, 0)
24. reg_name Varchar 50
25. regs_no Varchar 50
26. curr_name Varchar 50
27. sub_curr Varchar 50
28. symbol Varchar 50
29. date_format Varchar 50
30. date_sample Varchar 50
31. bank_name Varchar 50
32. brach_no Varchar 50
33. ac_no Varchar 50

Invoice_Header:
FIELD NAME DATA SIZE
TYPE
1. InvoiceID Bigint -
2. SalesOrderID Bigint -
3. QuoteID Bigint -
4. SrNum Varchar 50
5. ClientCode Varchar 50
6. ClientName Varchar 50
7. Company Varchar 100
8. Address Varchar 100
9. Phone Varchar 50
10. Date datetime -
11. DueDate datetime -
12. Remarks Varchar 200
13. Before_Discount Money -
14. Pre_Discount Decimal (18, 0)
15. Discount Money -
16. Shippng_Charges Money -
17. Per_State Decimal (18, 0)
18. State Money -

26
19. Per_Country Decimal (18, 0)
20. Country Money -
21. Per_city Decimal (18, 0)
22. City Money -
23. Per_Sale Decimal (18, 0)
24. Sale Money -
25. Total Money -
26. Due_Total Money -

Item:
FIELD NAME DATA SIZE
TYPE
1. Item_Code Bigint -
2. Item_Date datetime -
3. Item_Name Varchar 50
4. Catlog_No Nchar 10
5. Sale_Price Money -
6. Purchased_Price Money -
7. Quntity_Sold Bigint -
8. Quntity_Purchased Bigint -
9. Remaining_Quntity Bigint -
10. Remarks Varchar 100

Purchase_Delivery_Order_Header:
FIELD NAME DATA SIZE
TYPE
1. PurDeliveryID Bigint -
2. PurchaseOrderID Bigint -
3. SrNum Varchar 50
4. VendorCode Varchar 50
5. VendorName Varchar 50

27
6. Company Varchar 100
7. Address Varchar 100
8. Phone Varchar 50
9. Date datetime -
10. DueDate datetime -
11. Remarks Varchar 200
12. Before_Discount Money -
13. Per_Discount Decimal (18, 0)
14. Discount Money -
15. Shippng_Charges Money -
16. Per_State Decimal (18, 0)
17. State Money -
18. Per_Country Decimal (18, 0)
19. Country Money -
20. Per_City Decimal (18, 0)
21. City Money -
22. Per_Sale Decimal (18, 0)
23. Sale Money -
24. Total Money -

PurchaseInvoice_Header:
FIELD NAME DATA SIZE
TYPE
1. PurchaseInvoiceID Bigint -
2. PurDeliveryID Bigint -
3. PurchaseOrderID Bigint -
4. SrNum Varchar 50
5. VendorCode Varchar 50
6. VendorName Varchar 50
7. Company Varchar 100
8. Address Varchar 100
9. Phone Varchar 50
10. Date datetime -
11. DueDate datetime -

28
12. Remarks varbinary 200
13. Before_Discount Money -
14. Per_Discount Decimal (18, 0)
15. Discount Money -
16. Shippng_Charges Money -
17. Per_State Decimal (18, 0)
18. State Money -
19. Per_Country Decimal (18, 0)
20. Country Money -
21. Per_City Decimal (18, 0)
22. City Money -
23. Per_Sale Decimal (18, 0)
24. Sale Money -
25. Total Money -
26. Due_Total Money -

PurchaseOrder_Header:
FIELD NAME DATA SIZE
TYPE
1. PurchaseOrderID Bigint -
2. SrNum Bigint -
3. VendorCode Varchar 50
4. VendorName Varchar 50
5. Company Varchar 100
6. Address Varchar 100
7. Phone Varchar 50
8. Date datetime -
9. DueDate datetime -
10. Remarks Varchar 200
11. Before_Discount Money -
12. Per_Discount Decimal (18,0)
13. Discount Money -
14. Shippng_Charge Money -
15. Per_State Decimal (18, 0)

29
16. State Money -
17. Per_Country Decimal (18, 0)
18. Country Money -
19. Per_City Decimal (18, 0)
20. City Money -
21. Per_Sale Decimal (18, 0)
22. Sale Money -
23. Total Money -

Quote_Header:
FIELD NAME DATA SIZE
TYPE
1. SrNum Varchar 50
2. ClientCode Varchar 50
3. ClientName Varchar 50
4. Company Varcha 100
5. Address Varchar 100
6. Phone Varchar 50
7. Date datetime -
8. DueDate datetime -
9. QuoteID Bigint -
10. remarks Varchar 200
11. Befor_Discount Money -
12. Per_Discount Decimal (18,0)
13. Discount Money -
14. Shippng_Charges Money -
15. Per_State Decimal (18, 0)
16. state Money -
17. per_country Decimal (18, 0)
18. country Money -
19. per_city Decimal (18, 0)
20. city Money -

30
21. per_sale Decimal (18, 0)
22. sale Money -
23. total Money -

SaleOrder_Header:
FIELD NAME DATA SIZE
TYPE
1. SalesOrderID Bigint -
2. QuoteID Bigint -
3. SrNum Varchar 50
4. ClientCode Varchar 50
5. ClientName Varchar 50
6. Company Varchar 100
7. Address Varchar 100
8. Phone Varchar 50
9. Date datetime -
10. DueDate datetime -
11. Remarks Varchar 200
12. Befor_Discount Money -
13. Per_Discount Decimal (18,0)
14. Discount Money -
15. Shippng_Charges Money -
16. Per_State Decimal (18,0)
17. state Money -
18. per_country Decimal (18,0)
19. country Money -
20. per_city Decimal (18, 0)

31
21. city Money -
22. per_sale Decimal (18, 0)
23. sale Money -
24. total Money -

FORM LAYOUT

32
User Login

33
Main Master Form:

34
Company Details:-

35
Client Details:-

36
Quote Detail:-

37
CODING

38
Module:--

For Connection String-


Imports System
Imports System.IO
Imports System.Configuration
Public Class ReadConnectionString

Public Function GetConnectionString(ByVal strConnection As String) As


String

'Declare a string to hold the connection string


Dim sReturn As New String("")
'Check to see if they provided a connection string name
If Not String.IsNullOrEmpty(strConnection) Then
'Retrieve the connection string fromt he app.config
sReturn =
ConfigurationManager.ConnectionStrings(strConnection).ConnectionString()
Else
sReturn =
ConfigurationManager.ConnectionStrings("WindowsApplication1.My.MySettings.Comp
any_DatabaseConnectionString").ConnectionString()
End If
Return sReturn

End Function

End Class

Global Declaration For User Login Modul –


Module user_module
Public UserID As String
Public Password As String
Public FirstName As String
Public LastName As String
Public sUserType As String
End Module

Company Form
Imports System.Data

39
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions

PublicClass Company_Accounting_Details

Dim dv As DataView
Dim con As SqlConnection
Dim ds As DataSet
Dim da As SqlDataAdapter
Dim cmd As SqlCommand

PublicSub company_database()
Dim strConnectionString AsString
Dim ReadConnection = New ReadConnectionString()
strConnectionString =
ReadConnection.GetConnectionString("WindowsApplication1.My.MySettings.Company_
DatabaseConnectionString")

con = New SqlConnection(strConnectionString)

' Try
con.Open()
da = New SqlDataAdapter("Select * from company_details", con)
ds = New DataSet
da.Fill(ds, "company_details")
dv = New DataView(ds.Tables("company_details"))
'............................................................
'tabcontrol1
'............................................................
txtcn.DataBindings.Clear()
txtcn.DataBindings.Add("text", dv, "company_name")

txtst.DataBindings.Clear()
txtst.DataBindings.Add("text", dv, "subtitle")

txtrn.DataBindings.Clear()
txtrn.DataBindings.Add("text", dv, "reg_no")

txtba.DataBindings.Clear()
txtba.DataBindings.Add("text", dv, "billing_address")

txtcity.DataBindings.Clear()
txtcity.DataBindings.Add("text", dv, "city")

txtstate.DataBindings.Clear()
txtstate.DataBindings.Add("text", dv, "state")

txtzip.DataBindings.Clear()
txtzip.DataBindings.Add("text", dv, "zip")

txtcountry.DataBindings.Clear()
txtcountry.DataBindings.Add("text", dv, "country")

txtemail.DataBindings.Clear()
txtemail.DataBindings.Add("text", dv, "email")

txtphone.DataBindings.Clear()

40
txtphone.DataBindings.Add("text", dv, "phone")

txtmobile.DataBindings.Clear()
txtmobile.DataBindings.Add("text", dv, "mobile")

txtfax.DataBindings.Clear()
txtfax.DataBindings.Add("text", dv, "fax")

txtweb.DataBindings.Clear()
txtweb.DataBindings.Add("text", dv, "website")
'............................................................
'tabcontrol2
'............................................................
cmbcountry.DataBindings.Clear()
cmbcountry.DataBindings.Add("text", dv, "a_country")

cmbstate.DataBindings.Clear()
cmbstate.DataBindings.Add("text", dv, "a_stat")

txtstax.DataBindings.Clear()
txtstax.DataBindings.Add("text", dv, "state_tax")

txtctax.DataBindings.Clear()
txtctax.DataBindings.Add("text", dv, "country_tax")

txtcitytax.DataBindings.Clear()
txtcitytax.DataBindings.Add("text", dv, "city_tax")

txttotaltax.DataBindings.Clear()
txttotaltax.DataBindings.Add("text", dv, "total_tax")

txtstaterate.DataBindings.Clear()
txtstaterate.DataBindings.Add("text", dv, "state_rate")

txtcrate.DataBindings.Clear()
txtcrate.DataBindings.Add("text", dv, "country_rate")

txtcityrate.DataBindings.Clear()
txtcityrate.DataBindings.Add("text", dv, "city_rate")

txttotalrate.DataBindings.Clear()
txttotalrate.DataBindings.Add("text", dv, "total_rate")

txtregname.DataBindings.Clear()
txtregname.DataBindings.Add("text", dv, "reg_name")

txtregno.DataBindings.Clear()
txtregno.DataBindings.Add("text", dv, "regs_no")

txtcurrancyname.DataBindings.Clear()
txtcurrancyname.DataBindings.Add("text", dv, "curr_name")

txtsubcur.DataBindings.Clear()
txtsubcur.DataBindings.Add("text", dv, "sub_curr")

txtsymbol.DataBindings.Clear()
txtsymbol.DataBindings.Add("text", dv, "symbol")

41
cmbdf.DataBindings.Clear()
cmbdf.DataBindings.Add("text", dv, "date_format")

txtds.DataBindings.Clear()
txtds.DataBindings.Add("text", dv, "date_sample")

txtbankname.DataBindings.Clear()
txtbankname.DataBindings.Add("text", dv, "bank_name")

txtbranch.DataBindings.Clear()
txtbranch.DataBindings.Add("text", dv, "brach_no")

txtaccount.DataBindings.Clear()
txtaccount.DataBindings.Add("text", dv, "ac_no")

'............................................................

con.Close()

'Catch ex As Exception
'MsgBox(ex.Message)

'End Try

EndSub

PrivateSub txttotalrate_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txttotalrate.TextChanged

Dim sale AsDecimal


Dim country AsDecimal
Dim city AsDecimal
Dim total AsDecimal

sale = txtstaterate.Text
country = txtcrate.Text
city = txtcityrate.Text
total = txttotalrate.Text
total = sale + country + city
txttotalrate.Text = total
EndSub

PrivateSub cmbcountry_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles cmbcountry.SelectedIndexChanged
If cmbcountry.Text = "India"Then
txtcurrancyname.Text = "Rupees"
txtsubcur.Text = "Paisa"
txtsymbol.Text = "Rs"
ElseIf cmbcountry.Text = "Australia"Then
txtcurrancyname.Text = "Dollars"
txtsubcur.Text = "Cent"
txtsymbol.Text = "$"
ElseIf cmbcountry.Text = "Bangladesh"Then
txtcurrancyname.Text = "Taka"
txtsubcur.Text = "Paisa"

42
txtsymbol.Text = "৳"
ElseIf cmbcountry.Text = "Canada"Then
txtcurrancyname.Text = "Dollars"
txtsubcur.Text = "Cent"
txtsymbol.Text = "$"
ElseIf cmbcountry.Text = "China"Then
txtcurrancyname.Text = "Yuan Renminbi"
txtsubcur.Text = "Jiao"
txtsymbol.Text = "¥"
ElseIf cmbcountry.Text = "France"Then
txtcurrancyname.Text = "Euro"
txtsubcur.Text = "Cent"
txtsymbol.Text = "€"
ElseIf cmbcountry.Text = "Japan"Then
txtcurrancyname.Text = "Yen"
txtsubcur.Text = "Sen"
txtsymbol.Text = "¥"
ElseIf cmbcountry.Text = "Sri Lanka"Then
txtcurrancyname.Text = "Rupees"
txtsubcur.Text = "Cent"
txtsymbol.Text = "Rs"
ElseIf cmbcountry.Text = "Nepal"Then
txtcurrancyname.Text = "Rupees"
txtsubcur.Text = "Paisa"
txtsymbol.Text = "Rsa"
ElseIf cmbcountry.Text = "Singapore"Then
txtcurrancyname.Text = "Dollars"
txtsubcur.Text = "Sen"
txtsymbol.Text = "$"
ElseIf cmbcountry.Text = "USA"Then
txtcurrancyname.Text = "Dollars"
txtsubcur.Text = "Cent"
txtsymbol.Text = "$"
EndIf
EndSub

PrivateSub cmbstate_SelectedIndexChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles cmbstate.SelectedIndexChanged
If cmbstate.Text = "Maharashtra"Then
txtstax.Text = "Maharshtra Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Asam"Then
txtstax.Text = "Asam Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"

43
ElseIf cmbstate.Text = "Andhra Pradesh"Then
txtstax.Text = "Andhra Pradesh Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Arunachal Pradesh"Then
txtstax.Text = "Arunachal Pradesh Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Bihar"Then
txtstax.Text = "Bihar Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Delhi"Then
txtstax.Text = "Delhi Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Goa"Then
txtstax.Text = "Goa Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Gujarat"Then
txtstax.Text = "Gujarat Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Haryana"Then
txtstax.Text = "Haryana Sale Tax"
txtctax.Text = "Country Sale Tax"

44
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Jammu & Kashmir"Then
txtstax.Text = "Jammu & Kashmir Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Keral"Then
txtstax.Text = "Keral Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Madhya Pradesh"Then
txtstax.Text = "Madhya Pradesh Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Punjab"Then
txtstax.Text = "Punjab Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
ElseIf cmbstate.Text = "Uttar Pradesh"Then
txtstax.Text = "Uttar Pradesh Sale Tax"
txtctax.Text = "Country Sale Tax"
txtcitytax.Text = "City Sale Tax"
txttotaltax.Text = "Sales Tax"
txtstaterate.Text = "4"
txtcrate.Text = "0"
txtcityrate.Text = "0"
txttotalrate.Text = "0"
EndIf
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'Try

45
con.Open()

cmd = New SqlCommand("insert into company_details


values(@company_name,@subtitle,@reg_no,@billing_address,@city,@state,@zip,@cou
ntry,@email,@phone,@mobile,@fax,@website,@a_country,@a_stat,@state_tax,@countr
y_tax,@city_tax,@total_tax,@state_rate,@country_rate,@city_rate,@total_rate,@r
eg_name,@regs_no,@curr_name,@sub_curr,@symbol,@date_format,@date_sample,@bank_
name,@brach_no,@ac_no)", con)

cmd.Parameters.Add("@company_name", SqlDbType.VarChar, 50)


cmd.Parameters.Add("@subtitle", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@reg_no", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@billing_address", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@city", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@state", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@zip", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@country", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@email", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@phone", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@mobile", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@fax", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@website", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@a_country", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@a_stat", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@state_tax", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@country_tax", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@city_tax", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@total_tax", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@state_rate", SqlDbType.Decimal)
cmd.Parameters.Add("@country_rate", SqlDbType.Decimal)
cmd.Parameters.Add("@city_rate", SqlDbType.Decimal)
cmd.Parameters.Add("@total_rate", SqlDbType.Decimal)
cmd.Parameters.Add("@reg_name", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@regs_no", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@curr_name", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@sub_curr", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@symbol", SqlDbType.NChar, 50)
cmd.Parameters.Add("@date_format", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@date_sample", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@bank_name", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@brach_no", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@ac_no", SqlDbType.VarChar, 50)

cmd.Parameters("@company_name").Value = txtcn.Text
cmd.Parameters("@subtitle").Value = txtst.Text
cmd.Parameters("@reg_no").Value = txtrn.Text
cmd.Parameters("@billing_address").Value = txtba.Text
cmd.Parameters("@city").Value = txtcity.Text
cmd.Parameters("@state").Value = txtstate.Text
cmd.Parameters("@zip").Value = txtzip.Text
cmd.Parameters("@country").Value = txtcountry.Text
cmd.Parameters("@email").Value = txtemail.Text
cmd.Parameters("@phone").Value = txtphone.Text
cmd.Parameters("@mobile").Value = txtmobile.Text
cmd.Parameters("@fax").Value = txtfax.Text

46
cmd.Parameters("@website").Value = txtweb.Text
cmd.Parameters("@a_country").Value = cmbcountry.Text
cmd.Parameters("@a_stat").Value = cmbstate.Text
cmd.Parameters("@state_tax").Value = txtstax.Text
cmd.Parameters("@country_tax").Value = txtctax.Text
cmd.Parameters("@city_tax").Value = txtcitytax.Text
cmd.Parameters("@total_tax").Value = txttotaltax.Text
cmd.Parameters("@state_rate").Value = txtstaterate.Text
cmd.Parameters("@country_rate").Value = txtcrate.Text
cmd.Parameters("@city_rate").Value = txtcityrate.Text
cmd.Parameters("@total_rate").Value = txttotalrate.Text
cmd.Parameters("@reg_name").Value = txtregname.Text
cmd.Parameters("@regs_no").Value = txtregno.Text
cmd.Parameters("@curr_name").Value = txtcurrancyname.Text
cmd.Parameters("@sub_curr").Value = txtsubcur.Text
cmd.Parameters("@symbol").Value = txtsymbol.Text
cmd.Parameters("@date_format").Value = cmbdf.Text
cmd.Parameters("@date_sample").Value = txtds.Text
cmd.Parameters("@bank_name").Value = txtbankname.Text
cmd.Parameters("@brach_no").Value = txtbranch.Text
cmd.Parameters("@ac_no").Value = txtaccount.Text

cmd.ExecuteNonQuery()

con.Close()

MsgBox("Company Added Successfully", MsgBoxStyle.Information,


"Verify")
' Catch ex As Exception
'MsgBox(ex.Message)
'End Try

'company_database()

EndSub

PrivateSub Company_Accounting_Details_Load(ByVal sender As System.Object,


ByVal e As System.EventArgs) HandlesMyBase.Load
company_database()
EndSub

PrivateSub txtcn_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtcn.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsLetter(e.KeyChar)) Or (Char.IsWhiteSpace(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Character & Spaces Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtcn.Focus()
EndIf
EndIf

47
EndSub

PrivateSub txtst_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtst.KeyPress
If (Char.IsControl(e.KeyChar) = False) Then
If (Char.IsLetter(e.KeyChar)) Or (Char.IsWhiteSpace(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Character & Spaces Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtst.Focus()
EndIf
EndIf
EndSub

PrivateSub txtcity_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtcity.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsLetter(e.KeyChar)) Or (Char.IsWhiteSpace(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Character & Spaces Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtcity.Focus()
EndIf
EndIf

EndSub
PrivateSub txtstate_KeyPress(ByVal sender AsObject, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtstate.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsLetter(e.KeyChar)) Or (Char.IsWhiteSpace(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Character & Spaces Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtstate.Focus()
EndIf
EndIf
EndSub
PrivateSub txtcountry_KeyPress(ByVal sender AsObject, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtcountry.KeyPress
If (Char.IsControl(e.KeyChar) = False) Then
If (Char.IsLetter(e.KeyChar)) Or (Char.IsWhiteSpace(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Character & Spaces Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtcountry.Focus()
EndIf

48
EndIf

EndSub
PrivateSub txtmobile_KeyPress(ByVal sender AsObject, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtmobile.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsDigit(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Digits Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtmobile.Focus()
EndIf
EndIf
EndSub

PrivateSub txtphone_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtphone.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsDigit(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Digits Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtphone.Focus()
EndIf
EndIf
EndSub

PrivateSub txtphone_Validated(ByVal sender AsObject, ByVal e As


System.EventArgs) Handles txtphone.Validated
'Phone No
'NUMBER 2
'.............................................................................
....
Dim TempStr AsString
Dim i AsInteger
Const DIGITS AsString = "0123456789"

TempStr = txtphone.Text
'strip to only digits. there may be a lette way to remove non-digits off
DoUntilString.IsNullOrEmpty(TempStr)
For i = 0 To TempStr.Length - 1
If DIGITS.IndexOf(TempStr(i)) < 0 Then
'not digits , remove it
TempStr = TempStr.Replace(TempStr(i), "")
ContinueDo
EndIf
Next i
ExitDo
Loop
'Use Custom Format string
IfNotString.IsNullOrEmpty(TempStr) Then

49
txtphone.Text = CLng(TempStr).ToString("'('###')'###'-'####")
EndIf
'.............................................................................
.......
EndSub

PrivateSub txtzip_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtzip.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsDigit(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Digits Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtzip.Focus()
EndIf
EndIf
EndSub

PrivateSub txtfax_KeyPress(ByVal sender AsObject, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtfax.KeyPress

If (Char.IsControl(e.KeyChar) = False) Then


If (Char.IsDigit(e.KeyChar)) Then
'do nothing
Else
e.Handled = True
MsgBox("Sorry Only Digits Allowed!!", _
MsgBoxStyle.Information, "Verify")
txtfax.Focus()
EndIf
EndIf
EndSub

PrivateSub txtmobile_Validated(ByVal sender AsObject, ByVal e As


System.EventArgs) Handles txtmobile.Validated
'Mobile No
If txtmobile.Text <>""Then
Dim rex As Match = Regex.Match(Trim(txtmobile.Text), "^\
(?\d{3}\)?-?\d{3}?\d{4}$", RegexOptions.IgnoreCase)

If rex.Success = FalseThen
MessageBox.Show("Please Enter a Valid Mobile No ",
"Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtmobile.Focus()
ExitSub

EndIf
EndIf
EndSub

50
PrivateSub txtzip_Validated(ByVal sender AsObject, ByVal e As
System.EventArgs) Handles txtzip.Validated
'Zip Code
If txtzip.Text <>""Then
Dim rex As Match = Regex.Match(Trim(txtzip.Text), "^([1-9])([0-9]){5}$",
RegexOptions.IgnoreCase)

If rex.Success = FalseThen
MessageBox.Show("Please Enter a Valid Zip Code ",
"Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtzip.Focus()
ExitSub

EndIf
EndIf

EndSub

PrivateSub txtemail_Validated(ByVal sender AsObject, ByVal e As


System.EventArgs) Handles txtemail.Validated
'E-Mail validation
If txtemail.Text <>""Then
Dim rex As Match = Regex.Match(Trim(txtemail.Text), "^([0-9a-zA-Z]([-.\w]*[0-
9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,3})$",
RegexOptions.IgnoreCase)

If rex.Success = FalseThen
MessageBox.Show("Please Enter a valid Email-Address ",
"Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtemail.Focus()
ExitSub

EndIf
EndIf
EndSub

PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Me.Close()
EndSub
EndClass

client

Imports System.Data
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions
PublicClass client
Dim dv As DataView
Dim con As SqlConnection
Dim ds As DataSet
Dim da As SqlDataAdapter

51
Dim cmd As SqlCommand

Private _sAction AsString


PublicProperty Action()
Get
Return _sAction
EndGet
Set(ByVal value)
_sAction = value
EndSet
EndProperty

Private _sClientCode AsString


PublicProperty ClientCode()
Get
Return _sClientCode
EndGet
Set(ByVal value)
_sClientCode = value
EndSet
EndProperty

PublicSub client_database()
Try
Dim strConnectionString AsString
Dim ReadConnection = New ReadConnectionString()
strConnectionString =
ReadConnection.GetConnectionString("WindowsApplication1.My.MySettings.Company_
DatabaseConnectionString")

con = New SqlConnection(strConnectionString)

con.Open()

If Action = "Insert"Then
da = New SqlDataAdapter("SELECT IDENT_CURRENT ('Client') + 1
AS Current_Identity", con)
ds = New DataSet
da.Fill(ds, "Client")
dv = New DataView(ds.Tables("Client"))

Txtccode.DataBindings.Clear()
Txtccode.DataBindings.Add("text", dv, "Current_Identity")
Else

da = New SqlDataAdapter("Select * from Client where


Client_Code=" + ClientCode, con)
ds = New DataSet
da.Fill(ds, "Client")
dv = New DataView(ds.Tables("Client"))

Txtccode.DataBindings.Clear()
Txtccode.DataBindings.Add("text", dv, "Client_Code")

Txtcname.DataBindings.Clear()
Txtcname.DataBindings.Add("text", dv, "Client_Name")

52
Txtcompany.DataBindings.Clear()
Txtcompany.DataBindings.Add("text", dv, "Company_Name")

Txtadd.DataBindings.Clear()
Txtadd.DataBindings.Add("text", dv, "Address")

Txtcity.DataBindings.Clear()
Txtcity.DataBindings.Add("text", dv, "City")

Txtstate.DataBindings.Clear()
Txtstate.DataBindings.Add("text", dv, "State")

Txtzip.DataBindings.Clear()
Txtzip.DataBindings.Add("text", dv, "Zip")

Txtcountry.DataBindings.Clear()
Txtcountry.DataBindings.Add("text", dv, "Country")

Txtemail.DataBindings.Clear()
Txtemail.DataBindings.Add("text", dv, "Email")

Txtph.DataBindings.Clear()
Txtph.DataBindings.Add("text", dv, "Phone")

Txtmobile.DataBindings.Clear()
Txtmobile.DataBindings.Add("text", dv, "Mobile")

Txtfax.DataBindings.Clear()
Txtfax.DataBindings.Add("text", dv, "Fax")

Txtremark.DataBindings.Clear()
Txtremark.DataBindings.Add("text", dv, "Remarks")

EndIf
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub

PrivateSub client_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) HandlesMyBase.Load
'Change Tax
'..............................................................
Txtst.Text = Company_Accounting_Details.txttotalrate.Text
Txtcity.Text = Company_Accounting_Details.txtcityrate.Text
Txtcst.Text = Company_Accounting_Details.txtcrate.Text
txtstatetax.Text = Company_Accounting_Details.txtstaterate.Text
Txtcityst.Text = Company_Accounting_Details.txtcityrate.Text
Label30.Text = Company_Accounting_Details.txttotaltax.Text
chkcityst.Text = Company_Accounting_Details.txtcitytax.Text
Chkcst.Text = Company_Accounting_Details.txtctax.Text
chkstate.Text = Company_Accounting_Details.txtstax.Text
'...............................................................

'Disabled Client Code


'........................

53
Txtccode.Enabled = False
'........................

If Action = "Insert"Then
btnsave.Text = "Insert"
Else
btnsave.Text = "Save"
EndIf
client_database()
Txtst.Enabled = False
EndSub
PublicFunction ValidateData() AsBoolean
Try
If Txtcname.Text = ""Then
MsgBox("Please Enter The Client Name", MsgBoxStyle.Critical,
"Verify")
Txtcname.Clear()
Txtcname.Focus()
ReturnFalse
ElseIf Txtadd.Text = ""Then
MsgBox("Please Enter the Address", MsgBoxStyle.Critical,
"Verify")
Txtadd.Clear()
Txtadd.Focus()
ReturnFalse
ElseIf Txtcity.Text = ""Then
MsgBox("Please Enter the City", MsgBoxStyle.Critical,
"Verify")
Txtcity.Clear()
Txtcity.Focus()
ReturnFalse
ElseIf Txtstate.Text = ""Then
MsgBox("Please Enter the State", MsgBoxStyle.Critical,
"Verify")
Txtstate.Focus()
ReturnFalse
'ElseIf Txtzip.Focus = "" Then
' MsgBox("Please Enter The Zip Code", MsgBoxStyle.Critical, "Verify")
' Txtzip.Clear()
' Txtzip.Focus()
' Return False
ElseIf Txtph.Text = ""Then
MsgBox("Please Enter Phone Number", MsgBoxStyle.Critical,
"Verify")
Txtph.Clear()
Txtph.Focus()
ReturnFalse
Else
ReturnTrue
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndFunction
PrivateSub btnsave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnsave.Click
Try

54
If ValidateData() = TrueThen
If Action = "Insert"Then
cmd = New SqlCommand("insert into Client
values(@Client_Name,@Company_Name,@Address,@City,@State,@Zip,@Country,@Email,@
Phone,@Mobile,@Fax,@Remarks)", con)
Else
cmd = New SqlCommand("Update Client set
Client_Name=@Client_Name,Company_Name=@Company_Name,Address=@Address,City=@Cit
y,State=@State,Zip=@Zip,Country=@Country,Email=@Email,Phone=@Phone,Mobile=@Mob
ile,Fax=@Fax,Remarks = @Remarks where Client_Code=@Client_Code", con)
EndIf

'cmd.Parameters.Add("@Client_Code", SqlDbType.VarChar, 50)


cmd.Parameters.Add("@Client_Name", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@Company_Name", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@Address", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@City", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@State", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@Zip", SqlDbType.NChar, 10)
cmd.Parameters.Add("@Country", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@Email", SqlDbType.VarChar, 50)
cmd.Parameters.Add("@Phone", SqlDbType.NChar, 10)
cmd.Parameters.Add("@Mobile", SqlDbType.NChar, 10)
cmd.Parameters.Add("@Fax", SqlDbType.NChar, 10)
cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 100)

If Action = "Update"Then
cmd.Parameters.Add("@Client_Code", SqlDbType.BigInt)
EndIf

cmd.Parameters("@Client_Name").Value = Txtcname.Text
cmd.Parameters("@Company_Name").Value = Txtcompany.Text
cmd.Parameters("@Address").Value = Txtadd.Text
cmd.Parameters("@City").Value = Txtcity.Text
cmd.Parameters("@State").Value = Txtstate.Text
cmd.Parameters("@Zip").Value = Txtzip.Text
cmd.Parameters("@Country").Value = Txtcountry.Text
cmd.Parameters("@Email").Value = Txtemail.Text
cmd.Parameters("@Phone").Value = Txtph.Text
cmd.Parameters("@Mobile").Value = Txtmobile.Text
cmd.Parameters("@Fax").Value = Txtfax.Text
cmd.Parameters("@Remarks").Value = Txtremark.Text

If Action = "Update"Then
cmd.Parameters("@Client_Code").Value = ClientCode
EndIf
con.Open()
cmd.ExecuteNonQuery()
con.Close()

If Action = "Insert"Then
MsgBox("Record Successfully Added",
MsgBoxStyle.Information, "Inserted")
ExitSub
Else
MsgBox("Record Successfully Updated",
MsgBoxStyle.Information, "Updated")

55
EndIf

EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry

EndSub

56
TESTING

57
TESTING:-
Testing is process of executing a program with interest of finding errors.
Testing process can be viewed as destructive rather than constructive in
nature. Testing requires that the developer discardsThe opinions of
“correctness of the developed software”. Testing is a very important step in
software development.

TESTING OBJECTIVES:
1) Testing is process of executing a program with the interest of finding
errors.

2) A good test case is one that has high probability of finding the undiscovered
errors.

3) A successful test is one that uncovers undiscovered errors.

Our objective is to conduct a test that systematically uncovers different


classes of errors in small effort and time. If testing is conducted successfully, it
will uncover errors in software.

As a secondary benefit, testing demonstrates that software functions


appear to be working according to specification and requirements .Also
testing provides a good indication of software reliability and quality.

But, testing cannot show absence of errors and defects, it can only show that
software errors are present. It is important to keep this statement in mind
when testing is conducted.

Attributes of good test are:


1) A good test has high probability of finding errors.
2) A good test is not redundant.
3) A good test should be best of breed.
4) A good test should be neither too simple nor too complex.

58
Types of Testing:
1) White Box Testing
2) Black Box Testing

White Box Testing:


White box testing, sometimes called as glass box testing, is test case design
method that use a control structure of design to derive test cases. Using white
box testing methods, test cases can be derived that:

A) Guarantees that all independent path within modules are tested at least
ones.
B) Exercises all the logical decision on their true and false sides.

C) Exercises all the logical at their boundaries and within the operational
bounds.

D) Exercises internal data structure to ensure their validity.

White box testing checks each path independentlyas top-down, bottom-up or


loop wise.

The white box testing methods are as follows:

 Flow Graph Notations


 Condition Testing
 Data Flow Testing
 Loop Testing

Disadvantages:

 More time to test


 No surety can be given on 100 % error correction

59
Black Box Testing:
Black box testing is also called as behavioral testing.
It focuses on the functional requirement of the software. That is, Black
box testing allows a software engineer to derive a set of input conditions that
will fully exercise all the functional requirements of a program.
Black box testing is not an alternative for white box testing; rather it is
a complementary approach that is likely to uncover a different class of errors
in following categories.
A) Incorrect or missing function

B) Interface errors

C) Errors in data structure or external database access.

D) Behavior or performance errors.

E) Initialization or termination errors.

Unlike white box testing which is performed early in the testing


process, black box testing is applied during later stage of testing.

The black box testing methods are as follows:


 Graph Based Testing
 Boundary Value Analysis

60
FUTURE SCOPE:

61
Future Scope:
1) Provide facility to view multiple forms at a time for easy analysis
(multiple forms visibility).

2) On Successful implementation the software can be linked with other


Branches as well.

3) A central database can be maintained and data can be simultaneously


Accessed at a single time.

4) More than one person can access the data but cannot change the data
instead of administrator.

5) Instead of time-consuming manual data entry, our best purchase order


software facilitates with advance feature so that records can be easily
generated and accessed.

6) Software is password protected such that only authorized person can


access the records.

7) Software provides facility to take the backup of company records and


restore the data at safe location for future reference in case data loss
occur due to virus attack or any other reason.

62
BIBLIOGRAPHY:

63
BIBLIOGRAPHY:
1) www.wikipedia.com

2) www.scribd.com

3) www.microsoft.com

4) http://vb.net/

5) VB.Net Black Book


6) Database Management System

64
CONCLUSION:

65
CONCLUSION:
Keeping in mind the requirement of the system the project has completed on
time with following advantages:

1) Easy to use interface.

2) Better load handling capacity.

3) Better Security.

66
67
Thank you

68

Potrebbero piacerti anche