8/9/2019 Ooad Documentation Mc9248
1/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
EX.NO:DATE:
QUIZ SYSTEMAIM:
To implement the Quiz System using Rational Software.
ALGORITHM:
Step 1: Identify the Actors and Use cases.
In this system,the actors and use cases are:
Actors: User ,System and Database .
Use cases: Login,Option,answering questions,calculating marks and Display score
card.
Step 2: Build the relationship between actors and use cases.The use case diagram for the quiz system is given in Fig(1).
Fig (1): Use case diagram for the Quiz System
8/9/2019 Ooad Documentation Mc9248
2/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
Step 1: Identify the objects.
In this system, the objects are: User, System and Database.
Step 2: Identify the sequence of events .
Step 3: Login to the system to check the validity.
Step 4: Select the option in the system.
Step 5: Answer the questions for the selected options
Step 6: Evaluate the answer and calculate the mark.
Step 7: Save the score in the database .
Step 8: Display the score.
Fig(2): Sequence diagram for Quiz System
USER SYSTEM DATABASE
ENTER THE LOGIN NAME
DISPLAY CATAGORIES FORM
SELECT ANY CATAGORIES
DISPLAY THE QUESTIONS
ANSWER THE QUESTIONS
DISPLAY THE SCORESTORE THE SCORE
8/9/2019 Ooad Documentation Mc9248
3/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3. ALGORITHM FOR CLASS DIAGRAM:
Step 1: Create class diagram for each identified objects under sequence diagram.
Identified objects are: User, System and Database.
Step 2 : Class diagram for each object is divided into three parts.
Top portion represents the Class Name.
Middle portion represents the Attributes.
Bottom portion represents the Methods.
The Class diagram for Quiz System is shown in Fig(3).
Fig(3):Class diagram for Quiz system
Procedure to write the software for the Quiz System using Rational Software tool
Selecting the Software:1. Click start-> Rational Software->Rational Rose Enterprise Edition.
Create the project:
2. In the Create New Model window select VB6 Standard Framework->A screen appears;select
the untitled project from the browser window and save it
To draw the diagram:
3.Right Click the Use case view->New->Use case diagram->Sequence diagram->Class
diagram(name and save the files)
4. Click Use case diagram->using the tool box build the use case diagram.
5. Click Sequence diagram->using the tool box build the sequence diagram .
6. Click Class diagram-> using the tool box build the class diagram.
8/9/2019 Ooad Documentation Mc9248
4/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Generate the coding form:
7.Right click component view -> component diagram-> open specification -> select the
stereotype as DLL-> select the language as visual basic ->switch from general tab to realizes
tab-> select the classes you created in class diagram-> right click ->Assign->Ok.
8.Right click component view -> update code form model-> the tool window for converting
diagrams to code appears->next->finish->the skeleton code in VB is generated automatically
for the class diagram designed.
8/9/2019 Ooad Documentation Mc9248
5/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE
LOGIN FORM:
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
LoginSucceeded = False
End
End Sub
Private Sub cmdOK_Click()
If txtUserName = "mca" Then
If txtPassword = "mca" Then
LoginSucceeded = True
Form1.Show
Me.Hide
Else
MsgBox "Invalid Password, try again!", vbInformation, "Login"
txtPassword.SetFocus
End If
Else
MsgBox "Invalid Username, try again!", vbInformation, "Login"
End If
8/9/2019 Ooad Documentation Mc9248
6/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End Sub
Form 1:
Private Sub Option2_Click()
Form2.Show
Me.Hide
End Sub
Private Sub Option3_Click()
Form5.Show
Me.Hide
End Sub
Private Sub Option4_Click()
Form6.Show
Me.Hide
End Sub
Form 2:
Dim a As Integer
Private Sub Command1_Click()
Text1.Text = ""
If Option2.Value = True Then
Text1.Text = Val(Text1.Text) + 10
8/9/2019 Ooad Documentation Mc9248
7/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Else
Text1.Text = Val(Text1.Text) + 0
End If
Frame2.Visible = True
Frame1.Visible = False
End Sub
Private Sub Command2_Click()
If Option7.Value = True Then
Text1.Text = Val(Text1.Text) + 10
Else
Text1.Text = Val(Text1.Text) + 0
End If
Form3.Show
Me.Hide
End Sub
Private Sub Form_Load()
Frame2.Visible = False
End Sub
8/9/2019 Ooad Documentation Mc9248
8/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Timer1_Timer()
Me.Hide
Form1.Show
End Sub
Form 3:
Private Sub Command1_Click()
If Option4.Value = True Then
Text1.Text = Val(Text1.Text) + 10
Else
Text1.Text = Val(Text1.Text) + 0
End If
Frame2.Visible = True
Frame1.Visible = False
End Sub
Private Sub Command2_Click()
If Option13.Value = True Then
Text1.Text = Val(Text1.Text) + 10
8/9/2019 Ooad Documentation Mc9248
9/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Else
Text1.Text = Val(Text1.Text) + 0
End If
Form8.Show
Me.Hide
End Sub
Private Sub Form_Load()
Frame2.Visible = False
End Sub
RESULT FORM:
Dim db As Database
Dim rs As Recordset
Private Sub Command1_Click()
rs(0) = lable2.Caption
rs(1) = Text1.Text
rs(2) = Text2.Text
AddNew
End Sub
8/9/2019 Ooad Documentation Mc9248
10/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
If Form1.Option2.Value = True Then
Label2.Caption = Val(Form3.Text1.Text) + Val(Form2.Text1.Text)
ElseIf Form1.Option3.Value = True Then
End If
End Sub
Private Sub Form_Load()
MDIForm1.Label1.Caption = ""
MDIForm1.Picture1.Visible = False
Set db = OpenDatabase("D:\PROJECTS\tittu pro\RESULT.MDB")
Set rs = db.OpenRecordset("res")
End Sub
8/9/2019 Ooad Documentation Mc9248
11/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
OUTPUT:
LOGIN FORM :
FORM 1:
8/9/2019 Ooad Documentation Mc9248
12/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 2:
8/9/2019 Ooad Documentation Mc9248
13/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 3:
8/9/2019 Ooad Documentation Mc9248
14/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
RESULT FORM:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
8/9/2019 Ooad Documentation Mc9248
15/138
8/9/2019 Ooad Documentation Mc9248
16/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
Step1: Identify the objects.
In this System, the objects are: User, System and Database.
Step2: Identify the sequence of events.
Step3: Login to the system to check the validity.
Step4: Select the option in the system.
Step5: For the user to deposit or withdraw the amount ,they should enter the option in the
System.
Step6: The System will do the corresponding processing with proper Updation in the Database.
Step7: Finally the balance is displayed to the user.
The sequence diagram for ATM System is give4n in Fig(2).
Fig (2): Sequence diagram for ATM System
8/9/2019 Ooad Documentation Mc9248
17/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3. ALGORITHM FOR CLASS DIAGRAM:
Step1: Create class diagram for each identified objects under sequence diagram.
Identified objects are: User, System and Database.
Step2: Class diagram for each object is divided into three parts.
Top portion represents the Class name.
Middle portion represents the Attributes.
Bottom portion represents the methods.
The class diagram for ATM system is shown in Fig (3).
Fig (3): class diagram for ATM system
8/9/2019 Ooad Documentation Mc9248
18/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Procedure to write the software for the ATM system using rational Software tool
Selecting the Software:
1. Click start Rational Software Rational Rose Enterprise Edition.
Create the project:
2. In the Create New model window select VB6 Standard Framework A screen appears;select the untitled project from the browser window and save it.
To draw the diagram:
3. Right Click the use case view New Use case diagram Sequence diagram class diagram(name and save the files)
4. Click use case diagram using the tool box build the use case diagram.
5. Click sequence diagram using the tool box build the sequence diagram.
6. Click class diagram using the tool box build the class diagram.
Generate the coding form:
7.Right click Component view component diagram Open specification select the Stereotypeas DLL Select the language as Visual Basic Switch from General tab to Realize tab Selectthe classes you created in class diagram right click Assign Ok.
8. Right click component view update code from model the tool window for convertingdiagrams to code appears next Finish the skeleton code in VB is generated automatically
for the class diagram.
8/9/2019 Ooad Documentation Mc9248
19/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
PINPROCESS CODING:
Dim DB As Database
Dim RS As RecordsetDim A As Integer
Private Sub Command1_Click()
A = Val(Text1.Text)
RS.MoveFirst
While (True)
If Val(A) = Val(RS(3)) Then
form2.Show
GoTo AA
Else
RS.MoveNext
End If
If RS.EOF = True Then
MsgBox "YOUR PIN NUMBER IS WRONG"
GoTo AA
End If
Wend
AA:
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("E:\atm\STORAGE.mdb")
Set RS = DB.OpenRecordset("CUSDET")
End Sub
8/9/2019 Ooad Documentation Mc9248
20/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
DISPLAY CODING:
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()RS.MoveFirst
While (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
Form3.Show
GoTo AA
Else
RS.MoveNext
End If
Wend
AA:
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub Command3_Click()
Form5.Show
End Sub
Private Sub Command4_Click()
Form6.Show
End Sub
Private Sub Command6_Click()
Form1.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
21/138
8/9/2019 Ooad Documentation Mc9248
22/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Form_Load()
Set DB = OpenDatabase("E:\atm\STORAGE.mdb")
Set RS = DB.OpenRecordset("CUSDET")
RS.MoveFirstWhile (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
Label2.Caption = RS(4)
Label4.Caption = RS(5)
GoTo AA
Else
RS.MoveNext
End If
Wend
AA:
End Sub
WITHDRAW CODING:
Dim DB As Database
Dim RS As Recordset
Dim B As Double
Private Sub Command1_Click()
B = 0
B = Val(Text1.Text)
RS.MoveFirst
While (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
If (Val(B) > Val(RS(4))) Then
8/9/2019 Ooad Documentation Mc9248
23/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
MsgBox "YOUR BALANCE IS LOW"
Text1.Text = ""
Text1.SetFocus
GoTo BBElse
MsgBox "TAKE YOUR CASH "
Text1.Text = ""
B = Val(RS(4)) - Val(B)
RS.Edit
RS(4) = Val(B)
RS(5) = Val(RS(4))
RS.Update
GoTo AA
End If
Else
RS.MoveNext
End If
Wend
AA:
BB:
Form1.Show
Form1.Text1.Text = ""
Form1.Text1.SetFocus
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Form1.Show
8/9/2019 Ooad Documentation Mc9248
24/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("E:\atm\STORAGE.mdb")
Set RS = DB.OpenRecordset("CUSDET")Text1.Text = ""
End Sub
MOBILE NUMBER CHANGE CODING:
Dim DB As Database
Dim RS As Recordset
Dim B As Double
Private Sub Command1_Click()
B = 0
B = Val(Text1.Text)
RS.MoveFirst
While (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
If (Val(B) > Val(RS(4))) Then
MsgBox "YOUR BALANCE IS LOW"
Text1.Text = ""
Text1.SetFocus
GoTo BB
Else
MsgBox "TAKE YOUR CASH "
Text1.Text = ""
B = Val(RS(4)) - Val(B)
RS.Edit
8/9/2019 Ooad Documentation Mc9248
25/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
RS(4) = Val(B)
RS(5) = Val(RS(4))
RS.Update
GoTo AAEnd If
Else
RS.MoveNext
End If
Wend
AA:
BB:
Form1.Show
Form1.Text1.Text = ""
Form1.Text1.SetFocus
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("E:\atm\STORAGE.mdb")
Set RS = DB.OpenRecordset("CUSDET")
Text1.Text = ""
End Sub
8/9/2019 Ooad Documentation Mc9248
26/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
PIN NUMBER CHANGE CODING:
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()RS.MoveFirst
While (True)
If Val(Text1.Text) = Val(RS(3)) Then
MsgBox "PIN ALREADY EXIST"
Text1.Text = ""
GoTo BB
Else
RS.MoveNext
End If
If RS.EOF = False Then
GoTo CC
End If
Wend
CC:
RS.MoveFirst
While (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
RS.Edit
RS(3) = Val(Text1.Text)
Form1.Text1.Text = Val(Text1.Text)
RS.Update
MsgBox "YOUR PIN NO WILL BE CHANGE"
Text1.Text = ""
8/9/2019 Ooad Documentation Mc9248
27/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
GoTo AA
Else
RS.MoveNext
End IfWend
AA:
Form1.Show
Form1.Text1.Text = ""
Unload Me
BB:
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Form1.Show
End Sub
Private Sub Form_Activate()
RS.MoveFirst
While (True)
If Val(Form1.Text1.Text) = Val(RS(3)) Then
Label2.Caption = RS(3)
GoTo AA
Else
RS.MoveNext
End If
Wend
AA:
End Sub
8/9/2019 Ooad Documentation Mc9248
28/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Form_Load()
Set DB = OpenDatabase("E:\atm\STORAGE.mdb")
Set RS = DB.OpenRecordset("CUSDET")
End Sub
8/9/2019 Ooad Documentation Mc9248
29/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
OUTPUT:
PIN NUMBER PROCESS FORM:
MENU FORM:
8/9/2019 Ooad Documentation Mc9248
30/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
BALANCE ENQUIRY FORM:
WITHDRAW FORM:
8/9/2019 Ooad Documentation Mc9248
31/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
PIN NUMBER CHANGE FORM:
MOBILE NUMBER CHAGE FORM:
8/9/2019 Ooad Documentation Mc9248
32/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
CHECK YOUR BALANCE FORM:
CHECK YOUR PIN NUMBER:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
8/9/2019 Ooad Documentation Mc9248
33/138
8/9/2019 Ooad Documentation Mc9248
34/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
Step 1: Identify the objects.
In this system,the objects are:Admin,User,Book entry,Search,Return,Issue,Strock.
Step 2: Identify the sequence of events.
Step 3: Collect the information from catalogue.
Step 4: Save the details in database
Step 5: Display the result.
The Sequence diagram for for Library Management System is given in Fig(2).
Fig(2):Sequence diagram for Library Management System
Admin User Book entry Search Return Issue Stock
Enter Book Detail
Enter Book Id
Book Found
Book Request
Book Issued
Enter bookid
Book Returned
Add Book To Stock
8/9/2019 Ooad Documentation Mc9248
35/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3. ALGORITHM FOR CLASS DIAGRAM:
Step 1: Create class diagram for each identified objects under sequence diagram.
Identified objects are:User and Admin.
Step 2: Create diagram for each object is divided into three parts.
Top portion represents the Class Name.
Middle portion represents the Attributes.
Bottom portion represents the Methods.
The Class diagram for Library Management system is shown in Fig(3).
Fig(3): Class diagram for Library Management System
8/9/2019 Ooad Documentation Mc9248
36/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Procedure to write the software for the Management System using Rational Software Tool
Selecting the Software:
1.Click start-> Rational Software->Rational Rose Enterprise Edition.
Create the project:
2.In the Create New Model window select VB^ Standard Framework->A screenappears;select the untitled project from the browser window and save it.
To draw the diagram:
3.Right Click the Use case view->New->Use case diagram->Sequence diagram->Classdiagram(name and save the files)
4.Click Use case diagram->Using the toolbox build the Usecase diagram.5.Click Sequence diagram->Using the tool box build the Sequence diagram.
6.Click Class diagram->Using the tool box build the class diagram.
8/9/2019 Ooad Documentation Mc9248
37/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
FORM 1:
Private Sub Command1_Click()
If Combo1.Text = "ADMIN" And Text1.Text = "123" Then
MDIForm1.Show
ElseIf Combo1.Text = "USER" And Text1.Text = "stud" Then
Form5.Show
Else
MsgBox ("INCORRECT LOGIN")
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem ("ADMIN")
Combo1.AddItem ("USER")
End Sub
FORM 2:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim db1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim a As Integer
8/9/2019 Ooad Documentation Mc9248
38/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command1_Click()
a = Text3.Text
rs.MoveFirst
While (rs.EOF = False)
If (a = rs(0)) Then
rs1.AddNew
rs1(0) = rs(0)
rs1(1) = rs(1)
rs1(2) = rs(2)
rs1(3) = rs(3)
rs1(4) = rs(4)
rs1.Update
rs.Delete
MsgBox ("BOOK ISSUED")
End If
rs.MoveNext
Wend
rs.MoveLast
If (a = rs(0)) Then
rs1.AddNew
rs1(0) = rs(0)
8/9/2019 Ooad Documentation Mc9248
39/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
rs1(1) = rs(1)
rs1(2) = rs(2)
rs1(3) = rs(3)
rs1(4) = rs(4)
rs1.Update
rs.Delete
MsgBox ("BOOK ISSUED")
End If
End Sub
Private Sub Command2_Click()
MDIForm1.Show
End Sub
Private Sub Form_Load()
db.CursorLocation = adUseClient
db.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs.Open "book", db, adOpenDynamic, adLockOptimistic
db1.CursorLocation = adUseClient
db1.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs1.Open "issued", db, adOpenDynamic, adLockOptimistic
End Sub
8/9/2019 Ooad Documentation Mc9248
40/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim db1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim a As Integer
Private Sub Command1_Click()
a = Text3.Text
rs.MoveFirst
While (rs.EOF = False)
If (a = rs(0)) Then
rs1.AddNew
rs1(0) = rs(0)
rs1(1) = rs(1)
rs1(2) = rs(2)
rs1(3) = rs(3)
rs1(4) = rs(4)
rs1.Update
rs.Delete
MsgBox ("BOOK ISSUED")
End If
rs.MoveNext
8/9/2019 Ooad Documentation Mc9248
41/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Wend
rs.MoveLast
If (a = rs(0)) Then
rs1.AddNew
rs1(0) = rs(0)
rs1(1) = rs(1)
rs1(2) = rs(2)
rs1(3) = rs(3)
rs1(4) = rs(4)
rs1.Update
rs.Delete
MsgBox ("BOOK ISSUED")
End If
End Sub
Private Sub Command2_Click()
MDIForm1.Show
End Sub
Private Sub Form_Load()
db.CursorLocation = adUseClient
db.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
8/9/2019 Ooad Documentation Mc9248
42/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
rs.Open "book", db, adOpenDynamic, adLockOptimistic
db1.CursorLocation = adUseClient
db1.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs1.Open "issued", db, adOpenDynamic, adLockOptimistic
End Sub
FORM 3:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim db1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim b As Integer
Private Sub Command1_Click()
b = Text3.Text
rs1.MoveFirst
While (rs1.EOF = False)
If (b = rs1(0)) Then
rs.AddNew
rs(0) = rs1(0)
rs(1) = rs1(1)
rs(2) = rs1(2)
8/9/2019 Ooad Documentation Mc9248
43/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
rs(3) = rs1(3)
rs(4) = rs1(4)
rs.Update
rs1.Delete
MsgBox ("BOOK RETURNED")
End If
rs1.MoveNext
Wend
rs1.MoveLast
If (b = rs1(0)) Then
rs.AddNew
rs(0) = rs1(0)
rs(1) = rs1(1)
rs(2) = rs1(2)
rs(3) = rs1(3)
rs(4) = rs1(4)
rs.Update
rs1.Delete
MsgBox ("BOOK RETURNED")
End If
End Sub
8/9/2019 Ooad Documentation Mc9248
44/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command2_Click()
MDIForm1.Show
End Sub
Private Sub Command3_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
End Sub
Private Sub Form_Load()
db.CursorLocation = adUseClient
db.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs.Open "book", db, adOpenDynamic, adLockOptimistic
db1.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs1.Open "issued", db, adOpenDynamic, adLockOptimistic
End Sub
FORM 4:
Private Sub Command1_Click()
Form4.Show
End Sub
Private Sub Command2_Click()
8/9/2019 Ooad Documentation Mc9248
45/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Form3.Show
End Sub
Private Sub BOOKENTRY_Click()
Form2.Show
End Sub
Private Sub EXIT_Click()
End
End Sub
Private Sub ISSUE_Click()
Form3.Show
End Sub
Private Sub RETURN_Click()
Form4.Show
End Sub
Private Sub SEARCH_Click()
DataReport1.Show
End Sub
Private Sub STOCK_Click()
DataReport1.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
46/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
OUTPUT:
USER LOGIN FORM:
8/9/2019 Ooad Documentation Mc9248
47/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
MDI FORM:
8/9/2019 Ooad Documentation Mc9248
48/138
8/9/2019 Ooad Documentation Mc9248
49/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
BOOK ISSUE FORM:
8/9/2019 Ooad Documentation Mc9248
50/138
8/9/2019 Ooad Documentation Mc9248
51/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
DATAREPORT FORM:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
8/9/2019 Ooad Documentation Mc9248
52/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
EX.NO:DATE:
TICKET RESERVATION SYSTEM
AIM
To implement the Ticket Reservation System using Rational Software.
ALGORITHM
1. ALGORITHM FOR USE CASE DIAGRAM (TICKET RESERVATION):
Step1: Identify the Actors and Usecases.
In the system ,the actors and use cases are:
Actors :Passenger,System,and Database.
Usecases :Details,seats available,reservation of ticket,and
Print the journey of reservation ticket.
Step2: Build the relationship between actors.
The Use case diagram for Ticket Reservation is given in fig(1).
View_and_print_the_journey_r...
Information_Cancellation
Seats _Available
Reservation_of_Ticket
Reserve_the_Ticket
Passenger
Database
Sys
Fig(1):Use case Diagram for Ticket Reservation
8/9/2019 Ooad Documentation Mc9248
53/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR USE CASE DIAGRAM (TICKET CANCELLATION):
Step1: Identify the Actors and Usecases .
In the system ,the actors and use cases are:
Actors :Passenger,System,and Database.
Use cases: cancellation of ticket,cancel the ticket,view the cancelled details.
Step2 : Build the relationship between actors and use cases.
The Use case diagram for Ticket Cancellation is given in fig(2).
passenger sys
database
Cancellation_of_Ticket
Cancel_the _Ticket
View_and_Print_Cancelled_Details
Fig(2):Use case Diagram for Ticket Cancellation
8/9/2019 Ooad Documentation Mc9248
54/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3. ALGORITHM FOR SEQUENCE DIAGRAM (TICKET RESERVATION):
Step1: Identify the objects.
In this system,the odjects are:Passenger,System Database and Reservation.
Step2: Identify the sequence of events.
Step3: Select the required information for reservation.
Step4: Perforn the reservation process.
Step5: Save the details in database.
Step6: Send the details to the system .
Step7: View and print the journey of reservation ticket details .
The Sequence diagram for Ticket Reservation is given in fig(3).
passenger system database reservation
1.Get the seat availablity
2.Provide details
3.Select information to reserve 4.Perform the reservation process
5.Save the details
6.Send the details
7.View and print the journey of reservation
Fig(3):Sequence diagram for Ticket Reservation
8/9/2019 Ooad Documentation Mc9248
55/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
4. ALGORITHM FOR SEQUENCE DIAGRAM (TICKET CANCELLATION):
Step1: Identify the objects.
In this system,the objects are:Passenger,System Database and Cancellation .
Step2: Identify the sequence of events .
Step3: Enter the PNR number.
Step4: Perform the cancellation process .
Step5: Send the details to the system.
Step6: View the completion process of ticket cancellation .
The Sequence diagram for Ticket Cancellation is given in fig(4).
passenger
system database cancellation
1.Enter the PNR no
2.Perform the cancellation process
3.Cancel the ticket
4.Send the details
5.View and print the cancellation process
ig(4):Sequence diagram for ticket cancellation
8/9/2019 Ooad Documentation Mc9248
56/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
5. ALGORITHM FOR CLASS DIAGRAM (TICKET RESERVATION):
Step1: Create class diagram for each identified Objects under sequence diagram.
Identified objects are:User,System and Database and reservation.
Step2: Class diagram for each object is divided into three parts.
Top portion represents the class Name.
Middle portion represents the Attributes.
Bottom portion represents the Methods.
The Class diagram for Ticket Reservation is shown in fig(5).
8/9/2019 Ooad Documentation Mc9248
57/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
6. ALGORITHM FOR CLASS DIAGRAM (TICKET CANCELLATION):
Step1: Create class diagram for each identified Objects under sequence diagram.
Identified objects are:User,System and Database and reservation.
Step2: Class diagram for each object is divided into three parts.
Top portion represents the class Name.
Middle portion represents the Attributes.
Bottom portion represents the Methods.
The Class diagram for Ticket Cancellation is shown in fig(6).
8/9/2019 Ooad Documentation Mc9248
58/138
8/9/2019 Ooad Documentation Mc9248
59/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
FORM 1:
Private Sub Command1_Click()
If Text1.Text = "online" And Text2.Text = "mca" Then
MsgBox "WELCOME"
Form2.Show
Form1.Hide
Else
MsgBox "INVALIDE LOGIN"
End If
End Sub
FORM 2:
Private Sub Command1_Click()
Form2.Hide
Form3.Show
End Sub
Private Sub Command2_Click()
Form2.Hide
Form4.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
60/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command3_Click()
Form2.Hide
Form6.Show
End Sub
FORM 3:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Add_Click()
rs.AddNew
rs(0) = Combo1.Text
rs(1) = Text1.Text
rs(2) = Text2.Text
rs(3) = Text3.Text
rs(4) = Text4.Text
rs(5) = Text5.Text
rs(6) = Text6.Text
rs(7) = Text7.Text
rs(8) = Text8.Text
rs(9) = Text9.Text
MsgBox "new Record Added"
End Sub
8/9/2019 Ooad Documentation Mc9248
61/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command1_Click()
rs.MoveFirst
Combo1.Text = rs(0)
Text1.Text = rs(1)
Text2.Text = rs(2)
Text3.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
Text9.Text = rs(9)
End Sub
Private Sub Command2_Click()
rs.MovePrevious
Combo1.Text = rs(0)
Text1.Text = rs(1)
Text2.Text = rs(2)
Text3.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
8/9/2019 Ooad Documentation Mc9248
62/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
Text9.Text = rs(9)
End Sub
Private Sub Command3_Click()
rs.MoveNext
Combo1.Text = rs(0)
Text1.Text = rs(1)
Text2.Text = rs(2)
Text3.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
Text9.Text = rs(9)
End Sub
Private Sub Command4_Click()
rs.MoveLast
Combo1.Text = rs(0)
8/9/2019 Ooad Documentation Mc9248
63/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text1.Text = rs(1)
Text2.Text = rs(2)
Text3.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
Text9.Text = rs(9)
End Sub
Private Sub Command5_Click()
rs.Delete
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
8/9/2019 Ooad Documentation Mc9248
64/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text9.Text = ""
End Sub
Private Sub Command6_Click()
Form2.Show
Form3.Hide
End Sub
Private Sub Command7_Click()
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Command8_Click()
DataReport2.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
65/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Delete_Click()
rs.Delete
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Form_Load()
db.CursorLocation = adUseClient
db.Open "Provider=MSDAORA.1;User ID=scott;password=tiger;Data Source=oracle;Persist
Security Info=False"
rs.Open "details", db, adOpenDynamic, adLockOptimistic
Combo1.Text = rs(0)
Text1.Text = rs(1)
Text2.Text = rs(2)
8/9/2019 Ooad Documentation Mc9248
66/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text3.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
Text9.Text = rs(9)
End Sub
Private Sub Home_Click()
Form3.Hide
Form2.Show
End Sub
FORM 4:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Combo1_Click()
Select Case Combo1.Text
Case "Vaigai Express"
Text4.Text = "TN 28/1234"
Text5.Text = "Chennai"
Text6.Text = "Kovai"
8/9/2019 Ooad Documentation Mc9248
67/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text7.Text = "7.00AM"
Text8.Text = "800"
Case "Kovai Express"
Text4.Text = "TN 07/1235"
Text5.Text = "Kovai"
Text6.Text = "Delhi"
Text7.Text = "2.00PM"
Text8.Text = "1500"
Case "Blue Mountain"
Text4.Text = "TN 21/876"
Text5.Text = "Trichy"
Text6.Text = "Chennai"
Text7.Text = "5.00AM"
Text8.Text = "700"
Case "Pandiyan Express"
Text4.Text = "TN 77/0742"
Text5.Text = "Salem"
Text6.Text = "Karaikudi"
Text7.Text = "7.00Pm"
Text8.Text = "900"
End Select
8/9/2019 Ooad Documentation Mc9248
68/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End Sub
Private Sub Command1_Click()
Form4.Hide
Form2.Show
End Sub
Private Sub Command3_Click()
rs.Delete
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End Sub
8/9/2019 Ooad Documentation Mc9248
69/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command2_Click()
Form6.Show
Form4.Hide
End Sub
Private Sub Command5_Click()
rs.MoveFirst
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Combo1.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
End Sub
Private Sub Command6_Click()
rs.MovePrevious
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
8/9/2019 Ooad Documentation Mc9248
70/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Combo1.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
End Sub
Private Sub Command7_Click()
rs.MoveNext
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Combo1.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
End Sub
8/9/2019 Ooad Documentation Mc9248
71/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command8_Click()
rs.MoveLast
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Combo1.Text = rs(3)
Text4.Text = rs(4)
Text5.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Text8.Text = rs(8)
End Sub
Private Sub Form_Load()
Combo1.AddItem ("Vaigai Express")
Combo1.AddItem ("Kovai Express")
Combo1.AddItem ("Blue Mountain")
Combo1.AddItem ("Pandiyan Express")
db.CursorLocation = adUseClient
db.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=oracle;Persist
Security Info=True"
rs.Open "reser222", db, adOpenDynamic, adLockOptimistic
8/9/2019 Ooad Documentation Mc9248
72/138
8/9/2019 Ooad Documentation Mc9248
73/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
End Sub
Private Sub Command5_Click()
If Option3 = True Then
Text8.Text = "Firstclass"
ElseIf Option4 = True Then
Text8.Text = "Secondclass"
End If
8/9/2019 Ooad Documentation Mc9248
74/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
If Text8.Text = "Firstclass" Then
a = Val(Combo1.Text) * 500
b = Val(Combo2.Text) * 300
c = Val(Combo3.Text) * 250
Text7.Text = a + b + c
ElseIf Text8.Text = "Secondclass" Then
a = Val(Combo1.Text) * 300
b = Val(Combo2.Text) * 150
c = Val(Combo3.Text) * 100
Text7.Text = a + b + c
Else
MsgBox "Invalid Entry"
End If
End Sub
Private Sub Form_Load()
End Sub
Private Sub Home_Click()
Form2.Show
Form6.Hide
End Sub
8/9/2019 Ooad Documentation Mc9248
75/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Text1_Change()
Combo4.Clear
d = Val(Text1.Text) + d
For i = i To Val(d) - 1
Combo4.AddItem i + 1
Next
End Sub
8/9/2019 Ooad Documentation Mc9248
76/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
OUTPUT:
FORM 1:
8/9/2019 Ooad Documentation Mc9248
77/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 2:
8/9/2019 Ooad Documentation Mc9248
78/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 3:
8/9/2019 Ooad Documentation Mc9248
79/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 4:
8/9/2019 Ooad Documentation Mc9248
80/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 5:
8/9/2019 Ooad Documentation Mc9248
81/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
FORM 6:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
8/9/2019 Ooad Documentation Mc9248
82/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
EX.NO:DATE:
STOCK MANAGEMENT SYSTEM
AIM:
To Implement the Stock Management System using Rational Software.
ALGORITHM:
1. ALGORITHM FOR USE CASE DIAGRAM:
Step 1: Identify the actors and use cases.
In this system, the actors and use cases are:
Actors : User, System and Database.
Use cases: Login, Product in, Product Delivery, Add New Product, Updation.
Step 2: Build the relationship between actors and use cases.
The use case diagram for the stock maintenance system is given in Fig(1).
Fig (1): Use Case Diagram for Stock Management System
Product-In
login
View Stock DetailsUser
Product-Out
Return Stock
Admin
Update & Modified
8/9/2019 Ooad Documentation Mc9248
83/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
Step 1: Identify the objects.
In this system, the objects are: user, system and database.
Step 2: Identify the sequence of events.
Step 3: Login to the system to check the system.
Step 4: The user request for in products in the system.
Step 5: System show the details by making query request in database.
Step 6: Then the user may request our product in the system and for that also it will
respond by requesting the database.
Step 7: And if the user request the new product, it will be added as a new product.
Step 8: Finally confirmation is given to the user for the request product.
The sequence diagram for stock maintenance system is given in Fig (2).
8/9/2019 Ooad Documentation Mc9248
84/138
8/9/2019 Ooad Documentation Mc9248
85/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Fig (3): Class Diagram for Stock Management System
Procedure to write the software for the Stock Management System using
Rational Software.
Selecting the software:
1. Click start-> rational software -> rational rose enterprise edition.
Create the Project :
2. In the create new model window select vb6 standard framework -> A screen
appears; select the untitled project from the browser window and save it.
To draw the diagram:
3. Right click the use case view -> new -> use diagram -> sequence diagram ->
class diagram (name and save the files)
4. Click use case diagram -> using the tool box build the USECASE diagram.
5. Click sequence diagram -> using the tool box build the SEQUENCE diagram.
6. Click class diagram -> using the tool box build the CLASS diagram.
Generate the coding form:
7. Right click component view -> component diagram -> open specification ->
select the sterotype as DLL-> select the language as visual basic -> switch from
general tab to realize tab -> select the classes you created in class diagram ->
right click-> assign ->ok.
8. Right click component view-> update code fro model -> the tool window for
converting diagram to code appears -> next -> finish -> the skeleton code in VB is
generated automatically for the class diagram designed.
8/9/2019 Ooad Documentation Mc9248
86/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
LOGIN FORM:
Private Sub Command1_Click()
If Combo1.Text = "ADMIN" And Text2.Text = "mca" Then
Form3.Show
ElseIf Combo1.Text = "SUPPLIER" And Text2.Text = "mca1" Then
Form3.Show
ElseIf Combo1.Text = "CUSTOMER" And Text2.Text = "mca2" Then
Form3.Show
Else
MsgBox "Invalid"
End If
End Sub
Private Sub Form_Activate()
Combo1.Clear
Combo1.AddItem "ADMIN"
Combo1.AddItem "SUPPLIER"
Combo1.AddItem "CUSTOMER"
End Sub
Private Sub Command2_Click()
End
End Sub
8/9/2019 Ooad Documentation Mc9248
87/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
MAIN FORM:
Dim db2 As Database
Dim rs2 As Recordset
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub Command3_Click()
Form6.Show
End Sub
Private Sub Command4_Click()
If rs2.EOF = True Then
GoTo aa
End If
rs2.MoveFirst
While (True)
If rs2.EOF = False Then
Form6.Combo1.Text = rs2(0)
Form6.Label7.Caption = rs2(1)
Form6.Text1.Text = rs2(2)
Form6.Label8.Caption = rs2(3)
Form6.Label9.Caption = rs2(4)
8/9/2019 Ooad Documentation Mc9248
88/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Form6.Text2.Text = rs2(5)
Form6.Label11.Caption = rs2(6)
rs2.Delete
rs2.MoveNext
Else
GoTo aa
End If
Wend aa:
Form1.Show
End Sub
Private Sub Command5_Click()
Form8.Show
End Sub
Private Sub Command6_Click()
Form1.Show
End Sub
Private Sub Form_Activate()
If Form1.Combo1.Text = "ADMIN" and Form1. Combo1.Text = "SUPPLIER" Then
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
Command4.Visible = False
Command5.Visible = True
Command6.Visible = True
ElseIf Form1.Combo1.Text = "CUSTOMER" Then
8/9/2019 Ooad Documentation Mc9248
89/138
8/9/2019 Ooad Documentation Mc9248
90/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
MsgBox "record deleted"
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.Update
MsgBox "record is modify"
End Sub
Private Sub Command5_Click()
Form3.Show
End Sub
Private Sub Command6_Click()
DataReport1.Show
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MoveNext
End Sub
Private Sub Command8_Click()
Adodc1.Recordset.MovePrevious
End Sub
Private Sub Text5_Change()
Text6.Text = Val(Text3.Text) * Val(Text5.Text)
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\Stock project_II_MCA\product.mdb")
Set rs = db.OpenRecordset("product")
End Sub
8/9/2019 Ooad Documentation Mc9248
91/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SELECT ITEM DETAILS FORM:
Dim s As String
Dim rs As Recordset
Dim db As Database
Private Sub Combo1_Click()
s = Combo1.Text
rs.MoveFirst
While (True)
If rs(0) = s Then
Label6.Caption = rs(1)
Label7.Caption = rs(2)
Label8.Caption = rs(4)
GoTo product
Else
rs.MoveNext
End If
Wend
product:
End Sub
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Form_Activate()
Combo1.AddItem ""
8/9/2019 Ooad Documentation Mc9248
92/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Label6.Caption = ""
Label7.Caption = ""
Label8.Caption = ""
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\Stock project_II_MCA\product.mdb")
Set rs = db.OpenRecordset("product")
rs.MoveFirst
While (True)
Combo1.AddItem rs(0)
rs.MoveNext
If rs.EOF = True Then
GoTo aa
End If
Wend
aa:
End Sub
DISPATCH DETAILS FORM:
Dim db As Database
Dim rs As Recordset
Dim db1 As Database
Dim rs1 As Recordset
Dim db2 As Database
Dim rs2 As Recordset
8/9/2019 Ooad Documentation Mc9248
93/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Dim s As String
Private Sub Combo1_Click()
s = Combo1.Text
rs.MoveFirst
While (True)
If rs(0) = s Then
Label7.Caption = rs(1)
Label8.Caption = rs(3)
Label9.Caption = rs(4)
GoTo product
Else
rs.MoveNext
End If
Wend
product:
End Sub
Private Sub Command1_Click()
rs1(0) = Combo1.Text
rs1(1) = Label7.Caption
rs1(2) = Text1.Text
rs1(3) = Label8.Caption
rs1(4) = Label9.Caption
rs1(5) = Text2.Text
rs1(6) = Label11.Caption
rs1.Update
8/9/2019 Ooad Documentation Mc9248
94/138
8/9/2019 Ooad Documentation Mc9248
95/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command3_Click()
Combo1.Text = ""
Label7.Caption = ""
Text1.Text = ""
Label8.Caption = ""
Label9.Caption = ""
Text2.Text = ""
Label11.Caption = ""
rs1.AddNew
rs2.AddNew
End Sub
Private Sub Command4_Click()
DataReport4.Show
End Sub
Private Sub Command5_Click()
DataReport3.Show
End Sub
Private Sub Form_Activate()
If Form1.Combo1.Text = "ADMIN" Then
Command3.Visible = False
Command5.Visible = True
Command4.Visible = False
Command1.Visible = False
Command2.Visible = True
ElseIf Form1.Combo1.Text = "SUPPLIER" Then
8/9/2019 Ooad Documentation Mc9248
96/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Command5.Visible = True
Command4.Visible = False
Command3.Visible = False
Command1.Visible = False
Command2.Visible = True
ElseIf Form1.Combo1.Text = "CUSTOMER" Then
Command5.Visible = False
Command3.Visible = True
Command4.Visible = True
Command1.Visible = True
Command2.Visible = True
End If
rs1.AddNew
rs2.AddNew
Combo1.AddItem ""
Label7.Caption = ""
Label8.Caption = ""
Label9.Caption = ""
Label11.Caption = ""
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\Stock project_II_MCA\product.mdb")
Set rs = db.OpenRecordset("product")
8/9/2019 Ooad Documentation Mc9248
97/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Set db1 = OpenDatabase("D:\Stock project_II_MCA\adispatch.mdb")
Set rs1 = db1.OpenRecordset("adispatch")
Set db2 = OpenDatabase("D:\Stock project_II_MCA\cdispatch.mdb")
Set rs2 = db2.OpenRecordset("cdispatch")
rs.MoveFirst
While (True)
Combo1.AddItem rs(0)
rs.MoveNext
If rs.EOF = True Then
GoTo aa
End If
Wend aa:
End Sub
Private Sub Text1_Change()
Label11.Caption = Val(Text1.Text) * Val(Label9.Caption)
End Sub
RETURN DETAILS FORM:
Dim db As Database
Dim rs As Recordset
Private Sub Command1_Click()
DataReport2.Show
End Sub
Private Sub Command2_Click()
Form3.Show
8/9/2019 Ooad Documentation Mc9248
98/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End Sub
Private Sub Command3_Click()
While (True)
If rs(1) = Val(Text2.Text) Then
rs.Edit
rs(2) = Val(rs(2)) + Val(Text4.Text)
rs(5) = Val(rs(5)) + Val(Text6.Text)
rs.Update
GoTo aa
Else
rs.MoveNext
End If
Wend
aa:
Adodc1.Recordset.Update
MsgBox "Stock Returned "
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.AddNew
End Sub
Private Sub Form_Activate()
Set db = OpenDatabase("D:\Stock project_II_MCA\product.mdb")
Set rs = db.OpenRecordset("product")
End Sub
Private Sub Text5_Change()
8/9/2019 Ooad Documentation Mc9248
99/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Text6.Text = Val(Text4.Text) * Val(Text5.Text)End Sub
OUTPUT:
ADMIN ENTRY
LOGIN FORM:
MAIN FORM:
8/9/2019 Ooad Documentation Mc9248
100/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STOCK DETAILS:
SELECT ITEM DETAILS:
8/9/2019 Ooad Documentation Mc9248
101/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
RETURN STOCK DETAILS:
8/9/2019 Ooad Documentation Mc9248
102/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
CUSTOMER ENTRY
8/9/2019 Ooad Documentation Mc9248
103/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
LOGIN FORM:
MAIN FORM DETAILS:
SELECT ITEM DETAILS:
8/9/2019 Ooad Documentation Mc9248
104/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
DISPATCH DETAILS:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
EX.NO:
8/9/2019 Ooad Documentation Mc9248
105/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
DATE:STUDENT INFORMATION SYSTEM
AIM:
To implement the Student information system using Rational Software.
ALGORITHM:
ALGORITHM FOR USE CASE DIAGRAM:
Step1: Identify the actors and use cases.
In the system, the actors and use cases are:
Actors: Student, system, and database.
Use cases: fill the input form, validity check, retrieve marks, calculation, and view andtotal marks, percentage, and grade.
Step2: Build the relationship between actors and use cases.
The use case diagram for the student information system is given in Fig (1).
Fig (1): use case diagram for the student information system.
8/9/2019 Ooad Documentation Mc9248
106/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
Step1: Identify the objects.
In this system, the objects are student, system database and mark processing.
Step2: Fill the input form.
Step3: Store the details in database.
Step4: Perform the computation.
Step 5 : Return the computed values to the database.
Step 6: Save the details in database.
Step7: Display the result.
The sequence diagram for student information system is given in fig (2).
fig (2): Sequence diagram for Student information
8/9/2019 Ooad Documentation Mc9248
107/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3. ALGORITHM FOR CLASS DIAGRAM:
Step1: Create class diagram for each identified objects under sequence diagram.
Identified objects are: User, system and database.
Step 2: Class diagram for each object is divided into three parts. Top portion represents the class name.
Middle portion represents the attributes.
Bottom portion represents the methods.
The class diagram for student information system is shown in fig (3).
fig (3): The class diagram for student information system .
8/9/2019 Ooad Documentation Mc9248
108/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Procedure to write software for the student information system using rational software tool
Selecting the software:
1. Click start rational software rational rose enterprise edition.
Create the project:
2. In the create new model window select VB6 standard framework A screen appears;
select the untitled project from the
browser window and save it.
Draw the diagram:
3. Right click the use case view New use case diagram sequence diagram class
diagram (name and save the files)
4. Click use case diagram using the tool box build the use case diagram.
5. Click sequence diagram using the tool box build the sequence diagram.
6. Click class diagram using the tool box build the class diagram.
Generate the coding form:
7. Right click component view component diagram open specification select the
stereotype as DLL select the
language as visual basic switch from general tab to release tab select the classes
view created in class diagram right . click assign ok.
8. Right click component view Update code from model the tool window for
converting diagrams to code
Appears nex9t finish the skeleton code in VB is generated automatically for class
diagram designed.
8/9/2019 Ooad Documentation Mc9248
109/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
LOGIN:
Private Sub Command1_Click()
If Combo1.Text = "student" And Text2.Text = "mca" Then
Form2.Show
Text2.Text = ""
Else
If Combo1.Text = "staff" And Text2.Text = "mca" Then
Form4.Show
Text2.Text = ""
Else
If Combo1.Text = "admin" And Text2.Text = "mca" Then
Form5.Show
Text2.Text = ""
Else
MsgBox ("Try Agin")
End If
End If
End If
End Sub
Private Sub Form_Load()
8/9/2019 Ooad Documentation Mc9248
110/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Combo1.AddItem "staff"
Combo1.AddItem "student"
Combo1.AddItem "admin"
End Sub
STUDENT RECORD:
Dim DB As Database
Dim rs As Recordset
Dim a As Integer
Private Sub Command1_Click()
a = Val(Text1.Text)
While (True)
Form3.Show
If rs(0) = a Then
Form3.Label4 = rs(0)
Form3.Label10 = rs(1)
Form3.Label11 = rs(2)
Form3.Label12 = rs(3)
Form3.Label13 = rs(4)
Form3.Label14 = rs(5)
Form3.Label15 = rs(6)
GoTo aa
8/9/2019 Ooad Documentation Mc9248
111/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Else
rs.MoveNext
End If
Wend
aa:
End Sub
Private Sub Command2_Click()
Text1.Text = ""
End Sub
Private Sub Command3_Click()
form1.Show
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("F:\mohan\New folder\student.mdb")
Set rs = DB.OpenRecordset("stu")
End Sub
8/9/2019 Ooad Documentation Mc9248
112/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STUDENT RECORD VIEW:
Dim DB1 As Database
Dim rs1 As Recordset
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Command2_Click()
DataReport1.Show
End Sub
Private Sub Form_Load()
Set DB1 = OpenDatabase("F:\mohan\New folder\student.mdb")
Set rs1 = DB1.OpenRecordset("stu")
End Sub
STUDENT INFORMATION:
Dim DB As Database
Dim rs As Recordset
Dim a As Integer
Dim b As Integer
Private Sub Command1_Click()
Data1.Recordset.AddNew
End Sub
8/9/2019 Ooad Documentation Mc9248
113/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command2_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
MsgBox "Record Saved"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = "”
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Command3_Click()
a = Text3.Text
b = Text4.Text
Text5.Text = Val(a) + Val(b)
Text6.Text = Text5.Text / 2
If Val(a) > 50 And Val(b) > 50 Then
Text7.Text = "pass"
Else
Text7.Text = "fail"
8/9/2019 Ooad Documentation Mc9248
114/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End If
a = 0
b = 0
End Sub
Private Sub Command5_Click()
form1.Show
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("F:\mohan\New folder\student.mdb")
Set rs = DB.OpenRecordset("stu")
End Sub
ADMIN:
Private Sub Command1_Click()
Form6.Show
End Sub
Private Sub Command2_Click()
Form7.Show
End Sub
Private Sub Command3_Click()
form1.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
115/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STAFF PERSONAL INFORMATION:
Private Sub Command1_Click()
Form5.Show
End Sub
Private Sub Command2_Click()
Data1.Recordset.AddNew
End Sub
Private Sub Command3_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
MsgBox "Record is saved"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
8/9/2019 Ooad Documentation Mc9248
116/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STUDENT PERSONAL INFORMATION:
Private Sub Command1_Click()
Form5.Show
End Sub
Private Sub Command2_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
MsgBox "Record is saved"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command3_Click()
Data1.Recordset.AddNew
End Sub
8/9/2019 Ooad Documentation Mc9248
117/138
8/9/2019 Ooad Documentation Mc9248
118/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STUDENT RECORD VIEW:
DATA REPORT:
8/9/2019 Ooad Documentation Mc9248
119/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STUDENT INFORMATION:
ADMIN:
8/9/2019 Ooad Documentation Mc9248
120/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
STAFF PERSONAL DETAILS:
STUDENT PERSONAL DETAILS:
RESULT:
Thus the above program has been successfully completed and drawn in Rational Rose.
8/9/2019 Ooad Documentation Mc9248
121/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
EX. NO:
DATE:
PAYROLL PROCESSING
AIM:
To Implement the Payroll Processing using Rational Software.
ALGORITHM:
1. ALGORITHM FOR USE CASE DIAGRAM:
STEP1: Identify the Actors and Use Cases.
In the system, actors and use cases are:
Actors: Employee, Administrator, System and Database.
Use cases: Employee details, validity check, payroll processing, view and print the salary
details.
STEP2: Build the relationship between actors and Use case.The use case diagram for the payroll
processing is given in Fig(1).
Fig(1):Use case diagram for the payroll processing
8/9/2019 Ooad Documentation Mc9248
122/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
2. ALGORITHM FOR SEQUENCE DIAGRAM:
STEP 1: Identify the objects.
In this system, the objects are: Employee, Administrator, System and Database.
STEP 2: Identify the sequence of events.
STEP 3: Enter the employee ID.
STEP 4: Perform the computation.
STEP 5: Return the computed values to the database.
STEP 6: Save the details in database.
STEP 7: View and print the salary details.
The Sequence diagram for payroll processing is given in Fig (2).
Fig (2): Sequence diagram for payroll processing
8/9/2019 Ooad Documentation Mc9248
123/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
3: ALGORITHM FOR CLASS DIAGRAM:
STEP 1: Create class diagram for each identified objects under sequence diagram.
Identified objects are: Employee, Administrator, System and Database.
STEP 2: Class diagram for each object is divided into three parts.
Top portion represents the class Name.
Middle portion represents the Attributes.
Bottom portion represents the Methods.
The Class diagram for Payroll Processing shown in Fig (3).
Fig (3):class diagram for payroll processing
8/9/2019 Ooad Documentation Mc9248
124/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Procedure to write the software for the payroll processing using Rational software tool
Selecting the Software:
1.Click start Rational Software Rational Rose Enterprise Edition.
Create the project:
2.In the Create New Model window select VB6 Standard Framework A screen appears;select the
untitled project from the browser window and save it
To draw the diagram:
3.Right Click the Use case view New Use case diagram Sequence diagram Class diagram(name
and save the files)
4.Click Use case diagram Using the tool box build the use case diagram.
5.Click Sequence diagram using the tool box build the sequence diagram.
6.Click Class diagram Using the tool box build the class diagram.
Generate the coding form:
7.Right click Component view component diagram open specification select the Stereotype as
DLL Select the language as Visual basic Switch from General tab to Realizes tab Select the
classes you created in class diagram right click Assign OK.
8.Right click Component view Update code from model the tool window for converting diagrams to
code appears next Finish the skeleton code in VB is generated automatically for the class diagram
designed.
8/9/2019 Ooad Documentation Mc9248
125/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
SOURCE CODE:
LOGIN PROCESS:
Dim db As Database
Dim rs As Recordset
Private Sub Command2_Click()
Data1.Recordset.update
MsgBox "RECORDS ARE SUCCESSFULLY UPDATED"
End Sub
Private Sub Command3_Click()
admin.Show
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
Data1.Visible = False
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.mdb")
Set rs = db.OpenRecordset("emp1")
End Sub
8/9/2019 Ooad Documentation Mc9248
126/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
ADMIN PROCESS:
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.mdb")
Set rs = db.OpenRecordset("emp1")
End Sub
Private Sub Label2_Click()
addemp.Show
End Sub
Private Sub Label3_Click()
delete.Show
End Sub
Private Sub Label4_Click()
update.Show
End Sub
Private Sub Label5_Click()
login.Show
End Sub
8/9/2019 Ooad Documentation Mc9248
127/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
ADDING EMPLOYEE PROCESS:
Dim db As Database
Dim rs As Recordset
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs(7) = Text8.Text
rs(8) = Text9.Text
rs(10) = Text10.Text
rs(9) = Text11.Text
rs.update
MsgBox "RECORD IS ADDED"
End Sub
8/9/2019 Ooad Documentation Mc9248
128/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command3_Click()
admin.Show
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
rs.AddNew
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
Data1.Visible = False
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.MDB")
Set rs = db.OpenRecordset("emp1")
End Sub
8/9/2019 Ooad Documentation Mc9248
129/138
8/9/2019 Ooad Documentation Mc9248
130/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.mdb")
Set rs = db.OpenRecordset("emp1")
End Sub
UPDATING PROCESS:
Dim db As Database
Dim rs As Recordset
Private Sub Command2_Click()
Data1.Recordset.update
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs(7) = Text8.Text
rs(8) = Text9.Text
rs(10) = Text10.Text
rs(9) = Text11.Text
MsgBox "RECORDS ARE SUCCESSFULLY UPDATED"
8/9/2019 Ooad Documentation Mc9248
131/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
End Sub
Private Sub Command3_Click()
admin.Show
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Command5_Click()
rs.Edit
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs(7) = Text8.Text
rs(8) = Text9.Text
rs(10) = Text10.Text
rs(9) = Text11.Text
End Sub
8/9/2019 Ooad Documentation Mc9248
132/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Data1_Validate(Action As Integer, Save As Integer)
Data1.Visible = False
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.mdb")
Set rs = db.OpenRecordset("emp1")
End Sub
SEARCH EMPLOYEES FORM:
Dim db As Database
Dim rs As Recordset
Dim a As Integer
Private Sub Command1_Click()
'a = Form9(rs(0))
rs.MoveFirst
While (True)
If Val(Text1.Text) = Val(rs(0)) Then
empdetails.Show
empdetails.Label2.Caption = rs(0)
empdetails.Label10.Caption = rs(1)
empdetails.Label11.Caption = rs(2)
empdetails.Label12.Caption = rs(3)
8/9/2019 Ooad Documentation Mc9248
133/138
8/9/2019 Ooad Documentation Mc9248
134/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
Private Sub Command3_Click()
admin.Show
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\CASE TOOLS\emp.MDB")
Set rs = db.OpenRecordset("emp1")
End Sub
8/9/2019 Ooad Documentation Mc9248
135/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
OUTPUT:
ADMIN LOGIN FORM:
ADMINISTRATOR FORM:
8/9/2019 Ooad Documentation Mc9248
136/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
EMPLOYEE FORM:
DELETE FORM:
8/9/2019 Ooad Documentation Mc9248
137/138
WWW.VIDYARTHIPLUS.COM
WWW.VIDYARTHIPLUS.COM V+ TEAM
UPDATE FORM:
EMPLOYEE ADMIN FORM:
8/9/2019 Ooad Documentation Mc9248
138/138
WWW.VIDYARTHIPLUS.COM
EMPLOYEE SEARCH FORM:
EMPLOYEE DETAILS: