26623608 Stock Maintenance System | Oracle Database | Databases

Stock maintenance system

Stock maintenance system

ABSTRACT
The main objective of this project is to overcome the work load and time consumption which makes the maintenance of the stock in an organization as a tedious process. This project provides complete information about the details of the stock to the users. This project identifies the amount of stock available,the product that is purchased faults in the product,products that are replaced,products that have been sold,and the date at which the products are bought and sold in a particular concern.Separate modules have been created for purchasing, viewing stock details,selling, details and delivery details.As a whole ,marketing process can be improved if stock has been maintained properly. This project is developed with help of visual basic 6.0 as a front end and oracle 9i as back end. The application software Rational Rose is also used.

I

Stock maintenance system

CONTENTS
S.No Title Page No I II III

Abstracts List of figures List of tables Introduction 1. 1.1 problem 1.2 problem definition System tools 2. 2.1 MS-VISUAL basic 2.2 ORACLE9i Methodology 3. 3.1 concept 3.2 database connectivity System requirement 4. 4.1 hardware requirement 4.2 software requirement System modules 5.1 structural diagram 5.1.1 use case diagram 5.1.2 class diagram 5. 5.1.3 state diagram 5.1.4 activity diagram 5.1.5 sequence diagram 5.1.6 collaboration diagram 5.2 module diagram 5.2.1 stock module

3 delivery module 5.2. 9.4 replacing the fault module 6.1 reference book 9. Implementation and result 7.2.2.2 sales module 5.2 reference web sites .1 conclution 8.2 future enhancement Reference 9.Stock maintenance system 5. Testing Conclusion and future enhancement 8. 8.

3. 2. USE CASE DIAGRAM CLASS DIAGRAM STATE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM COLLABORATION DIAGRAM STOCK MODULE 1. 4. 6. 5. USE CASE DIAGRAM CLASS DIAGRAM STATE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM COLLABORATION DIAGRAM PAGE NO . 4. USE CASE DIAGRAM CLASS DIAGRAM STATE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM COLLABORATION DIAGRAM SALES MODULE 1. 2. 3. 2. 5. USE CASE DIAGRAM CLASS DIAGRAM STATE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM COLLABORATION DIAGRAM DELIVERY MODULE 1. 2. 4. 4. 5. 6. 3. 3. 6. 6. 5.Stock maintenance system LIST OF FIGURES FIG NO TITLE OVER ALL DIAGRAM 1.

6. USE CASE DIAGRAM CLASS DIAGRAM STATE DIAGRAM ACTIVITY DIAGRAM SEQUENCE DIAGRAM COLLABORATION DIAGRAM II .Stock maintenance system REPLASEING THE FAULT MODULE 1. 4. 5. 2. 3.

3. TITLE STOCK MODULE SALES MODULE DELIVERY MODULE REPLACING THE FAULTS MODULE PAGE NO III . 4. 2.Stock maintenance system LIST OF TABLES TABLE NO 1.

. is 1. This project also gives idea about the faults in the purchased product and the products that are to be replaced also been given. As a whole the marketing process can be improved if the stock maintained properly. The stock details which includes the amount of stock available. Stock maintenance in this project gives the idea about how products are maintained in a particular concern.1 PROBLEM Stock Maintenance gives an idea about how products are maintained in the particular concern. Further some additional details of the current stock that is available in the store is also given.Stock maintenance system 1. the products that are to be sold are maintained here. the amount that is already available are maintained in this project. The stock maintenance in this project is understood by goin through the modules that is being involved. the date or the time it is being bought or delivered. The whole economic status is being improved properly if stock is maintained. the stock is to be purchased. Stock maintenance in this project is done in an authorized way.2PROBLEM DEFINITION: The stock has to be maintained properly since the whole marketing process can be improved. INTRODUCTION 1. The password and user id has been set here. The products that are to be purchased.

1 MS-VISUAL BASIC: Visual Basic 6. 2.Stock maintenance system 2.2 ORACLE 9i: Oracle 9i makes most necessary conversion to the code automatically when we convert our data base.The ³Visual´ part refers to the method used to create Graphical User Interface.0 is fastest and easiest way to create single user and client/server applications for Microsoft Windows. SOFTWARE TOOLS 2. and there are some additional changes that must made in order to run the application successfully in oracle. . It is an ideal programming language for developing sophisticated professional applications for Microsoft. However the conversion process makes some changes to code that need to aware of. Visual Basic 6.0 provides complete set of tools to simplify rapid application development both for the experienced professional and new windows programmers.The ³Basic´ part refers to the BASIC language used by more programmers than any other language in the history of computing.

A standard protocol that permits application to connect to a variety of external database servers or files. Use connection string : any data link file already stored can be specified.0 and oracle9i is provided by using Microsoft ADO Data control 6. A term used to a database or database server used as a source of data.The database connectivity between Visual Basic 6.0(OLEDB). keeps track of all the information about the stock exchange that are made by the customers. Thus the project makes use of the internal feature of ADODC for communicating with the database and this is responsible for transfer of data to and from the table from and to the front end. Data sources can be created by using the windows control panel or the register database method.0 and the back end that is used for this project is Oracle9i. They are as follows 1. : choose build to create a new connection String specifying the OLEDB provider.1 CONCEPT Storing of information about the stock values and updating the stock values for each organization which is using this system. Use data link file 2. 3.0(OLEDB). .2 DATABASE CONNECTIVITY: The front end used for implementation of this project is Visual Basic 6. METHODOLOGY 3.Stock maintenance system 3.. To add ADO data control to the toolbox go to the components and select Microsoft ado Data control 6. ODBC drivers used by the Microsoft database engine permit access to Microsoft SQL server and several other databases. : any ODBC DSN can be specified. ODBC data source are referred to by their Data Source Name (DSN). Use ODBC Data source name 3. having registration feature of adding up new customers to the organization are provided in this system. There are three different options insetting connection string.

0 GHZ 20 GB 512 MB 4.Stock maintenance system 4.SYSTEM REQUIREMENT 4. 1.1 Hardware Requirements: Processor CPU Speed Strorage Capacity RAM Capacity : : : : Intel Pentium III or later.2 Software Requirements: Front End Back End Operating System Application Software : : : : VISUAL BASIC 6.0 Oracle 9i Windows Family Rational Rose .

1 USE CASE DIAGRAM: Use case diagram is a diagram that shows the interaction between the user and the system to captures the user¶s goal. .Stock maintenance system 5.1 STRUCTURE DIAGRAM OVERALL DIAGRAM 5.SYSTEM MODULES 5.1.

2 CLASS DIAGRAM: Class diagram or object modeling is a collection of static elements such as classes.2 .1. STORE KEEPER address phone no USER name address request() purchase() ORDER price amount dispatch() close() DEALER name address sends price details() request replacing defected items() DB MANAGER update() display() ORDER LINE quantity price COMPANY MANAGER id address supply items() Fig 1. their relationships connected as a graph to each other.Stock maintenance system 5.

3 STATE DIAGRAM: State diagram shows that the sequence of states that an object goes through during its life in response to outside stimuli and messages.1. .Stock maintenance system 5.

1. create requirement from customer check availablity receive payroll supply products request and receive item yes no check for damage replace damaged items Fig 1.4 ACTIVITY DIAGRAM Activity diagram is a variation or special case of a state machine in which the states are activities representing the performance of operations and the transitions are triggered by the completion of the operations.4 .Stock maintenance system 5.

5 .5 SEQUENCE DIAGRAM: Sequence diagram is an easy and intuitive way of describing the behaviour of a system by viewing the interaction between the system and its environment.Stock maintenance system 5.1. USER ORDER SHOP KEEPER DEALER COMPANY DB MANAGER request for item check for availablity order items update prodect details ask for quotation send price details capture deal dispatch product request for deliv ery request for customer details send customer details update delivery detail complain about defect detail of defect request for replacing refected items replace defect replace deliver item close order Fig 1.

which is a set of objects related in a particular context and interaction.6 . 9: request for delivery 13: complain about defect SHOP KEEPER USER 1: request for item ORDER 11: send customer details 6: send price details 17: replace deliver item 2: check for availablity 18: close order 4: order items 8: dispatch product 5: ask for quotation 7: capture deal 14: detail of defect 10: request for customer details 3: update prodect details 12: update delivery detail DB MANAGER 15: request for replacing refected items DEALER 16: replace defect COMPAN Y Fig 1.5 COLLABORATION DEIAGRAM: Colloboration diagram represents a collaboration.1.which is a set of exchanged amongt the objects with in the collaboration to achieve a desired outcome.Stock maintenance system 5.

5.1 STOCK MODULE: USE CASE DIAGRAM . their relationships connected as a graph to each other.2.2 MODULE DIAGRAM Class diagram or object modeling is a collection of static elements such as classes.Stock maintenance system 5.

2 STATE DIAGRAM: .Stock maintenance system CLASS DIAGRAM: USER name address complain() purchase() STORE KEEPER user id password deliver() send defects details() DEALER name address replace() request return() ORDER price amount dispatch() close() DB MANAGER update details() display details() COMPANY name address supply items() set limit() Fig 2.

Stock maintenance system ACTIVITY DIAGRAM: SEQUENCE DIAGRAM: .

Stock maintenance system COLLABORATION DIAGRAM: .

Stock maintenance system 5.2.2 SALES MODULE: USE CASE DIAGRAM: price deal DEALER verify price STORE KEEPER capture deal set limit update product details COMPANY MANAGER DB MANAGER Fig 2.7 .

Stock maintenance system CLASS DIAGRAM: COMPANY name address supply items() set limit() DEALER name address replace() request return() ORDER price amount dispatch() close() DB MANAGER update details() display details() STORE KEEPER user id password deliver() send defects details() Fig 2.8 STATE DIAGRAM: .

Stock maintenance system ACTIVITY DIAGRAM: SEQUENCE DIAGRAM: .

Stock maintenance system COLLABORATION DIAGRAM: .

3 DELIVERY MODULE: USE CASE DIAGRAM: asks for product STORE KEEPER sends the product USER receive payment update product's delivery details DB MANAGER Fig 2.14 DB MANAGER update details() display details() .Stock maintenance system 5.13 CLASS DIAGRAM: USER name address complain() purchase() STORE KEEPER user id password deliver() send defects details() Fig 2.2.

Stock maintenance system STATE DIAGRAM: ACTIVITY DIAGRAM: .

Stock maintenance system COLLABORATION DIAGRAM: .

4 REPLACING THE FAULT MODULE: USE CASE DIAGRAM: DB MANAGER details about defect DEALER update details complaints about defect STORE KEEPER replaces the defect requests for return return another product USER COMPANY MANAGER fig 2.Stock maintenance system 5.18 .2.

Stock maintenance system CLASS DIAGRAM: USER name address complain() purchase() STORE KEEPER user id password deliver() send defects details() DEALER DB MANAGER update details() display details() name address replace() request return() COMPANY MANAGER replace product() Fig 2.19 STATE DIAGRAM: .

Stock maintenance system ACTIVITY DIAGRAM: COLLABORATION DIAGRAM: .

2 CODING: Private Sub cmdCancel_Click() LoginSucceeded = False Unload Me End Sub Private Sub cmdOK_Click() If (txtUserName.Text = "") Then . vbCritical + vbOKOnly.Stock maintenance system 6.Text = "") Then MsgBox "Enter a valid Username". "Error" ElseIf (txtPassword.IMPLEMENTATION AND RESULT: LOGIN FORM: Fig 6.1 OUTPUT: Fig 6.

Text = True frmLogin. db. 2 If rs. vbCritical + vbOKOnly.Hide frmmsg.Text = "" txtPassword.EOF = True Then 'If Search is found MsgBox "User not found".Label1.Text) Then MsgBox "Invalid Password". 1.Text = "admin") Then userAdmin = True Text1. "Error" txtPassword.Fields("Passwd") <> txtPassword. vbCritical + vbOKOnly. "Error" Else If (rs.Stock maintenance system MsgBox "Enter a valid Password".Show End If End If End Sub .Open "Select Passwd from Login where uname = '" & txtUserName.Caption = "welcome to Stock Maintenance System" frmmsg. vbCritical + vbOKOnly.SetFocus Else user = txtUserName.Close rs.Text If (txtUserName. "Error" End If rs.Text & "'".

3 .Stock maintenance system MAIN FROM: Fig :6.

4 .Stock maintenance system STOCK MAINTENANCE: Fig 6.

5 NEW ENTRY: Fig 6.Stock maintenance system UPDATE: Fig :6.6 .

7 CODING: Dim date1 As Date Dim temp. p As Integer Dim db As New ADODB. vbYesNo + vbQuestion. "Stock") = vbYes) Then .Connection Dim rs As New ADODB. q.Recordset Private Sub cmddelete_Click() Dim str As String If (MsgBox("Are you sure you want to Delete it".Stock maintenance system SHOW ALL: Fig :6.

"Update" Unload Me frmStockDetails. txtquantity.Update "quantity".Text . vbOKOnly cmbitype.Show End If Else frmStockDetails.Update "netweight". "Stock") = vbYes) Then With rs . vbInformation + vbOKOnly.SetFocus End Sub .Text .Text .Text .Update "itemname".Close connectme MsgBox "Deleted Successfully".Text End With MsgBox "Stock Detail modified successfully". txtitype.Update "itemtype".Update "date_of_entry".Visible = True Else frmStockDetails.Update "itemcode". txtdate. txtprice.Stock maintenance system str = "delete from Stock where itemcode='" & rs!itemcode & "'" db.Execute str db. txtnetwt. vbYesNo + vbQuestion.Update "price".Text .Text . txtiname. txticode.SetFocus End If End If End Sub Private Sub Command2_Click() If (MsgBox("Are you sure you want to update the stock".

"tiger" Call Resetall rs. db. adOpenKeyset.Visible = True Call Reset End Sub Private Sub Form_Load() connectme MSHFlexGrid1. db.DataSource = rs End Sub Private Sub connectme() Dim i As Integer.Open "arun". j As Integer db.Visible = False rs.Open "select * from stock ".AddItem rs!itemtype rs. adOpenKeyset.Visible = False cmbitype.Stock maintenance system Private Sub Command1_Click() frmpurchase. adLockOptimistic While rs.EOF <> True cmbitype.Show End Sub Private Sub Command3_Click() txtitype. "scott".Visible = False End Sub .Open "select itemtype from stock group By itemtype ".Close rs. adLockOptimistic Set MSHFlexGrid1.MoveNext Wend txtitype.

Stock maintenance system Private Sub Command4_Click() If MSHFlexGrid1.Visible = True txtprice.Enabled = True cmddelete. db.Visible = True txticode.Visible = True Then MSHFlexGrid1.MoveFirst cmbitype. adLockOptimistic rs.Visible = False txtitype.Visible = True txtiname.Visible = False txtitype.Visible = True txtquantity.Visible = True With rs txtitype = !itemtype txticode = !itemcode txtiname.Visible = True txtnetwt.Visible = True Command2. adOpenKeyset.Close rs.Enabled = True Else Unload Me End If End Sub Private Sub cmbitype_Click() Call Reset rs.Text = !itemname .Visible = True txtamount.Open "select * from stock where itemtype=" & "'" & cmbitype.Visible = True txtdate.Text & "'".

Enabled = False cmdFIrst.Number = 3021 Then .Text = "" txtprice.Text = "" txtnetwt.Enabled = False Err: If Err.Text = !price p = txtprice.Text = !netweight txtdate.Text = "" txtiname.Text = "" txtdate.Text = !quantity txtprice.Text = p * q End With End Sub Public Sub Resetall() cmbitype.Stock maintenance system txtnetwt.Enabled = True cmdLast.Text = !date_of_entry txtquantity.Visible = True On Error GoTo Err cmdNext.Enabled = True rs.Text = "" End Sub Private Sub cmdfirst_Click() txticode.Text = "" txtquantity.MoveFirst Display cmdPrev.Text q = txtquantity.Text txtamount.Clear txticode.

Number = 3021 Then MsgBox "NO CURRENT RECORD" cmdNext.Enabled = False cmdLast.BOF <> True And rs.Enabled = False cmdFIrst.Enabled = False cmdPrev.Enabled = False End If End Sub Private Sub cmdlast_Click() txticode.Enabled = False cmdLast.Visible = True On Error GoTo Err cmdFIrst.Enabled = False cmdFIrst.Enabled = False cmdLast.Enabled = False cmdPrev.Enabled = True cmdPrev.MoveLast Display cmdNext.Enabled = False Err: If Err.Enabled = True rs.Enabled = False End If End Sub Private Sub cmdnext_Click() txticode.EOF <> True Then .Visible = True On Error GoTo Err If rs.Stock maintenance system MsgBox "NO CURRENT RECORD" cmdNext.

Enabled = True rs.Enabled = False End If End Sub Private Sub cmdprev_Click() txticode.BOF <> True And rs.Enabled = False .Enabled = False cmdLast.MoveNext Display Else rs.Enabled = False cmdLast.MoveLast Display cmdNext.Enabled = False cmdFIrst.MovePrevious Display Else rs.Number = 3021 Then MsgBox "NO CURRENT RECORD" cmdNext.Enabled = True If rs.Enabled = False End If If Err.MoveFirst Display cmdPrev.Visible = True On Error GoTo Err cmdNext.Enabled = True cmdPrev.Enabled = False cmdPrev.EOF <> True Then rs.Stock maintenance system cmdFIrst.Enabled = True cmdLast.

Enabled = False cmdLast.Enabled = False End If Err: If Err.Enabled = False cmdFIrst.Enabled = False cmdPrev.Enabled = False End If End Sub .Stock maintenance system cmdFIrst.Number = 3021 Then MsgBox "NO CURRENT RECORD" cmdNext.

Stock maintenance system SALES MASTER: Fig 6.8 .

9 .Stock maintenance system OUTPUT: Fig :6.

11 .10 Fig :6.Stock maintenance system Fig :6.

q As Double Private Sub cmbitype_Click() Command6.Visible = False txtcname. adOpenKeyset.Enabled = True Command1.Recordset Dim p.Enabled = True Label17.Open "select itemcode from stock where itemtype=" & "'" & temp & "'".AddItem rs!itemcode rs.Enabled = True .DataSource = rs rs. adLockPessimistic While rs.Close rs.EOF <> True cmbicode. db.Open "select * from stock where itemtype= " & "'" & temp & "'".Close End Sub Private Sub Command3_Click() Command6.Clear rs. db.MoveNext Wend rs. adOpenDynamic.Stock maintenance system CODING: Dim db As New ADODB.Visible = False temp = cmbitype.Enabled = True Command1. adLockOptimistic Set MSHFlexGrid1.Text Call Reset cmbicode.Connection Dim rs As New ADODB.

Stock maintenance system Label17.Visible = False txtcname.Visible = False Call save connectme End Sub

Private Sub Command6_Click() rs1.Open "select * from itemorder ", db, adOpenKeyset, adLockOptimistic rs1.AddNew rs1!billnumber = txtbillno.Text rs1!itemcode = cmbicode.Text rs1!customername = txtcname.Text rs1!order_date = txtdate.Text rs1!orderedquantity = txtquantity.Text rs1!amount = txtamount.Text rs1.Update rs1.Close MsgBox "Item Detail Save Successfully ", , "Order Master" MsgBox "your item will be Delivered as Soon as Possible", , "Order Master" Call save Call saleanother Label17.Visible = False txtcname.Visible = False Command1.Enabled = True End Sub

Private Sub open1() rs2.Open "select * from stock where itemcode=" & "'" & cmbicode.Text & "'" & "and itemtype=" & "'" & cmbitype.Text & "'" & "and itemname=" & "'" & txtiname.Text & "'", db, adOpenKeyset, adLockOptimistic If rs2.EOF <> True And rs2.BOF <> True Then

Stock maintenance system rs2!quantity = rs2!quantity - Val(txtquantity.Text) If rs2!quantity < 0 Then MsgBox "Sorry Not Enough Stock and you want order it " Exit Sub End If rs2.Update rs2.Close MsgBox "item quantity updated" Else MsgBox "THAT ITEM IS NOT AVIALABLE" End If rs1.Open "select * from sales ", db, adOpenKeyset, adLockOptimistic rs1.AddNew rs1!billnumber = txtbillno.Text rs1!itemtype = cmbitype.Text rs1!itemcode = cmbicode.Text rs1!itemname = txtiname.Text rs1!netweight = txtnetwt.Text rs1!sale_date = txtdate.Text rs1!quantity = txtquantity.Text rs1!price = txtprice.Text rs1!amount = txtamount.Text rs1.Update rs1.Close MsgBox "Item Detail Save Successfully", vbOKOnly, "Sales Master" If (MsgBox("sale another Item", vbYesNo + vbQuestion, "Sales Master ") = vbYes) Then Call save Call saleanother Command6.Enabled = True Else Unload Me

Stock maintenance system frmSaleentry.Show frmSaleentry.SetFocus End If

End Sub Private Sub saleanother()

rs.Open "select itemtype from stock group By itemtype ", db, adOpenKeyset, adLockOptimistic While rs.EOF <> True cmbitype.AddItem rs!itemtype rs.MoveNext Wend rs.Close rs.Open "select itemtype from stock group By itemtype ", db, adOpenKeyset, adLockOptimistic

rs.Close End Sub Private Sub save() txtcname.Text = "" cmbitype.Clear cmbicode.Clear txtiname.Text = "" txtnetwt.Text = "" txtdate.Text = "" txtdate.Text = Format$(Date, "dd/mm/yyyy") txtquantity.Text = "" txtprice.Text = "" txtamount.Text = "" End Sub

Close If x > z Then i = Val(x) i=i+1 .Open "select * from itemorder order by BILLNUMBER".BOF <> True And rs1. adLockOptimistic If rs1. db. x As Double cmdRefresh_Click connectme cmbitype.Close rs1.Enabled = True Label17.Enabled = True End Sub Private Sub increment() rs1. adOpenKeyset.Text = "" x = Val(rs1!billnumber) rs1. adLockOptimistic If rs1.Visible = False Command6.MoveLast z = Val(rs1!billnumber) z=z+1 txtbillno.Open "select * from sales order by BILLNUMBER".EOF <> True Then rs1.Stock maintenance system Private Sub Command2_Click() Dim z.Text = z rs1. adOpenKeyset.MoveLast txtbillno.EOF <> True Then rs1.BOF <> True And rs1.SetFocus Command1.Visible = False txtcname. db.

Text = 7000 rs1.Text = !itemname txtnetwt.Text = "" End Sub Private Sub cmbicode_Click() Call Reset rs.Text = "" txtamount.Close End If Else txtbillno.Text = "" txtiname.Text = "" txtprice.Text = i End If Else rs1.Close End If End Sub Public Sub Reset() txtcname.Text & "'" & " and itemcode=" & "'" & cmbicode.Text = i Else i = Val(z) i=i+1 txtbillno.Open "select * from stock where itemtype=" & "'" & cmbitype.Text = !netweight .Text = "" txtnetwt. db. adLockOptimistic With rs txtiname.Text = "" txtquantity. adOpenKeyset.Text & "'".Stock maintenance system txtbillno.

adOpenKeyset.DataSource = rs rs. adLockOptimistic Set MSHFlexGrid1. "scott".AddItem rs!itemtype rs.Text = "" cmbitype.Text = !price End With rs. adOpenKeyset.Open "select itemtype from stock group By itemtype ".Stock maintenance system txtquantity.Text = "" txtprice.Open "select itemtype from stock group By itemtype ".Clear .MoveNext Wend rs. db. db.Close rs. adLockOptimistic While rs.SetFocus End Sub Private Sub Form_Load() db.Open "arun".Clear cmbicode.Close End Sub Public Sub Resetall() txtbillno.EOF <> True cmbitype. "tiger" connectme End Sub Private Sub connectme() Call Resetall increment rs.Close txtquantity.

Text = "" txtnetwt.Text = "" txtamount.Text = "" txtprice.Text = "" txtdate.Text = "" End Sub .Stock maintenance system txtiname.Text = "" txtquantity.

12 .Stock maintenance system DELIVERY MODULE: Fig :6.

Stock maintenance system OUTPUT: Fig :6.13 .

Recordset Private Sub cmbbillno_click() temp = cmbbillno. adLockPessimistic Set MSHFlexGrid1.MoveNext Wend rs.Text cmbicode. adLockPessimistic While rs. adOpenDynamic.Close rs.14 CODING: Dim db As New ADODB. db. adOpenDynamic.DataSource = rs .AddItem rs!itemcode rs.EOF <> True cmbicode.Stock maintenance system Fig :6.Open "select billnumber.deliver from itemorder where billnumber=" & "'" & temp & "' and deliver is NULL". db.Clear rs.Connection Dim rs As New ADODB.itemcode.Open "select * from itemorder where billnumber=" & "'" & temp & "'and deliver is NULL".

EOF <> True And rs. adLockPessimistic With rs txtcname = !customername txtdate = !order_date txtoquantity = !orderedquantity txtamount = !amount End With rs. db.Close End Sub End Sub Private Sub cmbicode_Click() rs.Text & "'". adOpenDynamic. adOpenDynamic.Close End Sub Private Sub Command1_Click() Dim x.Open "select * from stock where itemcode=" & "'" & cmbicode & "'". adOpenKeyset. y As Double rs.Stock maintenance system rs.Open "select * from itemorder where itemcode=" & "'" & cmbicode.BOF <> True Then .Text & "'". db. db. adLockOptimistic x = Val(rs!quantity) If rs.Open "select * from stock where itemcode=" & "'" & cmbicode. adLockPessimistic With rs txtitype = !itemtype txtiname = !itemname txtnetwt = !netweight txtprice = !price End With rs.Close rs.

Update "deliver". db.Close rs.DataSource = rs rs. db.Text & "'" & " and billnumber=" & "'" & cmbbillno.So Delivery is not Possible " rs.Text & "'".Enabled = False MSHFlexGrid2. adOpenDynamic.Text .deliver from itemorder where billnumber=" & "'" & cmbbillno.Open "select billnumber.Update MsgBox "item is Delivered" End If rs. adOpenDynamic.Open "select * from itemorder where deliver is not NULL". adOpenDynamic. txtddate.Text & "'".Visible = True rs.Close End Sub .Text) If y < 0 Then MsgBox "Sorry Not Enough Stock.Open "select * from itemorder where itemcode=" & "'" & cmbicode.Stock maintenance system y = x .Text End With rs. adLockPessimistic Set MSHFlexGrid2.DataSource = rs End Sub Private Sub Command2_Click() Command1.Close Exit Sub End If rs!quantity = y rs. adLockPessimistic Set MSHFlexGrid1.Update "DELIVERY_DATE". adLockPessimistic With rs . txtdeliver.Close rs.Val(txtoquantity. db.Text & "'" & " and billnumber=" & "'" & cmbbillno.itemcode.

DataSource = rs MSHFlexGrid2.Open "select * from itemorder ".Open "arun".Close End Sub Private Sub Form_Load() txtddate.Enabled = False MSHFlexGrid2. "tiger" rs. adOpenDynamic.DataSource = rs rs. db.Visible = True Then MSHFlexGrid2.AddItem rs!billnumber rs.MoveNext Wend Set MSHFlexGrid1. db.Stock maintenance system Private Sub Command3_Click() Command1. "scott".Visible = True rs. adOpenKeyset.EOF <> True cmbbillno.Visible = False Else Unload Me End If End Sub Private Sub Command4_Click() Command1.Open "select billnumber from(Select * from itemorder group By billnumber)where deliver is NULL".Enabled = True If MSHFlexGrid2. adLockOptimistic While rs.Visible = False rs. "dd/mm/yyyy") db.Text = Format$(Date.Close End Sub . adLockPessimistic Set MSHFlexGrid2.

16 .Stock maintenance system REPLACING FAULT MODULE: Fig :6.15 OUTPUT: Fig :6.

AddItem rs!itemcode . adLockPessimistic While rs.Open "select billnumber. adLockPessimistic Set MSHFlexGrid1.DataSource = rs rs.Clear rs.itemcode.Open "select * from itemorder where billnumber=" & "'" & temp & "'and deliver is not NULL". db.Close End Sub Private Sub cmbbillno_click() temp = cmbbillno.EOF <> True cmbicode.AddItem rs!itemcode rs. db.Stock maintenance system CODING: Dim db As New ADODB.Open "select * from itemorder where billnumber=" & "'" & temp & "'and deliver is not NULL".EOF <> True cmbicode.Text Call Resetall cmbicode.Close rs. db. adOpenDynamic.Clear rs. adLockPessimistic While rs. adOpenDynamic.MoveNext Wend rs.Text Call Resetall cmbicode.Recordset Private Sub cmbbillno_Change() temp = cmbbillno. adOpenDynamic.Connection Dim rs As New ADODB.amount from itemorder where billnumber=" & "'" & temp & "' and deliver is not NULL".Customername.

otherwise press No".DataSource = rs rs.Open "select billnumber.Close End Sub Public Sub Resetall() cmbicode.Close If (MsgBox("If you want to Replace the item press Yes . adOpenDynamic. db. adLockPessimistic With rs txtcname = !customername txtoquantity = !orderedquantity End With rs.itemcode.Stock maintenance system rs.Open "select * from itemorder where itemcode=" & "'" & cmbicode & "'" & " and billnumber=" & "'" & cmbbillno.Text & "'".Text = "" End Sub Private Sub cmbicode_Click() rs. vbYesNo + vbQuestion.Clear txtcname. adOpenDynamic.Close rs. "Replace/Reject") = vbYes) Then .Text = "" txtnoreplace.MoveNext Wend rs.Text = "" txtoquantity.amount from itemorder where billnumber=" & "'" & temp & "' and deliver is not NULL". adLockPessimistic Set MSHFlexGrid1.Customername. db.

Text rs!customername = txtcname.DataSource = rs rs. adLockPessimistic Set MSHFlexGrid1.Enabled = False Else Command1.Text rs!Replace = Text1.Stock maintenance system Command2.Open "select billnumber.Open "select * from replace where itemcode=" & "'" & cmbicode.replace from replace where billnumber=" & "'" & cmbbillno.Visible = False txtnoreplace.Text rs!replace_date = txtdate. db. vbYesNo + vbQuestion.Text rs!itemcode = cmbicode. adOpenDynamic.Text rs!replace_quantity = txtnoreplace. . "Replace") = vbYes) Then rs. adOpenDynamic.replace_quantity .Enabled = False Label1.AddNew rs!billnumber = cmbbillno.Text rs.Update MsgBox "Replacement successfully done". "Replace" rs.Visible = False End If End Sub Private Sub Command1_Click() If (MsgBox("If you press Yes Replacement will done".Close Command2.Close rs. db.Text & "'".Text & "'". adLockPessimistic rs.Text & "'" & " and itemcode=" & "'" & cmbicode.itemcode.Enabled = True End If End Sub .Text & "'" & " and billnumber=" & "'" & cmbbillno.

replace from replace where billnumber=" & "'" & cmbbillno.Text rs!customername = txtcname.Close rs. db. vbYesNo + vbQuestion. "Reject" rs.Text & "'".DataSource = rs rs.itemcode. adOpenDynamic.Stock maintenance system Private Sub Command2_Click() If (MsgBox("Are you sure want to Reject".Update MsgBox "Replacement not done".Enabled = True Label1.Text & "'".Visible = True txtnoreplace.Visible = True .Text rs!replace_quantity = 0 rs!replace_date = txtdate.Close Command1.Text rs!Replace = Text2. .Text & "'" & " and billnumber=" & "'" & cmbbillno.replace_quantity .AddNew rs!billnumber = cmbbillno. adLockPessimistic rs.Open "select * from replace where itemcode=" & "'" & cmbicode.Open "select billnumber. "Reject") = vbYes) Then rs.Visible = True txtnoreplace.Visible = True End If End Sub Private Sub Command4_Click() cmbbillno.Clear Label1.Text rs. adLockPessimistic Set MSHFlexGrid1. adOpenDynamic.Text rs!itemcode = cmbicode.Text & "'" & " and itemcode=" & "'" & cmbicode. db.

adOpenKeyset. "tiger" rs. "scott".Open "select billnumber.itemcode.AddItem rs!billnumber rs. adOpenKeyset. "dd/mm/yyyy") End Sub . adLockOptimistic Set MSHFlexGrid1.Open "arun".Close txtdate.Enabled = True Command2.Stock maintenance system Command1.customername from (replace full outer join itemorder using (billnumber.DataSource = rs rs.Text = Format$(Date. db.Close Call Form_Load End Sub Private Sub Form_Load() db.Open "select billnumber from(select * from(replace full outer join itemorder using ( billnumber))where replace is null and deliver is not null )group By billnumber".itemcode))where replace is null and deliver is not null ".MoveNext Wend rs.EOF <> True cmbbillno. db. adLockOptimistic While rs.Enabled = True Call Resetall db.Close rs.customername.

2) .2) SALES MODULE: NAME BILLNUMBER ITEMTYPE ITEMCODE ITEMNAME NETWEIGHT SALE_DATE QUANTITY PRICE AMOUNT NULL? TYPE NUMBER(35) VARCHAR2(60) NUMBER(35) VARCHAR2(60) VARCHAR2(50) DATE NUMBER(35) NUMBER(35) NUMBER(10.Stock maintenance system TABLES DESIGN STOCK MODULE: NAME ITEMTYPE ITEMCODE ITEMNAME NETWEIGHT DATE_OF_ENTRY QUANTITY PRICE NULL? TYPE VARCHAR2(60) NUMBER(35) VARCHAR2(100) VARCHAR2(70) DATE NUMBER(35) NUMBER(10.

Stock maintenance system DELIVERY MODULE: NAME BILLNUMBER ITEMCODE CUSTOMERNAME ORDER_DATE DELIVERY_DATE ORDERED QUANTITY AMOUNT DELIVER NUMBER(10.2) VARCHAR2(50) NULL? TYPE NUMBER(35) NUMBER(35) VARCHAR2(60) DATE DATE VARCHAR2(60) REPLACE MODULE: NAME BILLNUMBER ITEMCODE CUSTOMERNAME REPLACE_DATE REPLACE_QUANTITY REPLACE NULL? TYPE NUMBER(35) NUMBER(35) VARCHAR2(60) DATE VARCHAR2(60) VARCHAR2(68) .

In future we will enhance this project by making our system to store the details of the customer such as the house address to make the door delivery which is an easy and quick way. The important thing is that the software should be flexible enough for further modifications. CONCLUSION AND FUTURE ENHANCEMENT 8. .Stock maintenance system 8. 8.2 FUTURE ENHANCEMENT There is always a room for the improvement in any software package. however good and efficient it may be.it also gives idea about how stocks are to be purchased and how to be maintained in a company.1 CONCLUSION Thus the project gives the detailed explanation about how stock is maintained in an organization.

 ³Oracle The complete Reference´ by George Koch and Kevin Loney.v3schools . REFERENCE 9.Stock maintenance system 9.epay.0´ by Francesco Balena.NET Framework Black Book´ by Temple man and Vitter 9.  ³Visual Studio .com .com  www.1 REFERENCE BOOKS  ³Programming in Microsoft Visual Basic 6.2 REFERENCE WEBSITES  www.NET :The .

Sign up to vote on this title
UsefulNot useful