Anda di halaman 1dari 19

MEDICAL MANAGEMENT SYSTEM TO MAINTAIN

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

PENTIUM III 866 MHz

RAM

128 MD SD RAM

MONITOR

15 COLOR

HARD DISK

20 GB

FLOPPY DRIVE

1.44 MB

CDDRIVE

LG 52X

KEYBOARD

STANDARD 102 KEYS

MOUSE

3 BUTTONS

SOFTWARE CONFIGURATION
The software used for the development of the project is:
OPERATING SYSTEM

WINDOWS 2000 PROFESSIONAL

ENVIRONMENT

VISUAL STUDIO .NET 2003

.NET FRAMEWORK

VERSION 1.1

LANGUAGE

VISUAL BASIC.NET

BACKEND

SQL SERVER 2000

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

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim DrugCode As String = ""
DrugCode = InputBox("Enter Drug ID")
If DrugCode = "" Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Select * from Drug Where DrugCode='" & DrugCode & "'"
cmd.CommandText = sqlstr
Dim r As OleDbDataReader = cmd.ExecuteReader
If r.Read Then
TextBox1.Text = DrugCode
TextBox2.Text = r(1)
TextBox3.Text = r(2)
TextBox4.Text = r(3)
Else
MsgBox("Drug not found", MsgBoxStyle.Information)
End If
r.Close()
r = Nothing
con.Close()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim DrugCode As String = ""
DrugCode = InputBox("Enter Drug Code")
If DrugCode = "" Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Select * from Drug Where DrugCode='" & DrugCode & "'"
cmd.CommandText = sqlstr
Dim r As OleDbDataReader = cmd.ExecuteReader
If r.Read Then
TextBox1.Text = DrugCode
TextBox2.Text = r(1)
TextBox3.Text = r(2)
TextBox4.Text = r(3)
Else
MsgBox("Drug not found", MsgBoxStyle.Information)
End If
r.Close()
r = Nothing
con.Close()
End Sub

Page | 4

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button6.Click
Dim DrugCode As String = ""
DrugCode = InputBox("Enter Drug Code")
If DrugCode = "" Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Delete from Drug Where DrugCode='" & DrugCode & "'"
cmd.CommandText = sqlstr
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Drug Deleted", MsgBoxStyle.Information)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
Else
MsgBox("Drug not found", MsgBoxStyle.Information)
End If
con.Close()
RefreshData()
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) = 13 Then
TextBox2.Focus()
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) = 13 Then
TextBox3.Focus()
End If
End Sub
Private Sub TextBox3_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If Asc(e.KeyChar) = 13 Then
TextBox4.Focus()
End If
End Sub
Private Sub TextBox4_KeyPress(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Asc(e.KeyChar) = 13 Then
Button1.Focus()
End If
End Sub
Private Sub frmDrug_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
RefreshData()
End Sub
Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As
System.Windows.Forms.NavigateEventArgs) Handles DataGrid1.Navigate
End Sub
End Class

Page | 5

Frmlogin.VB
Imports System.Data.OleDb
Public Class frmLogin
Inherits System.Windows.Forms.Form

Windows Form Designer generated code


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Try
If con.State <> ConnectionState.Open Then con.Open()
cmd.CommandText = "Select count(*) From Users Where UserName='" &
txtuname.Text & "' and [Password]='" & txtpassword.Text & "'"
If cmd.ExecuteScalar > 0 Then
cmd.CommandText = "Select count(*) From Users Where
UserName='" & txtuname.Text & "' and [Password]='" & txtpassword.Text & "'"
LoggedUser = txtuname.Text
loginsucceed = True
Me.Close()
Else
MsgBox("Invalid User...", MsgBoxStyle.Critical)
End If
Catch ex As Exception
MsgBox(ex.Message.ToString, MsgBoxStyle.Critical)
Finally
con.Close()
End Try
End Sub
End Class

Frmpurchase.vb
Imports System.Data.OleDb
Public Class frmPurchase
Inherits System.Windows.Forms.Form

Windows Form Designer generated code


Dim ds As New DataSet
Dim da As New OleDbDataAdapter(cmd)
Dim dt As New DataTable("Purchase")
Dim obj As New OleDbCommandBuilder(da)
Dim cmd2 As OleDbCommand
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Page | 6

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim sno As Integer
sno = Val(t10.Text)
' If Validatecontrols(Me) = True Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Delete from Purchase Where BillNo=" & T1.Text & " and SNo="
& t10.Text
cmd.CommandText = sqlstr
cmd.ExecuteNonQuery()
cmd.CommandText = "Insert into purchase 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
End Sub
Sub RefreshData()
ds.Clear()
cmd.CommandText = "select * from Purchase"
da.Fill(ds, "Purchase")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Purchase"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
da.Update(ds, "Purchase")
ds.Clear()
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Purchase"
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 Purchase 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)

Page | 7

'TextBox5.Text = r(4)
'TextBox6.Text = r(5)
Else

MsgBox("Purchase 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 Purchase Where Billno=" & Val(billno)
If cmd.ExecuteNonQuery > 0 Then
MsgBox("Record Deleted", MsgBoxStyle.Information)
Else
MsgBox("Record Not Found", MsgBoxStyle.Information)
End If
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 purchase"
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 frmPurchase_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

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

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()

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

Windows Form Designer generated code


Dim ds As New DataSet
Dim da As New OleDbDataAdapter(cmd)
Dim dt As New DataTable("Sales")
Dim obj As New OleDbCommandBuilder(da)
Dim cmd2 As OleDbCommand
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
Dim sno As Integer
sno = Val(t10.Text)
' If Validatecontrols(Me) = True Then Exit Sub
Dim sqlstr As String
If con.State <> ConnectionState.Open Then con.Open()
sqlstr = "Delete from Sales Where BillNo=" & T1.Text & " and SNo=" &

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

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
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

Private Sub frmSales_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)
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
Private Sub T4_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles T4.LostFocus
If T4.Text.Length > 0 Then
cmd.CommandText = "Select MfgDate,ExpiryDate From Purchase Where
BatchNo='" & T4.Text & "'"
con.Open()
Dim r As OleDb.OleDbDataReader = cmd.ExecuteReader
If r.Read Then
T5.Text = r(0)
T6.Text = r(1)
End If
r.Close()
con.Close()
End If

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

Anda mungkin juga menyukai