39266312-Ooad-Record

110
TAMILNADU COLLEGE OF ENGINEERING KARUMATHAMPATTI COIMBATORE – 641 659 LABORATORY RECORD Name : …………………………………………… Class : …………………………………………… Branch : …………………………………………… Subject : ……………………………………………. UNIVERSITY REGISTER NO. ROLL NO. This is to certify that this is a bonafide record of work done by the above student in Laboratory during the academic year/semester STAFF IN-CHARGE HEAD OF THE DEPARTMENT Submitted for the practical examination held on …………………………………………. INTERNAL EXAMINER EXTERNAL EXAMINER

Transcript of 39266312-Ooad-Record

Page 1: 39266312-Ooad-Record

TAMILNADU COLLEGE OF ENGINEERING

KARUMATHAMPATTI

COIMBATORE – 641 659

LABORATORY RECORD

Name : ……………………………………………

Class : ……………………………………………

Branch : ……………………………………………

Subject : …………………………………………….

UNIVERSITY REGISTER NO. ROLL NO.

This is to certify that this is a bonafide record of work done by the above student in

Laboratory during the academic year/semester

STAFF IN-CHARGE HEAD OF THE DEPARTMENT

Submitted for the practical examination held on ………………………………………….

INTERNAL EXAMINER EXTERNAL EXAMINER

Page 2: 39266312-Ooad-Record

STUDENTS MARKS ANALYSIS SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

5. Screen Shots

Page 3: 39266312-Ooad-Record

STOCK MAINTENANCE SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

5. Screen Shots

Page 4: 39266312-Ooad-Record

PAYROLL MANAGEMENT SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

Page 5: 39266312-Ooad-Record

STUDENT MARKS ANALYZING SYSTEM

Page 6: 39266312-Ooad-Record

STUDENT MARKS ANALYZING SYSTEM

PROGRAM ANALYSIS AND PROJECT PLANNING:

Thorough study of the problem:

The student marks analyzing system is developed for easy analysis of marks and it can be accessed by any person like students, staffs etc…

The student has following features:• Authentication to login to the system, a username and password is

asked.• It also contains the details of students like name, roll no, dept,

Semester marks etc• Students can view their analyzed report. It gives all details about

his/her marks.

Identify project scope

• Any person like student, staff, etc can view marks and reports.• Authentication is provided using password and username of both student and

staffs.

Objectives:

To design a model for the Student Marks analyzingsystem using UML and generate code using VB.

Infrastructure:

a) Hardware Requirements :PCb) Software Requirements:

• Platform: Windows xp/98/me• Front end tool: Microsoft Visual Basic 6.0• Back end tool: Microsoft access

MODULES:

The modules of the project are • Login• Student details• Student mark details

Page 7: 39266312-Ooad-Record

MODULE DELIVERABLES

Login:

Brief description:

The use case describes hoe a user logs into student information management system.

Flow of events:

\1. Basic flow:

• The use case sorts when the user wishes to log into the system.

• The system request the actor to enter his/her name and password

• The actor enters name and password.

• The system validates the entered name and password and logs into the system.

2. Alternate flow:

• invalid name/password

If in the basic flow the actor enters the invalid name or password the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• The actor should select any category

5. Post condition:

• If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

Page 8: 39266312-Ooad-Record

Student details:

Brief description

This use case allows the user to maintain student information in the student details and generate the report .This includes adding, searching, updating student detail from the system.

Add:

Flow of events:

1. Basic flow:

• The use case adds when the user wishes to add the student details in the database system.

• The system request the actor to enter student details

• The actor enters student details

• The system validates will save the student details into the database system.

• If the user selects add function then add sub flow is executed

2. Alternate flow:

• invalid data item

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• use case will connect to the entry form interface.

5. Post condition:

• If the use case was successful, the actor is now adding the student details into the database system. If not the system state is unchanged

Page 9: 39266312-Ooad-Record

Search:

Flow of events:

1. Basic flow

• When the user wants to search particular record from system he can initialize search function.

• If the user selects search function then search sub flow is executed.

2. Alternate flow:

• invalid data item

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• use case will connect to the search form interface.

5. Post condition:

• If the use case was successful, then actor will search the particular record and display the student details. If not, the system state is unchanged.

Update:

Flow of events:

1. Basic flow

• When the user wants to update particular record from system he can initialize update function.

• If the user selects update function then update sub flow is executed.

2. Alternate flow:

• invalid data item

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

Page 10: 39266312-Ooad-Record

3. Special requirements:

• None

4. Precondition:

• use case will connect to the update form interface.

5. Post condition:

• If the use case was successful, the actor is now update the student details and saves that into the database system. If not, the system state is unchanged.

Delete:

Flow of events:

1. Basic flow

• When the user wants to delete particular record from system he can initialize delete function.

• If the user selects delete function then delete sub flow is executed.

2. Alternate flow:

• invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• use case will connect to the delete form interface.

5. Post condition:

• If the use case was successful, then actor will delete the particular record and display the student details. If not, the system state is unchanged.

GENERATING USE CASE DIAGRAM ,CLASS DIAGRAM , STATE CHART DIAGRAM , ACTIVITY DIAGRAM USING RATIONAL ROSE

Page 11: 39266312-Ooad-Record

DESCRIPTION:

(i) Use Case diagram:

It shows some of the use cases, actors in the Student InformationSystem and the relationships between them.

Use case is a high level piece of functionality that the system will provide.An actor is anything or anyone that interacts with the system being built

(ii) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(iii) State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:1. Right click the desired class in the browser.2. Select “open state diagram” from the pop up menu.

Adding states:

1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should appear.

To add an activity:

1. Open a specification window for the desired state.2. Select the detail lab.3. Right click on the actins box.4. Select “insert” from the pop up menu.5. Double click the new action. Enter the action in the actions field.6. In the when box, select “enter until exit” to make the new action an activity.

USE CASE DIAGRAM

Page 12: 39266312-Ooad-Record

U p d a t e R e c o r d

S t u d e n t V ie w R e c o rd

A d d R e c o rd

S e a rc h R e c o rd

D e le t e R e c o rd

S t a ff

L o g in

U s e rn a m e & P a s s w o rd

U s e rn a m e & P a s s w o rd

E n t e r D e t a i l s

E n t e r R e g n o .

E n t e r R e g n o .

CLASS DIAGRAM

Page 13: 39266312-Ooad-Record

S e a r c h R e c o r d

n a m er e g n od e p ts e m _ m a r k s

s e a r c h ( )

D e l e t e R e c o r d

n a m er e g n od e p ts e m _ m a r k s

d e l e t e ( )

V i e w R e c o r d

n a m er e g n od e p ts e m _ m a r k s

d i s p l a y ( )

S t u d e n t M a r k l i s t A n a l y s i s S y s t e m

A d d R e c o r d

n a m er e g n od e p ts e m _ m a r k s

a d d ( )

ACTIVITY DIAGRAM

ACTIVITY DIAGRAM FOR STUDENT

Page 14: 39266312-Ooad-Record

S tu de n t M a rk lis t

E n t e r R e g n o .

D is p la y E rro r M e s s a g e

D is p la y R e c o rd

R e g n o fou n d ?

Y e s

N o

ACTIVITY DIAGRAM FOR STAFF

Page 15: 39266312-Ooad-Record

Student Mark lis t

E nter Type

Add Record

S earch Record

Delete Rec ord

Enter Details

V iew Rec ord

Delete Detail

P rovide E rror Message

Reg no Found?

Y es

Reg no Found?Reg no Found?

Y esNo

Y es NoNo

STATE CHART DIAGRAMS

Add Record:

Page 16: 39266312-Ooad-Record

Chec k ing

Rejec ted

Add to Database

/ get s tudent Regno.

Regno not found

Regno found

Search Record:

Checking

Rejected

Display Details

/ get student Regno.

Valid Regno

Invalid Regno

Delete Record:

Page 17: 39266312-Ooad-Record

Checking

Rejected

Delete Record

/ get student Regno.

Valid Regno

Invalid Regno

View Record:

Checking

Rejected

View Record

/ get student Regno.

Valid Regno

Invalid Regno

GENERATING SEQUENCE DIAGRAM,COLLABORATION DIAGRAM,COMPONENT DIAGRAM ,DEPLOYMENT DIAGRAM USING RATIONAL ROSE

Page 18: 39266312-Ooad-Record

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1. Right click the appropriate package/use case in the browser. 2. From the short cut menu,select new -> Sequence diagram.3. Name the new sequence diagram.4. Double-click the new sequence diagram in the browser to open it.

To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram.2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams,collaboration diagrams are used to show the flow through a specific scenario of a use case. collaborations diagrams focus on more on the relationship between the objects, While sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser.2. From the short cut menu, select new->collaboration diagram.3. Name the new collaboration diagram.4. double click the new collaboration diagram in the browser to open it.

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

(iii) Component Diagram:

The component diagram is a uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files.once the components are created, they are added to a component diagram and relationships are

Page 19: 39266312-Ooad-Record

drawn between them.the only type of a relationship between components is a dependency.a dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser ,Right click the package to contain the component diagram.2. select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1.In the browser , Right click the component diagram.2. Select delete from the pop up menu.

iv)Deployment diagram:

A deployment diagram shows allow the modes on the network,the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser. 2 .Rose will open the deployment diagram for the model.

Adding processors:A processor is any machine that has a processing power.

To add a processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

To Delete a processor from the Model:

1. Select the processor on the deployment diagram.2. Select edit -> Delete from model or press ctrl+D.

Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals,printers and scanners.

To add a device:

1. Select device from the toolbox.2. Click the deployment to place the device.3. Enter the name of the device.

To Delete a device from the model:

Page 20: 39266312-Ooad-Record

1. Select the device on the deployment diagram.2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:

A connection is a physical link between two processors., two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox.2. Click on the node to connect.3. Drag the connection link to another node.

To Delete a connection from the model:

1. Select the connection on the deployment diagram.2. Select edit -> Delete from model or press ctrl + d

SEQUENCE DIAGRAM

ADD RECORD SEQUENCE DIAGRAM

Page 21: 39266312-Ooad-Record

Staff System Database

1.Request to Add

2.Enter Regno.

3.Check Regno.

4.Check Database

5.Return Status

6.Details Added

7.Terminate

SEQUENCE RECORD FOR SEARCH RECORD

Page 22: 39266312-Ooad-Record

Staff System Database

1.Request to Search

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.Details Displayed

7.Terminate

SEQUENCE DIAGRAM FOR DELETE RECORD

Staff System Database

1.Request to Delete

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.Details Deleted

7.Terminate

SEQUENCE DIAGRAM FOR VIEW RECORD

Page 23: 39266312-Ooad-Record

Student System Database

1.Request to View Record

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.View Record

7.Terminate

COLLABORATION DIAGRAM S;

Collaboration Diagram for Add Record:

Staff System

Database

1: 1.Request to Add

2: 2.Enter Regno.

3: 3.Check Regno.4: 4.Check Database

5: 5.Return Status

6: 6.Details Added

7: 7.Terminate

Collaboration Diagram for Search Record:

Page 24: 39266312-Ooad-Record

Staff System

Database

1: 1.Request to Search

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.Details Displayed

7: 7.Terminate

Collaboration Diagram for Delete Record:

Staff System

Database

1: 1.Request to Delete

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.Details Deleted

7: 7.Terminate

Collaboration Diagram for view Record:

Page 25: 39266312-Ooad-Record

Student System

Database

1: 1.Request to View Record

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.View Record

7: 7.Terminate

COMPONENT DIAGRAM:

Login

Student Details

Database

DEPLOYMENT DIAGRAM:

Page 26: 39266312-Ooad-Record

Database

Add Search Delete View

StaffStudent

RATIONAL ROSE IMPLEMENTATION

Page 27: 39266312-Ooad-Record

PROCEDURE:

REVERSE ENGINEERING:

1. Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3. Right click on project1 properties and select project for which code should be

generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS: FORM1: HOME PAGE

Private Sub Command1_Click()Form2.ShowEnd Sub

Private Sub Command2_Click()Form13.ShowEnd Sub

Private Sub Command3_Click()EndEnd Sub

FORM2 : STAFF LOGINPrivate Sub Command1_Click()If (Text1.Text = "STAFF" And Text2.Text = "STAFF") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form3.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()Me.HideEnd Sub

FORM 3:STUDENT DETAILSPrivate Sub Command1_Click()

Page 28: 39266312-Ooad-Record

Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command4_Click()Dim a, f As Integera = InputBox("ENTER REG.NO TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("REG NO") = Val(a)) Thenf = 1Data1.Recordset.DeleteMsgBox ("RECORD DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form4.ShowEnd Sub

Private Sub Command6_Click()Me.Hide

Page 29: 39266312-Ooad-Record

End Sub

FORM 4: SEM1 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form4.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form5.ShowEnd Sub

FORM 5: SEM2 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDo

Page 30: 39266312-Ooad-Record

If (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form5.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form6.ShowEnd Sub

FORM 6:SEM 3 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()

Page 31: 39266312-Ooad-Record

Form6.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form7.ShowEnd Sub

FORM7 : SEM 4 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form7.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form8.ShowEnd Sub

FORM 8:SEM 5 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()

Page 32: 39266312-Ooad-Record

Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form8.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form9.ShowEnd Sub

FORM 9: SEM 6 DERAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Page 33: 39266312-Ooad-Record

Private Sub Command5_Click()Form9.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form10.ShowEnd Sub

FORM10:SEM 7Private Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form10.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form511.ShowEnd Sub

FORM 11: SEM 8Private Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Page 34: 39266312-Ooad-Record

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form11.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form12.ShowEnd Sub

FORM 12:STUDENT RECORDPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Page 35: 39266312-Ooad-Record

Private Sub Command2_Click()Form12.Text11.Text = (Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text)) / 8End Sub

Private Sub Command3_Click()Form1.ShowEnd Sub

FORM 13: STUDENT LOGINPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command2_Click()Form12.Text11.Text = (Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text)) / 8End Sub

Private Sub Command3_Click()Form1.ShowEnd Sub

FORM 14:STUD MARK LISTPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNext

Page 36: 39266312-Ooad-Record

Loop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command2_Click()EndEnd Sub

Page 37: 39266312-Ooad-Record

OUTPUT

FORM1:HOME PAGE:

FORM2:STAFF LOGIN:

FORM3: STUDENT DETAILSADD:

Page 38: 39266312-Ooad-Record

SAVE:

SEARCH:

Page 39: 39266312-Ooad-Record

DELETE

Page 40: 39266312-Ooad-Record

FORM4: SEMESTER MARKS

Page 41: 39266312-Ooad-Record

SEARCHING STUDENT MARKS:

Page 42: 39266312-Ooad-Record

FORM13: STUDENT LOGIN

Page 43: 39266312-Ooad-Record

FORM14:STUDENTS FULL MARK LIST

Page 44: 39266312-Ooad-Record
Page 45: 39266312-Ooad-Record

Result:

Thus the implementation of STUDENT MARKS ANALYZING SYSTEM is developed in visual basic and output is tested using rational rose software.

Page 46: 39266312-Ooad-Record

STOCK MAINTENANCE SYSTEM

STOCK MAINTENANCE SYSTEM

PROGRAM ANALYSIS AND PROJECT PLANNING:

Page 47: 39266312-Ooad-Record

PROBLEM STATEMENT:

In any organization the records about stock are maintained manually. Since these activities are done manually and need regular updates to these records there is much probability of error occurrence, moreover this work is a tedious work process. The various activities involved in these types of systems are:

• Adding stock• Deleting stock• Updating stock• Searching stock

The problems faced by maintaining this system manually are• While adding the product manually, there may be a chance of missing its detail in

a large database.• While deleting the product, it takes time to search that particular product in a large

database.• As we are maintaining a large database, updating a product is difficult.• The amount of time taken to search a particular product in a large database is high

if the searching is done manually.• The additional work of generating the reports on some timely basis is also

involved in this.

ANALYSIS REPORT:

In order to overcome the major flaws of the manual record maintenance the shift towards computerization of the process is mandatory .The primary objective of this project is to implement the software which is capable of maintenance of the records with simplicity and in well structured manner.

THOROUGH STUDY OF THE PROBLEM:

• Stock maintenance system has to be developed for maintaining the stock list of a stationary stock company.

• Automatic ordering of stock when the stock reaches minimum stock balance• Checking stock list for minimum balance.• Get minimum and maximum number of each product in the stock (product list of

stock list).• Products list contains product name, product id, maximum and minimum

products. • Current list contains number of items currently present in the stock o;f each

product.• Reduce the number of items in the current list, after ordering of the customer

according to the product.• Product show list of the name of the product available in the market.

.• When the current list quantity is less than for a particular product then the

product is order to the company, according to the constrain given in the product list.

• Updating the stock list and current list with the newly purchased product.

Page 48: 39266312-Ooad-Record

• In the product list, there is an additional option demand for increasing quantity of a particular product in the stock. During the time of the demand, the option should be selected.

• The system access given to the accountant, stock manager.

Identify project scope:

• The scope of the product is to maintain stock in a stationary stock company.• To calculate the available quantity of a particular product presently in the stock.• It’s easy to add to the stock list, when there is an arrival of a new product to the

super market. • When a particular product reaches a minimum level then automatically it types

letter with the required quantity of product to the product company.

Objectives:

• The main aim of the project is to maintain the stock list details & company address of each product, inform the stock manager when the action is required to be taken.

• The project avoids excess ordering of the stock and order necessary stock when the stock goes beneath the minimum level specified.

• When the particular product reaches minimum level then it should type the letter automatically to the particularly company.

Stock maintenance using UML and generate code using VB

Page 49: 39266312-Ooad-Record

PROCEDURE:

STEPS: 1. Start the process. 2. Design the Use case diagram using UML. 3. Design the Sequence diagram. 4. Obtain Collaboration diagram from Sequence diagram. 5. Design the class diagram for Hospital Management System corresponding attributes and operations. 6. Design the component diagram and choose the VB to generate code for analysis specified. 7. Design deployment diagram. 8. Link the class in class diagram with component in component diagram. 9. Update model which designed. 10. The VB code is generated. 11. Stop the process.

SYSTEM SPECIFICATION:

c) Hardware Specification:

1. A server to store all the data and for doing transaction.2. a client machine to interact with user3. a printer to print the receipts

d) Software Specification:

1. A DB server like oracle, MS SQL server.2. A front end software like VB3. A networking OS like LINUX, WINDOWS 2000 Server etc.,

MODULES:

The modules of the project are

1) Login2) Add stock details3) Delete stock details4) Search5) Update stock details6) Bill receipt.

MODULE DELIVERABLES:

1. LOGIN:

Page 50: 39266312-Ooad-Record

Brief description:

The use case describes how a user logs into stock maintenance.

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to log into the system.

• The system request the actor to enter his/her name and password

• The actor enters name and password.

• The system validates the entered name and password and logs into

2. Alternate flow:

Invalid user name/password

• If in the basic flow the actor enters the invalid name or password

• The system displays error message .the actor is providing with

• Another chance to enter corrects one or exit from the system

3. Special requirements:

• None

4. Precondition:

• The actor should select any category

5. Post condition:

• If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

2. ADD STOCK DETAILS:

Brief description:

Page 51: 39266312-Ooad-Record

The use case describes how to add the stock

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to add the stock.

• The system request the actor to enter the pr_id, pr_name, com_name, cost, quantity

• After entering the above details the system displays the message that the stock is added successfully

2. Alternate flow:

• Copy of product id.

• If we enter the already existing pr_id, it will not be added in the stock.

3. Special requirements:

• None

4. Precondition:

• The actor should enter the pr_id

5. Post condition:

• If the use case was successful, the item is now added into the system. If not the system state is unchanged

3. DELETE STOCK:

Brief description:

The use case describes how to delete the stock.

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to delete the stock.

• The system request the actor to enter the pr_id.

• After entering the pr_id the system displays the message that the stock is deleted successfully

Page 52: 39266312-Ooad-Record

2. Alternate flow:

• Invalid product id.

• If we enter the invalid pr_id, it will not be deleted from the stock.

3. Special requirements:

• None

4. Precondition:

• The actor should enter the pr_id

5. Post condition:

• If the use case was successful, the item is now deleted into the system. If not the system state is unchanged

4. SEARCH STOCK:

Brief description:

The use case describes how to search the product from stock.

Flow of events:

1.Basic flow:

• The use case sorts when the user wishes to search from the stock.

• The system requests the actor to enter the pr_name.

• After entering the pr_name the system displays details of the product.

2. Alternate flow:

• Invalid product name.

• If we enter the invalid pr_name, it will not be searched.

3. Special requirements:

• None

4. Precondition:

• The actor should enter the pr_name

Page 53: 39266312-Ooad-Record

5. Post condition:

• If the use case was successful, the items are now searched and display the details of the product.

5. UPDATE STOCK:

Brief description:

The use case describes how to update the product from stock.

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to update the stock.

• The system requests the actor to enter the pr_id.

• After entering the pr_id the system displays details of the product and updated.

2. Alternate flow:

• Invalid product name.

• If we enter the invalid pr_name, it will not be searched.

3. Special requirements:

• None

4. Precondition:

• The actor should enter the pr_name

5. Post condition:

• If the use case was successful, the items are now searched and display the details of the product.

6. PRODUCT DETAILS:

Brief description:

Page 54: 39266312-Ooad-Record

The use case describes how to display the bill for the product purchased.

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to display the product details.

• The system requests the actor to enter the quantity and name of the

• Product.

• After entering the details the product details are displayed and remaining items are shown.

2. Alternate flow:

• None.

3. Special requirements:

• None

4. Precondition:

• The actor should enter the pr_name .

5. Post condition:

• If the use case was successful, the product details.are displayed

.

GENERATING USE CASE DIAGRAM, CLASS DIAGRAM, STATE CHART DIAGRAM, ACTIVITY DIAGRAM USING RATIONAL ROSE

Page 55: 39266312-Ooad-Record

PROCEDURE:

1. Start Rational Rose Enterprise Edition.2. Create New Use case view.3. Draw the Use case diagram.4. Draw the corresponding Class diagram.5. Draw the state chart and activity diagram.6. Stop the program

DESCRIPTION:

(iv)Use Case diagram:

It shows some of the use cases, actors in the STOCK MAINTENANCE system and the relationships between them.

Use case is a high level piece of functionality that the system will provide. An actor is anything or anyone that interacts with the system being built

(v) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(vi) State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:1. Right click the desired class in the browser.2. Select “open state diagram” from the pop up menu.

Adding states:

1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should appear.

Page 56: 39266312-Ooad-Record

To add an activity:

1. Open a specification window for the desired state.2. Select the detail lab.3. Right click on the actins box.4. Select “insert” from the pop up menu.5. Double click the new action. Enter the action in the actions field.6. In the when box, select “enter until exit” to make the new action an activity.

\USE CASE DIAGRAM

Page 57: 39266312-Ooad-Record

CLASS DIAGRAM

Data base

System startup

Add Items

Delete Items

Search Items

Update Items

Bill receipt

Administrator

Switch on/off

Enter details

Enter Pr_id

Enter name

Enter Pr_id

Enter Pr_id

Customer

Page 58: 39266312-Ooad-Record

S T O C K M A IN T A IN A N C E

A D D P R O D U C Tp r _ n a m ep r _ i dc o m p _ n a m ec o s tq u a n t i t y

a d d ( )

D E L E T E P R O D U C Tp r _ n a m ep r _ i dc o m p _ n a m ec o s tq u a n t i t y

d e le t e ( )

S E A R C H P R O D U C Tp r _ n a m ep r _ idc o m p _ n a m ec o s tq u a n t i t y

s e a r c h ( )

U P D A T E P R O D U C Tp r _ n a m ep r _ idc o m p _ n a m ec o s tq u a n t i t y

u p d a t e ( )

B I L Lp r _ n a m ep r _ i dc o m p _ n a m ec o s tq u a n t i t y

b i l l ( )

Page 59: 39266312-Ooad-Record

ACTIVITY DIAGRAM

ADD RECORD ACTIVITY DIAGRAM

SEARCH RECORD ACTIVITY DIAGRAM

stock maintainance

add product

delete product

search product

update product

bill receipt

enter details

delete Items

display details

update Items

provide error

pr_id found

no

yes

pr_name found

yes

no

pr_id found

yes

no

pr_id found

yes

no

pr_name found

Stock maintaince

Enter Product id

Product id found

Enter product details

No

Error message

Yes

Page 60: 39266312-Ooad-Record

DELETE RECORD ACTIVITY DIAGRAM

STATE CHART DIAGRAM

Stock maintanence

Enter Pr_id

Pr_id found?Display Items

detailsYes

Provide Error

No

Stock maintaince

Enter Product id

Product id found

reject

No

delete details

Yes

Page 61: 39266312-Ooad-Record

ADD STOCK:

SEARCH STOCK

DELETE STOCK:

checking Add to database

rejected

/get product id

[product id not available]

[ product id present]

checking print details

rejected

/get product id

[valid product id]

[invalid product id]

checking delete details

rejected

/get product id

[valid product id]

[invalid product id]

Page 62: 39266312-Ooad-Record

GENERATING SEQUENCE DIAGRAM, COLLABORATION DIAGRAM, COMPONENT DIAGRAM, DEPLOYMENT DIAGRAM USING RATIONAL ROSE

PROCEDURE:

1. Start Rational Rose Enterprise Edition. 2. Create New Use case view. 3. Draw the use case diagram. 4. Draw the corresponding Class diagram. 5. Draw the state chart and activity diagrams. 6. Stop the program.

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1. Right click the appropriate package/use case in the browser. 2. From the short cut menu, select new -> Sequence diagram. 3. Name the new sequence diagram. 4. Double-click the new sequence diagram in the browser to open it.To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram. 2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams, collaboration diagrams are used to show the flow through a specific scenario of a use case. Collaborations diagrams focus on more on the relationship between the objects, while sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser. 2. From the short cut menu, select new->collaboration diagram. 3. Name the new collaboration diagram. 4. Double click the new collaboration diagram in the browser to open it.

Page 63: 39266312-Ooad-Record

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

(iii) Component Diagram:

The component diagram is an uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files. Once the components are created, they are added to a component diagram and relationships are drawn between them. The only type of a relationship between components is a dependency. A dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser, Right click the package to contain the component diagram.2. Select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1. In the browser, Right click the component diagram.2. Select delete from the pop up menu.

iv) Deployment diagram:

A deployment diagram shows allow the modes on the network, the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser.

2. Rose will open the deployment diagram for the model.

Adding processors:

A processor is any machine that has a processing power.

To add o processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

Page 64: 39266312-Ooad-Record

To Delete a processor from the Model:

1. Select the processor on the deployment diagram. 2. Select edit -> Delete from model or press ctrl+D.Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals, printers and scanners.

To add a device:

1. Select device from the toolbox. 2. Click the deployment to place the device. 3. Enter the name of the device.

To Delete a device from the model:

1. Select the device on the deployment diagram. 2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:A connection is a physical link between two processors. two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox. 2. Click on the node to connect.

3. Drag the connection link to another node.

To Delete a connection from the model:

1 .Select the connection on the deployment diagram. 2. Select edit -> Delete from model or press ctrl + d

Page 65: 39266312-Ooad-Record

SEQUENCE DIAGRAM

DELETE RECORD SEQUENCE DIAGRAM:

ADD RECORD SEQUENCE DIAGRAM:

System DatabaseAdministrator

1: request to delete

2: Enter pr_id3: Check for pro_id

4: Check Database

5: Return status

7: terminate

6: Item deleted

System DatabaseAdministrator

1: request to add

2: Enter details3: Check for pro_id

4: Check Database

5: Return status

7: terminate

6: Item added

Page 66: 39266312-Ooad-Record

UPDATE RECORD SEQUENCE DIAGRAM:

ADMINISTRATOR SYSTEM DATABASE

1: Request for update

2: Request Pr_id

3: Enter Pr_id

4: Check for Pr_id

5: Check Database

6: Return status

7: Request for updation

8: Update Item

9: Update Item

10: Update Database

11: Update Successful

12: Item Updated

13: Terminate

Page 67: 39266312-Ooad-Record

COLLABORATION DIAGRAM

ADD STOCK DETAILS:

A d m in is tra to r

S ys te m

D a ta b a se

4 : C h e c k d a ta b a s e

1 : re q ue s t to a d d7 : te rm ina te

2 : E n te r d e ta i ls6 : Ite m a d d e d

3 : C he c k fo r p ro _ id

5 : R e tu rn s ta tus

UPDATE STOCK DETAILS:

A D M IN IS T RA T O R

S Y S T EM

D A T A B AS E

5 : C h e c k D a ta b a s e1 0 : U p d a te D a ta b a s e

1 : R e q u e s t fo r u p d a te3 : E n te r P r _ i d8 : U p d a te Ite m1 3 : T e rm i n a te

2 : R e q u e s t P r_ i d7 : R e q u e s t fo r u p d a t i o n

1 2 : Ite m u p d a te d

4 : C h e c k fo r P r_ i d9 : U p d a te Ite m

6 : R e tu r n s ta tu s1 1 : U p d a te s u c c e s s fu l

Page 68: 39266312-Ooad-Record

DELETE RECORD FROM STOCK:

A d m i n i s t ra t o r

S y s t e m

D a t a b a se

4 : C h e c k D a t a b a s e

1 : r e q u e s t t o d e le t e7 : t e r m i n a t e

2 : E n t e r p r _ i d6 : I t e m d e le t e d

3 : C h e c k f o r p r o _ i d

5 : R e t u r n s t a t u s

Page 69: 39266312-Ooad-Record

COMPONENT DIAGRAM:

LOGIN

STOCK DETAILS

DATABASE

DEPLOYMENT DIAGRAM:

ADD STOCK

SEARCH STOCK

DELETE STOCK

SAVE STOCK

ADMIN

DATABASE

Page 70: 39266312-Ooad-Record

RATIONAL ROSE IMPLEMENTATION

PROCEDURE:

REVERSE ENGINEERING:

1.Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3.Right click on project1 properties and select project for which code should be generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS:

FORM 1:LOGIN FORM

Private Sub Command1_Click()If (Text1.Text = "STOCK" And Text2.Text = "STOCK") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form2.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()Me.HideEnd Sub

FORM 2:Private Sub Command1_Click()Form3.ShowEnd Sub

Private Sub Command2_Click()Form4.ShowEnd Sub

Private Sub Command3_Click()Form5.ShowEnd Sub

Page 71: 39266312-Ooad-Record

Private Sub Command4_Click()EndEnd Sub

FORM 3:SALES

Private Sub Form_Load()Set db = OpenDatabase("C:\STOCKK\STOCK.mdb")Set rs = db.OpenRecordset("ISSUE")End SubPrivate Sub Form_Paint()Data1.Recordset.AddNewEnd SubPrivate Sub Form_Unload(Cancel As Integer)Data1.Recordset.UpdateEnd SubPrivate Sub Command1_Click()Dim a As IntegerIf (a = Val(Text1.Text)) Thenrs.MoveFirstData1.Recordset.UpdateMsgBox "ITEM ISSUED"rs.MoveNextElseMsgBox ("ITEM CAN'T BE ISSUED")End IfEnd Sub

FORM 4: STOCK DETAILS

Private Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd SubPrivate Sub Command5_Click()Dim a, f As Integera = InputBox("Enter product id to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("PID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNext

Page 72: 39266312-Ooad-Record

Loop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("PRODUCT NOT FOUND")End IfEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("ENTER PRODUCT ID TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("PID") = Val(a)) Thenf = 1Data1.Recordset.DeleteMsgBox ("PRODUCT DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("PRODUCT NOT FOUND")End IfEnd Sub

FORM 5:PRODUCT DETAILS

Private Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd SubPrivate Sub Command3_Click()Dim a, f As Integera = InputBox("Enter product id to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("PID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)

If (f = 0) Then

Page 73: 39266312-Ooad-Record

MsgBox ("PRODUCT NOT FOUND")End IfEnd SubPrivate Sub Command4_Click()EndEnd SubPrivate Sub Command5_Click()Form2.ShowEnd Sub

Private Sub Command4_Click()Form2.ShowEnd Sub

Page 74: 39266312-Ooad-Record

OUTPUT:

LOGIN:

Page 75: 39266312-Ooad-Record

MAIN FROM: STOCK MAINTENANCE

ADD PRODUCT DETAILS:

Page 76: 39266312-Ooad-Record

SAVE PRODUCT DETAILS:

Page 77: 39266312-Ooad-Record

SEARCH PRODUCT:

Page 78: 39266312-Ooad-Record

STOCK DETAILS:ADD

SAVE:

Page 79: 39266312-Ooad-Record

SEARCH:

Page 80: 39266312-Ooad-Record

DELETE :

Page 81: 39266312-Ooad-Record

SALES DETAILS:

Page 82: 39266312-Ooad-Record

RESULT: Thus the implementation of STOCK MAINTENANCE system is developed using visual basic and output is tested using rational rose software.

Page 83: 39266312-Ooad-Record

PAYROLL SYSTEM

Page 84: 39266312-Ooad-Record

PAYROLL SYSTEM

PROGRAM ANALYSIS AND PROJECT PLANNING:

Thorough study of the problem:

The employee information management system is developed for easy maintaining employee details and it can be accessed by any person like employees, supervisors etc…

The employee has following features:• Authentication to login to the system, a username and password is

asked.• It also contains the details of employees like ename, eid, design, basic

pay , blood group, and address etc• Employees can view their analyzed report. It gives all details about

employees.

Identify project scope

• Any person like employee, supervisor, etc can view salary details.• Authentication is provided using password and username of both employee and

supervisor.

Objectives:

To design a model for the Payroll Management system using UML and generate code using VB.

Infrastructure:s

1. Hardware Requirements :PC2. Software Requirements:

• Platform: Windows xp/98/me• Front end tool: Microsoft Visual Basic 6.0• Back end tool: Microsoft access

MODULES:

The modules of the project are • Login• Employee details• Calculate Allowance

Page 85: 39266312-Ooad-Record

MODULE DELIVERABLES

Login:

Brief description:

The use case describes hoe a user logs into Payroll management system.

Flow of events:

1. Basic flow:

• The use case sorts when the user wishes to log into the system.

• The system request the actor to enter his/her name and password

• The actor enters name and password.

• The system validates the entered name and password and logs into the system.

2. Alternate flow:

• invalid name/password

If in the basic flow the actor enters the invalid name or password the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• The actor should select any category

5. Post condition:

• If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

Page 86: 39266312-Ooad-Record

Employee details:

Brief description

This use case allows the user to maintain employee information in the employee details and generate the report .This includes adding, searching, deleting employee detail from the system.

Add:

Flow of events:

1. Basic flow:

• The use case adds when the user wishes to add the employee details in the database system.

• The system request the actor to enter employee details

• The actor enters employee details

• The system validates will save the employee details into the database system.

• If the user selects add function then add sub flow is executed

2. Alternate flow:

• invalid data item

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• Use case will connect to the entry form interface.

5. Post condition:

• If the use case was successful, the actor is now adding the employee details into the database system. If not the system state is unchanged

Page 87: 39266312-Ooad-Record

Search:

Flow of events:

1. Basic flow

• When the user wants to search particular record from system he can initialize search function.

• If the user selects search function then search sub flow is executed.

2. Alternate flow:

• invalid data item

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

• None

4. Precondition:

• use case will connect to the search form interface.

5. Post condition:

• If the use case was successful, then actor will search the particular record and display the employee details. If not, the system state is unchanged.

Delete:

Flow of events:

1. Basic flow

• When the user wants to Delete particular record from system he can initialize Delete function.

• If the user selects Delete function then delete sub flow is executed.

2. Alternate flow:

• invalid data item

Page 88: 39266312-Ooad-Record

• If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system.

3. Special requirements:

• None

4. Precondition:

• use case will connect to the delete form interface.

5. Post condition:

• If the use case was successful, the actor is now delete the employee details and saves that into the database system. If not, the system state is unchanged.

Calculate Allowance:

Flow of events:

1. Basic flow

• When the user wants to calculate allowance for particular record from system he can initialize Delete function.

• If the user selects calculate allowance function then delete sub flow is executed.

2. Alternate flow:

• There is no chance for error. The allowance is calculated for existing record only.

3. Special requirements:

• None

4. Precondition:

• use case will connect to the calculate allowance form interface.

5. Post condition:

• If the use case was successful, the actor is now calculate allowance the employee details and saves that into the database system. If not, the system state is unchanged.

Page 89: 39266312-Ooad-Record

GENERATING USE CASE DIAGRAM ,CLASS DIAGRAM , STATE CHART DIAGRAM , ACTIVITY DIAGRAM USING RATIONAL ROSE

DESCRIPTION:

(vii) Use Case diagram:

It shows some of the use cases, actors in the Employee InformationSystem and the relationships between them.

Use case is a high level piece of functionality that the system will provide.An actor is anything or anyone that interacts with the system being built

(viii) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(ix) State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:Right click the desired class in the browser.Select “open state diagram” from the pop up menu.

Adding states:

1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should appear.

To add an activity:1. Select the detail lab.2. Right click on the actins box.3. Select “insert” from the pop up menu.4. Double click the new action. Enter the action in the actions field.5. In the when box, select “enter until exit” to make the new action an activity.

Page 90: 39266312-Ooad-Record

USE CASE DIAGRAM

U p d a te

L o g o n

A d d i te m s

D e le te i te m s

S e a rc h i te m s

C a lc ula te a llo w a nc e

M a na g e r

e nte r d e ta i ls

e nte r e id

e nte r e id

e nte r d e ta i ls

us e rna m e &p a s sw o rd

CLASS DIAGRAM

Page 91: 39266312-Ooad-Record

p a yro ll s ys te m

A d de n a m ee idd e s ig nb a s ic p a ya d d re s sp h o n eb lo o d g ro u p

a d d ()

D e le tee n a m ee idd e s ig nb a s ic p a ya d d re s sp h o n eb lo o d g ro u p

d e le te ()

S e a rc he n a m ee idd e s ig nb a s ic p a ya d d re s sp h o n eb lo o d g ro u p

s e a rc h ()

c a lc u la te a llo w a nc eH R ATAD M S AP F

S a la ry ()

ACTIVITY DIAGRAM

Page 92: 39266312-Ooad-Record

p a yro ll sys te m

E nte r k ind

a d d e m p D e ta i ls D e le te e m p

D e ta i lsS e a rch e m p

D e ta i lsC a lcula te a llo wa nce

V ie w sa la ry

E nte r D e ta i ls

D e le te D e ta i ls

D isp lay D e ta i ls

P ro vid e e rro r m e ssa g e

No

ye s

ye s

no

no

ye s

e id fo und ? e id found ?e id fo und ?

STATE CHART DIAGRAMS:

Page 93: 39266312-Ooad-Record

Add EmpDetails:

Checking

Rejected

Add to Database

/get eid

eid not Available

eid Present

Search EmpDetails:

Checking

Rejected

Display Details

/get eid

valid eid

invalid eid

Delete EmpDetails:

Checking

Rejected

Delete Details

/get eid

valid eid

invalid eid

GENERATING SEQUENCE DIAGRAM,COLLABORATION

Page 94: 39266312-Ooad-Record

DIAGRAM,COMPONENT DIAGRAM ,DEPLOYMENT DIAGRAM USING RATIONAL ROSE

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1.Right click the appropriate package/use case in the browser. 2.From the short cut menu,select new -> Sequence diagram.3.Name the new sequence diagram.

4.Double-click the new sequence diagram in the browser to open it.

To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram.2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams,collaboration diagrams are used to show the flow through a specific scenario of a use case. collaborations diagrams focus on more on the relationship between the objects, While sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser.2. From the short cut menu, select new->collaboration diagram.3. Name the new collaboration diagram.4. double click the new collaboration diagram in the browser to open it.

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

Page 95: 39266312-Ooad-Record

(iii) Component Diagram:

The component diagram is a uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files.once the components are created, they are added to a component diagram and relationships are drawn between them.the only type of a relationship between components is a dependency.a dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser ,Right click the package to contain the component diagram.2. select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1.In the browser , Right click the component diagram.2. Select delete from the pop up menu.

iv)Deployment diagram:

A deployment diagram shows allow the modes on the network,the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser. 2 .Rose will open the deployment diagram for the model.

Adding processors:A processor is any machine that has a processing power.

To add a processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

To Delete a processor from the Model:

1. Select the processor on the deployment diagram.2. Select edit -> Delete from model or press ctrl+D.

Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals,printers and scanners.

To add a device:

Page 96: 39266312-Ooad-Record

1. Select device from the toolbox.

2. Click the deployment to place the device.3. Enter the name of the device.

To Delete a device from the model:

1. Select the device on the deployment diagram.2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:

A connection is a physical link between two processors., two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox.2. Click on the node to connect.3. Drag the connection link to another node.

To Delete a connection from the model:

1. Select the connection on the deployment diagram.2. Select edit -> Delete from model or press ctrl + d

SEQUENCE DIAGRAM

Page 97: 39266312-Ooad-Record

ADD RECORD SEQUENCE DIAGRAM

Manager System Database

1.Request to Add Record

2.Enter Details

3.Check eid Availability

4.Check Database

5.Return Status

6.Details Added

7.Terminate

SEARH RECORD SEQUENCE DIAGRAM:

Manager System Database

1: Request to Search

2: Enter eid

3: Check for eid availability

4: Check Database

5: Return Status

6: Display Details

7: Terminate

DELETE RECORD SEQUENCE DIAGRAM

Page 98: 39266312-Ooad-Record

M anag e r S ystem D a ta b a se

1 : R eq ues t to D e le te

2 : E nte r e id

3 : C heck fo r e id a va ilab i lity

4 : C he ck D a ta ba se

5 : R e turn S ta tus

6 : D e le te D e ta ils

7 : Te rm ina te

COLLABORATION DIAGRAM:

Page 99: 39266312-Ooad-Record

Collaboration Diagram for Add EmpDetails:

Manager System

Database

4: 4.Check Database

1: 1.Request to Add Record7: 7.Terminate

2: 2.Enter Details6: 6.Details Added

3: 3.Check eid Availability

5: 5.Return Status

Collaboration Diagram for search EmpDetails:

Manager System

Database

1: Request to Search

2: Enter eid

3: Check for eid availability4: Check Database

5: Return Status

6: Display Details

7: Terminate

Collaboration Diagram for delete EmpDetails:

Page 100: 39266312-Ooad-Record

Manager System

Database

1: Request to Delete

2: Enter eid

3: Check for eid availability4: Check Database

5: Return Status

6: Delete Details

7: Terminate

COMPONENT DIAGRAM:

Log on

Emp Details

Data Base

DEPLOYMENT DIAGRAM:

Page 101: 39266312-Ooad-Record

A d d d e t a i ls D e le t e D e t a i ls

S e a r c h D e t a i l s

A l lo w a n c e D e t a i ls

m a n a g e r

RATIONAL ROSE IMPLEMENTATION

Page 102: 39266312-Ooad-Record

PROCEDURE:

REVERSE ENGINEERING:

1. Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3. Right click on project1 properties and select project for which code should be

generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS:FORM 1: LOGIN

Private Sub Command1_Click()If (Text1.Text = "PAYROLL" And Text2.Text = "PAYROLL") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form2.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()EndEnd Sub

FORM 2:EMPLOYEE DETAILSPrivate Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("RECORD ADDED")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("ENTER THE EMPID TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("EMPID") = Val(a)) Thenf = 1Data1.Recordset.Delete

Page 103: 39266312-Ooad-Record

MsgBox ("RECORD DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command4_Click()Dim a, f As Integera = InputBox("ENTER THE EMPID TO SEARCH")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("EMPID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form3.Text1.Text = Val((Text4.Text) * 0.05)Form3.Text2.Text = Val((Text4.Text) * 0.02)Form3.Text3.Text = Val((Text4.Text) * 0.02)Form3.Text4.Text = Val((Text4.Text) * 0.05)Form3.Text5.Text = Val(Text4.Text) + Val(Form3.Text1.Text) + Val(Form3.Text2.Text) + Val(Form3.Text3.Text) + Val(Form3.Text4.Text)Form3.ShowEnd Sub

Private Sub Command6_Click()Me.HideEnd Sub

FORM3:SALARYPrivate Sub Command1_Click()Me.HideEnd Sub

OUTPUT

Page 104: 39266312-Ooad-Record

Login form:

EMPLOYEE DETAILS:

Page 105: 39266312-Ooad-Record

ADD EMPLOYEE DETAILS

SAVE EMPLOYEE DETAILS

Page 106: 39266312-Ooad-Record

DELETE EMPLOYEE DETAILS

Page 107: 39266312-Ooad-Record

SEARCH EMPLOYEE DETAILS

Page 108: 39266312-Ooad-Record

ALLOWANCE CALCULATION

Page 109: 39266312-Ooad-Record
Page 110: 39266312-Ooad-Record

RESULT:

Thus the implementation of THE PAYROLL SYSTEM is developed using visual basic and output is tested using rational rose software.