Download - Final Msm black book Final
Mobile Store Management
CHAPTER 1
PRELIMINARY INVESTIGATION
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
PROJECT DESCRIPTION
NAME OF THE PROJECT: MOBILE STORE MANAGMENT
Following are few characteristics of the Mobile Management System
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
PROCESSING ENVIRONMENT
Processing environment includes hardware and software requirements.
Software Requirement
Operating system: - Windows XP, Windows7Front-end Tool: - Visual studio 2008Back-end Tool: - MS SQL2005
Hardware Requirement
Operating system: Windows XP and above.Minimum 5 GB HDD space3.00 Megahertz Intel Pentium IV Processor1 GB RAM
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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:
Technical Feasibility:-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
Organizational and 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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Operational Feasibility:-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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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:-
EMPLOYEESHe 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.
CUSTOMERCustomer 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.
ADMINISTRATORThe 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
FACT FINDING TECHNIQUES
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
Record InspectionThe 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
EVENT TABLE
TRIGGER:
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
EVENT TRIGGER SOURCE ACTIVITY RESPONSE DESTINATION
Create anEmployee
Employee Details
Employee Add employee details
Information saved
Employee
UpdateEmployee
Update employee
Employee Update employee
Update Information
Employee
Add Mobile Mobiledetails 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
USE CASE
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Represent Data Entity.
Represent connection Administrator
Represent the relationship.
Symbols used in Entity-Relationship Diagram are as follows:
Connect two Entities or One to One relation.
Mobile Store Management
Invoice Detail Subsystem
ER-DIAGRAM
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
ACTIVITY DIAGRAM
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Customer
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
the system's classes, their attributes, operations (or methods), and the relationships among the classes.
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:
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
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
Mobile Store Management
Customer
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Customer Admin Database
Enquiry about product
Give Information
Take Product & pay
Pay receipt
Check availability
Found information available
Add information
Take time details
Mobile Store Management
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)
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
CONVERTING ERD TO TABLES
1. Customer 2. Employee 3. Product Details
4. Bill Receipt 6. Employee salary
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
LIST OFTABLESWITHATTRIBUTES AND CONSTRAINTS
Table Name: UserMasterFieldName DateType Key DescriptionUserName Varchar(100) Primary Key To store username and
passwordPassword Varchar(150) ----
Table Name: MobileFieldName DateType Key DescriptionMobileID Numeric(18,0) Primary Key To store the Mobile
detailsMobileName Varchar(50) ----batchNo Varchar(50) ----ExpiryDate datetime ----ManufacturingDate datetime ----Price Numeric(18,0) ----
Table Name: InventoryFieldName DateType Key DescriptionInventoryID Numeric(18,0) Primary Key To store
Inventorydetailsof the Mobile
MobileID Numeric(18,0) foreign KeyQuantity Varchar(50) ----
Table Name: EmployeeFieldName DateType Key DescriptionemployeeID Numeric(18,0) Primary Key To store the Employee
detailsemployeeName Varchar(50) ----desigantionID Numeric(18,0) foreign keysalary numeric(18,2) ----
address varchar(50) ----
Table Name: CustomerFieldName DateType Key Description
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
customerID Numeric(18,0) Primary Key To store Customer adoption details customerName varchar(50) ----
address varchar(50) ----contactNo varchar(50) ----emailed varchar(50) ----
Table Name:EmployeeDesignationFieldName DateType Key DescriptiondesiganationID Numeric(18,0) Primary Key To store
EmployeeDesignationdetails
Type Varchar(50) ----
Table Name: AttendanceFieldName DateType Key DescriptionAttendanceID Numeric(18,0) Primary Key To store
EmployeeAttendancedetails
employeeID Numeric(18,0) foreign keyattendancevalue Varchar(100) ----attendanceDate Datetime ----
Table Name: PunchesFieldName DateType Key DescriptionpurchesID 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) ----
Table Name:SaleFieldName DateType Key DescriptionsaleID Numeric(18,0) Primary Key To store the details of MobileID Numeric(18,0) ----
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
sales of the MobileQuantity Numeric(18,0) ----totalamount Numeric(18,0) ----Date of sale Datetime ----customerId Numeric(18,0) ----
tax Numeric(18,0) -----
VALIDATION
The forms were tested for their functionality and error messages are displayed wherever the input does not meet the required requirements
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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 dataCustomer Info form gives an error message if valid data entry is not done.Email ID should be proper format.
SaleForm gives error messageSale 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.
VALIDATION TABLE
CustomerField Name Valid values Invalid values
ID admin 1,2
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Name admin r@jesh,v@ish,s@rekhaContact number 985421654 178$%&^
address Nerul,Andheri Ne@rul,And@heri
MobileField name Valid values Invalid values
Id 1 ,2 One, twoname Wall counter wal@lmo@unt_rdate 28/1/2011 28jan-2011price 4000 Four thousand
EmployeeField name Valid values Invalid values
ID 1,2 One, two
name Rajesh Ra%je@sh
salary 4000 Five thousand
address - -
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
SCREEN LAYOUT & REPORT LAYOUT
Splash screen
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Program listing
Coding for Splash screen:
PublicClass splpane1
PrivateSub splpane1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load Timer1.Enabled = True Timer1.Interval = 50EndSub
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 ThenDim f AsNew LMSLoginFormMe.Hide() f.Show()
Timer1.Enabled = FalseEndIfEndSub
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for login screen:
Imports System.ThreadingImports System.Data.SqlClientImports System.ConfigurationImports System.TextImports 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()TryDim 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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
'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.ClickMe.Close()EndSub
PrivateSub LogoPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogoPictureBox.Click
EndSubPrivateFunction GenerateHash(ByVal SourceText AsString) AsStringDim ByteSourceText() AsByte = Ue.GetBytes(SourceText)Dim Md5 AsNew MD5CryptoServiceProvider()Dim ByteHash() AsByte = Md5.ComputeHash(ByteSourceText)'And convert it to String format for returnReturn Convert.ToBase64String(ByteHash)EndFunctionPrivateSub 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 = TrueMe.UsernameTextBox.Text = "administrator"Me.PasswordTextBox.Focus()IfNotString.IsNullOrEmpty("MSMConnection") Then constr = ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStringEndIfEndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for main screen:
Imports System.Windows.FormsImports System.Data.SqlClientImports 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) ThenDim FileName AsString = OpenFileDialog.FileName' TODO: Add code here to open the file.EndIfEndSub
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) ThenDim FileName AsString = SaveFileDialog.FileName' TODO: Add code here to save the current contents of the form to a file.EndIfEndSub
PrivateSub ExitToolsStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs) Handles ExitToolStripMenuItem.ClickMe.Close()EndSub
PrivateSub ToolBarToolStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs)'Me.ToolStrip.Visible = Me.ToolBarToolStripMenuItem.Checked
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
EndSub
PrivateSub StatusBarToolStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs)'s Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.CheckedEndSub
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()NextEndSub
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()EndSubPrivateSub addMobile()
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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()EndSubPrivateSub addEmployee()Dim objEmployee AsNew Employee objEmployee.MdiParent = Me objEmployee.NewButton.Enabled = False objEmployee.EIDTextBox.Text = Utility.getMobileID("Employee", "EmployeeID").ToString objEmployee.Show()EndSubProtectedOverloadsOverridesSub Dispose(ByVal disposing AsBoolean)If disposing ThenIfNot (components IsNothing) Then components.Dispose()EndIfEndIfMyBase.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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
PrivateSub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click CloseAll() search()EndSubPrivateSub search() CloseAll()Dim obj As SearchDialog = New SearchDialog() obj.ShowDialog()EndSubPrivateSub 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()EndSubPrivateSub CloseAll()ForEach frm As Form In MdiChildren frm.Close()NextEndSub
PrivateSub LMSMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSub
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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()
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Dim obj As ViewAttendanceForm = New ViewAttendanceForm 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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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()EndSubPrivateSub CallSystem()Dim objsystem As SystemLibrary.System = New SystemLibrary.SystemDim constr AsString = ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStringDim strpath AsStringDim 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.LocalApplicationData)
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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()
EndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for Sale form:
Imports System.Data.SqlClientImports System.Configuration
PublicClass SaleForm
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim objcon As SqlConnection = NothingDim objcmd As SqlCommand = NothingDim objcmd2 As SqlCommand = NothingIf validateFields ThenTry 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.ExecuteNonQueryIf i > 0 ThenDim 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()EndIfEndIfCatch ex As Exception
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
MsgBox(ex.Message)EndTryEndIfEndSubPrivateSub getMobiles()MobileComboBox.Items.Add("Select Mobile")Dim objcon As SqlConnection = NothingDim objcmd As SqlCommand = NothingDim objrdr As SqlDataReader = NothingDim 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.ReadDim 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)EndTryEndSubPrivateSub clearFields()MobileComboBox.SelectedIndex = 0 OwnerTextBox.Text = "" OwnerIDTextBox.Text = "" QuantityTextBox.Text = "" PriceTextBox.Text = "" TaxTextBox.Text = "" TotalAmountTextBox.Text = "" DateTimePicker1.Value = Date.NowEndSubPrivateSub printInvoice() clearFields()EndSubPrivateFunction validateFields() AsBooleanIf MobileComboBox.SelectedIndex = 0 Then MsgBox("Please select a Mobile!")ReturnFalse
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
EndIfIf OwnerIDTextBox.Text.Trim.Length = 0 Then MsgBox("Please register customer!")ReturnFalseEndIfIf TaxTextBox.Text.Trim.Length = 0 Then MsgBox("Please Enter Tax value!")ReturnFalseEndIfReturnTrueEndFunctionPrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickMe.Close()EndSub
PrivateSub SaleForm_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load getMobiles()MobileComboBox.SelectedIndex = 0 TaxTextBox.Text = 10.3EndSub
PrivateSub OwnerTextBox_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles OwnerTextBox.MouseClickIf MsgBox("New Customer?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes ThenDim obj As CustomerInfoForm = New CustomerInfoForm(Me) obj.StartPosition = FormStartPosition.CenterScreen obj.MdiParent = Me.MdiParent obj.Show()ElseDim obj As CustomerDialogvb = New CustomerDialogvb(Me) obj.StartPosition = FormStartPosition.CenterScreen obj.MdiParent = Me.MdiParent obj.Show()EndIfEndSub
PrivateSub MobileComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MobileComboBox.SelectedIndexChangedIfNot MobileComboBox.SelectedIndex = 0 Then PriceTextBox.Text = CType(MobileComboBox.SelectedItem, MobileClass).RateEndIfEndSub
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
PrivateSub QuantityTextBox_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuantityTextBox.Leave calculateTotal()EndSubPrivateSub 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()EndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for ViewSaleRecord form:
Imports System.ConfigurationImports System.Data.SqlClient
PublicClass ViewSaleRecordFormDim constr AsStringPrivateSub 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 = NothingDim 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 = tableCatch ex As Exception MsgBox(ex.Message)EndTryEndSub
PrivateSub ViewSaleRecordForm_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load constr = ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStringDim objcon As SqlConnection = NothingDim 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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
objcon = New SqlConnection(constr)Dim objda As SqlDataAdapter = New SqlDataAdapter(query, objcon)Dim table AsNew DataTable objda.Fill(table) DataGridView1.DataSource = tableCatch ex As Exception MsgBox(ex.Message)EndTryEndSub
PrivateSub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
EndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for CustomerInfo Form:
Imports System.Data.SqlClientImports System.ConfigurationImports System.Text.RegularExpressions
PublicClass CustomerInfoFormDim obj As SaleFormDim k AsIntegerPrivateSub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.ClickDim objcon As SqlConnection = NothingDim objcmd As SqlCommand = Nothing
If validateFields ThenTry 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.ExecuteNonQueryIf i > 0 ThenIf k = 1 ThenIf MsgBox("Customer Registered Successfully!Do You want to register more customer?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then clearFields()Else objcmd.Dispose() objcon.Close()Me.Close()EndIfEndIfIf k = 2 Then objcmd.Dispose() objcon.Close()Dim id AsInteger = Utility.getMobileID("Customer", "CustomerID") obj.OwnerIDTextBox.Text = (id - 1) obj.OwnerTextBox.Text = CustomerNameTextBox.TextMe.Close()EndIfEndIfCatch ex As Exception MsgBox(ex.Message)EndTry
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
EndIfEndSubPrivateSub clearFields() CustomerNameTextBox.Text = "" AddressTextBox.Text = "" ContactNoTextBox.Text = "" AddressTextBox.Text = "" EmailIDTextBox.Text = "" CustomerNameTextBox.Focus()EndSubPrivateFunction 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!")ReturnFalseEndIfIf AddressTextBox.Text.Trim.Length = 0 Then MsgBox("Customer Address is required!")ReturnFalseEndIfIf ContactNoTextBox.Text.Trim.Length = 0 Then MsgBox("Contact Number is required!")ReturnFalseEndIfIfNot IsNumeric(ContactNoTextBox.Text.Trim) OrNot (ContactNoTextBox.Text.Trim.Length > 9 And ContactNoTextBox.Text.Trim.Length < 12) Then MsgBox("Valid Contact Number is required!")ReturnFalseEndIfIf EmailIDTextBox.Text.Trim.Length = 0 Then MsgBox("EmailID is required!")ReturnFalseEndIfIfNot check.IsMatch(EmailIDTextBox.Text.Trim) Then MsgBox("Please Enter valid EmailID!")ReturnFalseEndIfReturnTrueEndFunction
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
PrivateSub ButtonCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCancel.ClickMe.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 = 1EndSubPublicSubNew(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 = 2EndSub
PrivateSub CustomerInfoForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for ViewAllCustomerForm:
Imports System.Data.SqlClientImports System.Configuration
PublicClass ViewAllCustomerForm
PrivateSub ViewAllCustomerForm_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
Dim objcon As SqlConnection = NothingDim 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 = tableCatch ex As Exception MsgBox(ex.Message)EndTryEndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding Employee form:
Imports System.Data.SqlClientImports System.ConfigurationImports 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.CustomMe.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()EndSubPrivateSub ClearFields() EIDTextBox.Text = "" ENameTextBox.Text = "" DesignationComboBox.SelectedIndex = 0 SalaryTextBox.Text = "" DOBTextBox.Text = "" AddressTextBox.Text = "" ENameTextBox.Focus()EndSubPrivateSub FillCombo()Me.DesignationComboBox.Items.Clear()Dim objcon As SqlConnection = NothingDim objcmd As SqlCommand = NothingTry objcon = New SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionString)
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
'objcon = New SqlConnection("Data Source=COM4\SQLEXPRESS;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)EndTryEndSubPrivateSub upadteEmployee()Dim d AsDate = DateTimePicker1.ValueTryDim 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.ExecuteNonQueryIf i > 0 ThenIf MsgBox("Mobile has been Updated!Do you want to continue?", MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then ClearFields()Else objcmd.Dispose() objcon.Close()Me.Dispose()EndIfEndIfCatch ex As Exception MsgBox(ex.Message)EndTry
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
EndSubPrivateSub 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.ValueTryDim 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()
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
objcmd.Parameters.Add(param5)
Dim i AsInteger = objcmd.ExecuteNonQueryIf i > 0 ThenIf MsgBox("Employee added to Database!Do you want to continue?", MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then ClearFields()Else objcmd.Dispose() objcon.Close()Me.Dispose()EndIfEndIfCatch ex As Exception MsgBox(ex.Message)EndTryEndSub
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()EndSubPublicSubNew()
' This call is required by the Windows Form Designer. InitializeComponent()
' Add any initialization after the InitializeComponent() call.
EndSubPublicSubNew(ByRef obj As EmployeeClass) InitializeComponent() setEmployeeValues(obj)EndSubPrivateSub setEmployeeValues(ByRef obj As EmployeeClass) FillCombo() fillStatus()Me.EIDTextBox.Text = obj.EmployeeIDMe.ENameTextBox.Text = obj.EmployeeNameDim i AsIntegerFor i = 0 To DesignationComboBox.Items.Count - 1If DesignationComboBox.Items.Item(i).ToString = obj.DesignationType Then
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Me.DesignationComboBox.SelectedItem = DesignationComboBox.Items.Item(i)EndIfNextIfMe.StatusComboBox.Items.Contains(obj.Status) ThenMe.StatusComboBox.SelectedItem = obj.StatusEndIfMe.DOBTextBox.Text = obj.DateofBirthDim dateobj As DateTimeFormatInfo = New DateTimeFormatInfo() dateobj.ShortDatePattern = "dd/MM/yyyy"Dim date1 AsDate = Date.Parse(obj.DateofBirth, dateobj)Me.DateTimePicker1.Value = date1Me.SalaryTextBox.Text = obj.SalaryMe.AddressTextBox.Text = obj.AddressEndSubPrivateSub fillStatus() StatusComboBox.Items.Clear() StatusComboBox.Items.Add("Active") StatusComboBox.Items.Add("InActive")EndSub
EndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for Mobileform:
Imports System.ConfigurationImports System.Data.SqlClientImports System.TextImports System.Security.CryptographyImports System.Globalization
PublicClass MobileDim obj As MobileClassPrivateSub 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.LoadMe.DateTimePicker1.Format = DateTimePickerFormat.CustomMe.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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
'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)
EndSubPrivateSub setPID() PIDTextBox.Text = Utility.getMobileID("Mobile", "MobileID").ToString()EndSubPrivateSub 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)
EndSubPrivateSub upadteMobile()Dim d AsDate = DateTimePicker1.Value
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Dim objcon As SqlConnection = NothingDim q AsInteger = obj.Quantity + Val(QuantityTextBox.Text)Dim transaction As SqlTransaction =NothingTry 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.ExecuteNonQueryDim objcmd2 As SqlCommand = New SqlCommand(query2, objcon, transaction)Dim j AsInteger = objcmd2.ExecuteNonQuery transaction.Commit()If i > 0 And j > 0 ThenIf MsgBox("Mobile has been Updated!Do you want to continue?", MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then ClearFields()Else objcmd.Dispose() objcon.Close()Me.Dispose()EndIfEndIfCatch ex As Exception transaction.Rollback() MsgBox(ex.Message)EndTryEndSubPrivateSub saveMobile()'MsgBox(PNameTextBox.Text.Trim() & "," & PBatchNoTextBox.Text.Trim() & "," & MDateTextBox.Text & "," &DescriptionTextBox.Text.Trim() & "," & Val(RateTextBox.Text.Trim())
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
&"," & Val(QuantityTextBox.Text.Trim()) & "," & Val(TotalTextBox.Text.Trim()))Dim d AsDate = DateTimePicker1.ValueDim transaction As SqlTransaction = NothingDim objcon As SqlConnection = NothingTry objcon = New SqlConnection(ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionString) objcon.Open()Dim objcmd As SqlCommand = New SqlCommand("insert into Mobile(MobileName,BatchNo,ManufacturingDate,Description,Rate,Total)values('"& 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 ThenIf MsgBox("Mobile added to Database!Do you want to continue?", MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then ClearFields()Else objcmd.Dispose() objcon.Close()Me.Dispose()EndIfEndIfCatch ex As Exception MsgBox(ex.Message)EndTryEndSubPublicSubNew()
' This call is required by the Windows Form Designer. InitializeComponent()
' Add any initialization after the InitializeComponent() call.
EndSubPrivateSub SetProuctValues(ByRef obj As MobileClass)Me.PIDTextBox.Text = obj.MobileIDMe.PNameTextBox.Text = obj.MobileNameMe.PBatchNoTextBox.Text = obj.BatchNo
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Me.MDateTextBox.Text = obj.ManufacturingDateDim dateobj As DateTimeFormatInfo = New DateTimeFormatInfo() dateobj.ShortDatePattern = "dd/MM/yyyy"Dim date1 AsDate = Date.Parse(obj.ManufacturingDate, dateobj)Me.DateTimePicker1.Value = date1Me.DescriptionTextBox.Text = obj.DescriptionMe.QuantityTextBox.Text = obj.QuantityMe.RateTextBox.Text = obj.RateMe.TotalTextBox.Text = obj.TotalEndSub
PrivateSub MobileCancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MobileCancelButton.ClickMe.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.PaintEndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for ViewAllMobile form:
Imports System.ConfigurationImports System.Data.SqlClient
PublicClass ViewAllMobileFormDim constr AsStringPrivateSub ViewAllMobileForm_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load constr = ConfigurationManager.ConnectionStrings("MSMConnection").ConnectionStringDim objcon As SqlConnection = NothingDim 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 = tableCatch ex As Exception MsgBox(ex.Message)EndTryEndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for PurchasedItemForm:
PublicClass PurchasedItemForm
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickMe.Close()EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickTryDim objda As PurchasedItemDataAccess = New PurchasedItemDataAccessDim 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 ThenIf MsgBox("Purchased item has been Added!Do you want to continue?", MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then ClearFields()ElseMe.Close()EndIfEndIfCatch ex As Exception MsgBox(ex.Message)EndTryEndSubPrivateSub clearFields() PurchasedItemTextBox.Text = "" DateTimePicker1.Value = Date.Now QuantityTextBox.Text = "" RateTextBox.Text = "" TotalTextBox.Text = ""EndSubPrivateFunction validateFields() AsBooleanIf PurchasedItemTextBox.Text.Trim.Length = 0 Then MsgBox("purchase item is required!")ReturnFalseEndIfIf QuantityTextBox.Text.Trim.Length = 0 OrNot IsNumeric(QuantityTextBox.Text.Trim) Then MsgBox("Valid quantity is requird!")ReturnFalseEndIf
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
If RateTextBox.Text.Trim.Length = 0 OrNot IsNumeric(RateTextBox.Text.Trim) Then MsgBox("Valid rate is requird!")ReturnFalseEndIfReturnTrueEndFunction
PrivateSub RateTextBox_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RateTextBox.LeaveIfNot 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)EndIfEndSub
PrivateSub PurchasedItemForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSub
EndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for ViewPurchasedItemsForm:
Imports System.ConfigurationImports System.Data.SqlClient
PublicClass ViewPurchasedItemsForm
PrivateSub ViewPurchasedItemsForm_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
Dim objcon As SqlConnection = NothingDim 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 = tableCatch ex As Exception MsgBox(ex.Message)EndTryEndSubEndClass
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for EmployeeReport Form
Imports System.ConfigurationImports 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").ConnectionString 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 SubEnd Class
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding for Customer Report Form
Imports System.ConfigurationImports 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").ConnectionString 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 SubEnd Class
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
Coding forMobileReport Form
Imports System.ConfigurationImports 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").ConnectionString 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 SubEnd Class
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
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.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
CHAPTER 8
REFERENCES AND BIBLIOGRAPHY
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012
Mobile Store Management
BIBLIOGRAPHY
BOOK REFERENCE
1.) Book name:Murach visual basic 2008 Author: Anne Boehm, Murach
2.) Book name:Database programming with Visual Basic in 21 daysAuthor:Curtis Smith & Michael Amundsen
WEBSITE REFERENCE
www.google.com
www.webmonkey.com
www.w3schools.com
Thank you.
T.Y. B.Sc. (COMPUTER SCIENCE) 2011– 2012