PRODUCT DETAILS
ABSTRACT
The project titled Medical Management System to Maintain Product Details is
designed using Microsoft Visual Studio.NET as the front end and SQL SERVER 2000 as the
back end which is developed under Visual Studio .NET 2003.
The project contains following modules:
In this module admin can create new users .he can delete and update the users.
In drug module we can add the drugs details, drug code, drug name, drug category and
description.
The transaction module contains purchase; purchase return sale and sales return details.
During this process bill no drug code, batch no expiry date, rate drug name mfg date also
maintain here, we can add these details, and also modify the details.
The Reports and view module contains drugs details and bill details sales, and purchase
details are viewable. The bill details either date wise, drug id wise or all details.
Page | 1
SYSTEM SPECIFICATION
HARDWARE CONFIGURATION
The hardware used for the development of the project is:
PROCESSOR
RAM
128 MD SD RAM
MONITOR
15 COLOR
HARD DISK
20 GB
FLOPPY DRIVE
1.44 MB
CDDRIVE
LG 52X
KEYBOARD
MOUSE
3 BUTTONS
SOFTWARE CONFIGURATION
The software used for the development of the project is:
OPERATING SYSTEM
ENVIRONMENT
.NET FRAMEWORK
VERSION 1.1
LANGUAGE
VISUAL BASIC.NET
BACKEND
Page | 2
CODINGS
Frmdrug.VB
Imports System.Data.OleDb
Public Class frmDrug
Inherits System.Windows.Forms.Form
Windows Form Designer generated code
Dim ds As New DataSet
Dim da As New OleDbDataAdapter(cmd)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or
TextBox4.Text = "" Then
MsgBox("Some of the fields are missing.", MsgBoxStyle.Information)
Exit Sub
End If
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Delete from Drug Where DrugCode='" & TextBox1.Text & "'"
cmd.CommandText = sqlstr
cmd.ExecuteNonQuery()
sqlstr = "Insert into Drug values('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "')"
cmd.CommandText = sqlstr
cmd.ExecuteNonQuery()
con.Close()
MsgBox("Drug Details Saved...", MsgBoxStyle.Information)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
RefreshData()
End Sub
Sub RefreshData()
ds.Clear()
cmd.CommandText = "select * from Drug"
da.Fill(ds, "Drug")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Drug"
End Sub
Page | 3
Page | 4
Page | 5
Frmlogin.VB
Imports System.Data.OleDb
Public Class frmLogin
Inherits System.Windows.Forms.Form
Frmpurchase.vb
Imports System.Data.OleDb
Public Class frmPurchase
Inherits System.Windows.Forms.Form
Page | 6
Page | 7
'TextBox5.Text = r(4)
'TextBox6.Text = r(5)
Else
Page | 8
ComboBox1.Items.Add(r(0))
End While
r.Close()
con.Close()
t10.Text = 1
End Sub
Private Sub ComboBox1_KeyPress(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) = 13 Then
T2.Focus()
End If
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles T5.TextChanged
End Sub
Function Validatecontrols(ByVal fx As Form) As Boolean
Dim l, t As Integer
For Each x As Control In fx.Controls
If TypeOf x Is TextBox Or TypeOf x Is ComboBox Then
If x.Text.Trim = "" Then
l = x.Left
t = x.Top
For Each y As Control In fx.Controls
If TypeOf y Is Label Then
If y.Top > t - 10 And y.Top < t + 10 Then
If l - (y.Left + y.Width) < 150 Then
MsgBox("Enter Proper value for " & y.Text,
MsgBoxStyle.Information)
x.Select()
Return True
Exit Function
End If
End If
End If
Next
Exit For
End If
End If
Next
Return False
End Function
Page | 9
End Sub
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim x As Control
For Each x In Me.Controls
If TypeOf x Is TextBox Then
x.Text = ""
End If
If TypeOf x Is ComboBox Then
x.Text = ""
End If
Next
If con.State <> ConnectionState.Open Then con.Open()
Dim sqlstr As String
sqlstr = "Select max(billno) from purchase"
cmd.CommandText = sqlstr
'Dim r As New OleDbDataAdapter
'
DataGrid1.DataSource = ds
'DataGrid1.DataMember = "Purchase"
Try
T1.Text = Val(cmd.ExecuteScalar) + 1
Catch ex As Exception
T1.Text = 1
End Try
con.Close()
T2.Text = Format(DateTime.Today, "dd/MM/yyyy")
End Sub
Private Sub T5_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles T5.LostFocus
If IsDate(T5.Text) Then
T5.Text = DateTime.ParseExact(T5.Text, "dd/MM/yyyy", Nothing)
End If
End Sub
Private Sub T6_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles T6.LostFocus
If IsDate(T6.Text) Then
T6.Text = DateTime.ParseExact(T6.Text, "dd/MM/yyyy", Nothing)
End If
End Sub
Private Sub frmPurchase_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Escape Then
Me.Close()
ElseIf e.KeyCode = Keys.Return Then
SendKeys.Send("{tab}")
End If
End Sub
Private Sub T7_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles T7.TextChanged
If T7.Text.Length > 0 Then T9.Text = Val(T7.Text) * Val(T8.Text)
Page | 10
End Sub
Private Sub T8_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles T8.TextChanged
If T8.Text.Length > 0 Then T9.Text = Val(T7.Text) * Val(T8.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Button3_Click_1(Button3, New System.EventArgs)
t10.Text = 1
End Sub
End Class
SALES.vb
Imports System.Data.OleDb
Public Class frmSales
Inherits System.Windows.Forms.Form
t10.Text
cmd.CommandText = sqlstr
cmd.ExecuteNonQuery()
cmd.CommandText = "Insert into Sales values(" & Val(T1.Text) & ",'" &
T2.Text & "'," & Val(t10.Text) & ",'" & ComboBox1.Text & "','" & T3.Text &
"','" & T4.Text & "','" & T5.Text & "','" & T6.Text & "'," & T7.Text & "," &
T8.Text & "," & T9.Text & ")"
cmd.ExecuteNonQuery()
con.Close()
MsgBox("Record Saved...", MsgBoxStyle.Information)
' Button3_Click_1(Button3, New System.EventArgs)
RefreshData()
t10.Text = sno + 1
Page | 11
End Sub
Sub RefreshData()
ds.Clear()
cmd.CommandText = "select * from Sales"
da.Fill(ds, "Sales")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Sales"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
da.Update(ds, "Sales")
ds.Clear()
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Sales"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim BillNo As String = ""
BillNo = InputBox("Enter BillNo")
If BillNo = "" Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Select * from Sales Where BillNo=" & BillNo & ""
cmd.CommandText = sqlstr
Dim r As OleDbDataReader = cmd.ExecuteReader
If r.Read Then
ComboBox1.Text = BillNo
t10.Text = r(1)
'TextBox3.Text = r(2)
'TextBox4.Text = r(3)
'TextBox5.Text = r(4)
'TextBox6.Text = r(5)
Else
MsgBox("Sales Bill not found", MsgBoxStyle.Information)
End If
r.Close()
r = Nothing
con.Close()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
Dim BillNo As String = ""
BillNo = InputBox("Enter BillNo")
If BillNo = "" Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
cmd.CommandText = "Delete From Sales Where Billno=" & Val(BillNo)
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Record Deleted", MsgBoxStyle.Information)
Else
MsgBox("Record Not Found", MsgBoxStyle.Information)
End If
Page | 12
con.Close()
Dim x As Control
For Each x In Me.Controls
If TypeOf x Is TextBox Then
x.Text = ""
End If
If TypeOf x Is ComboBox Then
x.Text = ""
End If
Next
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Select max(billno) from Sales"
cmd.CommandText = sqlstr
Try
T1.Text = Val(cmd.ExecuteScalar) + 1
Catch ex As Exception
T1.Text = 1
End Try
t10.Text = 1
con.Close()
T2.Text = Format(DateTime.Today, "dd/MM/yyyy")
End Sub
Private Sub frmSales_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Button3_Click_1(Button3, New System.EventArgs)
RefreshData()
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
ComboBox1.Items.Clear()
sqlstr = "Select drugcode from drug"
cmd.CommandText = sqlstr
Dim r As OleDbDataReader = cmd.ExecuteReader
While r.Read
ComboBox1.Items.Add(r(0))
End While
r.Close()
con.Close()
t10.Text = 1
End Sub
Private Sub ComboBox1_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) = 13 Then
T2.Focus()
End If
End Sub
Function Validatecontrols(ByVal fx As Form) As Boolean
Dim l, t As Integer
For Each x As Control In fx.Controls
If TypeOf x Is TextBox Or TypeOf x Is ComboBox Then
If x.Text.Trim = "" Then
l = x.Left
t = x.Top
For Each y As Control In fx.Controls
If TypeOf y Is Label Then
Page | 13
MsgBoxStyle.Information)
x.Select()
Return True
Exit Function
End If
End If
End If
Next
Exit For
End If
End If
Next
Return False
End Function
Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectedIndexChanged
If con.State <> ConnectionState.Open Then con.Open()
cmd.CommandText = "Select drugname from drug where drugcode='" &
ComboBox1.Text & "'"
Dim r As OleDbDataReader = cmd.ExecuteReader
While r.Read
T3.Text = (r(0))
End While
r.Close()
con.Close()
End Sub
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim x As Control
For Each x In Me.Controls
If TypeOf x Is TextBox Then
x.Text = ""
End If
If TypeOf x Is ComboBox Then
x.Text = ""
End If
Next
If con.State <> ConnectionState.Open Then con.Open()
Dim sqlstr As String
sqlstr = "Select max(billno) from Sales"
cmd.CommandText = sqlstr
'Dim r As New OleDbDataAdapter
'
DataGrid1.DataSource = ds
'DataGrid1.DataMember = "Sales"
Try
T1.Text = Val(cmd.ExecuteScalar) + 1
Catch ex As Exception
T1.Text = 1
End Try
con.Close()
T2.Text = Format(DateTime.Today, "dd/MM/yyyy")
Page | 14
End Sub
Private Sub T6_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles T6.TextChanged
End Sub
Private Sub T5_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles T5.LostFocus
If IsDate(T5.Text) Then
T5.Text = DateTime.ParseExact(T5.Text, "dd/MM/yyyy", Nothing)
End If
End Sub
Private Sub T6_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles T6.LostFocus
If IsDate(T6.Text) Then
T6.Text = DateTime.ParseExact(T6.Text, "dd/MM/yyyy", Nothing)
End If
End Sub
Page | 15
End Sub
End Class
SCREENSHOTS
LOGIN
DRUG
PURCHASE
Page | 16
SALES
Page | 17
Page | 18
CONCLUSION
Thus, Our Mini Project is successfully completed and
it includes all the features includes views and edited.
Page | 19