0% found this document useful (0 votes)
19 views9 pages

Project

Uploaded by

eugenearmoh24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views9 pages

Project

Uploaded by

eugenearmoh24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

GHANA COMMUNICATION TECHNOLOGY UNIVERSITY (GCTU)

FACULTY OF COMPUTING AND INFORMATION SYSTEMS

DEPARTMENT OF INFORMATION SYSTEMS

ASSIGNMENT FIVE

CICS 314: ADVANCED VISUAL BASIC .NET PROGRAMMING

STUDENT INFORMATION
INDEX NUMBER: 4211223612
FULL NAME: JOHN RICHMOND ABBAN
PROGRAMME: BSC INFORMATION TECHNOLOGY
LEVEL: 300
SESSION: GROUP A
LECTURER: DR. FORGOR LEMPOGO
QUESTION 1: DESIGNING THE DATA GRID VIEW USER INTERFACE.
Create a new form that will allow you to search for any user using their ID
number. It should have a data grid view to show you each record and its data.

THE SCREENSHOT OF USER INTERFACE FOR QUESTION/FUNCTION 1 (test


results)

The data grid view form for the access database above.

CODE FOR QUESTION/FUNCTION 1:


Imports System.Data
Imports System.Data.OleDb

Public Class newForm5


Private Sub newForm5_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
'TODO: This line of code loads data into the
'Contact_DBDataSet.Person_TB' table. You can move, or remove it, as needed.
Me.Person_TBTableAdapter.Fill(Me.Contact_DBDataSet.Person_TB)
End Sub

Private Sub Person_TBBindingNavigatorSaveItem_Click(sender As Object, e


As
EventArgs) Handles Person_TBBindingNavigatorSaveItem.Click
Me.Validate()
Me.Person_TBBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Contact_DBDataSet)
End Sub

Private Sub FillByP_IDToolStripButton_Click(sender As Object, e As


EventArgs) Handles FillByP_IDToolStripButton.Click
Try

Me.Person_TBTableAdapter.FillByP_ID(Me.Contact_DBDataSet.Person_TB,
New System.Nullable(Of Integer)(CType(P_IDToolStripTextBox.Text, Integer)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub btnViewAll_Click(sender As Object, e As EventArgs) Handles


btnViewAll.Click
Me.Person_TBTableAdapter.Fill(Me.Contact_DBDataSet.Person_TB)
End Sub

Private Sub FillByVendorIDToolStripButton_Click(sender As Object, e As


EventArgs) Handles FillByVendorIDToolStripButton.Click
Try
Me.Person_TBTableAdapter.Fill(Me.Contact_DBDataSet.Person_TB)
Catch ex As OleDbException
MessageBox.Show("OleDb error #" & ex.ErrorCode & ": " & ex.Message,
ex.GetType.ToString)
End Try
End Sub
End Class

QUESTION 2: DESIGNING THE DATA GRID VIEW USER INTERFACE.

Create a new form that will allow you to view the call’s details and the
message’s details. It should also show the user record in textbox above.
THE SCREENSHOT OF USER INTERFACE FOR QUESTION/FUNCTION 2 (test
results)

The data grid view allowing you to see view the message and see the call detail.

CODE FOR QUESTION/FUNCTION 2:


Public Class newForm6
Private Sub Person_TBBindingNavigatorSaveItem_Click(sender As Object, e
As
EventArgs) Handles Person_TBBindingNavigatorSaveItem.Click
Me.Validate()
Me.Person_TBBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Contact_DBDataSet)
End Sub

Private Sub newForm6_Load(sender As Object, e As EventArgs) Handles


MyBase.Load
'TODO: This line of code loads data into the
'Contact_DBDataSet.Message_TB' table. You can move, or remove it, as needed.
Me.Message_TBTableAdapter.Fill(Me.Contact_DBDataSet.Message_TB)
'TODO: This line of code loads data into the 'Contact_DBDataSet.Call_TB'
table. You can move, or remove it, as needed.
Me.Call_TBTableAdapter.Fill(Me.Contact_DBDataSet.Call_TB)
'TODO: This line of code loads data into the
'Contact_DBDataSet.Person_TB' table. You can move, or remove it, as needed.
Me.Person_TBTableAdapter.Fill(Me.Contact_DBDataSet.Person_TB)
End Sub
Private Sub Call_TBDataGridView_CellContentClick(sender As Object, e As
DataGridViewCellEventArgs) Handles Call_TBDataGridView.CellContentClick
If e.ColumnIndex = 5 Then
' View Call button clicked
' Get the ID of the selected Message
Dim i As Integer = e.RowIndex
Dim row As DataGridViewRow =
Call_TBDataGridView.Rows(i)
Dim cell As DataGridViewCell = row.Cells(1)
Dim Call_ID As String = cell.Value
' Display the newForm7 form
Dim callForm As New newForm7
callForm.Tag = Call_ID
callForm.ShowDialog()
End If
End Sub

Private Sub Message_TBDataGridView_CellContentClick(sender As Object, e


As
DataGridViewCellEventArgs) Handles
Message_TBDataGridView.CellContentClick
If e.ColumnIndex = 4 Then
' View Message button clicked
' Get the ID of the selected Message
Dim i As Integer = e.RowIndex
Dim row As DataGridViewRow =
Message_TBDataGridView.Rows(i)
Dim cell As DataGridViewCell = row.Cells(1)
Dim Message_ID As String = cell.Value
' Display the newForm8 form
Dim messageForm As New newForm8
messageForm.Tag = Message_ID
messageForm.ShowDialog()
End If
End Sub
End Class
QUESTION 3: DESIGNING THE DATA GRID VIEW USER INTERFACE.
Create a new form that will be opened when the user clicks the view call button.
It should show the user’s call history for that particular call in textboxes.

THE SCREENSHOT OF USER INTERFACE FOR QUESTION/FUNCTION 3 (test


results)

CODE FOR QUESTION/FUNCTION 3:


Public Class newForm7
Private Sub Call_TBBindingNavigatorSaveItem_Click(sender As Object, e As
EventArgs) Handles Call_TBBindingNavigatorSaveItem.Click
Me.Validate()
Me.Call_TBBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Contact_DBDataSet)
End Sub
Private Sub newForm7_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
'TODO: This line of code loads data into the 'Contact_DBDataSet.Call_TB'
table. You can move, or remove it, as needed.
Me.Call_TBTableAdapter.Fill(Me.Contact_DBDataSet.Call_TB)

Dim Call_ID As String = Me.Tag


Try
Me.Call_TBTableAdapter.FillByC_ID(Me.Contact_DBDataSet.Call_TB,
CType(Call_ID, Integer))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub

End Class
QUESTION 4: DESIGNING THE DATA GRID VIEW USER INTERFACE.
Create a new form that will be opened when the user clicks the view message
button. It should show the user’s message content and its IDs (for the message
and the sender).

THE SCREENSHOT OF USER INTERFACE FOR QUESTION/FUNCTION 4 (test


results)

CODE FOR QUESTION/FUNCTION 4:


Public Class newForm8
Private Sub Message_TBBindingNavigatorSaveItem_Click(sender As Object, e
As
EventArgs) Handles Message_TBBindingNavigatorSaveItem.Click
Me.Validate()
Me.Message_TBBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Contact_DBDataSet)
End Sub

Private Sub newForm8_Load(sender As Object, e As EventArgs) Handles


MyBase.Load
'TODO: This line of code loads data into the
'Contact_DBDataSet.Message_TB' table. You can move, or remove it, as needed.

Me.Message_TBTableAdapter.Fill(Me.Contact_DBDataSet.Message_TB
)
Dim Message_ID As String = Me.Tag
Try

Me.Message_TBTableAdapter.FillByM_ID(Me.Contact_DBDataSet.Message_TB,
CType(Message_ID, Integer))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub

End Class

You might also like