Sie sind auf Seite 1von 100

TABLE OF CONTENTS

CHAPTER NO

TITLE ABSTRACT LIST OF TABLE LIST OF FIGURES LIST OF ABBREVATIONS

PAGE NO 8 4 5 6 7 8 13 14 14 15 15 15 15 22 23 26 29 31 31 32 33 35 36 37 37 38 39 39

1 2

INTRODUCTION 1. PROJECT OBJECTIVE SYSTEM STUDY 2.1 SYSTEM ANALYSIS AND DESIGN 2.1.1 Existing System 2.1.2 Proposed System 2.2 SYSTEM REQUIREMENT SPECIFICATION 2.2.1 Software Requirements 2.2.2 Hardware Requirements 2.2.3 Software System Attributes 2.3 SYSTEM DESIGN 2.3.1 Dataflow Diagram 2.3.2 Database Design 2.4 FEATURES OF THE PROJECT 2.5 PROJECT MODULES 2.5.1. Login Module 2.5.2 User Manager Module 2.5.3 Dispatcher Module 2.5.4 Receiver Module 2.5.5 Visitor Information Module 2.5.6 Waiting List Module 2.5.7 User List Module 2.5.8 Send Message Module 2.6 SOFTWARE TESTING 2.6.1 Unit Testing

2.6.2 Integration Testing 2.6.3 Validation Testing 2.6.4 Function Testing 2.7 SOFTWARE DESIGN 2.7.1 Source Code 2.7.2 Snapshots 3 4 CONCLUSION REFERENCES

39 40 40 43 44 51 42 99

LIST OF TABLES
TABLE NO 2.3.2 TITLE LOGDETAILS XXX CURRENT VISITOR XXXVISITOR INFO USER INFO VISITOR INFO PAGE NO

LIST OF FIGURES

FIGURE NO TITLE 2.2.3 ADO.NET ARCHITECHTURE

PAGE NO

LIST OF ABBREVIATIONS

IIS ADO SQL MSDTC RDBMS DTS DSI

INTERNET INFORMATION SERVER ACTIVE X DATA OBJECT STRUCTURED QUERY LANGUAGE MICROSOFT DISTRIBUTED TRANSACTION CO-ORDINATOR RELATIONAL DATABASE MANAGEMENT SYSTEM DATA TRANSFORMATION SERVICES DYNAMIC SYSTEMS INITIATIVE

ABSTRACT The basic idea behind this project is to computerize the communication between the reception section and the internal office. Cyber Eye provides an efficient way of implementing the security system. Using this system, it is possible to send the information about the visitors to the higher authority of the organization. The highlight of this project is not only sending the textual message but also sending the snapshot of the visitor as an image. This technique is implemented using the web camera and necessary software tools. This is a generalized project so that it can be used in any organization like factories, colleges etc. One system is installed in the reception with the camera. The snapshots of the visitor is taken and send to another system which is usually kept on the table of the higher authority, along with the additional information such as visitor name, designation etc. The

higher authority takes the decision whether to allow the visitor or not. Cyber Eye can be established and worked only in a network. It is not only a security system, which passes the information to the higher authority but also stores the snapshot of the visitor for the future reference.

INTRODUCTION

PROJECT OBJECTIVE The basic idea behind this project is to computerize the communication between the reception section and the internal office. Security takes an important role in almost all of the organizations. One portion of the security includes recording information about the visitor, avoiding allowing of needless visitors etc. Cyber Eye provides an efficient way of implementing the above security system. Using this system, it is possible to send the information about the visitors to the higher authority of the organization. The highlight of this project is, not only sending a textual message, it is possible to send the snapshot of the visitor as an image. This technique is implemented using Web Camera and necessary Software tools. This is a generalized project so that it can be used in any organization like Factories, Offices, and Colleges etc.

The existing traditional system provides only a person-to-person communication. The person who receives the visitor obtain information such as name, whom to meet, coming from where and it is informed to the higher authority. Based on the decision made by the higher authority the visitor is allowed or not allowed. This kind of communication is still used by lower level organizations. Higher-level organizations use the intercom facility to communicate with other portions of the organization. This system provides immediate passing and receiving of information. In both the above cases, it is possible to pass and record only the name and some additional information about the persons in a text format. In addition, any bogus information given by the visitor cannot be used for further future reference. Cyber Eye can be used an alternate for this. It stores the snapshot of the visitor as an image file, along with the textual information. So, it can be used for future reference. Based on the organization storing of information can be customized so that information can be periodically deleted. Cyber Eye can be established and worked only in a network. It needs a minimum of two systems that is connected through network. One system is installed in the reception, along with Camera as an additional device. The snapshot of the visitor is taken through the Web Camera and it is send to another system which is usually kept on the table of the higher authority, along with additional information about the visitor such as name, coming from where etc. The higher authority then takes decision as per his/her willing, whether to

allow the visitor or not. The receptionist allows or not allows the person based on the decision taken by the higher authority. It is not only a security system, which passes information to the higher authority. It also stores the information about the visitor for future reference.

SYSTEM STUDY

SYSTEM ANALYSIS AND DESIGN

System analysis is conducted with following objectives in mind Identify the customers requirement Evaluate the system concept for feasibility Perform economic and technical analysis Allocate functions to system elements Establish cost and schedule constraints Create a system definition that forms the foundation to all the subsequent engineering works Design process actually translates requirements into a representation of the software that can be assessed for quality before code generation begins. Like requirements the design is documented and becomes part of the software configuration.

EXISTING SYSTEM: The existing traditional system provides only a person-to-person communication. The person who receives the visitor obtain information such as name, whom to meet, coming from where and it is informed to the higher authority. Based on the decision made by the higher authority the visitor is allowed or not allowed. In the above case, it is possible to pass and record only the name and some additional information about the persons in a text format. In addition, any bogus information given by the visitor cannot be used for further future reference. PROPOSED SYSTEM: Cyber Eye can be used an alternate for this. It stores the snapshot of the visitor as an image file, along with the textual information. So,

it can be used for future reference. Based on the organization storing of information can be customized so that information can be periodically deleted.

SYSTEM REQUIREMENT SPECIFICATION


SOFTWARE REQUIREMENTS: -

VB.NET SQL Server2000 Windows 2000 or more. Internet Information Server(IIS)

HARDWARE REQUIREMENTS:-

Hard disk RAM Processor

80 GB 128mb Pentium

SOFTWARE SYSTEM ATTRIBUTES:

WINDOWS: Windows is the popularly used Operating System that handles many tasks like managing resource allocation, hence reducing the traffic density, utilizing the memory in an efficient manner.

VB.NET: Visual Basic.Net is the next version of Visual Basic. Rather than simply adding some features to Visual Basic 6.0,Microsft has reengineered the product to make it easier than ever before to write distributed applications such as web and enterprise n-tier systems.VisualBasic.Net has two new Forms packages (Window forms and web forms); a new version of ADO for accessing disconnected data sources; and the language itself has been streamlined, removing legacy words, improving type safety, exposing low-level constructs advanced developers require. VB.NET is now fully integrated with other Visual Studio.Net languages: Not only u can develop application components in programming languages; your classes can now inherit from classes written in other languages, using cross-language inheritance. With the unified debugger, you can now debug multiple language applications, irrespective of whether they are running locally or on remote computers. Finally, whatever language you use, the .NET framework provides a rich set of APIs for windows and the Internet.VB.NET introduces an enhanced version of ADO called ADO.NET .It targets the disconnected databases, and provides performance improvements over ADO when in distributed

applications.ADO.NET offers read/write data binding to controls for window forms and read-only data binding for web forms.

ADO.NET ARCHITECTURE: Data access in ADO.NET relies on two components Data set Data provider

Dataset: Dataset is the disconnected in-memory representation of data. The dataset is persisted in memory and the data in it can be manipulated and updated independent of the database. Data provider: Data provider is responsible for providing and the maintaining the connection to the database. The connection object provides the connection to the database The command object executes a command. The data adapter, which populates a disconnected dataset with data and performs updation.

Component classes: The connection object: This helps in creating the connection to the database. Here are two connection classes and they are given as (1) SQL Connection (2) OLEDB Connection

Command object The command object is represented by two corresponding classes (1) SQL Command

(2) OLEDB command

SQL SERVER2000: Microsoft SQL Server is full featured relational database management system that offers a variety of administrative tools Microsoft SQL Server 2000 is a full-featured relational database management system (RDBMS) that offers a variety of administrative tools to ease the burdens of database development, maintenance and administration. Features of Server2000: (1) Scalability and availability (2) Ease of deployment, installation & use (3) Data warehousing (4) Enterprise-level database features

SQL Server Tools:


Enterprise Manager:

Enterprise Manager is the main administrative console for SQL Server installations. The structure of the individual databases can be modified using this.

Sql Profiler: Sql profiler tool plays an important role in optimizing the databases with the performance issues.

Service Manager: Service Manager is used to control the MSSQLServer (the main SQL Server process), MSDTC (Microsoft Distributed Transaction Coordinator) and SQLServerAgent processes. Query Analyzer: Query Analyzer offers a quick and dirty method for performing queries against any of your SQL Server databases. It's a great way to quickly pull information out of a database in response to a user request, test queries before implementing them in other applications, create/modify stored procedures and execute administrative tasks.

Data Transformation Services (DTS):

Data Transformation Services provide an extremely flexible method for importing and exporting data between a Microsoft SQL Server installation and a large variety of other formats.

INTERNET INFORMATION SERVER IIS 6.0 is a powerful web server that provides a highly reliable ,manageable and scalable web application infrastructure for all versions of windows server 2003.IIS helps organizations increased website and application availability while lowering system administration cost. IIS 6.0 supports the Microsoft Dynamic Systems Initiative (DSI) with automated health monitoring process isolation and improved management capabilities. Dynamic Systems Initiative: The DSI is a Microsoft led industry effort to dynamically simplify and automate how business design, deploy and operate their increasingly complex and distributed computed systems.

SYSTEM DESIGN DATA FLOW DIAGRAM

LOGIN MODULE User Info

Username LOGIN Password Visitors Info

USER MANAGER MODULE

Username Address Designation Password fullname USER MANAGER

User Info

DISPATCHER MODULE

Current visitor Visitor info Snapshot Dispatche r

RECEIVER MODULE Visitor Info Current Visitor RECEIVER Snapshot

VISITOR INFO

Visitor name Whom to meet In time Response Out time Visited VISITOR INFO Visitor info

WAITING LIST MODULE

XXX Visitor Info

WAITING LIST

list of visitors waiting

USER LIST MODULE

User Info

USER LIST

User Information

SEND MESSAGE MODULE

Message

Send message

Recipient

DATABASE DESIGN LOG DETAILS User Name System Name Log in date Log in time Log out time varchar varchar varchar varchar varchar 20 200 15 15 15

XXXCURRENTVISITOR

Visitor name Address

varchar varchar

50 200

Designation company purpose remarks Image file path

varchar varchar varchar varchar varchar

50 50 100 100 100

XXXVISITORINFO

Visitor Name Address Contact no Company Designation purpose In date In time Out time remarks Whom to meet response

Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar

50 200 20 50 50 100 8 15 15 100 20 100

visited Image file path

Varchar Varchar

1 100

User Info User name password Full name designation department remarks varchar varchar varchar varchar varchar varchar 20 20 50 20 50 200

Visitor Info

Visitor name Whom to meet In time response Out time visited

varchar varchar varchar varchar varchar varchar

50 50 15 100 15 1

FEATURES OF THE PROJECT The important features of this project are Taking snapshot of visitor Security system

Taking snapshot of visitor: This project aims at taking the snapshot of the visitor using the web camera and the necessary software tools. The highlight is not only sending the textual message but also to send the snapshot of the visitor as an image. If any bogus information given by the visitor, it cannot be used for

future reference and for this purpose the image is stored along with the message and can be used for the future reference. Security system: This project aims at implementing the security system which is the major part of all the organizations .The implementation involves two main portions and they are Recording of the visitor information such as visitor name, designation, and address etc. thereby avoiding needless visitors. Taking the snapshot of the visitor and storing it as an image along with the textual message thereby using it for future reference.

PROJECT MODULES Various modules involved in the development of this software are as Follows LOGIN MODULE USER MANAGER MODULE DISPATCHER MODULE RECEIVER MODULE VISITOR INFORMATION MODULE WAITING LIST MODULE USER LIST MODULE SEND MESSAGE MODULE LOGIN MODULE: The main task of this module is to allow only authorized users to login.Since the system has been developed as a multi-user one, only authorized

users can logon to the system. Existing users enter the username and password and then click on the login button. After verifying the information with USER INFO table any one of the following will occur. If the username is CYBEREYE then the DISPATCHER screen must be opened. Also the VISITOR INFORMATION screen must be opened. If the username is other than CYBEREYE then RECEIVER screen must be opened. When a user has logged in, then his/her information such as username, system name, login time etc must be added as a new record in LOGDETAILS table. In order to create new users SIGN UP button must Be clicked.Only CYMIN user can able to create new users. When clicking on SIGN UP button, after checking whether it is CYMIN user and its password, USERMANAGER screen must be opened. Note that, the CYMIN user must already exist in the table. Other users can be created by CYMIN user. USER MANAGER MODULE: The main task of this module is to create new user, modify user, delete user etc. Previously mentioned, only CYMIN user can able to create new users. By supplying the user name CYMIN and its password the user has to click on SIGN UP button. The USER MANAGER screen must be opened.

New User Creation Username must be unique After supplying the other details, SUBMIT button must be clicked. The details must be stored in USER INFO table. Also for the user, XXX VISITOR INFO and XXX CURRENT VISITOR table must be created. For e.g. if the username is RAO then RAO VISITOR INFO and RAO CURRENT VISITOR table must be created.

User Modification User name must be selected from the combo box, which is already built using username field from the USER INFO table. After modifying values MODIFY button must be clicked. Values must be updated in USER INFO table. User Deletion User name must be selected from the combo box which is already built using USERNAME field from the USER INFO table.

When clicking on DELETE button, after confirmation from the user the selected user details must be deleted from the table USER INFO and also the related tables must be deleted. DISPATCHER MODULE: Used to take a snap shot image of the visitor and send to the corresponding person used be the reception /security section. The procedure involved is given as follows On Clicking SNAP button it must receive the image of the visitor through camera. Other information must be filled. From whom to meet combo box the person to meet is selected. This combo box is already built with contents from LOG DETAILS table. When clicking on SEND button the following must be done: A filename must be generated automatically to store the image. The image file must be stored in a separate location and the path of the image must be stored in table. 1. The information must be stored in the tables XXX VISITOR INFO, XXX CURRENT VISITOR and VISITOR INFO. XXX stands for the name, selected from whom to meet combo box. 2. A notification must be sent to the person whom the visitor wants to meet.

3. If the table XXX CURRENT VISITOR already has a record, then it means that the particular used didnt receive the previously sent information. In this case the information must not be sent. 4. Also if the person is busy the information should not be send. It is already identified when the person click on DISABLE button, from the RECEIVER screen. Clicking on HIDE button must hide the image. Clicking on CLEAR button must clear the contents of all the controls. Clicking on NEW button must clear the contents and place the current date and time on the date and in time boxes respectively. Clicking on SEND MESSAGE button opens the SEND MESSAGE screen, which is used to send message to the other users on the network. Clicking on USER LIST shows list of user information, so that reception/security section operator can able to know the user name of all the persons in the organization. On clicking LOGOUT button the DISPATCHER screen must be closed. Also after confirmation from the user the VISITOR INFO table contents must be deleted. RECEIVER MODULE: Used by the client systems, to receive information of the visitors From the reception section. The steps involved in this module are

Given as follows When receiving notification from the reception/security section, the user has to click on RECEIVE button. When clicking on RECEIVE button the Information must be obtained from the XXX CURRENT VISITOR table and placed in the specified controls. Here XXX stands for the current RECEIVER screen user name. Also the image file path must be obtained and the image must be read and placed in the specific control. The record from the table XXX CURRENT VISITOR must be deleted. After typing the response, the user has to click NOTIFY button. It must update the necessary fields in the XXX VISITOR INFO and VISITOR INFO table. Clicking on HIDE button must hide the image. Clicking on CLEAR button must clear the contents of all the controls. Clicking on LOGOUT closes the RECEIVER screen. When closing it must update the LOGOUT TIME field in LOG DETAILS table. Clicking on WAITING LIST button shows list of visitor waiting for meet that person. Clicking on SEND MESSAGE button opens the SEND MESSAGE screen, which is used to send message to the reception/security section or other users on the network. Clicking on DISABLE disables receiving of visitor information from the reception/security section, indicating that the person was busy. Also the

button caption changed to ENABLE. When clicking on ENABLE it enables receiving of visitor information and caption must be changed to DISABLE. VISITOR INFORMATION MODULE: This is used be the reception section to view the visitor Information. It must display the information such as visitor name, Whom to meet, in time etc from the table VISITOR INFO. The steps involved in this module are given as When departure of a visitor the out time and visited (Yes/No) controls must be filled. Then when clicking on UPDATE button the tables VISITOR INFO and XXX VISITOR INFO must be updated with the values out time and visited. Clicking on REFRESH refreshes the display.

WAITING LIST MODULE: This main task of this module is to show the list of visitors Waiting to meet the specific person. This screen is activated from the receiver screen.

The steps involved in this module are given as follows When opened shows the information of waiting visitors. Information is taken from the table XXX VISITOR INFO. XXX stands for the user name. When clicking on REFRESH it refreshes the information. When clicking on CLOSE button it closes the screen. USER LIST MODULE: The main task of this module is to list information and details about the users. This screen is activated from the DISPATCHER screen. The steps involved in this module are given as follows

When opened shows the information of users. Information is taken from the table USER INFO. When clicking on CLOSE button it closes the screen.

SEND MESSAGE MODULE: The main task of this module is to send messages between the persons on the network. The steps involved in this module are given as follows

The recipient must be selected from the combo box whom to send. It is already built using the table LOG DETAILS. Message must be typed and when clicking on SEND it must be send to the particular user who is in online.

SOFTWARE TESTING Testing is a process of executing a program with the intent of finding an error. If testing is conducted successfully it will uncover errors in the software. Testing cannot show the absence of the errors it can only show that software errors are present. UNIT TESTING: Unit testing focuses verification effort on the smallest unit of software design- the module. Using the procedural design description as a guide

important control parts are tested to uncover the errors within the boundary of the module. The unit test is normally white box oriented and the step can be conduct in parallel for multiple modules. It is usually considered as an adjunct to the coding step. INTEGRATION TESTING: Integration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associated with interfacing. The objective is to take unit tested modules and build a program structure that has been dictated by design. The program is constructed and tested in small segments, where errors are easier to isolate and correct; interfaces are more likely to be tested completely; and a systematic test approach may be applied.

VALIDATION TESTING: At the culmination of integration testing, software is completely assembled as a package; interfacing errors have been uncovered and corrected, and a final series of software tests- validation testing- may begin. Validation succeeds when software functions in a manner that can be reasonably expected. FUNCTION TESTING: All the functions in this software are tested individually for its appropriate outputs.

CONCLUSION

CONCLUSION In this project, we have presented the concept of storing the snapshots of the visitors with the help of web camera and other necessary software tools. In alternate to the existing system which solely relies on personto-person communication, Cyber Eye software has been developed which

stores the snapshot of the visitor as an image file with the textual message. So it can be used for the future reference to check whether it if in need. It is not only a security system, which passes information to the higher authority. It also stores the information along with the snapshot of the visitor for future reference.

SOFTWARE DESIGN

SNAPSHOTS LOGIN SCREEN

USER MANAGER SCREEN

DISPATCHER SCREEN

RECEIVER SCREEN

VISITOR INFORMATION SCREEN

WAITING LIST SCREEN

USER LIST SCREEN

SEND MESSAGE SCREEN

SOURCE CODE:

LOGIN FORM

Imports System.Data.SqlClient '' Public Class frmLogin Inherits System.Windows.Forms.Form Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click End End Sub Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click ' Dim formDispatcher As New frmDispatcher() Dim formReceiver As New frmReceiver() Dim formSystemTray As New frmSystemTray() Dim rdrLogin As sqlDataReader Dim cmdLogin As New sqlcommand("", conCE) Dim cmdLogDetails As New SqlCommand("", conCE) Dim strQuery As String

strQuery = "select * from UserInfo where Username='" & Trim(txtUserName.Text) & "' and Password='" & txtPassword.Text & "'" cmdLogin.CommandText = strQuery rdrLogin = cmdLogin.ExecuteReader If rdrLogin.Read Then rdrLogin.Close() USERNAME = Trim(txtUserName.Text) 'Update LogDetails strQuery = "insert into LogDetails values ('" & txtUserName.Text & "','" & Environment.MachineName & "','" & DateTime.Now.Day & "/" & DateTime.Now.Month & "/" & DateTime.Now.Year & "','" & DateTime.Now.Hour & ":" & DateTime.Now.Minute & ":" & DateTime.Now.Minute & "','-')" cmdLogDetails.CommandText = strQuery cmdLogDetails.ExecuteNonQuery() If Trim(txtUserName.Text) = "cybereye" Then formDispatcher.Visible = True formSystemTray.Show() Else formReceiver.Visible = True End If Me.Visible = False Else

MessageBox.Show("Username/Password error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If rdrLogin.Close() ' End Sub Private Sub btnAdmin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnAdmin.Click ' Dim rdrAdmin As SqlDataReader Dim cmdAdmin As New SqlCommand("", conCE) Dim strQuery As String Dim formSystemTray As New frmSystemTray() Dim formDispatcher As New frmDispatcher() Dim formReceiver As New frmReceiver() strQuery = "select * from UserInfo where Username='" & Trim(txtUserName.Text) & "' and Password='" & txtPassword.Text & "'" cmdAdmin.CommandText = strQuery rdrAdmin = cmdAdmin.ExecuteReader If rdrAdmin.Read Then If Trim(txtUserName.Text) = "cybereye" Then Me.Visible = False formSystemTray.Show()

Else MessageBox.Show("No administrator permission", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Else MessageBox.Show("Username/Password error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If rdrAdmin.Close() ' End Sub '' Private Sub frmLogin_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Call ConnectDatabase() ' End Sub '' End Class

DISPATCHER FORM Imports Microsoft.VisualBasic.Compatibility Imports System.IO Imports Scripting Imports System.Data.SqlClient '' Public Class frmDispatcher Inherits System.Windows.Forms.Form '' Dim IMAGEFILEPATH As String = "" Dim strImageFile As String Private Sub frmReceiver_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing ' If MessageBox.Show("Are you sure to close Cyber Eye?", "Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then e.Cancel = True Else Call Logout() End End If ' End Sub

'' Private Sub frmDispatcher_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing ' End ' End Sub Private Sub pnlRight_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pnlRight.Paint End Sub Private Sub btnSendMessage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendMessage.Click ' Dim formSendMessage As New frmSendMessage() formSendMessage.Show() formSendMessage.BringToFront() ' End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click

' Call Clear() ' End Sub Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click ' Dim cmdCurrentVisitor As New SqlCommand("", conCE) Dim rdrCurrentVisitor As SqlDataReader Dim cmdVisitorInfo As New SqlCommand("", conCE) Dim rdrVisitorInfo As SqlDataReader Dim strQuery As String Dim stmFile As FileStream Dim intLength As Integer Dim strFile As String Dim intVID As Integer Try 'Generating VisitorID cmdVisitorInfo.CommandText = "select Max(VisitorID) from VisitorInfo" cmdVisitorInfo.Connection = conCE rdrVisitorInfo = cmdVisitorInfo.ExecuteReader Try

If rdrVisitorInfo.Read Then intVID = rdrVisitorInfo.Item(0) Else intVID = 0 End If rdrVisitorInfo.Close() Catch rdrVisitorInfo.Close() intVID = 0 End Try intVID = intVID + 1 'Checking for existing record available strQuery = "select * from " & cboWhomToMeet.Text & "CurrentVisitor" cmdCurrentVisitor.CommandText = strQuery rdrCurrentVisitor = cmdCurrentVisitor.ExecuteReader If rdrCurrentVisitor.Read Then MessageBox.Show("Receiver is busy. Unable to send", "Send", MessageBoxButtons.OK, MessageBoxIcon.Information) Else rdrCurrentVisitor.Close() strQuery = "insert into " & cboWhomToMeet.Text & "CurrentVisitor (VisitorID, VisitorName, Address, Company, Designation, Purpose, Remarks)

values (" & intVID & ",'" & txtVisitorName.Text & "','" & txtAddress.Text & "','" & txtCompany.Text & "','" & txtDesignation.Text & "','" & txtPurpose.Text & "','" & txtRemarks.Text & "')" cmdCurrentVisitor.CommandText = strQuery cmdCurrentVisitor.ExecuteNonQuery() cmdCurrentVisitor.CommandText = "update " & cboWhomToMeet.Text & "CurrentVisitor set VisitorImage=@img1 where VisitorID=" & intVID 'Getting image from file strFile = VB6.GetPath & "\Visitor.jpg" Dim f As New FileStream(strFile, FileMode.Open) Dim br As New BinaryReader(f) Dim buf As Byte() buf = br.ReadBytes(f.Length - 1) cmdCurrentVisitor.Parameters.Add("@img1", buf) cmdCurrentVisitor.ExecuteNonQuery() 'Adding record in VisitorInfo strQuery = "insert into VisitorInfo (VisitorID, VisitorName, Address, ContactNo, Company, Designation, Purpose, InDate, InTime, OutTime, Remarks, WhomToMeet, Response, Visited) values (" & intVID & ",'" & txtVisitorName.Text & "','" & txtAddress.Text & "','" & txtContactNo.Text & "','" & txtCompany.Text & "','" & txtDesignation.Text & "','" &

txtPurpose.Text & "','" & Format(dtpInDate.Value, "M/d/yyyy") & "','" & txtInTime.Text & "','-','" & txtRemarks.Text & "','" & cboWhomToMeet.Text & "','-','N')" cmdVisitorInfo.CommandText = strQuery cmdVisitorInfo.ExecuteNonQuery() 'Updating image into VisitorInfo cmdVisitorInfo.CommandText = "update VisitorInfo set VisitorImage=@img2 where VisitorID=" & intVID cmdCurrentVisitor.Parameters.Add("@img2", buf) cmdCurrentVisitor.ExecuteNonQuery() MessageBox.Show("Send successfully", "Send", MessageBoxButtons.OK, MessageBoxIcon.Information) End If rdrCurrentVisitor.Close() Catch exnBtnSend As Exception MsgBox(exnBtnSend.Message) End Try ' End Sub '' Private Sub Clear() ' txtVisitorName.Text = ""

txtAddress.Text = "" txtContactNo.Text = "" txtCompany.Text = "" txtDesignation.Text = "" txtPurpose.Text = "" txtInTime.Text = "" txtRemarks.Text = "" cboWhomToMeet.SelectedIndex = -1 ' End Sub '' Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click ' Call Clear() txtInTime.Text = DateTime.Now.Hour & ":" & DateTime.Now.Minute ' End Sub '' Private Sub BuildWhomToMeet() ' Dim cmdWhomToMeet As New SqlCommand("", conCE) Dim rdrWhomToMeet As SqlDataReader Dim strQuery As String

strQuery = "select UserName from LogDetails where LoginDate='" & DateTime.Now.Day & "/" & DateTime.Now.Month & "/" & DateTime.Now.Year & "' and LogoutTime='-'" cmdWhomToMeet.CommandText = strQuery rdrWhomToMeet = cmdWhomToMeet.ExecuteReader cboWhomToMeet.Items.Clear() While rdrWhomToMeet.Read cboWhomToMeet.Items.Add(rdrWhomToMeet.Item("UserName")) End While rdrWhomToMeet.Close() ' End Sub '' Private Sub frmDispatcher_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ' wskReceiver.LocalPort = 3456 wskReceiver.Bind(3456) Call BuildWhomToMeet() ' End Sub '' Private Sub btnSnap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSnap.Click '

Dim strImageFile As String Dim fsoFile As New FileSystemObject() 'cam.OutputFile = "C:\selvan.jpg" 'cam.Video = True 'cam.Update() 'cam.Show() dlgOpen.InitialDirectory = VB6.GetPath If dlgOpen.ShowDialog = DialogResult.OK Then strImageFile = dlgOpen.FileName fsoFile.CopyFile(strImageFile, VB6.GetPath & "\Visitor.jpg", True) MsgBox(VB6.GetPath & "\Visitor.jpg")

Try pctSnap.Image = Image.FromFile(strImageFile) Catch MessageBox.Show("Invalid image format", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try End If ' End Sub ''

Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHide.Click ' If btnHide.Text = "Hide" Then pctSnap.Image = Nothing btnHide.Text = "Show" ElseIf btnHide.Text = "Show" Then Try pctSnap.Image = Image.FromFile(strImageFile) Catch MessageBox.Show("Invalid image format", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try btnHide.Text = "Hide" End If ' End Sub '' Private Sub btnUserList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUserList.Click ' Dim ScreenUserList As New frmUserList() ScreenUserList.Visible = True

ScreenUserList.BringToFront() ' End Sub '' Private Sub wskReceiver_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles wskReceiver.DataArrival ' Dim strMessage wskReceiver.GetData(strMessage) MessageBox.Show(strMessage, "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) ' End Sub '' Private Sub btnVisitorInformation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVisitorInformation.Click ' Dim ScreenVisitorInformation As New frmVisitorInformation() ScreenVisitorInformation.Visible = True ScreenVisitorInformation.BringToFront() ' End Sub

'' Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogout.Click ' If MessageBox.Show("Are you sure to logout and close Cyber Eye?", "Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then Call Logout() End End If ' End Sub End Class

RECEIVER FORM Imports Microsoft.VisualBasic.Compatibility Imports System.Threading Imports System.IO Imports System.Data.SqlClient '' Public Class frmReceiver Inherits System.Windows.Forms.Form '' Dim blnReceiveMessage As Boolean = True Dim thdListen As New Thread(AddressOf Listen) Dim rdrListen As SqlDataReader Dim blnFire As Boolean = False Dim conThread As SqlConnection Dim formHelpReceiver As frmHelpReceiver Private Sub frmReceiver_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing ' If MessageBox.Show("Are you sure to close Cyber Eye?", "Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then e.Cancel = True Else

Call Logout() End End If ' End Sub Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHelp.Click ' formHelpReceiver = New frmHelpReceiver() formHelpReceiver.Visible = True ' End Sub Private Sub frmReceiver_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' wskReceiver.LocalPort = 245 wskReceiver.Bind(245) ConnectDatabase() ConnectThreadDatabase() thdListen.Start() ' End Sub ''

Private Sub Listen() '' Dim cmdListen As New SqlCommand("", conThread) Dim strQuery As String 'blnFire = False While True strQuery = "select * from " & USERNAME & "CurrentVisitor" cmdListen.CommandText = strQuery rdrListen = cmdListen.ExecuteReader If rdrListen.Read Then Beep() btnReceive.Enabled = True End If rdrListen.Close() ' End While blnFire = True ' End Sub '' Private Sub btnReceive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReceive.Click ' Dim rdrReceive As SqlDataReader

Dim cmdReceive As New SqlCommand("", conCE) Dim strQuery As String Try thdListen.Suspend() rdrListen.Close() ConnectDatabase() strQuery = "select VisitorID, VisitorName, Address, Company, Designation, Purpose, Remarks, VisitorImage as ImageData from " & USERNAME & "CurrentVisitor" cmdReceive.Connection = conCE cmdReceive.CommandText = strQuery rdrReceive = cmdReceive.ExecuteReader(CommandBehavior.SequentialAccess) If rdrReceive.Read Then VISITORID = rdrReceive("VisitorID") txtVisitorName.Text = rdrReceive.Item("VisitorName") txtAddress.Text = rdrReceive.Item("Address") txtCompany.Text = rdrReceive.Item("Company") txtDesignation.Text = rdrReceive.Item("Designation") txtPurpose.Text = rdrReceive.Item("Purpose") txtRemarks.Text = rdrReceive.Item("Remarks") 'Getting Image

Dim fs As FileStream Dim bw As BinaryWriter Dim bufferSize As Integer = 100 Dim outByte(bufferSize - 1) As Byte Dim retVal As Long Dim startIndex As Long = 0 Dim pub_id As Integer fs = New FileStream(VB6.GetPath & "\" & txtVisitorName.Text & ".jpg", FileMode.OpenOrCreate, FileAccess.Write) bw = New BinaryWriter(fs) startIndex = 0 retVal = rdrReceive.GetBytes(7, startIndex, outByte, 0, bufferSize) Do While retVal = bufferSize bw.Write(outByte) bw.Flush() startIndex = startIndex + bufferSize retVal = rdrReceive.GetBytes(7, startIndex, outByte, 0, bufferSize) Loop bw.Write(outByte) bw.Flush() bw.Close() fs.Close()

pctVisitorImage.Image = Image.FromFile(VB6.GetPath & "\" & txtVisitorName.Text & ".jpg") End If rdrReceive.Close() 'Deleting the record after receiving it strQuery = "delete from " & USERNAME & "CurrentVisitor" cmdReceive.CommandText = strQuery cmdReceive.ExecuteNonQuery() btnReceive.Enabled = False thdListen.Resume() 'thdListen = New Thread(AddressOf Listen) 'thdListen.Start() Catch exnBtnReceive_Click As Exception MsgBox("exnBtnReceive_Click : " & exnBtnReceive_Click.Message) End Try ' End Sub '' Private Sub ConnectThreadDatabase() ' Try

'conCE = New SqlConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CyberEye;Data Source=CHOLAN;") conThread = New SqlConnection("data source=CHOLAN;initial catalog=CyberEye;integrated security=SSPI;persist security info=False;workstation id=CHOLAN;packet size=4096") conThread.Open() Catch exnConnectDatabase As Exception MsgBox(exnConnectDatabase.Message) End Try ' End Sub '' '' Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogout.Click ' If MessageBox.Show("Are you sure to logout and close Cyber Eye?", "Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then Call Logout() End End If '

End Sub '' Private Sub wskReceiver_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles wskReceiver.DataArrival ' Dim strMessage As String wskReceiver.GetData(strMessage) MessageBox.Show(strMessage, "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) ' End Sub '' Private Sub btnNotify_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNotify.Click ' Dim cmdNotify As New SqlCommand() Try cmdNotify.CommandText = "update VisitorInfo set Response='" & txtResponse.Text & "' where VisitorID=" & VISITORID cmdNotify.Connection = conCE cmdNotify.ExecuteNonQuery() Catch exnBtnNotify_Click As Exception

MsgBox("exnBtnNotify_Click : " & exnBtnNotify_Click.Message) End Try ' End Sub '' Private Sub btnWaitingList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWaitingList.Click ' Dim ScreenWaitingList As New frmWaitingList() ScreenWaitingList.Visible = True ScreenWaitingList.BringToFront() ' End Sub '' Private Sub btnSendMessage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendMessage.Click ' Dim formSendMessage As New frmSendMessage() formSendMessage.Show() formSendMessage.BringToFront() ' End Sub

'' Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click ' txtVisitorName.Text = "" txtAddress.Text = "" txtCompany.Text = "" txtDesignation.Text = "" txtPurpose.Text = "" txtRemarks.Text = "" txtResponse.Text = "" pctVisitorImage.Image = Nothing ' End Sub '' Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHide.Click ' If btnHide.Text = "Hide" Then pctVisitorImage.Visible = False btnHide.Text = "Show" Else pctVisitorImage.Visible = True btnHide.Text = "Hide"

End If ' End Sub '' End Class

MENU FORM Public Class frmMenu Inherits System.Windows.Forms.Form '' Public formReports As frmReports Public formUserManager As frmUserManager Public formSettings As frmSettings Public formHelpDispatcher As frmHelpDispatcher '' Private Sub UserManager_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pctUserManager.Click, labUserManager.Click ' formUserManager = New frmUserManager() formUserManager.Visible = True ' End Sub '' Private Sub Reports_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pctReports.Click, labReports.Click ' formReports = New frmReports() formReports.Visible = True ' End Sub '

'' Private Sub Settings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ' formSettings = New frmSettings() formSettings.Visible = True ' End Sub '' Private Sub Help_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pctHelp.Click, labHelp.Click ' formHelpDispatcher = New frmHelpDispatcher() formHelpDispatcher.Visible = True ' End Sub '' Private Sub UserManager_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pctUserManager.MouseMove, labUserManager.MouseMove ' labUserManager.ForeColor = Color.OrangeRed ' End Sub ''

Private Sub Reports_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pctReports.MouseMove, labReports.MouseMove ' labReports.ForeColor = Color.OrangeRed ' End Sub '' Private Sub Help_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pctHelp.MouseMove, labHelp.MouseMove ' labHelp.ForeColor = Color.OrangeRed 'End Sub ''Private Sub frmMenu_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove ' labUserManager.ForeColor = Color.RoyalBlue labReports.ForeColor = Color.RoyalBlue labHelp.ForeColor = Color.RoyalBlue ' End Sub End Class SEND MESSAGE FORM

Imports System.Data.SqlClient '' Public Class frmSendMessage Inherits System.Windows.Forms.Form Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click ' Me.Close() ' End Sub '' Private Sub frmSendMessage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' BuildComboTo() ' End Sub '' Private Sub BuildComboTo() ' Dim cmdTo As New SqlCommand() Dim rdrTo As SqlDataReader

cmdTo.Connection = conCE cmdTo.CommandText = "select * from LogDetails where LogoutTime='-'" rdrTo = cmdTo.ExecuteReader While rdrTo.Read cboTo.Items.Add(rdrTo.Item("UserName")) cboSystemName.Items.Add(rdrTo.Item("SystemName")) End While rdrTo.Close() ' End Sub '' Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click ' Try If Trim(cboSystemName.Text) <> "" Then wskSender.RemoteHost = cboSystemName.Text wskSender.RemotePort = 3456 wskSender.SendData(txtMessage.Text) MessageBox.Show("Message sent successfully", "Send", MessageBoxButtons.OK, MessageBoxIcon.Information) End If Catch exnBtnSend_Click As Exception

End Try ' End Sub '' Private Sub cboTo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboTo.SelectedIndexChanged ' cboSystemName.SelectedIndex = cboTo.SelectedIndex ' End Sub '' End Class

VISITOR INFORMATION FORM

Imports System.Data.SqlClient '' Public Class frmVisitorInformation Inherits System.Windows.Forms.Form Private Sub frmVisitorInformation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' ConnectDatabase() Call GetVisitorInformation() ' End Sub '' Private Sub FlexVisitorInformationSettings() ' flxVisitorInformation.set_TextMatrix(0, 0, "Visitor Name") flxVisitorInformation.set_TextMatrix(0, 1, "Whom To Meet") flxVisitorInformation.set_TextMatrix(0, 2, "In Time") flxVisitorInformation.set_TextMatrix(0, 3, "Response") flxVisitorInformation.set_TextMatrix(0, 4, "Out Time") flxVisitorInformation.set_TextMatrix(0, 5, "Visited") flxVisitorInformation.set_TextMatrix(0, 6, "VisitorID") flxVisitorInformation.set_ColWidth(0, 2200) flxVisitorInformation.set_ColWidth(1, 2200)

flxVisitorInformation.set_ColWidth(2, 1200) flxVisitorInformation.set_ColWidth(3, 3900) flxVisitorInformation.set_ColWidth(4, 1200) flxVisitorInformation.set_ColWidth(5, 800) flxVisitorInformation.set_ColWidth(6, 0) ' End Sub '' Private Sub GetVisitorInformation() ' Dim cmdGet As New SqlCommand() Dim rdrGet As SqlDataReader Dim intRow As Integer = 1 Dim intCol As Integer flxVisitorInformation.Clear() flxVisitorInformation.BackColor = Color.White flxVisitorInformation.Rows = 50 FlexVisitorInformationSettings() cmdGet.CommandText = "select * from VisitorInfo where InDate='" & Format(dtpInDate.Value, "M/d/yyyy") & "'" cmdGet.Connection = conCE rdrGet = cmdGet.ExecuteReader

While rdrGet.Read flxVisitorInformation.set_TextMatrix(intRow, 0, rdrGet.Item("VisitorName")) flxVisitorInformation.set_TextMatrix(intRow, 1, rdrGet.Item("WhomToMeet")) flxVisitorInformation.set_TextMatrix(intRow, 2, rdrGet.Item("InTime")) flxVisitorInformation.set_TextMatrix(intRow, 3, rdrGet.Item("Response")) flxVisitorInformation.set_TextMatrix(intRow, 4, rdrGet.Item("OutTime")) flxVisitorInformation.set_TextMatrix(intRow, 5, rdrGet.Item("Visited")) flxVisitorInformation.set_TextMatrix(intRow, 6, rdrGet.Item("VisitorID")) If flxVisitorInformation.get_TextMatrix(intRow, 5) = "Y" Then flxVisitorInformation.Row = intRow For intCol = 0 To 6 flxVisitorInformation.Col = intCol flxVisitorInformation.CellBackColor = Color.Salmon Next End If intRow = intRow + 1 flxVisitorInformation.Rows = flxVisitorInformation.Rows + 1

End While rdrGet.Close() ' End Sub '' Private Sub SetVisitorInformation() ' Dim cmdSet As New SqlCommand() Dim intRow As Integer For intRow = 1 To flxVisitorInformation.Rows - 1 If flxVisitorInformation.get_TextMatrix(intRow, 0) <> "" Then cmdSet.Connection = conCE cmdSet.CommandText = "update VisitorInfo set Visited='" & flxVisitorInformation.get_TextMatrix(intRow, 5) & "' where VisitorID=" & flxVisitorInformation.get_TextMatrix(intRow, 6) cmdSet.ExecuteNonQuery() End If Next GetVisitorInformation() ' End Sub ''

Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click ' GetVisitorInformation() ' End Sub '' Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click ' SetVisitorInformation() ' End Sub '' Private Sub dtpInDate_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpInDate.ValueChanged ' GetVisitorInformation() ' End Sub Private Sub flxVisitorInformation_ClickEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles flxVisitorInformation.ClickEvent '

If flxVisitorInformation.Col = 5 And flxVisitorInformation.get_TextMatrix(flxVisitorInformation.Row, 0) <> "" Then flxVisitorInformation.set_TextMatrix(flxVisitorInformation.Row, 4, DateTime.Now.Hour & ":" & DateTime.Now.Minute & ":" & DateTime.Now.Second) If flxVisitorInformation.get_TextMatrix(flxVisitorInformation.Row, 5) = "N" Then flxVisitorInformation.set_TextMatrix(flxVisitorInformation.Row, 5, "Y") Else flxVisitorInformation.set_TextMatrix(flxVisitorInformation.Row, 5, "N") End If End If ' End Sub '' End Class

USER LIST FORM

Imports System.Data.SqlClient '' Public Class frmUserList Inherits System.Windows.Forms.Form Windows form designer generated code Private Sub frmUserList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' FlexUserListSettings() SetData() ' End Sub '' Private Sub FlexUserListSettings() ' flxUserList.set_ColWidth(0, 1680) flxUserList.set_ColWidth(1, 1680) flxUserList.set_ColWidth(2, 1900) flxUserList.set_ColWidth(3, 1900) flxUserList.set_TextMatrix(0, 0, "User Name") flxUserList.set_TextMatrix(0, 1, "Full Name")

flxUserList.set_TextMatrix(0, 2, "Department") flxUserList.set_TextMatrix(0, 3, "Designation") ' End Sub '' Private Sub SetData() ' Dim cmdSet As New sqlCommand() Dim rdrSet As SqlDataReader Dim intRow As Integer = 1 cmdSet.Connection = conCE cmdSet.CommandText = "select * from UserInfo" rdrSet = cmdSet.ExecuteReader While rdrSet.Read flxUserList.set_TextMatrix(intRow, 0, rdrSet.Item("UserName")) flxUserList.set_TextMatrix(intRow, 1, rdrSet.Item("FullName")) flxUserList.set_TextMatrix(intRow, 2, rdrSet.Item("Department")) flxUserList.set_TextMatrix(intRow, 3, rdrSet.Item("Designation")) intRow = intRow + 1 End While rdrSet.Close() ' End Sub

'' Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click ' Me.Close() ' End Sub '' End Class

WAITING LIST FORM Imports System.Data.SqlClient '' Public Class frmWaitingList Inherits System.Windows.Forms.Form '' Private Sub frmVisitorInformation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' 'ConnectDatabase() Call GetWaitingList() ' End Sub '' Private Sub FlexWaitingListSettings() ' flxWaitingList.set_TextMatrix(0, 0, "Visitor Name") flxWaitingList.set_TextMatrix(0, 1, "Company") flxWaitingList.set_TextMatrix(0, 2, "Designation") flxWaitingList.set_TextMatrix(0, 3, "Purpose") flxWaitingList.set_TextMatrix(0, 4, "InTime") flxWaitingList.set_TextMatrix(0, 5, "Response")

flxWaitingList.set_ColWidth(0, 1600) flxWaitingList.set_ColWidth(1, 1600) flxWaitingList.set_ColWidth(2, 1200) flxWaitingList.set_ColWidth(3, 2400) flxWaitingList.set_ColWidth(4, 1000) flxWaitingList.set_ColWidth(5, 2400) ' End Sub '' Private Sub GetWaitingList() ' Dim cmdGet As New SqlCommand() Dim rdrGet As SqlDataReader Dim intRow As Integer = 1 Dim intCol As Integer flxWaitingList.Clear() flxWaitingList.BackColor = Color.White flxWaitingList.Rows = 50 FlexWaitingListSettings() cmdGet.CommandText = "select * from VisitorInfo where Visited='N' and WhomToMeet='" & USERNAME & "'" cmdGet.Connection = conCE

rdrGet = cmdGet.ExecuteReader While rdrGet.Read flxWaitingList.set_TextMatrix(intRow, 0, rdrGet.Item("VisitorName")) flxWaitingList.set_TextMatrix(intRow, 1, rdrGet.Item("Company")) flxWaitingList.set_TextMatrix(intRow, 2, rdrGet.Item("Designation")) flxWaitingList.set_TextMatrix(intRow, 3, rdrGet.Item("Purpose")) flxWaitingList.set_TextMatrix(intRow, 4, rdrGet.Item("InTime")) flxWaitingList.set_TextMatrix(intRow, 5, rdrGet.Item("Response")) intRow = intRow + 1 flxWaitingList.Rows = flxWaitingList.Rows + 1 End While rdrGet.Close() ' End Sub '' Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click ' GetWaitingList() ' End Sub '' End Class

MODGLOBALS Imports System.Data.SqlClient '' Module modGlobals '' Public conCE As SqlConnection Public USERNAME As String Public VISITORID As Integer '' Public Sub ConnectDatabase() ' Try 'conCE = New SqlConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CyberEye;Data Source=CHOLAN;") conCE = New SqlConnection("data source=CHOLAN;initial catalog=CyberEye;integrated security=SSPI;persist security info=False;workstation id=CHOLAN;packet size=4096") conCE.Open() Catch exnConnectDatabase As Exception MsgBox(exnConnectDatabase.Message) End Try '

End Sub '' Public Sub Logout() ' Dim cmdLogout As New SqlCommand("", conCE) cmdLogout.CommandText = "Update LogDetails set LogoutTime='" & System.DateTime.Now.Hour & ":" & System.DateTime.Now.Minute & ":" & System.DateTime.Now.Second & "' where LogoutTime='-' and UserName='" & USERNAME & "'" cmdLogout.ExecuteNonQuery() ' End Sub '' End Module

FORM REPORTS

Public Class frmReports Inherits System.Windows.Forms.Form '' Private Sub btnUserList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUserList.Click ' Dim reportUserList As New rptUserList() crvViewer.ReportSource = reportUserList crvViewer.Show() ' End Sub '' Private Sub btnVisitorInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVisitorPersonalInfo.Click ' Dim reportVisitorPersonalInfo As New rptVisitorPersonalInfo() crvViewer.ReportSource = reportVisitorPersonalInfo crvViewer.Show() ' End Sub ''

Private Sub btnUserWiseVisitorInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUserWiseVisitorInfo.Click ' Dim reportUserWiseVisitorInfo As New rptUserWiseVisitorInfo() crvViewer.ReportSource = reportUserWiseVisitorInfo crvViewer.Show() ' End Sub '' Private Sub btnVisitorWiseReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVisitorWiseReport.Click ' Dim reportVisitorWiseReport As New rptVisitorWiseReport() crvViewer.ReportSource = reportVisitorWiseReport crvViewer.Show() ' End Sub '' End Class

Das könnte Ihnen auch gefallen