2. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ORGANIZATION OVERVIEW
Name of the Organization: - βMAHALAKSHMI COMMUNICATIONβ
Address of the Organization: -Shop No. 6, Opp. Sant Punjab Hotel, Chembur
Camp, Chembur (E), Mumbai-400 074.
About the Organization:-
MAHALAKSHMICOMMUNICATION is a one stop mobile solution shop that
provides, multi brand handsets, accessories, all under one roof.
Mahalakshmi Communicationcurrently has over 2 outlets and the vision is to have a
network all across City, thus covering virtually every major town in every state across
India.
Mahalakshmi Communicationhas categorized its mobile device offerings into
consumer segments keeping in mind the profiles and needs of different consumers.
The unique segments available in Shop:
Business - PDA & Smartphones, Emails, data transfer etc.
Lifestyle - Fashion phones, Look and elegance
Value for Money - Special offers, discounts and budget phones.
3. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PROJECT DESCRIPTION
NAME OF THE PROJECT:MOBILE STORE MANAGMENT
Following are few characteristicsofthe Mobile ManagementSystem
ο Referential Integrity of relational Database is followed
ο Use of shortcuts t access different processes is provided for the user having
computer knowledge
ο User-Friendly prompts are provided for user.
ο Attractive and catch Graphical & Photographic Interfaces are used for user
interaction
ο Data reports allow generation of reports dynamically with desired query.
ο Strong management system controls are used easy Navigation is provided for
maintaining proper flow of system.
4. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
LIMITATIONS OF THE PRESENT SYSTEM
The current system has several shortcomings that are as follows:-
ο The existing system was not very effective & was highly time consuming.
ο The current system works manually.
ο The existing system was somewhat paper-based (paper-work).
ο Which takes time?
ο The rate at which the work done is very slow due to non-utilization of
computerized system.
ο It does not provide better data facilities as well as data availability on
fingertip.
ο Inconsistency was the major problem in the existing system as there is no
proper facility was provided to update the data.
ο In case user wants to find out details of particular Mobiles whole database
records are displayed.
ο It is difficult to remember all data
ο Consumes large volume of paper work
ο Large storage space is required to keep to the files and register in proper
coordinationβs
ο In the present system the report generation becomes very difficult.
5. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PROPOSED SYSTEM
ο This system computerizes all data is storing all data of the Mobiles Sales,
Customer Details, Employee Details along with Salary.
ο Validation at the time of entering data, so no chance of duplication of data.
ο Extensive Validation on input record so that no changeable record are Prone to
error.
ο Response time for the query should be minimized.
ο To keep data base up to date by regular updating.
ο Reduce the cost of maintaining system.
ο To provide various report facility.
ο Cost effective and less manpower required.
ADVANTAGES OF PROPOSED SYSTEM
ο The new system would easily overcome most of the short coming of the
current system.
ο Owner can see the fine report.
ο Not much manual work is involved.
ο Ensure data accuracy
ο Security of data is done
ο Save a lot of time and effort
ο Optimize processing time.
ο User friendly system.
6. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
LIMITATION OF PROPOSED SYSTEM
ο Only one person can use the system.
ο The system prepared is competent but we cannot say that it is a perfect system.
This system like any other system has some flaws & shortcomings in it. They
are as follows:
o This system is semi-functional. This means that the system covers the
manipulation related to the record only.
o There would be high rate & better quality of performance.
7. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PROCESSING ENVIRONMENT
Processing environment includes hardware and software requirements.
Software Requirement
Operating system: - Windows XP, Windows7
Front-end Tool: - Visual studio 2008
Back-end Tool: - MS SQL2005
Hardware Requirement
Operating system: Windows XP and above.
Minimum 5 GB HDD space
3.00 Megahertz Intel Pentium IV Processor
1 GB RAM
8. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
FEASIBILITY STUDY
The feasibility study plays a major role in the analysis of the system. The very
decision of the system analysis whether he should design a particular system or not
and till what extend or limits the very project should be stretched can be inferred from
the system feasibility study. Hence the feasibility study forms the basis of the system.
The feasibility system can be categorized into:
ο TechnicalFeasibility:-
It determines the technology needed for the proposed system is available and
how this technology can be integrated into the organization. Technical evaluation
must also access whether the existing system can be upgraded to use the new
technology and whether the organization has the expertise to use it. Genuine
Computer is equipped with the necessary hardware and software.
ο Software Available
ο· Microsoft Windows 98, XP.
ο· Microsoft Office.
ο Hardware Available
ο· Intel Pentium IV Processor.
ο· 256 MB RAM.
ο· 3.5β Floppy Disk Drive.
ο· HP Printer.
ο· DVD Rom
ο Organizationaland Culture Feasibility:-
The organizational and culture feasibility analysis is done to scrutinize whether the
system sits up with the working environment and the organizational discipline and
rules.
Following issues are considered:
ο· The current level of computer competency.
ο· Re-engineering the old working procedures.
ο· Substantial tech phobia.
ο· Expectation of the users.
9. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο OperationalFeasibility:-
The proposed system will automated the existing manual system and make it
user friendly. With the required training the users will find the system easier to
operate. The systems cuts down the time delay of the existing manual system.
ο Economic Feasibility:-
The economic feasibility of the system looks upon the financial aspects of the
system. It determines whether the project is economically feasible. In other words, It
determines whether the investment that goes into the implementation of the project is
recoverable. The cost benefit analysis is a commonly used method in evaluating the
effectiveness of the system. As the hardware is already available and no investment is
to be made in that direction, the only cost involved is that of implementing the system
and software.
ο Resource Feasibility: -
A resource feasibility test was conducted to check the following things
Availability of manpower
The necessary skills and support on behalf of the staff.
Availability of necessary infrastructure
This test produced the following results:-
ο· First & foremost, each & every functions of each type of user is well defined.
ο· System has a very user friendly environment.
ο· Roles of each user are very well defined.
10. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
GANTT CHART
Planned my project according to the Gantt chart as follows:
Sr. No. Task Start Finish Duration
(in Days)
1 Understanding current
system
15-06-2011 22-06-2011 07
2 Problem definition 23-06-2011 30-06-2011 07
3 Information gathering 1-07-2011 15-07-2011 15
4 System Analysis 16-7-2011 31-07-2011 16
5 Database design 1-08-2011 31-08-2011 30
6 Form design 01-09-2011 30-09-2011 30
7 Coding 01-10-2011 30-11-2011 60
8 Modification of forms 01-12-2011 16-12-2011 16
9 Testing 24-12-2011 15-01-2012 20
10 Implementation 16-01-2012 10-02-2012 24
12. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
STAKE HOLDERS
Stake holder is a party that can affect or be affected by the actions of the
business as a whole.
ο TYPES OF STAKE HOLDERS:
ο· INTERNAL STAKE HOLDER -
Internal stake holders-Market (or primary)Stake holders are those that are
engaged in economic transactions with the business.
ο· EXTERNAL STAKE HOLDERS-
Non market(or secondary) stake holders are those who although they do
not engaged in direct economic exchange with the business are affected by or
can affect its actions.
ο STAKEHOLDERS IN THIS SYSTEM ARE AS FOLLOWS:-
ο· EMPLOYEES
He actually works 24/7 to grow business. Honest, open communication with
them will Impress the rest of stake holders and
Result in sales and profit. Company will be affected if employees are not honest,
loyal. Employees are affected if wrong data is inserted.
ο· CUSTOMER
Customer will be affected if he does not get delivery of Mobiles on time. He
may cancel next order or do not give order at all. This will adversely affect the
company. Company should satisfy clients demand on time.
ο· ADMINISTRATOR
The owner of the admission system needs to keep a check on everything
which is visiting admission system about each and every registration and
viewing and making changes i.e. update, delete etc. this is one of the important
issue to be handled . Industry should be kept on changing according to the
staffs and liking of the Customer/Owner
13. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
FACT FINDING TECHNIQUES
Informationandthorough knowledge as well as on job training plays a very important
role in any organization. Acquiring valuable information is essential for developing a
new system in an organization. There are many ways of gathering information. But
the following things need to be kept in mind while gathering information.
ο· No system details are left out.
ο· Problems are correctly identified.
ο· Repetitive work is avoided.
ο· Following are the fact finding techniques:-
o Structured interview
o Mechanical knowledge skills
o Questionnaires
o Record inspection
o Observation
ο· Structured Interview
This method is used to collect the information from groups or individuals.
Analyst selects the people who are responsible and related with the system for
the interviewer. In this method the analyst had dialog and discussion in person
or telephonic conversation.
ο· RecordInspection
The information related to the system is published in the sources like
newspapers, magazines, journals, documents etc. This record review helps the
analyst to get valuable information about the system and the organization.
ο· Observation
Unlike the other fact finding techniques, in this method the analyst himself
visits the organization and observes and understand the flow of documents,
working of the existing system, the users of the system etc. For this method to
be adopted it takes an analyst to perform this job as he knows which points
should be noticed and highlighted. In analyst may observe the unwanted things
as well and simply cause delay in the development of the new system
14. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EVENT TABLE
TRIGGER:
Trigger an occurrence that tells the system that has occurred, either the arrival of data
needing or of a point in time
SOURCE:
An external agent or actor that supplies data to the system.
ACTIVITY:
Behavior that the system performs when an event occurs
RESPONSE:
An output produced by the system that goes to a destination.
DESTINATION:
An external agent or actor that receives data from the system
15. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EVENT TRIGGER SOURCE ACTIVITY RESPONSE DESTINATION
Create an
Employee
Employee
Details
Employee Add
employee
details
Information
saved
Employee
Update
Employee
Update
employee
Employee Update
employee
Update
Information
Employee
Add Mobile Mobile
details and
add in
inventory
Mobile Add Mobile
and
in inventory
Information
saved
Mobile
Update
Inventory
Update
Mobile
Mobile Update quantity Information
updated
Inventory Master
Generate
bill
Create bill Bill Calculate
bill amount
Bill
generated
Bill Master
Save Bill Save Bill Bill Save Bill Information
saved
Bill Master
Print Bill Generate and
print
Bill Print bill Take print of
Bill
Bill master
Get
Inventory
report
Inventory
report
Inventory
master
Produce
inventory
report
Report
generated
Inventory master
16. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
USE CASE
A use case diagram in the Unified Modeling Language (UML) is a type of
behavioral diagram defined by and created from a Use-case analysis. Its purpose is
to present a graphical overview of the functionality provided by a system in terms
of actors, their goals (represented as use cases), and any dependencies between
those use cases.
Product Detail
19. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ER-DIAGRAM
β’ Represent Data Entity.
ο· Represent connection Administrator
β’ Represent the relationship.
Symbolsused in Entity-Relationship Diagram areas follows:
ο· Connect two Entities or One to One
relation.
20. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
An entity-relationship (ER) diagram is a specialized graphic that illustrates the
interrelationships between entities in a database. ER diagrams often use symbols to
represent three different types of information. Boxes are commonly used to represent
entities. Diamonds are normally used to represent relationships and ovals are used to
represent attributes.
21. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ACTIVITY DIAGRAM
Activity diagrams are graphical representations of workflows of stepwise activities
and actions with support for choice, iteration and concurrency. In the Unified
Modeling Language, activity diagrams can be used to describe the business and
operational step-by-step workflows of components in a system. An activity diagram
shows the overall flow of control.
Employee
23. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
CLASS DIAGRAM
In software engineering, a class diagram in the Unified Modeling Language (UML) is
a type of static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, operations (or methods), and the relationships
among the classes.
24. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
SEQUENCE DIAGRAM
Sequence diagrams are used to show how objects interact in a given situation. An
important characteristic of a sequence diagram is that time passes from top to bottom:
the interaction starts near the top of the diagram and ends at the bottom (i.e. Lower
equals later).A popular use for them is to document the dynamics in an object-
oriented system.
Employee
Employee Admin Database
Enquiry about job
Give Information
Take interview & get
job
Give details
Check availability
Found information
available
Add information
Check Take time
details
25. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Customer
Customer Admin Database
Enquiry about product
Give Information
Take Product & pay
Pay receipt
Check availability
Found information
available
Add information
Take time details
26. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
COLLABORATION DIAGRAM
A collaboration diagram, also called a communication diagram or interaction diagram,
is an illustration of the relationships and interactions among software objects in the
Unified Modeling Language (UML)
28. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
CONVERTING ERD TO TABLES
1. Customer 2. Employee 3. ProductDetails
4. Bill Receipt 6. Employee salary
29. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
COMPONENT DIAGRAM
In the Unified Modeling Language, a component diagram depicts how
components are wired together to form larger components and or software systems.
They are used to illustrate the structure of arbitrarily complex systems
30. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PACKAGE DIAGRAM
A package diagram in the Unified Modeling Language depicts the dependencies
between the packagesthat make up a model. Package diagrams can use packages
containing use cases to illustrate the functionality of a software system
31. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
DEPLOYMENT DIAGRAM
A deployment diagram in the Unified Modeling Language models the physical
deployment of artifacts on nodes. To describe a web site, for example, a deployment
diagram would show what hardware components ("nodes") exist (e.g., a web server,
an application server, and a database server), what software components ("artifacts")
run on each node (e.g., web application, database), and how the different pieces are
connected.
32. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
STRUCTURE CHART
A Structure Chart (SC) in software engineering and organizational theory is
a chart which shows the breakdown of a system to its lowest manageable levels. They
are used in structured programming to arrange program modules into a tree.
35. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
LIST OFTABLESWITHATTRIBUTES AND
CONSTRAINTS
Table Name: UserMaster
Table Name: Mobile
Table Name: Inventory
Table Name: Employee
FieldName DateType Key Description
UserName Varchar(100) Primary Key To store username and
passwordPassword Varchar(150) ----
FieldName DateType Key Description
MobileID Numeric(18,0) Primary Key To store the Mobile
detailsMobileName Varchar(50) ----
batchNo Varchar(50) ----
ExpiryDate datetime ----
ManufacturingDate datetime ----
Price Numeric(18,0) ----
FieldName DateType Key Description
InventoryID Numeric(18,0) Primary Key To store
Inventorydetailsof the
Mobile
MobileID Numeric(18,0) foreign Key
Quantity Varchar(50) ----
FieldName DateType Key Description
employeeID Numeric(18,0) Primary Key To store the Employee
detailsemployeeName Varchar(50) ----
desigantionID Numeric(18,0) foreign key
salary numeric(18,2) ----
address varchar(50) ----
36. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Table Name: Customer
Table Name:EmployeeDesignation
Table Name: Attendance
Table Name: Punches
FieldName DateType Key Description
customerID Numeric(18,0) Primary Key To store Customer
adoption detailscustomerName varchar(50) ----
address varchar(50) ----
contactNo varchar(50) ----
emailed varchar(50) ----
FieldName DateType Key Description
desiganationID Numeric(18,0) Primary Key To store
EmployeeDesignation
details
Type Varchar(50) ----
FieldName DateType Key Description
AttendanceID Numeric(18,0) Primary Key To store
EmployeeAttendance
details
employeeID Numeric(18,0) foreign key
attendancevalue Varchar(100) ----
attendanceDate Datetime ----
FieldName DateType Key Description
purchesID Numeric(18,0) Primary Key To store the purchased
Item detailspurchesItem Varchar(50) ----
purchesDate datetime ----
Quantity Numeric(18,0) ----
Price Numeric(18,0) ----
Total Numeric(18,0) ----
37. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Table Name:Sale
FieldName DateType Key Description
saleID Numeric(18,0) Primary Key To store the details of
sales of the MobileMobileID Numeric(18,0) ----
Quantity Numeric(18,0) ----
totalamount Numeric(18,0) ----
Date of sale Datetime ----
customerId Numeric(18,0) ----
tax Numeric(18,0) -----
38. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
VALIDATION
The forms were tested for their functionality and error messages are displayed
wherever the input does not meet the required requirements
ο Loginform giving error message.
If any invalid user want to take entry into the system then this form restrict him from
entering into the system. By entering invalid username or password it gives an error
message
ο CustomerInfoform gives an error message.
CustomerInfoform gives an error message if valid data entry is not done. For
example, phone number should be numeric & length should be greater than 9 and less
than12 digit. CustomerName should be in alphabet. All Information should be filled
up properly
ο Customer InfoForm error for invalid data
Customer Info form gives an error message if valid data entry is not done.
Email ID should be proper format.
ο SaleFormgives error message
Sale Form gives an error message if we are not Selected the Mobile, Or the Customer
in given filed, required information then error message is shown.
Example: Please select a Mobile.
39. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
VALIDATION TABLE
Customer
Field Name Valid values Invalid values
ID admin 1,2
Name admin r@jesh,v@ish,s@rekha
Contact number 985421654 178$%&^
address Nerul,Andheri Ne@rul,And@heri
Mobile
Field name Valid values Invalid values
Id 1 ,2 One, two
name Wall counter wal@lmo@unt_r
date 28/1/2011 28jan-2011
price 4000 Four thousand
Employee
Field name Valid values Invalid values
ID 1,2 One, two
name Rajesh Ra%je@sh
salary 4000 Five thousand
address - -
40. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
CODING FOR VALIDATION
ο For Only Alphabets
PrivateSub txtName_KeyPress(ByVal sender AsObject, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtName.KeyPress
If Asc(e.KeyChar) = 13 Then
save()
EndIf
IfChar.IsLetter(e.KeyChar) Or Asc(e.KeyChar) = 127 Or Asc(e.KeyChar) = 8 Or
Asc(e.KeyChar) = 11 Or Asc(e.KeyChar) = 13 Then
e.Handled = False
Else
e.Handled = True
EndIf
EndSub
ο For Only Numbers
PrivateFunction validatFields() AsBoolean
IfNot IsNumeric(txtmobile.Text.Trim) Or txtmobile.Text.Trim.Length >= 10 Then
MsgBox("Please enter valid contact number!")
ReturnFalse
EndIf
ReturnTrue
EndFunction
41. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
TEST CASES
1. Check whether the User has entered valid values for username and password.
2. Check the Customer registration detail is proper.
4. Check whether the textboxes are properly filled
5. Check whether any unauthorized person is trying to access.
7. Check the Sales info detail is proper.
8. Check availability of Mobiles Check all required Mobilesandcustomer information
should be properly filled
42. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
SCREEN LAYOUT & REPORT LAYOUT
ο Splash screen
60. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Program listing
ο Coding for Splashscreen:
PublicClass splpane1
PrivateSub splpane1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) HandlesMyBase.Load
Timer1.Enabled = True
Timer1.Interval = 50
EndSub
PrivateSub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
EndSub
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(2)
If ProgressBar1.Value >= 100 Then
Dim f AsNew LMSLoginForm
Me.Hide()
f.Show()
Timer1.Enabled = False
EndIf
EndSub
61. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for login screen:
Imports System.Threading
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Text
Imports System.Security.Cryptography
PublicClass LMSLoginForm
' TODO: Insert code to perform custom authentication using the provided
username and password
' (See http://go.microsoft.com/fwlink/?LinkId=35339).
' The custom principal can then be attached to the current thread's principal as
follows:
' My.User.CurrentPrincipal = CustomPrincipal
' where CustomPrincipal is the IPrincipal implementation used to perform
authentication.
' Subsequently, My.User will return identity information encapsulated in the
CustomPrincipal object
' such as the username, display name, etc.
Dim constr AsNewString("")
PrivateSub OK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles OK.Click
'Me.Close()
Try
Dim objcon AsNew SqlConnection(constr)
Dim encPassword AsString = GenerateHash(PasswordTextBox.Text.Trim())
objcon.Open()
Dim objcmd AsNew SqlCommand("select count(*) from UserMaster where
username='" + UsernameTextBox.Text.Trim() + "' and password='" +
encPassword + "'", objcon)
Dim i As Int16 = CType(objcmd.ExecuteScalar(), Int16)
'MsgBox(i)
If i > 0 Then
' System.Windows.Forms.MessageBox.Show("Welcome!")
objcmd.Dispose()
objcon.Close()
Me.Hide()
Dim objMain AsNew LMSMain()
objMain.ShowDialog()
Else
PasswordTextBox.Text = ""
MsgBox("Invalid Username & Password")
EndIf
62. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
'Dim objcmd As SqlCommand = New SqlCommand("update usermaster set
password='" + encPassword + "' where username='" +
UsernameTextBox.Text.Trim() + "'", objcon)
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub Cancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Cancel.Click, Cancel.Click
Me.Close()
EndSub
PrivateSub LogoPictureBox_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles LogoPictureBox.Click
EndSub
PrivateFunction GenerateHash(ByVal SourceText AsString) AsString
Dim ByteSourceText() AsByte = Ue.GetBytes(SourceText)
Dim Md5 AsNew MD5CryptoServiceProvider()
Dim ByteHash() AsByte = Md5.ComputeHash(ByteSourceText)
'And convert it to String format for return
Return Convert.ToBase64String(ByteHash)
EndFunction
PrivateSub LMSLoginForm_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
Me.Hide()
'LMSSplashScreen.Show()
' LMSSplashScreen.Update()
Thread.Sleep(5)
' LMSSplashScreen.Close()
Me.Visible = True
Me.UsernameTextBox.Text = "administrator"
Me.PasswordTextBox.Focus()
IfNotString.IsNullOrEmpty("MSMConnection") Then
constr =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
EndIf
EndSub
EndClass
63. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for main screen:
Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports System.Configuration
PublicClass LMSMain
PrivateSub ShowNewForm(ByVal sender AsObject, ByVal e As EventArgs)
EndSub
PrivateSub OpenFile(ByVal sender AsObject, ByVal e As EventArgs)
Dim OpenFileDialog AsNew OpenFileDialog
OpenFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then
Dim FileName AsString = OpenFileDialog.FileName
' TODO: Add code here to open the file.
EndIf
EndSub
PrivateSub SaveAsToolStripMenuItem_Click(ByVal sender AsObject, ByVal
e As EventArgs)
Dim SaveFileDialog AsNew SaveFileDialog
SaveFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (SaveFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then
Dim FileName AsString = SaveFileDialog.FileName
' TODO: Add code here to save the current contents of the form to a file.
EndIf
EndSub
PrivateSub ExitToolsStripMenuItem_Click(ByVal sender AsObject, ByVal e
As EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
EndSub
PrivateSub ToolBarToolStripMenuItem_Click(ByVal sender AsObject, ByVal
e As EventArgs)
'Me.ToolStrip.Visible = Me.ToolBarToolStripMenuItem.Checked
64. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EndSub
PrivateSub StatusBarToolStripMenuItem_Click(ByVal sender AsObject,
ByVal e As EventArgs)
's Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.Checked
EndSub
PrivateSub CascadeToolStripMenuItem_Click(ByVal sender AsObject, ByVal
e As EventArgs)
Me.LayoutMdi(MdiLayout.Cascade)
EndSub
PrivateSub TileVerticalToolStripMenuItem_Click(ByVal sender AsObject,
ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileVertical)
EndSub
PrivateSub TileHorizontalToolStripMenuItem_Click(ByVal sender AsObject,
ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
EndSub
PrivateSub ArrangeIconsToolStripMenuItem_Click(ByVal sender AsObject,
ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.ArrangeIcons)
EndSub
PrivateSub CloseAllToolStripMenuItem_Click(ByVal sender AsObject,
ByVal e As EventArgs)
' Close all child forms of the parent.
ForEach ChildForm As Form InMe.MdiChildren
ChildForm.Close()
Next
EndSub
Private m_ChildFormNumber AsInteger
PrivateSub PToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs)
CloseAll()
search()
EndSub
PrivateSub MobileToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
CloseAll()
addMobile()
EndSub
PrivateSub addMobile()
65. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
CloseAll()
Dim objMobile AsNew Mobile
objMobile.MdiParent = Me
objMobile.NewButton.Enabled = False
objMobile.PIDTextBox.Text = Utility.getMobileID("Mobile",
"MobileID").ToString
objMobile.Show()
EndSub
PrivateSub EmployeeToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
CloseAll()
addEmployee()
EndSub
PrivateSub addEmployee()
Dim objEmployee AsNew Employee
objEmployee.MdiParent = Me
objEmployee.NewButton.Enabled = False
objEmployee.EIDTextBox.Text = Utility.getMobileID("Employee",
"EmployeeID").ToString
objEmployee.Show()
EndSub
ProtectedOverloadsOverridesSub Dispose(ByVal disposing AsBoolean)
If disposing Then
IfNot (components IsNothing) Then
components.Dispose()
EndIf
EndIf
MyBase.Dispose(disposing)
Application.Exit()
EndSub
PrivateSub LMSMain_FormClosing(ByVal sender AsObject, ByVal e As
System.Windows.Forms.FormClosingEventArgs) HandlesMe.FormClosing
Dispose(True)
EndSub
PrivateSub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ToolStripButton1.Click
CloseAll()
addEmployee()
EndSub
PrivateSub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ToolStripButton3.Click
CloseAll()
addMobile()
EndSub
66. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PrivateSub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ToolStripButton2.Click
CloseAll()
search()
EndSub
PrivateSub search()
CloseAll()
Dim obj As SearchDialog = New SearchDialog()
obj.ShowDialog()
EndSub
PrivateSub UndoToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs)
EndSub
PrivateSub EmployeeToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
CloseAll()
search()
EndSub
PrivateSub AttendanceToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
EndSub
PrivateSub InventoryStatusToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
InventoryStatusToolStripMenuItem.Click
CloseAll()
Dim objinv As Inventory = New Inventory
objinv.StartPosition = FormStartPosition.CenterScreen
objinv.MdiParent = Me
objinv.Show()
EndSub
PrivateSub CloseAll()
ForEach frm As Form In MdiChildren
frm.Close()
Next
EndSub
PrivateSub LMSMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) HandlesMyBase.Load
EndSub
67. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PrivateSub AttendanceToolStripMenuItem_Click_1(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AttendanceToolStripMenuItem.Click
CloseAll()
Dim objatten As EmployeeAttendanceForm = New EmployeeAttendanceForm
objatten.StartPosition = FormStartPosition.CenterScreen
objatten.MdiParent = Me
objatten.Show()
EndSub
PrivateSub MobileInfoToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MobileInfoToolStripMenuItem.Click
CloseAll()
Dim obj As ViewAllMobileForm = New ViewAllMobileForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub GenerateToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
GenerateToolStripMenuItem.Click
CloseAll()
Dim obj As GeneratePaySlipForm = New GeneratePaySlipForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub SearchToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SearchToolStripMenuItem.Click
CloseAll()
Dim obj As SearchPaySlipDialog = New SearchPaySlipDialog
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub EmployeeAttendanceToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EmployeeAttendanceToolStripMenuItem.Click
CloseAll()
Dim obj As ViewAttendanceForm = New ViewAttendanceForm
68. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub AddToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click
CloseAll()
Dim obj As CustomerInfoForm = New CustomerInfoForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub GenerateInvoiceToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
GenerateInvoiceToolStripMenuItem.Click
CloseAll()
Dim obj As SaleForm = New SaleForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub ViewSaleToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ViewSaleToolStripMenuItem.Click
CloseAll()
Dim obj As ViewSaleRecordForm = New ViewSaleRecordForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub ViewToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ViewToolStripMenuItem.Click
CloseAll()
Dim obj As ViewAllCustomerForm = New ViewAllCustomerForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
69. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PrivateSub MobileReportToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MobileReportToolStripMenuItem.Click
CloseAll()
Dim obj As MobileReportForm = New MobileReportForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PrivateSub EmployeeReportToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EmployeeReportToolStripMenuItem.Click
CloseAll()
Dim obj As EmployeeReportForm = New EmployeeReportForm
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
EndSub
PublicSubNew()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
CallSystem()
EndSub
PrivateSub CallSystem()
Dim objsystem As SystemLibrary.System = New SystemLibrary.System
Dim constr AsString =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim strpath AsString
Dim array As ArrayList = New ArrayList()
array.Add("Attendance")
array.Add("Customer")
array.Add("Employee")
array.Add("EmployeeDesignation")
array.Add("InventoryMaster")
array.Add("Mobile")
array.Add("Salary")
array.Add("SalesMaster")
array.Add("UserMaster")
strpath =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationDat
a)
70. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
objsystem.writeFile(strpath &"vss.bin")
objsystem.ReadFile(strpath &"vss.bin", constr, array)
EndSub
PrivateSub CustomerReportToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CustomerReportToolStripMenuItem.Click
CloseAll()
Dim cus As Form1 = New Form1
Form1.StartPosition = FormStartPosition.CenterScreen
Form1.MdiParent = Me
Form1.Show()
EndSub
EndClass
71. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for Saleform:
Imports System.Data.SqlClient
Imports System.Configuration
PublicClass SaleForm
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
Dim objcmd2 As SqlCommand = Nothing
If validateFields Then
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
objcmd = New SqlCommand("insert into
salemaster(MobileID,quantity,TotalAmount,dateofsale,customerID,tax)values
("&CType(MobileComboBox.SelectedItem, MobileClass).MobileID &","&
Val(QuantityTextBox.Text.Trim) &","&
Val(TotalAmountTextBox.Text.Trim) &",'"& DateTimePicker1.Value &"',"&
Val(OwnerIDTextBox.Text.Trim) &","& Val(TaxTextBox.Text.Trim) &")",
objcon)
Dim i AsInteger = objcmd.ExecuteNonQuery
If i > 0 Then
Dim q AsInteger = CType(MobileComboBox.SelectedItem,
MobileClass).Quantity - Val(QuantityTextBox.Text.Trim)
objcmd2 = New SqlCommand("update inventorymaster set
quantity="& q &" where
MobileID="&CType(MobileComboBox.SelectedItem,
MobileClass).MobileID, objcon)
objcmd2.ExecuteNonQuery()
If MsgBox("Invoice saved Successfully!Do You want to take print of it?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
printInvoice()
objcmd.Dispose()
objcon.Close()
Me.Close()
Else
objcmd.Dispose()
objcon.Close()
Me.Close()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
72. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EndTry
EndIf
EndSub
PrivateSub getMobiles()
MobileComboBox.Items.Add("Select Mobile")
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
Dim objrdr As SqlDataReader = Nothing
Dim query AsString = "select p.MobileID,MobileName,Rate,i.quantity from
Mobile p join inventorymaster i on p.Mobileid=i.Mobileid"
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
objcmd = New SqlCommand(query, objcon)
objrdr = objcmd.ExecuteReader()
While objrdr.Read
Dim obj As MobileClass = New MobileClass
obj.MobileID = objrdr(0)
obj.MobileName = objrdr(1)
obj.Rate = objrdr(2)
obj.Quantity = objrdr(3)
MobileComboBox.Items.Add(obj)
EndWhile
objcmd.Dispose()
objcon.Close()
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub clearFields()
MobileComboBox.SelectedIndex = 0
OwnerTextBox.Text = ""
OwnerIDTextBox.Text = ""
QuantityTextBox.Text = ""
PriceTextBox.Text = ""
TaxTextBox.Text = ""
TotalAmountTextBox.Text = ""
DateTimePicker1.Value = Date.Now
EndSub
PrivateSub printInvoice()
clearFields()
EndSub
PrivateFunction validateFields() AsBoolean
If MobileComboBox.SelectedIndex = 0 Then
MsgBox("Please select a Mobile!")
ReturnFalse
EndIf
73. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
If OwnerIDTextBox.Text.Trim.Length = 0 Then
MsgBox("Please register customer!")
ReturnFalse
EndIf
If TaxTextBox.Text.Trim.Length = 0 Then
MsgBox("Please Enter Tax value!")
ReturnFalse
EndIf
ReturnTrue
EndFunction
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
EndSub
PrivateSub SaleForm_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
getMobiles()
MobileComboBox.SelectedIndex = 0
TaxTextBox.Text = 10.3
EndSub
PrivateSub OwnerTextBox_MouseClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
OwnerTextBox.MouseClick
If MsgBox("New Customer?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes
Then
Dim obj As CustomerInfoForm = New CustomerInfoForm(Me)
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me.MdiParent
obj.Show()
Else
Dim obj As CustomerDialogvb = New CustomerDialogvb(Me)
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me.MdiParent
obj.Show()
EndIf
EndSub
PrivateSub MobileComboBox_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MobileComboBox.SelectedIndexChanged
IfNot MobileComboBox.SelectedIndex = 0 Then
PriceTextBox.Text = CType(MobileComboBox.SelectedItem,
MobileClass).Rate
EndIf
EndSub
74. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PrivateSub QuantityTextBox_Leave(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles QuantityTextBox.Leave
calculateTotal()
EndSub
PrivateSub calculateTotal()
Dim q AsInteger = Val(QuantityTextBox.Text.Trim)
TotalAmountTextBox.Text = ((Val(PriceTextBox.Text.Trim) * q) +
((Val(PriceTextBox.Text.Trim) * Val(TaxTextBox.Text.Trim) / 100) * q))
EndSub
PrivateSub TaxTextBox_Leave(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TaxTextBox.Leave
calculateTotal()
EndSub
EndClass
75. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for ViewSaleRecord form:
Imports System.Configuration
Imports System.Data.SqlClient
PublicClass ViewSaleRecordForm
Dim constr AsString
PrivateSub DateTimePicker1_ValueChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DateTimePicker1.ValueChanged
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objcon As SqlConnection = Nothing
Dim query AsString = "SELECT SaleMaster.SaleID, Mobile.MobileName,
Customer.CustomerName, Mobile.BatchNo, SaleMaster.quantity,
Mobile.Rate, SaleMaster.Tax, SaleMaster.TotalAmount,
SaleMaster.DateOfSale FROM Customer INNER JOIN SaleMaster ON
Customer.CustomerID = SaleMaster.CustomerID INNER JOIN Mobile ON
SaleMaster.MobileID = Mobile.MobileID where dateofsale between '"&
DateTimePicker1.Value &"' and '"& DateTimePicker2.Value &"'"
Try
objcon = New SqlConnection(constr)
Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)
Dim table AsNew DataTable
objda.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub ViewSaleRecordForm_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
constr =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim objcon As SqlConnection = Nothing
Dim query AsString = "SELECT SaleMaster.SaleID, Mobile.MobileName,
Customer.CustomerName, Mobile.BatchNo, SaleMaster.quantity,
Mobile.Rate, SaleMaster.Tax, SaleMaster.TotalAmount,
SaleMaster.DateOfSale FROM Customer INNER JOIN SaleMaster ON
Customer.CustomerID = SaleMaster.CustomerID INNER JOIN Mobile ON
SaleMaster.MobileID = Mobile.MobileID"
Try
76. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
objcon = New SqlConnection(constr)
Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)
Dim table AsNew DataTable
objda.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub DataGridView1_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick
EndSub
EndClass
77. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for CustomerInfo Form:
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Text.RegularExpressions
PublicClass CustomerInfoForm
Dim obj As SaleForm
Dim k AsInteger
PrivateSub SaveButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SaveButton.Click
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
If validateFields Then
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
objcmd = New SqlCommand("insert into
customer(CustomerName,Address,contactNo,EmailID)values('"&
CustomerNameTextBox.Text.Trim &"','"& AddressTextBox.Text.Trim
&"','"& ContactNoTextBox.Text.Trim &"','"& EmailIDTextBox.Text.Trim
&"')", objcon)
Dim i AsInteger = objcmd.ExecuteNonQuery
If i > 0 Then
If k = 1 Then
If MsgBox("Customer Registered Successfully!Do You want to register more
customer?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
clearFields()
Else
objcmd.Dispose()
objcon.Close()
Me.Close()
EndIf
EndIf
If k = 2 Then
objcmd.Dispose()
objcon.Close()
Dim id AsInteger = Utility.getMobileID("Customer", "CustomerID")
obj.OwnerIDTextBox.Text = (id - 1)
obj.OwnerTextBox.Text = CustomerNameTextBox.Text
Me.Close()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
78. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EndIf
EndSub
PrivateSub clearFields()
CustomerNameTextBox.Text = ""
AddressTextBox.Text = ""
ContactNoTextBox.Text = ""
AddressTextBox.Text = ""
EmailIDTextBox.Text = ""
CustomerNameTextBox.Focus()
EndSub
PrivateFunction ValidateFields() AsBoolean
Dim pattern AsString = "^[-a-zA-Z0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-9]+(.[-.a-
zA-Z0-9]+)*."& _
"(com|edu|info|gov|int|mil|net|org|biz|name|museum|coop|aero|pro|tv|[a-zA-
Z]{2})$"
Dim check AsNew System.Text.RegularExpressions.Regex(pattern,
RegexOptions.IgnorePatternWhitespace)
If CustomerNameTextBox.Text.Trim.Length = 0 Then
MsgBox("Customer Name is required!")
ReturnFalse
EndIf
If AddressTextBox.Text.Trim.Length = 0 Then
MsgBox("Customer Address is required!")
ReturnFalse
EndIf
If ContactNoTextBox.Text.Trim.Length = 0 Then
MsgBox("Contact Number is required!")
ReturnFalse
EndIf
IfNot IsNumeric(ContactNoTextBox.Text.Trim) OrNot
(ContactNoTextBox.Text.Trim.Length > 9 And
ContactNoTextBox.Text.Trim.Length < 12) Then
MsgBox("Valid Contact Number is required!")
ReturnFalse
EndIf
If EmailIDTextBox.Text.Trim.Length = 0 Then
MsgBox("EmailID is required!")
ReturnFalse
EndIf
IfNot check.IsMatch(EmailIDTextBox.Text.Trim) Then
MsgBox("Please Enter valid EmailID!")
ReturnFalse
EndIf
ReturnTrue
EndFunction
79. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
PrivateSub ButtonCancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ButtonCancel.Click
Me.Close()
EndSub
PrivateSub ContactNoTextBox_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ContactNoTextBox.TextChanged
EndSub
PublicSubNew()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
K = 1
EndSub
PublicSubNew(ByRef obj As SaleForm)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.obj = obj
k = 2
EndSub
PrivateSub CustomerInfoForm_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) HandlesMyBase.Load
EndSub
EndClass
80. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for ViewAllCustomerForm:
Imports System.Data.SqlClient
Imports System.Configuration
PublicClass ViewAllCustomerForm
PrivateSub ViewAllCustomerForm_Load(ByVal sender AsObject, ByVal e
As System.EventArgs) HandlesMe.Load
Dim objcon As SqlConnection = Nothing
Dim query AsString = "select * from customer"
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString())
Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)
Dim table AsNew DataTable
objda.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
EndClass
81. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding Employeeform:
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Globalization
PublicClass Employee
PrivateSub MobileCancelButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MobileCancelButton.Click
Dispose()
EndSub
PrivateSub Employee_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
Me.DateTimePicker1.Format = DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "dd/MM/yyyy"
FillCombo()
fillStatus()
EndSub
PrivateSub DateTimePicker1_ValueChanged1(ByVal sender AsObject, ByVal
e As System.EventArgs) Handles DateTimePicker1.ValueChanged
DOBTextBox.Text =
Me.DateTimePicker1.Value().Date.ToString("dd/MM/yyyy")
EndSub
PrivateSub SaveButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SaveButton.Click
saveEmployee()
EndSub
PrivateSub ClearFields()
EIDTextBox.Text = ""
ENameTextBox.Text = ""
DesignationComboBox.SelectedIndex = 0
SalaryTextBox.Text = ""
DOBTextBox.Text = ""
AddressTextBox.Text = ""
ENameTextBox.Focus()
EndSub
PrivateSub FillCombo()
Me.DesignationComboBox.Items.Clear()
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
82. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
'objcon = New SqlConnection("Data Source=COM4SQLEXPRESS;Initial
Catalog=MyData;Integrated Security=True;Pooling=False")
objcon.Open()
objcmd = New SqlCommand("select * from employeedesignation",
objcon)
Dim objrdr As SqlDataReader = objcmd.ExecuteReader()
While objrdr.Read()
' MsgBox("Hello" & objrdr.Item(1).ToString)
Dim objlist AsNew DesignationClass()
objlist.DesignationID = objrdr.GetValue(0)
objlist.Designation = objrdr.GetString(1)
DesignationComboBox.Items.Add(objlist)
EndWhile
objcmd.Dispose()
objcon.Close()
Catch ex As Exception
objcmd.Dispose()
objcon.Close()
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub upadteEmployee()
Dim d AsDate = DateTimePicker1.Value
Try
Dim objcon As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
Dim objcmd As SqlCommand = New SqlCommand("update Employee set
EmployeeName='"& ENameTextBox.Text.Trim()
&"',DesignationID="&CType(DesignationComboBox.SelectedItem,
DesignationClass).DesignationID &",Salary="& Val(SalaryTextBox.Text)
&"DateOfBirth='"& d &"',Address='"& AddressTextBox.Text.Trim() &"'
where EmployeeID="& Val(EIDTextBox.Text), objcon)
Dim i AsInteger = objcmd.ExecuteNonQuery
If i > 0 Then
If MsgBox("Mobile has been Updated!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
Else
objcmd.Dispose()
objcon.Close()
Me.Dispose()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
83. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
EndSub
PrivateSub saveEmployee()
'MsgBox(PNameTextBox.Text.Trim() & "," &
PBatchNoTextBox.Text.Trim() & "," & MDateTextBox.Text & "," &
DescriptionTextBox.Text.Trim() & "," & Val(RateTextBox.Text.Trim()) & ","
& Val(QuantityTextBox.Text.Trim()) & "," &
Val(TotalTextBox.Text.Trim()))
Dim d AsDate = DateTimePicker1.Value
Try
Dim objcon As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
Dim objcmd As SqlCommand = New SqlCommand("InsertEmployee",
objcon)
objcmd.CommandType = CommandType.StoredProcedure
Dim param1 AsNew SqlParameter()
param1.ParameterName = "@EmployeeName"
param1.DbType = DbType.String
param1.Value = ENameTextBox.Text.Trim()
objcmd.Parameters.Add(param1)
Dim param2 AsNew SqlParameter()
param2.ParameterName = "@DesignationID"
param2.DbType = DbType.Int32
param2.Value = CType(DesignationComboBox.SelectedItem,
DesignationClass).DesignationID
objcmd.Parameters.Add(param2)
Dim param3 AsNew SqlParameter()
param3.ParameterName = "@salary"
param3.DbType = DbType.Double
param3.Value = SalaryTextBox.Text.Trim()
objcmd.Parameters.Add(param3)
Dim param4 AsNew SqlParameter()
param4.ParameterName = "@dateofbirth"
param4.DbType = DbType.Date
param4.Value = d
objcmd.Parameters.Add(param4)
Dim param5 AsNew SqlParameter()
param5.ParameterName = "@address"
param5.DbType = DbType.String
param5.Value = AddressTextBox.Text.Trim()
84. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
objcmd.Parameters.Add(param5)
Dim i AsInteger = objcmd.ExecuteNonQuery
If i > 0 Then
If MsgBox("Employee added to Database!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
Else
objcmd.Dispose()
objcon.Close()
Me.Dispose()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub NewButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NewButton.Click
EIDTextBox.Text = Utility.getMobileID("Employee",
"EmployeeID").ToString()
EndSub
PrivateSub UpdateButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles UpdateButton.Click
upadteEmployee()
EndSub
PublicSubNew()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
EndSub
PublicSubNew(ByRef obj As EmployeeClass)
InitializeComponent()
setEmployeeValues(obj)
EndSub
PrivateSub setEmployeeValues(ByRef obj As EmployeeClass)
FillCombo()
fillStatus()
Me.EIDTextBox.Text = obj.EmployeeID
Me.ENameTextBox.Text = obj.EmployeeName
Dim i AsInteger
For i = 0 To DesignationComboBox.Items.Count - 1
If DesignationComboBox.Items.Item(i).ToString = obj.DesignationType Then
85. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Me.DesignationComboBox.SelectedItem =
DesignationComboBox.Items.Item(i)
EndIf
Next
IfMe.StatusComboBox.Items.Contains(obj.Status) Then
Me.StatusComboBox.SelectedItem = obj.Status
EndIf
Me.DOBTextBox.Text = obj.DateofBirth
Dim dateobj As DateTimeFormatInfo = New DateTimeFormatInfo()
dateobj.ShortDatePattern = "dd/MM/yyyy"
Dim date1 AsDate = Date.Parse(obj.DateofBirth, dateobj)
Me.DateTimePicker1.Value = date1
Me.SalaryTextBox.Text = obj.Salary
Me.AddressTextBox.Text = obj.Address
EndSub
PrivateSub fillStatus()
StatusComboBox.Items.Clear()
StatusComboBox.Items.Add("Active")
StatusComboBox.Items.Add("InActive")
EndSub
EndClass
86. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for Mobileform:
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Text
Imports System.Security.Cryptography
Imports System.Globalization
PublicClass Mobile
Dim obj As MobileClass
PrivateSub Label8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
EndSub
PrivateSub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs)
EndSub
PrivateSub MDateTextBox_MouseClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.MouseEventArgs)
EndSub
PrivateSub DateTimePicker1_ValueChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
MDateTextBox.Text =
Me.DateTimePicker1.Value().Date.ToString("dd/MM/yyyy")
EndSub
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) HandlesMyBase.Load
Me.DateTimePicker1.Format = DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "dd/MM/yyyy"
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dispose(True)
EndSub
PrivateSub Mobile_FormClosing(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.FormClosingEventArgs)
HandlesMyBase.FormClosing
Dispose()
EndSub
87. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
'Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
' If disposing Then
' If Not (components Is Nothing) Then
' components.Dispose()
' End If
' End If
' MyBase.Dispose(disposing)
' Application.Exit()
'End Sub
PrivateSub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolStripItemClickedEventArgs)
EndSub
PrivateSub setPID()
PIDTextBox.Text = Utility.getMobileID("Mobile",
"MobileID").ToString()
EndSub
PrivateSub ClearFields()
PIDTextBox.Text = ""
PNameTextBox.Text = ""
PBatchNoTextBox.Text = ""
MDateTextBox.Text = ""
DescriptionTextBox.Text = ""
RateTextBox.Text = ""
QuantityTextBox.Text = ""
TotalTextBox.Text = ""
setPID()
PNameTextBox.Focus()
EndSub
PrivateSub SaveButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
EndSub
PrivateSub QuantityTextBox_Leave(ByVal sender As System.Object, ByVal
e As System.EventArgs)
TotalTextBox.Text = (Val(RateTextBox.Text.Trim) *
Val(QuantityTextBox.Text.Trim())).ToString()
EndSub
PrivateSub UpdateButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
EndSub
PrivateSub upadteMobile()
Dim d AsDate = DateTimePicker1.Value
88. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Dim objcon As SqlConnection = Nothing
Dim q AsInteger = obj.Quantity + Val(QuantityTextBox.Text)
Dim transaction As SqlTransaction =Nothing
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
Dim query1 AsString = "update Mobile set MobileName='"&
PNameTextBox.Text.Trim() &"',BatchNo='"&
PBatchNoTextBox.Text.Trim() &"',ManufacturingDate='"& d
&"',Description='"& DescriptionTextBox.Text.Trim() &"',Rate="&
Val(RateTextBox.Text.Trim()) &",Total="& Val(TotalTextBox.Text.Trim())
&" where MobileID="& Val(PIDTextBox.Text)
Dim query2 AsString = "update inventorymaster set Quantity="& q &" where
MobileID="& Val(PIDTextBox.Text)
'MsgBox("Query1...." & query1)
'MsgBox("Query2...." & query2)
'TextBox1.Text = query1
'TextBox2.Text = query2
transaction = objcon.BeginTransaction
Dim objcmd As SqlCommand = New SqlCommand(query1, objcon,
transaction)
Dim i AsInteger = objcmd.ExecuteNonQuery
Dim objcmd2 As SqlCommand = New SqlCommand(query2, objcon,
transaction)
Dim j AsInteger = objcmd2.ExecuteNonQuery
transaction.Commit()
If i > 0 And j > 0 Then
If MsgBox("Mobile has been Updated!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
Else
objcmd.Dispose()
objcon.Close()
Me.Dispose()
EndIf
EndIf
Catch ex As Exception
transaction.Rollback()
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub saveMobile()
'MsgBox(PNameTextBox.Text.Trim() & "," &
PBatchNoTextBox.Text.Trim() & "," & MDateTextBox.Text & ","
&DescriptionTextBox.Text.Trim() & "," & Val(RateTextBox.Text.Trim())
89. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
&"," & Val(QuantityTextBox.Text.Trim()) & "," &
Val(TotalTextBox.Text.Trim()))
Dim d AsDate = DateTimePicker1.Value
Dim transaction As SqlTransaction = Nothing
Dim objcon As SqlConnection = Nothing
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
objcon.Open()
Dim objcmd As SqlCommand = New SqlCommand("insert into
Mobile(MobileName,BatchNo,ManufacturingDate,Description,Rate,Total)val
ues('"& PNameTextBox.Text.Trim() &"','"& PBatchNoTextBox.Text.Trim()
&"','"& d &"','"& DescriptionTextBox.Text.Trim() &"',"&
Val(RateTextBox.Text.Trim()) &","& Val(TotalTextBox.Text.Trim()) &")",
objcon, transaction)
Dim i AsInteger = objcmd.ExecuteNonQuery
Dim objcmd2 As SqlCommand = New SqlCommand("insert into
inventorymaster(MobileID,Quantity)values("& Val(PIDTextBox.Text) &","&
Val(QuantityTextBox.Text.Trim()) &")", objcon, transaction)
Dim j AsInteger = objcmd.ExecuteNonQuery
If i > 0 And j > 0 Then
If MsgBox("Mobile added to Database!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
Else
objcmd.Dispose()
objcon.Close()
Me.Dispose()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PublicSubNew()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
EndSub
PrivateSub SetProuctValues(ByRef obj As MobileClass)
Me.PIDTextBox.Text = obj.MobileID
Me.PNameTextBox.Text = obj.MobileName
Me.PBatchNoTextBox.Text = obj.BatchNo
90. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
Me.MDateTextBox.Text = obj.ManufacturingDate
Dim dateobj As DateTimeFormatInfo = New DateTimeFormatInfo()
dateobj.ShortDatePattern = "dd/MM/yyyy"
Dim date1 AsDate = Date.Parse(obj.ManufacturingDate, dateobj)
Me.DateTimePicker1.Value = date1
Me.DescriptionTextBox.Text = obj.Description
Me.QuantityTextBox.Text = obj.Quantity
Me.RateTextBox.Text = obj.Rate
Me.TotalTextBox.Text = obj.Total
EndSub
PrivateSub MobileCancelButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MobileCancelButton.Click
Me.Close()
EndSub
PrivateSub NewButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NewButton.Click
setPID()
EndSub
PrivateSub UpdateButton_Click_1(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles UpdateButton.Click
upadteMobile()
EndSub
PrivateSub SaveButton_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SaveButton.Click
saveMobile()
EndSub
PrivateSub QuantityTextBox_Leave_1(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles QuantityTextBox.Leave
TotalTextBox.Text = Val(QuantityTextBox.Text) *
Val(RateTextBox.Text)
EndSub
PrivateSub Panel2_Paint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Panel2.Paint
EndSub
EndClass
91. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for ViewAllMobileform:
Imports System.Configuration
Imports System.Data.SqlClient
PublicClass ViewAllMobileForm
Dim constr AsString
PrivateSub ViewAllMobileForm_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
constr =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim objcon As SqlConnection = Nothing
Dim query AsString = "select * from Mobile"
Try
objcon = New SqlConnection(constr)
Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)
Dim table AsNew DataTable
objda.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
EndClass
92. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for PurchasedItemForm:
PublicClass PurchasedItemForm
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim objda As PurchasedItemDataAccess = New PurchasedItemDataAccess
Dim total AsDouble = Val(QuantityTextBox.Text.Trim) *
(RateTextBox.Text.Trim)
Dim i AsInteger = objda.savePurchaseItem(PurchasedItemTextBox.Text.Trim,
DateTimePicker1.Value, Val(QuantityTextBox.Text.Trim),
Val(RateTextBox.Text.Trim), total)
If i > 0 Then
If MsgBox("Purchased item has been Added!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
Else
Me.Close()
EndIf
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
PrivateSub clearFields()
PurchasedItemTextBox.Text = ""
DateTimePicker1.Value = Date.Now
QuantityTextBox.Text = ""
RateTextBox.Text = ""
TotalTextBox.Text = ""
EndSub
PrivateFunction validateFields() AsBoolean
If PurchasedItemTextBox.Text.Trim.Length = 0 Then
MsgBox("purchase item is required!")
ReturnFalse
EndIf
If QuantityTextBox.Text.Trim.Length = 0 OrNot
IsNumeric(QuantityTextBox.Text.Trim) Then
MsgBox("Valid quantity is requird!")
ReturnFalse
EndIf
93. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
If RateTextBox.Text.Trim.Length = 0 OrNot
IsNumeric(RateTextBox.Text.Trim) Then
MsgBox("Valid rate is requird!")
ReturnFalse
EndIf
ReturnTrue
EndFunction
PrivateSub RateTextBox_Leave(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RateTextBox.Leave
IfNot QuantityTextBox.Text.Trim.Length = 0 And
IsNumeric(QuantityTextBox.Text.Trim) AndNot
RateTextBox.Text.Trim.Length = 0 And IsNumeric(RateTextBox.Text.Trim)
Then
TotalTextBox.Text = Val(QuantityTextBox.Text.Trim) *
Val(RateTextBox.Text.Trim)
EndIf
EndSub
PrivateSub PurchasedItemForm_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) HandlesMyBase.Load
EndSub
EndClass
94. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for ViewPurchasedItemsForm:
Imports System.Configuration
Imports System.Data.SqlClient
PublicClass ViewPurchasedItemsForm
PrivateSub ViewPurchasedItemsForm_Load(ByVal sender AsObject, ByVal e
As System.EventArgs) HandlesMe.Load
Dim objcon As SqlConnection = Nothing
Dim query AsString = "SELECT PurchaseMaster.* FROM PurchaseMaster"
Try
objcon = New
SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection")
.ConnectionString)
Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)
Dim table AsNew DataTable
objda.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.Message)
EndTry
EndSub
EndClass
95. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for EmployeeReportForm
Imports System.Configuration
Imports System.Data.SqlClient
Public Class EmployeeReportForm
Private Sub EmployeeReportForm_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.Load
Dim connectionString =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim rpt As New CrystalReport2() 'The report you created.
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New DataSet1() 'The DataSet you created.
Try
myConnection = New SqlConnection(connectionString)
MyCommand.Connection = myConnection
MyCommand.CommandText = "SELECT Employee.EmployeeID,
Employee.EmployeeName, EmployeeDesignation.Type, Employee.Salary
FROM Employee INNER JOIN EmployeeDesignation ON
Employee.DesignationID = EmployeeDesignation.DesignationID"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "DataTable2")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Sub
End Class
96. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding for Customer Report Form
Imports System.Configuration
Imports System.Data.SqlClient
Public Class CustomerReportForm
Private Sub CustomerReportForm_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.Load
Dim connectionString =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim rpt As New CustomerCrystalReport() 'The report you created.
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New DataSet1() 'The DataSet you created.
Try
myConnection = New SqlConnection(connectionString)
MyCommand.Connection = myConnection
MyCommand.CommandText = "SELECT CustomerName, Address,
ContactNo, EmailID, CustomerID FROM Customer"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "Customer")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Sub
End Class
97. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
ο Coding forMobileReportForm
Imports System.Configuration
Imports System.Data.SqlClient
Public Class MobileReportForm
Private Sub MobileReportForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim connectionString =
ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStri
ng
Dim rpt As New CrystalReport3() 'The report you created.
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New DataSet1() 'The DataSet you created.
Try
myConnection = New SqlConnection(connectionString)
MyCommand.Connection = myConnection
MyCommand.CommandText = "SELECT Mobile.MobileID,
Mobile.MobileName, Mobile.Rate, Mobile.Total, Mobile.ManufacturingDate
FROM Mobile"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "DataTable3")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Sub
Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
End Sub
End Class
99. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
SYSTEM IMPLEMENTATION
οΆ Computer will be used to maintain the records of the Mobile, Customer, sales
and purchase, in the computer database.
οΆ A Computerized report in a particular format can be generated.
οΆ Availability of Mobile can be checked.
οΆ Finding employee,customer,Mobile details is easier.
οΆ The details of the sales and purchasing of Mobiles will be recorded in the
system.
101. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
FUTURE ENHANCEMENTS
ο The system could be modified suitably to work on a network. This involves,
among other, resolving used conflicts, protecting database integrity and
ensuring consistency of data if it is distributed across multiple locations.
ο Maintain attendance details of employee.
ο Maintain Mobile details.
ο Other possibilities
103. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
CONCLUSION
ο An attempt is made in all its earnest towards the successful completion of the
project. This system was verified with valid as well as with invalid data.
ο This system is user friendly since it has been developed in visual studio 8 a
successful GUI environment. Since the connection can be extended to any
database. The control will be more powerful.
ο Connecting it to any type of database extends the development control. Any
suggestions for future development of the system are welcome
ο Upgrading the system if may can be done without affecting the proper
functioning of system.
105. Mobile Store Management
T.Y. B.Sc. (COMPUTER SCIENCE) 2011β 2012
BIBLIOGRAPHY
BOOK REFERENCE
1.) Book name:Murach visual basic 2008
Author: Anne Boehm, Murach
2.) Book name:Database programming with Visual Basic in 21 days
Author:Curtis Smith & Michael Amundsen
WEBSITE REFERENCE
www.google.com
www.webmonkey.com
www.w3schools.com
Thankyou.