Use Case Diagram
Collabration Diagram
Component Diagram
Deployment Diagram
Screen Desing in VB6.0
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rs.Open "select*from slogin", con, adOpenDynamic, adLockOptimistic
con.Execute ("insert into slogin values('" & Text1.Text & "','" & Text2.Text & "')")
MsgBox ("")
End Sub
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rs.Open "select * from slogin", con, adOpenDynamic, adLockOptimistic
Frame1.Visible = False
userADD.Visible = False
End Sub
Private Sub Label1_Click()
PurchaseFrm.Show
Unload Me
End Sub
Private Sub Label2_Click()
SalesFrm.Show
Unload Me
End Sub
Private Sub Label3_Click()
DataReport1.Show
End Sub
Private Sub OKButt_Click()
rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs.Fields("uname") And Text2.Text = rs.Fields("passwd") Then
MsgBox "Congratulations"
Frame1.Visible = True
Frame2.Visible = False
Else
MsgBox "Please Enter the Correct Username and Password"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
rs.MoveNext
Loop
End Sub
Screen Design
SOURCE CODE
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rsstk As New ADODB.Recordset
Private Sub AddButt_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rsstk.Open "select*from stkview", con, adOpenDynamic, adLockOptimistic
rs.Open "select*from purch", con, adOpenDynamic, adLockOptimistic
con.Execute ("insert into purch values(" & Text1.Text & ",'" & Text2.Text & "','" & Text3.Text & "','" & Combo1.Text & "'," & Text4.Text & "," & Text5.Text & "," & Text6.Text & ")")
MsgBox ("Stored your Purchase Details")
Dim N As Integer
N = Val(Text7)
con.Execute ("update stkview set pname='" & Combo1.Text & "',pqty=" & Text8.Text & " where pid=" & N & " ")
MsgBox ("Stock Also Updated")
Call TextClear
End Sub
Private Sub Combo1_Click()
rsstk.MoveFirst
Do While Not rsstk.EOF
If rsstk.Fields("pname") = Combo1.Text Then
Text7.Text = rsstk.Fields("pid")
Text8.Text = rsstk.Fields("pqty")
End If
rsstk.MoveNext
Loop
End Sub
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rs.Open "select * from purch", con, adOpenDynamic, adLockOptimistic
rsstk.Open "select * from stkview", con, adOpenDynamic, adLockOptimistic
Combo1.Clear
rsstk.MoveFirst
Do While Not rsstk.EOF
Combo1.AddItem (rsstk.Fields("pname"))
rsstk.MoveNext
Loop
Text7.Visible = False
Text8.Visible = False
End Sub
Private Sub Text5_LostFocus()
Text6 = Val(Text4) * Val(Text5)
Text8 = Val(Text8) + Val(Text5)
End Sub
Public Sub TextClear()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End Sub
Screen Design
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rsstk As New ADODB.Recordset
Private Sub AddButt_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rsstk.Open "select*from stkview", con, adOpenDynamic, adLockOptimistic
rs.Open "select*from sales", con, adOpenDynamic, adLockOptimistic
con.Execute ("insert into sales values(" & Text1.Text & ",'" & Text2.Text & "','" & Text3.Text & "','" & Combo1.Text & "'," & Text4.Text & "," & Text5.Text & "," & Text6.Text & ")")
MsgBox ("Stored your Sales Details")
Dim N As Integer
N = Val(Text7)
con.Execute ("update stkview set pname='" & Combo1.Text & "',pqty=" & Text8.Text & " where pid=" & N & " ")
MsgBox ("Stock Also Updated")
End Sub
Private Sub Combo1_Click()
rsstk.MoveFirst
Do While Not rsstk.EOF
If rsstk.Fields("pname") = Combo1.Text Then
Text7.Text = rsstk.Fields("pid")
Text8.Text = rsstk.Fields("pqty")
End If
rsstk.MoveNext
Loop
If Combo1.Text = "MOUSE" Then
Text4.Text = 75
ElseIf Combo1.Text = "KEYBOARD" Then
Text4.Text = 115
ElseIf Combo1.Text = "MONITOR" Then
Text4.Text = 4500
End If
End Sub
Private Sub Form_Load()
con.Open ("Provide=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rsstk.Open "select * from stkview", con, adOpenDynamic, adLockOptimistic
Cmbo1.Clear
rsstk.MoveFirst
Do While Not rsstk.EOF
Combo1.AddItem (rsstk.Fields("pname"))
rsstk.MoveNext
Loop
Text7.Visible = False
Text8.Visible = False
End Sub
Private Sub Text5_LostFocus()
Text6 = Val(Text4) * Val(Text5)
Text8 = Val(Text8) - Val(Text5)
End Sub
After Purchase and Sales - Stock Details
Dim rs As New ADODB.Recordset
Dim rsstk As New ADODB.Recordset
Private Sub AddButt_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rsstk.Open "select*from stkview", con, adOpenDynamic, adLockOptimistic
rs.Open "select*from sales", con, adOpenDynamic, adLockOptimistic
con.Execute ("insert into sales values(" & Text1.Text & ",'" & Text2.Text & "','" & Text3.Text & "','" & Combo1.Text & "'," & Text4.Text & "," & Text5.Text & "," & Text6.Text & ")")
MsgBox ("Stored your Sales Details")
Dim N As Integer
N = Val(Text7)
con.Execute ("update stkview set pname='" & Combo1.Text & "',pqty=" & Text8.Text & " where pid=" & N & " ")
MsgBox ("Stock Also Updated")
End Sub
Private Sub Combo1_Click()
rsstk.MoveFirst
Do While Not rsstk.EOF
If rsstk.Fields("pname") = Combo1.Text Then
Text7.Text = rsstk.Fields("pid")
Text8.Text = rsstk.Fields("pqty")
End If
rsstk.MoveNext
Loop
If Combo1.Text = "MOUSE" Then
Text4.Text = 75
ElseIf Combo1.Text = "KEYBOARD" Then
Text4.Text = 115
ElseIf Combo1.Text = "MONITOR" Then
Text4.Text = 4500
End If
End Sub
Private Sub Form_Load()
con.Open ("Provide=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=stk")
rsstk.Open "select * from stkview", con, adOpenDynamic, adLockOptimistic
Cmbo1.Clear
rsstk.MoveFirst
Do While Not rsstk.EOF
Combo1.AddItem (rsstk.Fields("pname"))
rsstk.MoveNext
Loop
Text7.Visible = False
Text8.Visible = False
End Sub
Private Sub Text5_LostFocus()
Text6 = Val(Text4) * Val(Text5)
Text8 = Val(Text8) - Val(Text5)
End Sub
After Purchase and Sales - Stock Details