-
Notifications
You must be signed in to change notification settings - Fork 0
/
Receipt1.xaml.vb
103 lines (82 loc) · 3.27 KB
/
Receipt1.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Imports System.Data
Imports System.Data.SqlClient
Public Class Receipt1
Dim index As Integer = 0
Dim table As New DataTable()
Private Sub BillingDetails_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
Dim a As Integer
a = txtbillno.Text
Dim connectionstring As String
connectionstring = lblstring.Content
Dim cs As New SqlConnection(connectionstring)
Dim cmd, cmd2 As New SqlCommand
Dim dr As SqlDataReader
cmd.Connection = cs
cs.Open()
cmd.CommandText = "Select * from Bills where BillNo='" & Val(a) & "'"
dr = cmd.ExecuteReader
With dr
Try
.Read()
txtbillno.Text = .GetValue(0)
cboadmissionNo.Text = .GetValue(1)
cboDiagnosisNo.Text = .GetValue(2)
txtwardno.Text = .GetValue(3)
txtPatientsID.Text = .GetValue(4)
txtwardname.Text = .GetValue(5)
txtBedNo.Text = .GetValue(6)
txtname.Text = .GetValue(7)
txtdocname.Text = .GetValue(8)
txtadmdate.Text = .GetValue(9)
dtpicker.Text = .GetValue(10)
txtadmbills.Text = .GetValue(11)
txthospitalbill.Text = .GetValue(12)
txtamountpaid.Text = .GetValue(13)
txtbalance.Text = .GetValue(14)
Catch ex As Exception
End Try
End With
dr.Close()
Catch ex As Exception
End Try
End Sub
Private Sub txtbillno_TextChanged(sender As Object, e As TextChangedEventArgs) Handles txtbillno.TextChanged
Try
Dim a As Integer
a = txtbillno.Text
Dim connectionstring As String
connectionstring = lblstring.Content
Dim cs As New SqlConnection(connectionstring)
Dim cmd, cmd2 As New SqlCommand
Dim dr As SqlDataReader
cmd.Connection = cs
cs.Open()
cmd.CommandText = "Select * from Bills where BillNo='" & Val(a) & "'"
dr = cmd.ExecuteReader
With dr
Try
.Read()
txtbillno.Text = .GetValue(0)
cboadmissionNo.Text = .GetValue(1)
cboDiagnosisNo.Text = .GetValue(2)
txtwardno.Text = .GetValue(3)
txtPatientsID.Text = .GetValue(4)
txtwardname.Text = .GetValue(5)
txtBedNo.Text = .GetValue(6)
txtname.Text = .GetValue(7)
txtdocname.Text = .GetValue(8)
txtadmdate.Text = .GetValue(9)
dtpicker.Text = .GetValue(10)
txtadmbills.Text = .GetValue(11)
txthospitalbill.Text = .GetValue(12)
txtamountpaid.Text = .GetValue(13)
txtbalance.Text = .GetValue(14)
Catch ex As Exception
End Try
End With
dr.Close()
Catch ex As Exception
End Try
End Sub
End Class