Вы находитесь на странице: 1из 110

PROJECT REPORT ON

Hally Instruments
21/165, Siddharth Nagar (Old), Rd No.9, Goregaon (W), Mumbai 400 104 Maharashtra

DEVELOPED BY

Ms. Sweta Sudhakar Shinde


T.Y.BSc (Computer Science) CHIKITSAK SAMUHAS
S.S & L.S. Patkar College of Arts & Science And V.P. Varde College of Commerce And Economics
S. V. Road, Goregaon (E), Mumbai 400 06

[University of Mumbai]

Academic Year 2007-2008

CHIKITSAK SAMUHAS

S. S. & L. S. Patkar College of Arts & Science And V. P. Varde College of Commerce & Economics
S. V. Road, Goregaon (E), Mumbai 400 062

Project Certificate
This is to certify that, the project title ____________________________________________________________ IS SUCCESSFULLY COMPLETED BY Mr. /Miss_____________________ ____________________________________________________________ OF T.Y.BSC COMPUTER SCIENCE DURING ACADEMIC YEAR 2006 2007 UNDER THE GUIDANCE OF PROF.________________________________________

DATE OF SUBMISSION: DATE OF FINAL REVIEW:

PROJECT GUIDE

HEAD OF DEPARTMENT

EXTERNAL EXAMINER

HALLY INSTRUMENTS
21/165, Siddharth Nagar (Old), Road No.9, Goregaon(West), Mumbai 400 104 Tel: +91-22-28769190 Fax..: +91-22-28777670 E-mail ID: hally_instruments@yahoo.co.in _______________________________________________________________________

I undersigned the Proprietor of Hally Instruments Mr. Dharmendra Shah hereby state that we would like to have a software designed for our Company. We have assigned this project to Ms. Sweta Sudhakar Shinde student of Patkar College, Computer Science, Roll no. 253, TYBSc/B, who approached us for preparing this project. We accept the party proposal and grant full authority and assent to the said party for preparing this project. Thanking you,

Yours Truly, Mr. Dharmendra Shah

HALLY INSTRUMENTS
21/165, Siddharth Nagar (Old), Road No.9, Goregaon(West), Mumbai 400 104 Tel: +91-22-28769190 Fax..: +91-22-28777670 E-mail ID: hally_instruments@yahoo.co.in ___________________________________________________________________

To WhomSoEver It May Concern: This is to certify that Ms. Sweta Sudhakar Shinde has worked with us for designing the software of Hally Instruments. We certify that she has successfully completed the software of our organization. Frequent visits & proper approach towards information gathering have made it a job of excellence. Her continuous hard work has made it possible for her to complete the task in about a month. Her work is indeed praise worthy. We wish her all the best for her future. We are sure that she will be successful person in her life. Her approach towards the work is really very sincere. All the best for her future. We hope that she continues the good job. Thanking you, Yours Truly, Mr. Dharmendra Shah

ACKNOWLEDGEMENT
I take this opportunity of submitting this report to express my profound gratitude to the management of S.S. & L.S. Patkar College of Science and Commerce for giving me the opportunity to accomplish this project work. I am very much thankful to Dr. Mr. Uday Mashelkar Principal, for their kind co-operation in the completion of my project. I am also grateful to our Head of Department and Project Guide Mr. Prashant Jadhav, for being resourceful, helpful & also for their constant support, encouragement and able Guidance, without which the successful completion of this project would have been impossible. Their positive attitude, forceful personality and unwavering faith in me assured that I come out of the woods whenever I encountered difficulties. It is my earnest endeavor to express my sincere thanks to the faculty for their kind co-operation, help and never ending support. I owe a lot to my client Mr. Dharmendra Shah, the Proprietor of Hally Instruments, who helped me a lot in making of this software by giving me useful information and support time again and again. Last but not the least entire Computer Department who directly or indirectly helped me in the completion of this project and to God and my family and friends without whose blessings, support, motivation and encouragement this would not have been possible.

Ms. Sweta Sudhakar Shinde

Objective of the Project


The B.Sc (Computer Science) course requires that the students prove the practical compatibility of their theory with their practical skills. However, the purpose of project work extends to the development of more important and long effective faculties; and the effort involved would boil down to a meaningless toil unless the same are considered. One of the main reasons for the development of a project is the development of skills to identify the different problems in the operation of the preexisting system. The next step is to analyze the problem considering the various aspects that affect it. Consequently, steps may be taken to the solving of that problem. Generally a problem has numerous solutions corresponding to the different ways in which the cause of the problem can be eliminated. From the many solutions thus obtained, an appropriate solution is chosen such that it best suits the criteria. that the situation demands. Accordingly, a change is introduced in the system. . However, care must be taken that this alteration does not cause any major decrease in the effectiveness of the system. The project incorporates all these factors. The concept of the project helps to develop the necessary attitude reporting all the important matters to a senior authority (guide). When designing a project one comes across many cases where scrutiny& supervision of the guide is essential. Hence, in order to maintain a continuous link with guide, & to seek his proper & judicious advice from time to time, it becomes inevitable that every single point is communicated to the internal guide. Project-work helps one to develop the skill of bringing to the notice of others what he plans to achieve through the project. The importance of the project in terms of its practical use, its cost effectiveness, the theoretical as well as practical aspects related to it should be convincingly communicated to those concerned using the best possible facilities. The suitable medium for this is that of lectures & seminars. A project requires proper foresight into what the situation will be in the course of designing the project. On this basis, the future action must be planned. Stepwise programming of further activities becomes essential. The project-work brings out the skill of sketching out a schedule & strictly following it in the course of action. When doing so there must be proper sequencing of the steps incorporating their order of importance. This kind of planning makes it possible that the project is accomplished well within the deadline. A single person cannot possibly achieve a project job. It requires team efforts. In this respect, the concept of a project develops the attitude of

coordination with each other in a group. The different jobs to be undertaken in a project have to be judiciously distributed amongst those involved in the project-work. The important decisions must be taken with the consent of all concerned. The project-job requires the use of innumerable references for the theoretical analysis of problem. In addition, components are required to practically realize the project. Once the project is operational, the information should be brought out to be the people. All these activities require a comparatively large finance. The monetary factors concerning the project-work should be considered beforehand. Throughout the designing of the project, careful vigil should be maintained on the spending & the same must be honestly recorded. The experience of the project work develops in an individual the attitude of careful accounting. The project work marks a suitable end to the B.Sc. (Computer Science) course. This is because the theoretical features are checked & verified practically. Also, the practical difficulties that may arise develop in an individual the realization of the differences between the theoretical & practical aspects; & the attitude of investigating the reasons thereof. The project that is designed & fabricated may also have its commercial counterparts in the market. In order that the project appeals to popular taste, its cost effectiveness must at least be comparable, if not competent, with the market models. Hence, a proper market survey is required to decide the standards of quality that the project must stand up to. There is, therefore, no room for doubt that the project work inculcates in a student the far-fetching attitudes of planning, coordination; hard work, time management & financial management; besides giving those hands on individual training.

Index
Sr. No. 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.1 2.2 2.3 2.4 2.5 2.6 3 3.1 3.2 3.3 4 5 6 6.1 7 7.1 8 9

CONTENTS
Introduction
Organizational profile Description of Existing system Limitations of Existing system Proposed system Feasibility study Scope of the system Events & Charts Gnatt Chart Event Table Class Diagram Use Case Diagram Sequence Diagrams Data Dictionary Table Design Database Design Table Information CRUD Table Report List Layouts Project Documentation Programming Code Report Layouts Report Layouts Testing & Implementation Bibliography

Page No.

INTRODUCTION

10

TITLE :
system

INFORMATION MAINTAINING

This project is designed using VB.NET and Microsoft Access server. The system is designed so that the records of all the tasks for the customer detail could be handled efficiently. The system keeps the records of the Customer who buy products from Hally Instruments and Suppliers who provide different Items for assembling of product. The system also keeps track of Customer and Supplier Order details. The system also generates appropriate reports .The application helps managing all these tasks. This software helps the system to utilize available resources & help in improving response as well as service to the customer thus achieving higher level of customer satisfaction.

11

1.1 ORAGANIZATIONAL PROFILE :


Name :

Hally Instruments

Established : 2006 Location : 21/165, Siddharth Nagar(Old), Road No.9, Goregaon(W), Mumbai 400 104 Tel No : +91-22-28769190 Fax: +91-22-28777670 Existing system: Presently system is rarely
manual Based system for storing records of customers and supplier for different orders.

12

1.2 DESCRIPTION OF EXISTING SYSTEM


The study of existing system brought the following issues to light .
The Hally Instruments System is partly managed by an automation system and partly managed by manual system which has some limitations. Out of the two staff, one staff administers the management while the other looks after the wear & tear of the products manufactured. The records need to be checked over & over to find the availability of particular product, customer or supplier. .

1.3 LIMITATIONS OF EXISTING SYSTEM


Maintenance of the records was a huge task. Lack of privacy about Information. Loss of data: The legacy system was manual hence paper work was involved which resulted in the loss of data due to natural calamities like floods, earthquakes etc. Analysis of data manually was time consuming and subject to human error. Heavy was there because of manual transfer of file. Management has to rely on physical movements of floppies and manual collation of data from various system for reporting.

The proposed system tries to eliminate the problems & limitations of the existing system.

13

1.4 PROPOSED SYSTEM


The Proposed System is computerized. The end user can access the overall information stored in database. No security concern in system. Retrieval of records becomes easy. Simple GUI makes the software easily accessible for any user. To store & update information about different customers. Information About different customers are stored in order to contact them after completion of their order. To store & update information about different suppliers. Information about different suppliers are stored in order to contact them for delivery of different items ordered To store and delete Customer Order. The system stores information about customer orderfor particular product. To store ,delete and cancel Supplier Order. Information about supplier order is stored and cancellation of order is done incase of defected items.. To show Customer bill. The system generates bill for particular customer order. To generate all Reports. All reports are generated as per demand of management.

14

1.5 FEASIBILITY STUDY


The feasibility study can be categorized into Technical feasibility: Hally Instruments is equipped with the following hardware and software. Hardware: 2.2 Ghz Pentuim IV 128 MB DDR RAM 40 GB hard disk 3.5 inch floppy disk drive Inkjet printer Dot matrics printer Software: Microsoft WindowsXP Professional Microsoft Access. Microsoft Visual Studio.Net 2003 Operational feasibility: The new system will overcome the problems faced by existing system and make it user friendly. With the required training, the users will find the system easier to operate. The system cuts down the time delay of the existing system. Economic feasibility: As the available hardware is sufficient and the VB.NET software is not available, investment is to be made in that direction which is free source on internet only needed to download it.

15

1.6 SCOPE OF THE SYSTEM


The proposed system facilitates the user in the following way:
To store information about customers. To store information about suppliers. To store information about multiple items available in manufacturing of a product. To store record of all customer and supplier order. To generate all kind of reports such as: Generating customer bill Generating supplier invoice details Generating customer order report on monthly basis Generating supplier order report on monthly basis.

In all these software will be used to keep record of all kinds of information. System is going to reduce cost of maintaining registers. It will also consume less time than conventional system. Attractive reports will be produced. Validated information will go in the database.

16

EVENTS AND CHARTS

17

2.1 Gnatt Chart


Gantt Chart
Task
January July February August

2007
March September April October May June November December

Project Planning
Define Business problem & Scope Produce detail project schedule Conform Project feasibility Launch project Milestone(Scope defined)

Analysis Phase
Gather Information Define System requirements Build Prototype for requirements Prioritize requirement Generate & Evaluate alternatives Review Recommendations with management Milestone(Details of module)

Design Phase
Design & integrate Networks Design Application architecture Design user interface Design System interface Design & integrate the system controls Milestone(All document created)

Implementation Phase
Design & Construct software components Verify & test Train & Document Install System Milestone(source code generated & testing successful)
Legend Milestone marker Estimated Time Required time for Planning Phase Required time for Anlysis Phase Required time for Design Phase Required time for Implementation Phase

18

2.2 Event Table

19

EVENT

TRIGGER

SOURCE Admin Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management Staff Management staff Management Staff Management Staff Management Staff Management

ACTIVITY Create new user Account Adding Customer Details Changing existing details of customer Deleting current customer Adding Supplier Details Changing existing details of supplier Deleting current supplier Adding new Item Changing existing Item details Deleting Item details Changing Product details Adding a customer order Deleting Customer order Detail Adding Supplier order Deleting Supplier Order Canceling Order Producing

RESPONSE New User Created New Customer Added Record Updated Record Deleted New Supplier Added Record Updated Record Deleted New Item Added Record Updated Record Deleted Record Updated Order Confirmation Record deleted Order Confirmation Record Deleted Record Deleted Report

Add new Request to add user new User Add new Custome r Update existing customer Delete existing customer Add new Supplier Update existing supplier Delete existing Supplier Admin adds new Item Update existing Item Delete existing Item Details Update existing Product Details Add new Custome r Order Delete Custome r Order Add new Supplier Order Delete Supplier order Cancel Supplier Order Produce Request to add new Customer Request to update record of customer Request to delete current customer Request to add new Supplier Request to update record of supplier Request to delete supplier Request to add new Item Request to update Item details Request to delete existing item Request to update existing product Request to add customer order Request to delete Customer order Request to add supplier order Request to delete Supplier Order Request to cancel Supplier Order Request to

DESTINAT ION Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management Hally Management 20 Hally

21

2.3 Class Diagram

22

2.4 Use Case Diagram

23

2.5 Sequence Diagrams


Sequence diagram for Customer sub-system

Sequence diagram for Supplier Sub-System

24

Sequence Diagram for Item Sub-System

Sequence Diagram for Product Sub - System

25

Sequence diagram for Customer Order Sub-System

Sequence diagram for Supplier Order Sub-System

26

Sequence Diagram for Report Sub-System

27

2.6 Data Dictionary Relationship

28

2.7 Menu Tree


Hally Management

File

Master

Transactions

Report

AddNew User ChangePa ssword Exit

Customer

Customer Order SupplierO rder CancelSu pplierOrd er

Customer Supplier Customer Order Supplier Order Monthly Customer Supplier DateToDate

Supplier

Item

Product

Customer

Customer

29

2.8 Class List


Class Number Class Name Purpose Input Table Output Table Validations Class Number Class Name Purpose Input Table Output Table Validations Class Number Class Name Purpose Input Table Output Table Validations 1 frmLogin To login the system. Accessible only to the Management. 2 frmMDI To show entire Menu List 3 frmAddNewUser To add new user. Name,Telephone and mobile no should be filled properly. 4 frmCustomer To add,delete and view all customer records. Customer Customer Name,Phone and Mobile no. should be filled properly. 5 frmSupplier To add,delete and view all Supplier record. Supplier Supplier Name,Phone and Mobile no should be properly filled.

Class Number Class Name Purpose Input Table Output Table Validations

Class Number Class Name Purpose Input Table Output Table Validations

30

Class Number Class Name Purpose Input Table Output Table Validations

6 frmItem To add,delete and view all Item records Item Item Name,Quantity and Cost price should be properly filled. 7 frmProduc To update and view Product record. Product Product Name,Phone and Mobile no should be properly filled. 8 frmCustomerOrder To add,delete and view all Customer Order record. CustomerOrder,Customer,Product CustomerOrder,Customer,Product Quantity and amount should be properly filled. 9 frmSupplierOrder To add,delete and view all Supplier Order record. SupplierOrder,Supplier,Item SupplierOrder,Supplier,Item Quantity and Amount should be properly filled. 10 frmCancelSupOrder To cancel and view all Supplier record. SupplierOrder,Supplier,Item SupplierOrder,Supplier,Item -

Class Number Class Name Purpose Input Table Output Table Validations

Class Number Class Name Purpose Input Table Output Table Validations

Class Number Class Name Purpose Input Table Output Table Validations

Class Number Class Name Purpose Input Table Output Table Validations

31

TABLE DESIGN

32

3.1 Database Design


Name of the Tables: 1. Admin 2. Customer 3. Supplier 4. Product 5. Item 6. CustomerOrder 7. SupplierOrder

33

3.2 Table Information


Name No. of fields Description
Field Name UserType UserName UserPwd PersonalNa me TelNo MboNo Data type Text Text Text Text Numb er Numb er

: : :
Field Size 50 50 50 50

Admin 6 Stores Admin or User Details.


Constraints Description Stores User type Stores Login name Stores User password in encrypted form Stores users personal name Stores Users Contact Number Stores Users Mobile Number

Long Integer Long Integer

Name No. of fields Description


Field Name CustID CustFNam e CustLNam e CustAdd CustCity CustState CustPhno CustMbo Data type Text Text Text Text Text Text Numb er Numb er Field Size 50 50 50 250 50 50 Long Integer Long Integer

: : :

Customer 8 Stores Customer Details.


Constraints Primary Key Description Stores Customers ID. Stores Customers First Name. Stores Customers Last Name. Stores Customers Address. Stores Customers City Stores Customers State Stores Customers Contact Number Stores Customers Mobile Number

34

Name No. of fields Description


Field Name SupID SupFName SupLName SupAdd SupCity SupState SupPhno SupMbo SupEmail SupItemName Data type Text Text Text Text Text Text Numb er Numb er Text Text

: : :
Field Size 50 50 50 250 50 50 Long Integer Long Integer 50 50

Supplier 10 Stores Supplier Details


Constraint s Primary Key Description Stores Suppliers ID. Stores Suppliers First Name. Stores Suppliers Last Name. Stores Suppliers Address. Stores Suppliers City Stores Suppliers State Stores Suppliers Contact Number Stores Suppliers Mobile Number Stores Suppliers Email-ID Stores Item Supplied by supplier

Name No. of fields Description


Field Name ProdID ProdName QtyOnHand SellPrice Data type Text Text Number Currency

: : :
Field Size 50 50 50 -

Product 4 Stores Product Details


Constraints Primary Key Description Stores Product ID Stores Product Name Stores Quantity Available. Stores product cost.

Name No. of fields Description


Field Name ItemID ItemName QtyOnHand CostPrice ItemNotes Data type Text Text Number Currency Text

: : :
Field Size 50 50 50 50

Item 5 Stores Items Details.


Constraints Primary Key Description Stores Item ID Stores Item Name Stores Quantity Available. Stores Item cost. Stores Item Notes.

35

Name No. of fields Description


Field Name CustOrdeNo CustID CustBillNo ProdID TotalQtyOrd erd TotalOrderA mt AmtPaid AmtRem CustOrderD ate CustDueDat e OrderMonth OrderYear Data type Text Text Text Text Number Currency Currency Currency Text Text Text Text

: : :
Field Size 50 50 50 50 Intege r -

CustomerOrder 12 Stores Customer Order details.


Constraints Primary Key Foreign Key Foreign Key Description Stores Customer Order No. Stores Customer ID Stores Customer Bill No. Stores Product ID Stores Total Quantity Order Stores total Order Amount Stores Amount Paid Stores Amount Remaining Stores Order Date Stores Order Due Date Stores Order Month Stores Order Year

Name No. of fields Description


Field Name SupOrdeNo SupID SupBillNo ItemID TotalQtyOrd erd OrderAmt AmtPaid AmtRem SupOrderDa te SupDueDate OrderMonth OrderYear Data type Text Text Text Text Number Currency Currency Currency Text Text Text Text

: : :
Field Size 50 50 50 50 Intege r -

SupplierOrder 12 Stores Supplier Order Details.


Constraints Primary Key Foreign Key Foreign Key Description Stores Supplier Order No. Stores Supplier ID Stores Supplier Bill No. Stores Item ID Stores Total Quantity Order Stores total Order Amount Stores Amount Paid Stores Amount Remaining Stores Order Date Stores Order Due Date Stores Order Month Stores Order Year

36

3.3

CRUD Table

TABLES
T1 C1 C2
R CR U -

T2
CR UD R -

T3
CR UD R R

T4
R U R U -

T5
CRU D R U R U

T6
RD -

T7
R D R D

C L A S S E S

C3 C4 C5 C6 C7 C8 C9 C10

37

Operations
C = Create
TABLES T1: Admin T2: Customer T3: Supplier T4: Product T5: Item T6: CustomerOrder T7: SupplierOrder CLASSES C1:frmLogin.vb C2:frmAddNewUser.vb C3:frmMDI.vb C4:frmCustomer.vb C5:frmSupplier.vb C6:frmProduct.vb C7frmItem.vb C8frmCustomerOrder.vb C9frmSupplierOrder.vb C10:frmCancelSupOrder.vb

R = Retrieve

U = Update

D = Delete

38

Report List

39

Report No Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description

1 frmAllCustReport.rpt Customer Prints all Customer detail . 2 fmAllSupReport.rpt Supplier Prints all Supplier Details. 3 frmCustBill.rpt Customer,CustomerOrder,Product Prints bill for Customer. 4 frmSupQuotation.rpt Supplier,SupplierOrder,Item Prints all Customer Order Details. 5 frmCustOrderReport.rpt Customer,CustomerOrder,Product Prints all Supplier Order Details. 6 frmSupOrderReport.rpt Supplier,SupplierOrder,Item Prints quotation for supplier. 7 frmDateToDateCustOrderReport.rpt Customer,CustomerOrder,Product Prints Customer Order report between 2 dates. 8 frmDateToDateSupOrder.rpt Supplier,SupplierOrder,Item Prints Supplier Order report between 2 dates.

40

Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description Report Number. Report Name Tables used Description

9 frmMonthCustomerOrderReport.rpt Customer,CustomerOrder,Product Prints Customer Order report for particular Month 10 frmMonthSupplierOrderReport.rpt Supplier,SupplierOrder,Item Prints Supplier Order report for particular month. 11 frmPrintCustomerReport.rpt Customer Prints selected Customer details. 12 frmPrintSupplierReport.rpt Supplier Prints selected Supplier details. 13 frmPrintItemReport.rpt Item Prints selected Item details.

41

Layouts

42

Startup.vb

frmLogin.vb

43

frmMDI.vb

44

frmCustomer.vb

System tells us to insert all details before saving.

45

frmCustomer.vb

System doesnt allows to enter numbers where characters are required.

46

frmCustomer.vb

System validates telephone no,mobile no and pincode to be numbers only.

47

frmCustomer.vb

48

frmSupplier.vb

Email validation is done.

49

frmSupplier.vb

50

frmSupplier.vb

51

frmItem.vb

52

frmCustomerOrder.vb

53

frmCustomerOrder.vb

54

frmCustomerOrder.vb

55

frmSupplierOrder.vb

56

frmCancelSupplierOrder.vb

57

Program Documentation

58

6.1 Program ID
Program ID
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

Class Name
frmLogin.vb frmMDI.vb frmAddNewUSer.vb frmCustomer.vb frmSupplier.vb frmItem.vb frmProduct.vb frmCustomerOrder.vb frmSupplierOrder.vb frmCancelSupplierOrder.vb

59

6.2 Program Function Explanation


Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation Program ID Program Name Explanation
1 frmLogin.vb To login the system. 2 frmMDI.vb To show the entire menu list. 3 frmAddNewUser.vb To add new user. 4 frmCustomer.vb To enter ,view and delete the customer records. 5 frmSupplier.vb To enter ,view and delete the supplier records. 6 frmItem.vb To enter ,view and delete the Item records. 7 frmProduct To view and update the Product record. 8 frmCustomerOrder.vb To enter ,view and delete the Customer Order records

60

Program ID Program Name Explanation Program ID Program Name Explanation

9 frmSupplierOrder.vb To enter ,view and delete the Supplier Order records. 10 frmCancelSupplierOrder To cancel supplier order.

61

6.3 Programming Code


frmLogin.vb
Imports System.Data.OleDb Imports System.Text Public Class frmLogin Inherits System.Windows.Forms.Form Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HallyDB.mdb;Persist Security Info=False") Dim com As New OleDbCommand Dim r As OleDbDataReader Public Shared Function Decrypt(ByVal Data As String) As String Dim dEC_data() As Byte = Convert.FromBase64String(Data) Dim dEC_Str As String = ASCIIEncoding.ASCII.GetString(dEC_data) Decrypt = dEC_Str End Function Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click Dim objmdi As frmMDI = New frmMDI Dim type As String s1 = txtusername.Text com.CommandText = "Select * from Admin where UserName='" & txtusername.Text & "'" com.Connection = con Dim pwd As String Try con.Open() r = com.ExecuteReader r.Read() type = r(0) pwd = Decrypt(r(2)) If pwd = txtpwd.Text Then MsgBox("Successfull") Me.Hide() objmdi.Show() Else MsgBox("Invalid Login") txtpwd.Text = "" End If If type = "Admin" Then objmdi.mnuaddnew.Enabled = True Else objmdi.mnuaddnew.Enabled = False End If Catch ex As Exception MsgBox("Invalid Username and Password")

62

txtusername.Text = "" txtpwd.Text = "" End Try con.Close() End Sub Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ToolTip1.SetToolTip(btnforgot, "Forgot Password") End Sub Private Sub btnforgot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnforgot.Click Dim objforgot As frmForgot = New frmForgot objforgot.Show() End Sub Private Sub btnreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreset.Click txtpwd.Text = "" txtusername.Text = "" End Sub Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click Me.ActiveForm.Close() End Sub End Class

frmMDI.vb
Imports System.IO Public Class frmMDI Inherits System.Windows.Forms.Form Private Sub mnucust_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnucust.Click Dim objcust As frmCustomer = New frmCustomer objcust.MdiParent = Me objcust.Show() End Sub Private Sub mnusup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnusup.Click Dim objsup As frmSupplier = New frmSupplier objsup.MdiParent = Me objsup.Show() End Sub Private Sub mnuitem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuitem.Click Dim objitem As frmItem = New frmItem

63

objitem.MdiParent = Me objitem.Show() End Sub Private Sub mnuproduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTrans.Click End Sub Private Sub mnuCustorder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCustorder.Click Dim objCustOrd As frmCustomerOrder = New frmCustomerOrder objCustOrd.MdiParent = Me objCustOrd.Show() End Sub Private Sub mnuSuporder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSuporder.Click Dim objSupOrder As frmSupplierOrder = New frmSupplierOrder objSupOrder.MdiParent = Me objSupOrder.Show() End Sub Private Sub mnuaddnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuaddnew.Click Dim objnew As frmAddNewUser = New frmAddNewUser objnew.MdiParent = Me objnew.Show() End Sub Private Sub frmMDI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load StatusBar1.ShowPanels() = True StatusBar1.Panels.Item(0).Text = DateTime.Today 'StatusBar1.Panels.Item(1).Text = Cursor.Position.X & "," & Cursor.Position.Y StatusBar1.Panels.Item(2).Text = "Scroll Lock: " & AutoScroll End Sub Private Sub mnucustreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnucustreport.Click Dim objallcust As New frmAllCustomer objallcust.Show() End Sub Private Sub mnusupreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnusupreport.Click Dim objallsup As New frmAllSupplier objallsup.Show() End Sub Private Sub mnuprod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuprod.Click

64

Dim objprod As New frmProduct objprod.MdiParent = Me objprod.Show() End Sub Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click Dim objcancel As New frmCancelSupOrder objcancel.MdiParent = Me objcancel.Show() End Sub Private Sub mnucustorderreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnucustorderreport.Click Dim objcustorderreport As New frmCustomerOrderReport objcustorderreport.ShowDialog() End Sub Private Sub mnusuporderreport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnusuporderreport.Click Dim objsuporderreport As New frmSupplierOrderReport objsuporderreport.Show() End Sub Private Sub mnuexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuexit.Click 'Dim obj As New frmMDI 'obj.ActiveForm.Close() 'obj.Dispose() Me.ActiveForm.Close() End Sub Private Sub StatusBar1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles StatusBar1.MouseMove StatusBar1.Panels.Item(1).Text = Cursor.Position.X & "," & Cursor.Position.Y End Sub Private Sub mnudatecust_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnudatecust.Click Dim objdcust As New frmDate2DateCust objdcust.MdiParent = Me objdcust.Show() End Sub Private Sub mnudatesup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnudatesup.Click Dim objdsup As New frmDate2DateSup objdsup.MdiParent = Me objdsup.Show() End Sub

65

Private Sub mnumonthcust_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnumonthcust.Click Dim obj As New frmMonthCustomer obj.MdiParent = Me obj.Show() End Sub Private Sub mnumonthsup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnumonthsup.Click Dim obj As New frmMonthSupplier obj.MdiParent = Me obj.Show() End Sub Private Sub frmMDI_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove StatusBar1.Panels.Item(1).Text = Cursor.Position.X & "," & Cursor.Position.Y End Sub Private Sub mnuchangepwd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuchangepwd.Click Dim objedit As New frmEditUser objedit.MdiParent = Me objedit.Show() End Sub Private Sub mnubackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnubackup.Click Try Dim sDBFile As String = "D:\TYAppProject\Hally\bin\HallyDB.mdb" Dim sBackUpFile As String = "D:\TYAppProject\Hally\bin\BackUp" If Not System.IO.Directory.Exists(sBackUpFile) Then System.IO.Directory.CreateDirectory(sBackUpFile) End If ' sBackUpFile &= "\db1BackUp.mdb" sBackUpFile &= "\Backup.txt" 'First check the file u want to compact exists or not If File.Exists(sDBFile) Then Dim db As New DAO.DBEngine 'CompactDatabase has two parameters, creates a copy of compact DB at the Destination path db.CompactDatabase(sDBFile, sBackUpFile) End If 'restore the original file from the compacted file If File.Exists(sBackUpFile) Then FileCopy(sBackUpFile, sDBFile) MsgBox("Database backed up in a text file") 'FileAt.Copy(sBackUpFile, sDBFile, True) End If Catch ex As Exception MsgBox(ex.Message)

66

End Try End Sub Private Sub mnuconvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuconvert.Click Try Dim sDBFile As String = "D:\TYAppProject\Hally\bin\BackUp\BackUp.txt" Dim sBackUpFile As String = "D:\TYAppProject" If Not System.IO.Directory.Exists(sBackUpFile) Then System.IO.Directory.CreateDirectory(sBackUpFile) End If 'sBackUpFile &= "\db1BackUp.mdb" sBackUpFile &= "\Backup.mdb" 'First check the file u want to compact exists or not If File.Exists(sDBFile) Then Dim db As New DAO.DBEngine 'CompactDatabase has two parameters, creates a copy of compact DB at the Destination path db.CompactDatabase(sDBFile, sBackUpFile) End If 'restore the original file from the compacted file If File.Exists(sBackUpFile) Then FileCopy(sBackUpFile, sDBFile) MsgBox("Database Converted to Normal Form") 'FileAt.Copy(sBackUpFile, sDBFile, True) End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub mnuabout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuabout.Click Dim objdev As New frmAbout objdev.MdiParent = Me objdev.Show() End Sub Private Sub mnudeve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnudeve.Click Dim objdev As New frmDeveloper objdev.MdiParent = Me objdev.Show() End Sub End Class

67

frmCustomer.vb
Imports System.Data.OleDb Public Class frmCustomer Inherits System.Windows.Forms.Form Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HallyDB.mdb;Persist Security Info=False") Dim com As New OleDbCommand Dim r As OleDbDataReader Dim ds As New DataSet Dim a As String Sub Autogenerate() Dim max As Integer Dim adp As New OleDbDataAdapter Dim ds As New DataSet Dim drs As DataRowCollection Dim dr As DataRow If con.State = ConnectionState.Closed Then con.Open() End If adp.SelectCommand = New OleDbCommand adp.SelectCommand.Connection = con adp.SelectCommand.CommandText = "select * from Customer" adp.Fill(ds, "Customer") drs = ds.Tables("Customer").Rows dr = ds.Tables("Customer").Rows(drs.Count - 1) Dim str As String str = dr(0) str = str.Substring(1) max = str + 1 txtcid.Text = "C" & max con.Close() End Sub Sub EnableText() 'txtcid.Enabled = True txtfname.Enabled = True txtlname.Enabled = True txtadd.Enabled = True txtcity.Enabled = True txtstate.Enabled = True txtpin.Enabled = True txtphno.Enabled = True txtmbo.Enabled = True End Sub Sub DisableText() txtcid.Enabled = False txtfname.Enabled = False

68

txtlname.Enabled = False txtadd.Enabled = False txtcity.Enabled = False txtstate.Enabled = False txtpin.Enabled = False txtphno.Enabled = False txtmbo.Enabled = False End Sub Sub clear() txtcid.Text = "" txtlname.Text = "" txtfname.Text = "" txtadd.Text = "" txtmbo.Text = "" txtphno.Text = "" txtpin.Text = "" txtcity.Text = "" txtstate.Text = "" End Sub Sub EnableButton() btnnew.Enabled = True btnupdate.Enabled = True btndel.Enabled = True btnsave.Enabled = False btnview.Enabled = True btncancel.Enabled = False End Sub Sub DisableButton() btnnew.Enabled = False btnupdate.Enabled = False btndel.Enabled = False btnsave.Enabled = True btnview.Enabled = False btncancel.Enabled = True End Sub Sub Save(ByVal action As String) If action = "Add" Then com.CommandText = "insert into Customer Values(@cid,@fname,@lname,@add,@city,@state,@pin,@phno,@mbo)" com.Parameters.Add("@cid", txtcid.Text) com.Parameters.Add("@fname", txtfname.Text) com.Parameters.Add("@lname", txtlname.Text) com.Parameters.Add("@add", txtadd.Text) com.Parameters.Add("@city", txtcity.Text) com.Parameters.Add("@state", txtstate.Text) com.Parameters.Add("@pin", txtpin.Text) com.Parameters.Add("@phno", txtphno.Text)

69

com.Parameters.Add("@mbo", txtmbo.Text) com.Connection = con Try con.Open() com.ExecuteNonQuery() MsgBox("Record Saved Successfully") Catch ex As Exception MsgBox(ex.ToString) End Try con.Close() fill() cbocid.Items.Add(txtcid.Text) DisableText() EnableButton() com.Dispose() ElseIf action = "Update" Then com.CommandText = "Update Customer set CustFName=@fname,CustLName=@lname,CustAdd=@add,CustCity=@city,CustState =@state,CustPin=@pin,CustPhno=@phno,CustMbo=@mbo where CustID=@cid" com.Parameters.Add("@fname", txtfname.Text) com.Parameters.Add("@lname", txtlname.Text) com.Parameters.Add("@add", txtadd.Text) com.Parameters.Add("@city", txtcity.Text) com.Parameters.Add("@state", txtstate.Text) com.Parameters.Add("@pin", txtpin.Text) com.Parameters.Add("@phno", txtphno.Text) com.Parameters.Add("@mbo", txtmbo.Text) com.Parameters.Add("@cid", txtcid.Text) com.Connection = con Try con.Open() com.ExecuteNonQuery() MsgBox("Record Updated Successfully") Catch ex As Exception MsgBox(ex.Message()) End Try fill() con.Close() DisableText() EnableButton() cbocid.Enabled = True com.Dispose() End If End Sub Sub fill() Dim adP As New OleDbDataAdapter Dim ds As New DataSet adP.SelectCommand = New OleDbCommand adP.SelectCommand.CommandText = "Select * from Customer"

70

adP.SelectCommand.Connection = con Try adP.Fill(ds, "Customer") Catch ex As Exception MsgBox(ex.Message) End Try Dim view As New DataView view = New DataView(ds.Tables("Customer")) DataGrid1.DataSource = view End Sub Sub fillcombo() Dim com As New OleDbCommand com.CommandText = "Select CustID from Customer" com.Connection = con Dim r As OleDbDataReader Try con.Open() r = com.ExecuteReader Do While r.Read cbocid.Items.Add(r(0)) Loop r.Close() con.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub btnnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnew.Click clear() Autogenerate() EnableText() a = "Add" DisableButton() btncancel.Enabled = True End Sub Private Sub frmCustomer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load fill() fillcombo() DisableText() EnableButton() DataGrid1.ReadOnly = True End Sub Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click

71

If txtfname.Text = "" And txtlname.Text = "" And txtadd.Text = "" And txtcity.Text = "" And txtstate.Text = "" And txtpin.Text = "" And txtphno.Text = "" And txtmbo.Text = "" Then MsgBox("Please enter all details") txtfname.Focus() ElseIf txtfname.Text = "" Then MsgBox("Please Enter your First Name") txtfname.Focus() ElseIf txtlname.Text = "" Then MsgBox("Please Enter your Second Name") txtlname.Focus() ElseIf txtadd.Text = "" Then MsgBox("Please Enter your Address") txtadd.Focus() ElseIf txtmbo.Text = "" Then MsgBox("Please Enter your Mobile No.") txtmbo.Focus() ElseIf txtphno.Text = "" Then MsgBox("Please Enter your Phone No.") txtphno.Focus() ElseIf txtcity.Text = "" Then MsgBox("Please Enter your City") txtcity.Focus() ElseIf txtstate.Text = "" Then MsgBox("Please Enter your state") txtstate.Focus() ElseIf txtpin.Text.Length <> 6 Then MsgBox("Invalid Pin", MsgBoxStyle.Critical, "Error") txtpin.Text = "" txtpin.Focus() ElseIf txtphno.Text.Length <> 8 Then MsgBox("Please enter 8 digit phone no") txtphno.Text = "" txtphno.Focus() ElseIf txtmbo.Text.Length <> 10 Then MsgBox("Please enter 10 digit mobile no.") txtmbo.Text = "" txtmbo.Focus() Else Save(a) End If End Sub Private Sub cbocid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbocid.SelectedIndexChanged EnableButton() DisableText() btndel.Enabled = True Dim adP As New OleDbDataAdapter Dim ds As New DataSet adP.SelectCommand = New OleDbCommand

72

adP.SelectCommand.CommandText = "Select * from Customer where CustID='" & cbocid.Text & "'" adP.SelectCommand.Connection = con Try adP.Fill(ds, "Customer") Catch ex As Exception MsgBox(ex.Message) End Try Dim view As New DataView view = New DataView(ds.Tables("Customer")) DataGrid1.DataSource = view End Sub Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click btncancel.Enabled = True a = "Update" DataGrid1.Select(Val(cbocid.Text)) txtcid.Text = DataGrid1.Item(0, 0) txtfname.Text = DataGrid1.Item(0, 1) txtlname.Text = DataGrid1.Item(0, 2) txtadd.Text = DataGrid1.Item(0, 3) txtcity.Text = DataGrid1.Item(0, 4) txtstate.Text = DataGrid1.Item(0, 5) txtpin.Text = DataGrid1.Item(0, 6) txtphno.Text = DataGrid1.Item(0, 7) txtmbo.Text = DataGrid1.Item(0, 8) EnableText() DisableButton() cbocid.Enabled = False ' btnsave.Enabled = True 'btnupdate.Enabled = False ' btnnew.Enabled = False End Sub Private Sub btnview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click fill() btndel.Enabled = False End Sub Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndel.Click If MsgBox("Do you Really Wnat to Delete this Record?", MsgBoxStyle.YesNo) = vbYes Then com.CommandText = "Delete * from Customer where CustID='" & txtcid.Text & "' or CustID='" & cbocid.Text & "'" com.Connection = con Try con.Open() com.ExecuteNonQuery() MsgBox("Record Deleted")

73

cbocid.Items.Remove(cbocid.Text) Catch ex As Exception MsgBox(ex.Message) End Try con.Close() fill() Else fill() btndel.Enabled = False 'MsgBox("thank u") End If fill() End Sub Private Sub txtfname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtfname.KeyPress If Asc(e.KeyChar) > 48 And Asc(e.KeyChar) < 57 Then MsgBox("Enter Only character") e.Handled = False txtfname.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtlname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtlname.KeyPress If Asc(e.KeyChar) > 48 And Asc(e.KeyChar) < 57 Then MsgBox("Enter Only character") e.Handled = False txtlname.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtcity_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtcity.KeyPress If Asc(e.KeyChar) > 48 And Asc(e.KeyChar) < 57 Then MsgBox("Enter Only character") e.Handled = False txtcity.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtstate_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtstate.KeyPress If Asc(e.KeyChar) > 48 And Asc(e.KeyChar) < 57 Then MsgBox("Enter Only character") e.Handled = False

74

txtstate.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtpin_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpin.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then MsgBox("Enter only number") e.Handled = False txtpin.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 120 Then MsgBox("Enter only number") e.Handled = False txtpin.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click clear() DisableText() EnableButton() btndel.Enabled = False fill() End Sub Private Sub txtphno_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtphno.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then MsgBox("Enter only number") e.Handled = False txtphno.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 120 Then MsgBox("Enter only number") e.Handled = False txtphno.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtmbo_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtmbo.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then

75

MsgBox("Enter only number") e.Handled = False txtmbo.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 120 Then MsgBox("Enter only number") e.Handled = False txtmbo.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click Dim objprintcust As New frmPrintCust If cbocid.SelectedItem = "" Then MsgBox("Please Select CustomerID to Print Report") Else s1 = cbocid.SelectedItem objprintcust.Show() End If End Sub Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click If MsgBox("Do you Really want to exit", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit") = vbYes Then Me.Close() Else 'MsgBox("Continue") End If End Sub End Class

frmItem.vb
Imports System.Data.OleDb Public Class frmItem Inherits System.Windows.Forms.Form Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HallyDB.mdb;Persist Security Info=False") Dim com As New OleDbCommand Dim r As OleDbDataReader Dim view As New DataView Dim cm As CurrencyManager Dim a As String Sub Autogenerate() Dim max As Integer

76

Dim adp As New OleDbDataAdapter Dim ds As New DataSet Dim drs As DataRowCollection Dim dr As DataRow If con.State = ConnectionState.Closed Then con.Open() End If adp.SelectCommand = New OleDbCommand adp.SelectCommand.Connection = con adp.SelectCommand.CommandText = "select * from Item" adp.Fill(ds, "Item") drs = ds.Tables("Item").Rows dr = ds.Tables("Item").Rows(drs.Count - 1) Dim str As String str = dr(0) str = str.Substring(1) max = str + 1 txtid.Text = "I" & max con.Close() End Sub Sub Save(ByVal action As String) If action = "add" Then com.CommandText = "Insert into Item values(@itemid,@itemname,@qtyonhand,@costprice,@itemnotes)" com.Parameters.Add("@itemid", txtid.Text) com.Parameters.Add("@itemname", txtname.Text) com.Parameters.Add("@qtyonhand", txtqtyava.Text) com.Parameters.Add("@costprice", txtcostprice.Text) com.Parameters.Add("@itemnotes", txtnote.Text) If con.State = ConnectionState.Closed Then con.Open() End If Try com.Connection = con com.ExecuteNonQuery() MsgBox("Stored Successfully") Catch ex As Exception MsgBox(ex.Message) End Try con.Close() com.Dispose() fill() fillgrid() binding() DisableText() EnableButton() 'Autogenerate() ElseIf action = "update" Then com.CommandText = "Update Item set ItemName=@itemname,QtyOnHand=@qtyonhand,CostPrice=@costprice,ItemNotes=@ itemnotes where ItemID=@itemid "

77

com.Parameters.Add("@itemname", txtname.Text) com.Parameters.Add("@qtyonhand", txtqtyava.Text) com.Parameters.Add("@costprice", txtcostprice.Text) com.Parameters.Add("@itemnotes", txtnote.Text) com.Parameters.Add("@itemid", txtid.Text) If con.State = ConnectionState.Closed Then con.Open() End If Try com.Connection = con com.ExecuteNonQuery() MsgBox("Update Successfully") Catch ex As Exception MsgBox(ex.Message) End Try If Not con Is Nothing Then con.Close() End If com.Dispose() fill() fillgrid() binding() DisableText() EnableButton() End If End Sub Sub fill() Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select * from Item" adp.SelectCommand.Connection = con Try adp.Fill(ds, "Item") Catch ex As Exception MsgBox(ex.ToString) End Try view = New DataView(ds.Tables("Item")) adp.SelectCommand.Dispose() End Sub Sub fillgrid() Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select * from Item" adp.SelectCommand.Connection = con Try adp.Fill(ds, "Item") Catch ex As Exception MsgBox(ex.Message) End Try

78

Dim view As New DataView view = New DataView(ds.Tables("Item")) DataGrid1.DataSource = view adp.SelectCommand.Dispose() End Sub Sub fillcombo() com.CommandText = "Select * from Item" com.Connection = con Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() r = com.ExecuteReader While r.Read cboitem.Items.Add(r(0)) End While Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() End Sub Sub binding() txtid.DataBindings.Clear() txtname.DataBindings.Clear() txtqtyava.DataBindings.Clear() txtnote.DataBindings.Clear() txtcostprice.DataBindings.Clear() txtid.DataBindings.Add("Text", view, "ItemID") txtname.DataBindings.Add("Text", view, "ItemName") txtqtyava.DataBindings.Add("Text", view, "QtyOnHand") txtnote.DataBindings.Add("text", view, "ItemNotes") txtcostprice.DataBindings.Add("text", view, "CostPrice") cm = CType(Me.BindingContext(view), CurrencyManager) End Sub Sub ClearText() txtid.Text = "" txtname.Text = "" txtqtyava.Text = "" txtcostprice.Text = "" ' txtsellprice.Text = "" txtnote.Text = "" ' txtreorder.Text = "" End Sub Sub EnableText() txtname.Enabled = True txtnote.Enabled = True

79

txtqtyava.Enabled = True txtcostprice.Enabled = True End Sub Sub DisableText() txtname.Enabled = False txtnote.Enabled = False txtqtyava.Enabled = False txtcostprice.Enabled = False End Sub Sub EnableButton() btnnew.Enabled = True btnsave.Enabled = False btnupdate.Enabled = True btndel.Enabled = True btnfirst.Enabled = True btnnext.Enabled = True btnprev.Enabled = True btnlast.Enabled = True End Sub Sub DisableButton() btnnew.Enabled = False btnsave.Enabled = True btnupdate.Enabled = False btndel.Enabled = False btnfirst.Enabled = False btnnext.Enabled = False btnprev.Enabled = False btnlast.Enabled = False End Sub Private Sub frmItem_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load fill() fillgrid() fillcombo() binding() DisableText() EnableButton() DataGrid1.ReadOnly = True End Sub Private Sub btnfirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfirst.Click cm.Position = 0 End Sub Private Sub btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnext.Click cm.Position = cm.Position + 1 End Sub

80

Private Sub btnprev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprev.Click cm.Position -= 1 End Sub Private Sub btnlast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlast.Click cm.Position = cm.Count - 1 End Sub Private Sub btnnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnew.Click a = "add" ClearText() EnableText() DisableButton() Autogenerate() End Sub Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click If txtname.Text = "" And txtcostprice.Text = "" And txtqtyava.Text = "" And txtnote.Text = "" Then MsgBox("Please Enter all Details") ElseIf txtname.Text = "" Then MsgBox("Please enter Item Name") ElseIf txtcostprice.Text = "" Then MsgBox("Please Enter Item CostPrice") ElseIf txtqtyava.Text = "" Then MsgBox("Please enter Available Quantity") ElseIf txtnote.Text = "" Then MsgBox("Please enter Item Notes") Else Save(a) End If End Sub Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click a = "update" EnableText() DisableButton() End Sub Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndel.Click If MsgBox("Do you Really want to delete this Item", MsgBoxStyle.YesNo, "Delete") = vbYes Then com.Connection = con com.CommandText = "delete * from Item where ItemID=@itemid" com.Parameters.Add("@itemid", txtid.Text) Try

81

con.Open() com.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) End Try con.Close() com.Dispose() MsgBox("Deleted") fill() binding() Else fill() binding() DisableText() EnableButton() End If End Sub Private Sub txtname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtname.KeyPress If Asc(e.KeyChar) > 48 And Asc(e.KeyChar) < 57 Then MsgBox("Enter Only character") e.Handled = False txtname.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtqtyava_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtqtyava.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then MsgBox("Enter only number") e.Handled = False txtqtyava.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 120 Then MsgBox("Enter only number") e.Handled = False txtqtyava.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub txtcostprice_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtcostprice.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then MsgBox("Enter only number") e.Handled = False

82

txtcostprice.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 120 Then MsgBox("Enter only number") e.Handled = False txtcostprice.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub cboitem_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboitem.SelectedIndexChanged Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select * from Item where ItemID='" & cboitem.Text & "'" adp.SelectCommand.Connection = con Try adp.Fill(ds, "Item") Catch ex As Exception MsgBox(ex.Message) End Try Dim view As New DataView view = New DataView(ds.Tables("Item")) DataGrid1.DataSource = view adp.SelectCommand.Dispose() End Sub Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click Dim objprintitem As New frmPrintItem If cboitem.SelectedItem = "" Then MsgBox("Please Select ItemID to PrintReport") Else s1 = cboitem.SelectedItem objprintitem.Show() End If End Sub Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click If MsgBox("Do you Really want to exit", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit") = vbYes Then Me.Close() Else MsgBox("Continue") End If End Sub End Class

83

frmCustomerOrder.vb
Imports System.Data.OleDb Public Class frmCustomerOrder Inherits System.Windows.Forms.Form Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HallyDB.mdb;Persist Security Info=False") Dim com As New OleDbCommand Dim r As OleDbDataReader Dim view As New DataView Dim cm As CurrencyManager Dim qty As Integer Dim remain As Integer Sub AutoOrderNo() Dim max As Integer Dim adp As New OleDbDataAdapter Dim ds As New DataSet Dim drs As DataRowCollection Dim dr As DataRow If con.State = ConnectionState.Closed Then con.Open() End If adp.SelectCommand = New OleDbCommand adp.SelectCommand.Connection = con adp.SelectCommand.CommandText = "select * from CustomerOrder" adp.Fill(ds, "CustomerOrder") drs = ds.Tables("CustomerOrder").Rows dr = ds.Tables("CustomerOrder").Rows(drs.Count - 1) Dim str As String str = dr(0) str = str.Substring(2) max = str + 1 txtorder.Text = "OD" & max con.Close() adp.SelectCommand.Dispose() End Sub Sub AutoBillNo() Dim max As Integer Dim adp As New OleDbDataAdapter Dim ds As New DataSet Dim drs As DataRowCollection Dim dr As DataRow If con.State = ConnectionState.Closed Then con.Open() End If adp.SelectCommand = New OleDbCommand adp.SelectCommand.Connection = con adp.SelectCommand.CommandText = "select * from CustomerOrder"

84

adp.Fill(ds, "CustomerOrder") drs = ds.Tables("CustomerOrder").Rows dr = ds.Tables("CustomerOrder").Rows(drs.Count - 1) Dim str As String str = dr(0) str = str.Substring(2) max = str + 1 txtbill.Text = "CB" & max con.Close() adp.SelectCommand.Dispose() End Sub Sub fillgrid() Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select CustOrderNo,CustID,CustBillNo,ProdID,TotalQtyOrder,TotalOrderAmt,AmtPaid,AmtRe m,CustOrderDate,CustDueDate from CustomerOrder" adp.SelectCommand.Connection = con Try adp.Fill(ds, "CustomerOrder") Catch ex As Exception MsgBox(ex.Message) End Try view = New DataView(ds.Tables("CustomerOrder")) DGCustOrdDet.DataSource = view End Sub Sub fillcombo() com.CommandText = "Select CustID from Customer" com.Connection = con Try con.Open() r = com.ExecuteReader Do While r.Read cboid.Items.Add(r(0)) Loop Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() End Sub Sub fillProdCombo() com.CommandText = "Select * from Product" com.Connection = con Try con.Open() r = com.ExecuteReader Do While r.Read cbopid.Items.Add(r(0)) Loop

85

Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() End Sub Sub DisableText() txtorder.Enabled = False txtbill.Enabled = False txttotal.Enabled = False txtfinal.Enabled = False txtname.Enabled = False txtmbo.Enabled = False txtphno.Enabled = False txtcity.Enabled = False txtamtrem.Enabled = False txtprodname.Enabled = False txtava.Enabled = False End Sub Sub clear() txtamtpaid.Text = "" txtamtrem.Text = "" txttotal.Text = "" txtorder.Text = "" txtbill.Text = "" txtfinal.Text = "" NUDqty.Value = 0 txtname.Text = "" txtmbo.Text = "" txtphno.Text = "" txtcity.Text = "" End Sub Sub enable() dtporderdate.Enabled = True dtporderdue.Enabled = True txtamtpaid.Enabled = True 'txtamtrem.Enabled = True NUDqty.Enabled = True cbopid.Enabled = True End Sub Sub disable() dtporderdate.Enabled = False dtporderdue.Enabled = False txtamtpaid.Enabled = False txtamtrem.Enabled = False NUDqty.Enabled = False cbopid.Enabled = False cbopid.Items.Clear() End Sub Sub reduceQty() com.CommandText = "Select * from Product where ProdID='" & cbopid.Text & "'"

86

com.Connection = con Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() r = com.ExecuteReader While r.Read() qty = r(2) End While r.Close() con.Close() Catch ex As Exception MsgBox(ex.Message) End Try com.Dispose() End Sub Sub updateProd() com.CommandText = "Update Product set QtyOnHand=@QtyOnHand where ProdID='" & cbopid.Text & "'" com.Parameters.Add("@QtyOnHand", remain) com.Connection = con Try con.Open() com.ExecuteNonQuery() 'MsgBox("Update") Catch ex As Exception MsgBox(ex.Message) End Try con.Close() com.Dispose() End Sub Sub fillOrder() com.CommandText = "Select * from CustomerOrder" com.Connection = con Try con.Open() r = com.ExecuteReader While r.Read cboorder.Items.Add(r(0)) End While r.Close() con.Close() Catch ex As Exception MsgBox(ex.Message) End Try com.Dispose() End Sub

87

Private Sub CustomerOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load fillcombo() fillOrder() DisableText() disable() btnsave.Enabled = False btncancel.Enabled = False btndel.Enabled = False DGCustOrdDet.ReadOnly() = True dtporderdate.Value = Today dtporderdue.Value = Today End Sub Private Sub cbopid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbopid.SelectedIndexChanged com.CommandText = "Select * from Product where ProdID='" & cbopid.Text & "'" com.Connection = con Try con.Open() r = com.ExecuteReader r.Read() txttotal.Text = r(3) txtprodname.Text = r(1) txtava.Text = r(2) Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() End Sub Private Sub btnnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnew.Click If cboid.SelectedItem = "" Then MsgBox("Please select Customer ID to place Order") Else fillProdCombo() AutoOrderNo() AutoBillNo() enable() btnnew.Enabled = False btnsave.Enabled = True btncancel.Enabled = True btnview.Enabled = False End If End Sub Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click If MsgBox("Confirm Order", MsgBoxStyle.YesNo) = vbYes Then

88

If NUDqty.Value = 0 Then MsgBox("Please Enter some quantity number") Exit Sub End If If dtporderdate.Value = dtporderdue.Value Then MsgBox("Order date and Due date should have minimum 10 days difference", MsgBoxStyle.Critical, "Error") Exit Sub ElseIf dtporderdate.Value > dtporderdue.Value Then MsgBox("Due date cannot be larger than order date") 'clear() 'disable() Exit Sub Else reduceQty() txtava.Text = remain updateProd() com.CommandText = "Insert into CustomerOrder values(@custorderno,@custid,@custbill,@pid,@totqtyorder,@totorderamt,@amtpaid,@ amtrem,@orderdate,@duedate,@ordermonth,@orderyear)" com.Parameters.Add("@custorderno", txtorder.Text) com.Parameters.Add("@custid", cboid.Text) com.Parameters.Add("@custbill", txtbill.Text) com.Parameters.Add("@pid", cbopid.Text) com.Parameters.Add("@totqtyorder", NUDqty.Value) com.Parameters.Add("@totorderamt", txtfinal.Text) com.Parameters.Add("@amtpaid", txtamtpaid.Text) com.Parameters.Add("@amtrem", txtamtrem.Text) com.Parameters.Add("@orderdate", dtporderdate.Value.Date.ToShortDateString) com.Parameters.Add("@duedate", dtporderdue.Value.Date.ToShortDateString) com.Parameters.Add("@ordermonth", dtporderdate.Value.Date.Month) com.Parameters.Add("@orderyear", dtporderdate.Value.Date.Year) com.Connection = con Try If con.State = ConnectionState.Open Then con.Close() End If If con.State = ConnectionState.Closed Then con.Open() End If com.ExecuteNonQuery() cboorder.Items.Add(txtorder.Text) MsgBox("Order Placed") If Val(txtamtrem.Text) = 0 Then MsgBox("Your Order will be delivered soon") Else MsgBox("Balance Amount Should Be Paid At Time Of Delivery", MsgBoxStyle.Information, "Important")

89

End If con.Close() Catch ex As Exception MsgBox(ex.Message) End Try End If com.Dispose() disable() 'fillOrder() fillgrid() btnnew.Enabled = True btnsave.Enabled = False btnview.Enabled = True btncancel.Enabled = False Me.Refresh() Else fillcombo() disable() clear() btnsave.Enabled = False btncancel.Enabled = False btnview.Enabled = True End If End Sub Private Sub txtamtpaid_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtamtpaid.LostFocus txtamtrem.Text = Val(txtfinal.Text) - Val(txtamtpaid.Text) If txtamtrem.Text < 0 Then MsgBox("Please enter full amount or half amount", MsgBoxStyle.Exclamation, "Invalid amount") txtamtrem.Text = "" Exit Sub Else Exit Sub End If End Sub Private Sub btnview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click Gpview.Visible = True DGCustOrdDet.Visible = True fillgrid() End Sub Private Sub cboid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboid.SelectedIndexChanged com.CommandText = "Select * from Customer where CustID='" & cboid.Text & "'" com.Connection = con Try

90

If con.State = ConnectionState.Open Then con.Close() End If con.Open() r.Close() r = com.ExecuteReader While r.Read txtname.Text = r(1) & " " & r(2) txtphno.Text = r(7) txtmbo.Text = r(8) txtcity.Text = r(4) End While r.Close() con.Close() Catch ex As Exception MsgBox(ex.Message) End Try com.Dispose() End Sub Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click fillcombo() disable() clear() btnsave.Enabled = False btncancel.Enabled = False btnview.Enabled = True btnnew.Enabled = True End Sub Private Sub cboorder_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboorder.SelectedIndexChanged btndel.Enabled = True Dim adp As New OleDbDataAdapter Dim ds As New DataSet Gpview.Visible = True DGCustOrdDet.Visible = True adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select * from CustomerOrder where CustOrderNo='" & cboorder.Text & "'" adp.SelectCommand.Connection = con Try adp.Fill(ds, "CustomerOrder") Catch ex As Exception MsgBox(ex.Message) End Try view = New DataView(ds.Tables("CustomerOrder")) DGCustOrdDet.DataSource = view End Sub

91

Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndel.Click If MsgBox("Do you Really Wnat to Delete this Record?", MsgBoxStyle.YesNo, "Delete") = vbYes Then If cboorder.SelectedText = "" Then MsgBox("Please select order no to delete record") Exit Sub Else com.CommandText = "Delete * from CustomerOrder where CustOrderNo='" & cboorder.Text & "'" com.Connection = con Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() com.ExecuteNonQuery() MsgBox("Record Deleted") cboorder.Items.Remove(cboorder.Text) Catch ex As Exception MsgBox(ex.Message) End Try con.Close() fillgrid() com.Dispose() End If Else fillgrid() btndel.Enabled = False End If End Sub Private Sub NUDqty_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles NUDqty.LostFocus reduceQty() If cbopid.SelectedItem = "" Then MsgBox("Please select product id") ElseIf qty <= 5 Then MsgBox("Cannot place an Order", MsgBoxStyle.Critical, "Out Of Stock") disable() fillgrid() clear() btnnew.Enabled = True btnsave.Enabled = False btnview.Enabled = True Exit Sub Else txtfinal.Text = NUDqty.Value * Val(txttotal.Text) End If End Sub

92

Private Sub txtamtpaid_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtamtpaid.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90 Then MsgBox("Please enter only number") e.Handled = False txtamtpaid.Text = "" e.Handled = True Exit Sub ElseIf Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) < 123 Then MsgBox("Please Enter Only Number") e.Handled = False txtamtpaid.Text = "" e.Handled = True Exit Sub End If End Sub Private Sub btnbill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbill.Click If cboorder.SelectedItem = "" Then MsgBox("Please select CustomerOrderNo. to View Bill") Else 'MsgBox("selected") s1 = cboorder.Text Dim objcbill As New frmCustomerBill objcbill.Show() End If End Sub Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click If MsgBox("Do you really want to exit", MsgBoxStyle.YesNo, "Exit") = vbYes Then Me.Close() Else 'MsgBox("Continue") End If End Sub End Class

93

frmCancelSupplierOrder.vb
Imports System.Data.OleDb Public Class frmCancelSupOrder Inherits System.Windows.Forms.Form Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HallyDB.mdb;Persist Security Info=False") Dim com As New OleDbCommand Dim r As OleDbDataReader Dim qty, ItemQty, reduce As Integer Sub fillSupOrderGrid() Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand 'adp.SelectCommand.CommandText = "Select * from SupplierOrder,Supplier where Supplier.SupID=SupplierOrder.SupID ", Item where Item.ItemID=SupplierOrder.ItemID adp.SelectCommand.CommandText = "Select * from SupplierOrder " adp.SelectCommand.Connection = con Try adp.Fill(ds, "SupplierOrder") Catch ex As Exception MsgBox(ex.Message) End Try Dim view As New DataView view = New DataView(ds.Tables("SupplierOrder")) Datagrid1.DataSource = view adp.SelectCommand.Dispose() End Sub Sub fillSupID() com.CommandText = "Select * from Supplier" com.Connection = con If con.State = ConnectionState.Open Then con.Close() End If Try con.Open() r = com.ExecuteReader While r.Read cbosupid.Items.Add(r(0)) End While Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() End Sub Sub disable()

94

txtcity.Enabled = False txtname.Enabled = False txtitemsup.Enabled = False txtmbo.Enabled = False txtphno.Enabled = False End Sub Private Sub frmCancelSupOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load fillSupOrderGrid() fillSupID() disable() Datagrid1.ReadOnly = True End Sub Private Sub cbosupid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbosupid.SelectedIndexChanged com.CommandText = "Select * from Supplier where SupID='" & cbosupid.Text & "'" com.Connection = con Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() r = com.ExecuteReader While r.Read txtname.Text = r(1) & " " & r(2) txtcity.Text = r(4) txtphno.Text = r(7) txtmbo.Text = r(8) txtitemsup.Text = r(10) End While Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() '------------------------------------Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.SelectCommand = New OleDbCommand adp.SelectCommand.CommandText = "Select * from SupplierOrder where SupID= '" & cbosupid.Text & "'" adp.SelectCommand.Connection = con Try adp.Fill(ds, "SupplierOrder") Catch ex As Exception MsgBox(ex.Message) ' MsgBox("No order ") End Try Dim view As New DataView

95

view = New DataView(ds.Tables("SupplierOrder")) Datagrid1.DataSource = view adp.SelectCommand.Dispose() End Sub Sub ReadQty() com.CommandText = "Select * from SupplierOrder" com.Connection = con Try con.Open() r = com.ExecuteReader While r.Read qty = r(3) End While Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() End Sub Sub ReadItem() com.CommandText = "Select * from Item where ItemName='" & txtitemsup.Text & "'" com.Connection = con Try con.Open() r = com.ExecuteReader While r.Read ItemQty = r(2) End While Catch ex As Exception MsgBox(ex.Message) End Try r.Close() con.Close() com.Dispose() End Sub Sub UpdateItem() com.CommandText = "Update Item set QtyOnHand=@QtyOnHand where ItemName='" & txtitemsup.Text & "'" com.Parameters.Add("@QtyOnHand", reduce) com.Connection = con Try con.Open() com.ExecuteNonQuery() MsgBox("Decreased") Catch ex As Exception MsgBox(ex.Message) End Try con.Close()

96

com.Dispose() End Sub Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click If MsgBox("Are you sure you want to cancel order", MsgBoxStyle.YesNo, "Cancel") = vbYes Then Dim a As Integer Dim order As String a = Datagrid1.CurrentRowIndex order = Datagrid1.Item(a, 0) MsgBox(order) ReadQty() ReadItem() MsgBox("Order :" & qty) MsgBox("Item :" & ItemQty) reduce = ItemQty - qty MsgBox("Reduced :" & reduce) UpdateItem() com.CommandText = "Delete * from SupplierOrder where SupOrderNo='" & order & "'" com.Connection = con Try con.Open() com.ExecuteNonQuery() MsgBox("Order Cancelled") Catch ex As Exception MsgBox(ex.Message) End Try con.Close() com.Dispose() fillSupOrderGrid() Else MsgBox("Ok") End If End Sub Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click If MsgBox("Do you Really want to exit", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit") = vbYes Then Me.Close() Else ' MsgBox("Continue") End If End Sub End Class

97

Report Layouts

98

PrintCustomer.rpt

99

Item.rpt

100

CustomerBill.rpt

101

SupplierQuotation.rpt

102

PrintAllSupplier.rpt

103

MonthlyCustomerReport.rpt

104

SupplierDateReport.rpt

105

Testing And Implementation

106

TESTING PLAN
Testing is very vital for any system to be successfully implemented. The common view is that it is performed to prove that there are no errors in a program. Therefore the most useful and practical approach is with the explicit intention of finding the errors. The system is tested experimentally to ensure that the software does not fail. The system is run according to its specifications and in the way the user expects. Following testing practices are used. The system will process as normal input preparation of test-sample data.
Following testing practices were used A. Unit Testing : Each and every module was intensively tested to check for errors and defects. All possible mistakes were rectified. Manually code is tested like spelling checks, logical errors. Once the manual checking is over the compilation has been done. Syntactical error if any has to be corrected. After the clean compilation of the program, some dummy data as per specifications has been used for testing of that module to see if it works as specified. B. System Testing : After testing the individual modules they were integrated and the entire system as checked and compatibility. After completing the sub-system testing, all the interconnected modules should be tested. The system testing will start only after the first testing is over. The necessary data as per specifications will entered and the system as a whole will be tested.

tested for

be

107

IMPLEMENTATION
1. CONVERSION : Conversion is the process of slowly changing the old system into the new system. For this a pilot approach was selected. Pilot Approach: First a small module was developed and tested with historical data. Historical data outputs of the system were checked against historical outputs 2. TRAINING : The users were familiarized with the basic operations of the computer. Intensive training was given to the regular user /operator of the system. Training with real time customers was carried out. 3. MAINTENANCE : After the system was installed it was continuously analyzed for defects or errors. In case of an error it was rectified on the spot or with an acceptable time frame.

108

Bibliography

109

Reference Books
Beginning VB.NET 2003 (Thearon Willis, et al(WROX)) Software Engineering A Practitioners Approach ( Roger S. Pressman ) www.google.com www.codeguru.com www.dotnetspider.com www.allexperts.com

110

Вам также может понравиться