Post on 25-Nov-2020
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
APLIKASI RUMAH SAKIT RAWAT JALAN VB.NET
MUser
Name Type Size Keterangan
Kode_User Text 5 Primary key
Nama_User Text 30
Password_User Text 20
Level_User Text 15
Status_User Text 15
MDokter
Name Type Size Keterangan
Kode_Dokter Text 5 Primary key
Nama_Dokter Text 30
Alamat_Dokter Text 30
Gender_Dokter Text 10
Telepon_Dokter Text 15
Tarif_Dokter Long Integer 4
Kode_Poli Text 5 Foreign key
Status_Dokter Text 15
MObat
Name Type Size Keterangan
Kode_Obat Text 5 Primary key
Nama_Obat Text 30
Satuan_Obat Text 10
Jenis_Obat Text 20
Stok_Obat Long Integer 4
Tarif_Obat Long Integer 4
Status_Obat Text 15
MPasien
Name Type Size Keterangan
Kode_Pasien Text 8 Primary key
Nama_Pasien Text 30
Alamat_Pasien Text 30
Gender_Pasien Text 10
TempatLahir_Pasien Text 30
TanggalLahir_Pasien Date/Time 8
Telepon_Pasien Text 15
GolonganDarah_Pasien Text 5
Pekerjaan_Pasien Text 30
Agama_Pasien Text 10
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
StatusPernikahan_Pasien Text 15
MPoli
Name Type Size Keterangan
Kode_Poli Text 5 Primary key
Nama_Poli Text 30
TPendaftaran
Name Type Size Keterangan
Kode_Pendaftaran Text 8 Primary key
Tanggal_Pendaftaran Date/Time 8
Kode_Pasien Text 8 Foreign key
Kode_Dokter Text 5 Foreign key
Keluhan Text 30
Status_Pendaftaran Text 10
Kode_User Text 5 Foreign key
TResep
Name Type Size Keterangan
Kode_Resep Text 8 Primary key
Tanggal_Resep Date/Time 8
Kode_Pendaftaran Text 8 Foreign key
Diagnosa Text 50
Tindakan Text 50
Total_Harga Long Integer 4
Status_Pembayaran Text 15
TResepDetail
Name Type Size Keterangan
Kode_Resep Text 8 Foreign key
Kode_Obat Text 5 Foreign key
Harga Long Integer 4
Jumlah Long Integer 4
Total Long Integer 4
TPembayaran
Name Type Size Keterangan
Kode_Pembayaran Text 8 Primary key
Tanggal_Pembayaran Date/Time 8
Kode_Resep Text 8 Foreign key
Total_Biaya Long Integer 4
Dibayar Long Integer 4
Kembali Long Integer 4
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
unnormal
Kode_User
Nama_User
Password_User
Level_User
Status_User
Kode_Dokter
Nama_Dokter
Alamat_Dokter
Gender_Dokter
Telepon_Dokter
Tarif_Dokter
Kode_Poli
Status_Dokter
Kode_Obat
Nama_Obat
Satuan_Obat
Jenis_Obat
Stok_Obat
Tarif_Obat
Status_Obat
Kode_Pasien
Nama_Pasien
Alamat_Pasien
Gender_Pasien
TempatLahir_Pasien
TanggalLahir_Pasien
Telepon_Pasien
GolonganDarah_Pasien
Pekerjaan_Pasien
Agama_Pasien
StatusPernikahan_Pasien
Kode_Poli
Nama_Poli
Kode_Pendaftaran
Tanggal_Pendaftaran
Kode_Pasien
Kode_Dokter
Keluhan
Status_Pendaftaran
Kode_User
Kode_Resep
Tanggal_Resep
Kode_Pendaftaran
Diagnosa
Tindakan
Total_Harga
Status_Pembayaran
Kode_Resep
Kode_Obat
Harga
Jumlah
Total
Kode_Pembayaran
Tanggal_Pembayaran
Kode_Resep
Total_Biaya
Dibayar
Kembali
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
normal 1
Kode_User *
Nama_User
Password_User
Level_User
Status_User
Kode_Dokter *
Nama_Dokter
Alamat_Dokter
Gender_Dokter
Telepon_Dokter
Tarif_Dokter
Status_Dokter
Kode_Obat *
Nama_Obat
Satuan_Obat
Jenis_Obat
Stok_Obat
Tarif_Obat
Status_Obat
Kode_Pasien *
Nama_Pasien
Alamat_Pasien
Gender_Pasien
TempatLahir_Pasien
TanggalLahir_Pasien
Telepon_Pasien
GolonganDarah_Pasien
Pekerjaan_Pasien
Agama_Pasien
StatusPernikahan_Pasien
Kode_Poli *
Nama_Poli
Kode_Pendaftaran *
Tanggal_Pendaftaran
Keluhan
Status_Pendaftaran
Kode_Resep *
Tanggal_Resep
Diagnosa
Tindakan
Total_Harga
Status_Pembayaran
Harga
Jumlah
Total
Kode_Pembayaran *
Tanggal_Pembayaran
Total_Biaya
Dibayar
Kembali
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
keterangan : * = kunci kandidat
normal 2
keterangan : * = kunci primer
** = kunci tamu
Kode_User *
Nama_User
Password_User
Level_User
Status_User
Kode_Dokter *
Nama_Dokter
Alamat_Dokter
Gender_Dokter
Telepon_Dokter
Tarif_Dokter
Kode_Poli **
Status_Dokter
Kode_User *
Nama_User
Password_User
Level_User
Status_User
Kode_Pembayaran *
Tanggal_Pembayaran
Kode_Resep **
Total_Biaya
Dibayar
Kembali
Kode_Obat *
Nama_Obat
Satuan_Obat
Jenis_Obat
Stok_Obat
Tarif_Obat
Status_Obat
Kode_Pasien *
Nama_Pasien
Alamat_Pasien
Gender_Pasien
TempatLahir_Pasien
TanggalLahir_Pasien
Telepon_Pasien
GolonganDarah_Pasien
Pekerjaan_Pasien
Agama_Pasien
StatusPernikahan_Pasien
Kode_Poli *
Nama_Poli
Kode_Pendaftaran *
Tanggal_Pendaftaran
Kode_Pasien **
Kode_Dokter **
Keluhan
Status_Pendaftaran
Kode_User **
Kode_Resep **
Tanggal_Resep
Kode_Pendaftaran **
Diagnosa
Tindakan
Total_Harga
Status_Pembayaran
Kode_Resep **
Kode_Obat **
Harga
Jumlah
Total
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
normal 3
keterangan : * = kunci primer
** = kunci tamu
Kode_User *
Nama_User
Password_User
Level_User
Status_User
Kode_Dokter *
Nama_Dokter
Alamat_Dokter
Gender_Dokter
Telepon_Dokter
Tarif_Dokter
Kode_Poli **
Status_Dokter
Kode_User *
Nama_User
Password_User
Level_User
Status_User
Kode_Pembayaran *
Tanggal_Pembayaran
Kode_Resep **
Total_Biaya
Dibayar
Kembali
Kode_Obat *
Nama_Obat
Satuan_Obat
Jenis_Obat
Stok_Obat
Tarif_Obat
Status_Obat
Kode_Pasien *
Nama_Pasien
Alamat_Pasien
Gender_Pasien
TempatLahir_Pasien
TanggalLahir_Pasien
Telepon_Pasien
GolonganDarah_Pasien
Pekerjaan_Pasien
Agama_Pasien
StatusPernikahan_Pasien
Kode_Poli *
Nama_Poli
Kode_Pendaftaran *
Tanggal_Pendaftaran
Kode_Pasien **
Kode_Dokter **
Keluhan
Status_Pendaftaran
Kode_User **
Kode_Resep *
Tanggal_Resep
Kode_Pendaftaran **
Diagnosa
Tindakan
Total_Harga
Status_Pembayaran
Kode_Resep **
Kode_Obat **
Harga
Jumlah
Total
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Module
Imports System.Data.OleDb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Module Module1
Public Conn As OleDbConnection
Public DA As OleDbDataAdapter
Public DS As DataSet
Public CMD As OleDbCommand
Public DR As OleDbDataReader
Public laporan As New ReportDocument
Public TabelLogon As
CrystalDecisions.Shared.TableLogOnInfo
Public Sub SetingLaporan()
Dim BacaTabel As
CrystalDecisions.CrystalReports.Engine.Table
For Each BacaTabel In laporan.Database.Tables
TabelLogon = BacaTabel.LogOnInfo
With TabelLogon.ConnectionInfo
.ServerName = Application.StartupPath &
"\rawatjalan.mdb"
.UserID = ""
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
.Password = ""
.DatabaseName = ""
End With
BacaTabel.ApplyLogOnInfo(TabelLogon)
Next BacaTabel
End Sub
Public Sub Koneksi()
Try
Conn = New
OleDbConnection("provider=microsoft.jet.oledb.4.0;data
source=rawatjalan.mdb")
Conn.Open()
Catch ex As Exception
MsgBox(ex.Message)
End
End Try
End Sub
End Module
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmdokter
Sub otomatis()
CMD = New OleDbCommand("select kode_dokter from
mdokter order by 1 desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
tkode.Text = "DKT01"
Else
tkode.Text = "DKT" +
Format(Microsoft.VisualBasic.Right(DR(0), 2) + 1, "00")
End If
tkode.Enabled = False
End Sub
Sub Kosongkan()
Call otomatis()
tnama.Text = "-"
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
talamat.Text = "-"
cmbjeniskelamin.Text = "Pilih"
ttarif.Text = 0
ttelepon.Text = "-"
cmbpoli.Text = "Pilih"
tcaridata.Text = ""
tnama.Focus()
Call TampilGrid()
Call TampilPoli()
End Sub
Sub DataBaru()
tnama.Text = "-"
talamat.Text = "-"
cmbjeniskelamin.Text = "Pilih"
ttarif.Text = 0
ttelepon.Text = "-"
cmbpoli.Text = "Pilih"
tcaridata.Text = ""
tnama.Focus()
End Sub
Sub Ketemu()
On Error Resume Next
tnama.Text = DR(1)
talamat.Text = DR(2)
cmbjeniskelamin.Text = DR(3)
ttelepon.Text = DR(4)
ttarif.Text = DR(5)
cmbpoli.Text = DR(6)
tnama.Focus()
Dim kodepoli As String = cmbpoli.Text
CMD = New OleDbCommand("select * from mpoli where
kode_poli='" & cmbpoli.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
cmbpoli.Items.Add(DR(0) & Space(2) & DR(1))
End If
End Sub
Sub TampilPoli()
CMD = New OleDbCommand("select * from mpoli ",
Conn)
DR = CMD.ExecuteReader
cmbpoli.Items.Clear()
Do While DR.Read
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
cmbpoli.Items.Add(DR(0) & Space(2) & DR(1))
Loop
End Sub
Sub CariKode()
CMD = New OleDbCommand("select * from mdokter
where kode_dokter='" & tkode.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("select * from mdokter",
Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Private Sub frmdokter_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Call Koneksi()
Call Kosongkan()
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Call CariKode()
If Not DR.HasRows Then
Dim simpan As String = "insert into mdokter
values ('" & tkode.Text & "','" & tnama.Text & "','" &
talamat.Text & "','" & cmbjeniskelamin.Text & "','" &
ttelepon.Text & "','" & ttarif.Text & "','" &
Microsoft.VisualBasic.Left(cmbpoli.Text, 5) &
"','AKTIF')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
Else
Dim edit As String = "update mdokter set
nama_dokter='" & tnama.Text & "',alamat_dokter='" &
talamat.Text & "',gender_dokter='" & cmbjeniskelamin.Text
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
& "',telepon_dokter='" & ttelepon.Text &
"',tarif_dokter='" & ttarif.Text & "',kode_poli='" &
Microsoft.VisualBasic.Left(cmbpoli.Text, 5) & "' where
kode_dokter='" & tkode.Text & "'"
CMD = New OleDbCommand(edit, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
End If
End Sub
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
Call CariKode()
If Not DR.HasRows Then
MsgBox("dokter tidak terdaftar")
Exit Sub
End If
If MessageBox.Show("yakin akan dihapus...?", "",
MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes
Then
Dim hapus As String = "delete * from mdokter
where kode_dokter='" & tkode.Text & "'"
CMD = New OleDbCommand(hapus, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
Else
Call Kosongkan()
End If
End Sub
Private Sub Button3_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
Call Kosongkan()
End Sub
Private Sub Button4_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button4.Click
Me.Close()
End Sub
Private Sub tcaridata_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
tcaridata.TextChanged
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
DA = New OleDbDataAdapter("select * from mdokter
where kode_dokter like '%" & tcaridata.Text & "%' or
nama_dokter like '%" & tcaridata.Text & "%' or
alamat_dokter like '%" & tcaridata.Text & "%'", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Private Sub DGV_CellMouseClick(ByVal sender As Object,
ByVal e As
System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles DGV.CellMouseClick
On Error Resume Next
tkode.Text = DGV.Rows(e.RowIndex).Cells(0).Value
Call CariKode()
If DR.HasRows Then
Call Ketemu()
End If
End Sub
End Class
Imports System.Data.OleDb
Public Class frmpasien
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Sub otomatis()
CMD = New OleDbCommand("select kode_pasien from
mpasien order by 1 desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
tkode.Text = "PSN00001"
Else
tkode.Text = "PSN" +
Format(Microsoft.VisualBasic.Right(DR(0), 5) + 1,
"00000")
End If
tkode.Enabled = False
End Sub
Sub Kosongkan()
Call otomatis()
tnama.Text = "-"
talamat.Text = "-"
cmbjeniskelamin.Text = "Pilih"
ttempatlahir.Text = "-"
ttelepon.Text = "-"
cmbgolongandarah.Text = "Pilih"
cmbpekerjaan.Text = "Pilih"
cmbagama.Text = "Pilih"
cmbstatuspernikahan.Text = "Pilih"
tcaridata.Text = ""
tnama.Focus()
Call TampilGrid()
End Sub
Sub DataBaru()
tnama.Text = "-"
talamat.Text = "-"
cmbjeniskelamin.Text = "Pilih"
ttempatlahir.Text = "-"
ttelepon.Text = "-"
cmbgolongandarah.Text = "Pilih"
cmbpekerjaan.Text = "Pilih"
cmbagama.Text = "Pilih"
cmbstatuspernikahan.Text = "Pilih"
tcaridata.Text = ""
tnama.Focus()
End Sub
Sub Ketemu()
On Error Resume Next
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
tnama.Text = DR(1)
talamat.Text = DR(2)
cmbjeniskelamin.Text = DR(3)
ttempatlahir.Text = DR(4)
ttanggallahir.Text = DR(5)
ttelepon.Text = DR(6)
cmbgolongandarah.Text = DR(7)
cmbpekerjaan.Text = DR(8)
cmbagama.Text = DR(9)
cmbstatuspernikahan.Text = DR(10)
tnama.Focus()
End Sub
Sub CariKode()
CMD = New OleDbCommand("select * from mpasien
where kode_pasien='" & tkode.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("select * from mpasien",
Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Private Sub frmpasien_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Call Koneksi()
Call Kosongkan()
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Call CariKode()
If Not DR.HasRows Then
Dim simpan As String = "insert into mpasien
values ('" & tkode.Text & "','" & tnama.Text & "','" &
talamat.Text & "','" & cmbjeniskelamin.Text & "','" &
ttempatlahir.Text & "','" & ttanggallahir.Text & "','" &
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
ttelepon.Text & "','" & cmbgolongandarah.Text & "','" &
cmbpekerjaan.Text & "','" & cmbagama.Text & "','" &
cmbstatuspernikahan.Text & "')"
CMD = New OleDbCommand(simpan, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
Else
Dim edit As String = "update mpasien set
nama_pasien='" & tnama.Text & "',alamat_pasien='" &
talamat.Text & "',gender_pasien='" & cmbjeniskelamin.Text
& "',tempatlahir_pasien='" & ttempatlahir.Text &
"',tanggallahir_pasien='" & ttanggallahir.Text &
"',telepon_pasien='" & ttelepon.Text &
"',golongandarah_pasien='" & cmbgolongandarah.Text &
"',pekerjaan_pasien='" & cmbpekerjaan.Text &
"',agama_pasien='" & cmbagama.Text &
"',statuspernikahan_pasien='" & cmbstatuspernikahan.Text
& "' where kode_pasien='" & tkode.Text & "'"
CMD = New OleDbCommand(edit, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
End If
End Sub
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
Call CariKode()
If Not DR.HasRows Then
MsgBox("Pasien tidak terdaftar")
Exit Sub
End If
If MessageBox.Show("yakin akan dihapus...?", "",
MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes
Then
Dim hapus As String = "delete * from mpasien
where kode_pasien='" & tkode.Text & "'"
CMD = New OleDbCommand(hapus, Conn)
CMD.ExecuteNonQuery()
Call Kosongkan()
Else
Call Kosongkan()
End If
End Sub
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Private Sub Button3_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
Call Kosongkan()
End Sub
Private Sub Button4_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button4.Click
Me.Close()
End Sub
Private Sub tcaridata_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
tcaridata.TextChanged
DA = New OleDbDataAdapter("select * from mpasien
where kode_pasien like '%" & tcaridata.Text & "%' or
nama_pasien like '%" & tcaridata.Text & "%' or
alamat_pasien like '%" & tcaridata.Text & "%'", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Private Sub DGV_CellMouseClick(ByVal sender As Object,
ByVal e As
System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles DGV.CellMouseClick
On Error Resume Next
tkode.Text = DGV.Rows(e.RowIndex).Cells(0).Value
Call CariKode()
If DR.HasRows Then
Call Ketemu()
End If
End Sub
End Class
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmtpendaftaran
Sub kodeotomatis()
CMD = New OleDbCommand("select kode_pendaftaran
from tpendaftaran order by 1 desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
Tkode.Text = "DFT00001"
Else
Tkode.Text = "DFT" +
Format(Microsoft.VisualBasic.Right(DR(0), 5) + 1,
"00000")
End If
Tkode.Enabled = False
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
End Sub
Sub Kosongkan()
Call kodeotomatis()
TTanggal.Text = Today
cmbkodepasien.Text = "Pilih"
tnamapasien.Text = "-"
cmbpoli.Text = "Pilih"
cmbdokter.Text = "Pilih"
Tkeluhan.Text = "-"
TxtCari.Clear()
TTanggal.Focus()
End Sub
Sub DataBaru()
cmbkodepasien.Text = "Pilih"
tnamapasien.Text = "-"
cmbpoli.Text = "Pilih"
cmbdokter.Text = "Pilih"
Tkeluhan.Text = "-"
TxtCari.Clear()
TTanggal.Focus()
End Sub
Sub Ketemu()
On Error Resume Next
TTanggal.Text = DR.Item(1)
cmbkodepasien.Text = DR.Item(2)
cmbpoli.Text = DR.Item(2)
TTanggal.Focus()
Call Caridokter1()
Call CariPasien()
End Sub
Sub Tampilgrid()
DA = New OleDbDataAdapter("select * from
Tpendaftaran", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub Tampilpasien()
CMD = New OleDbCommand("select kode_pasien from
mpasien where kode_pasien not in (select kode_pasien from
tpendaftaran WHERE status_pendaftaran='TERDAFTAR')",
Conn)
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
DR = CMD.ExecuteReader
cmbkodepasien.Items.Clear()
Do While DR.Read
cmbkodepasien.Items.Add(DR.Item("kode_pasien"))
Loop
End Sub
Sub Tampilpoli()
CMD = New OleDbCommand("select
mpoli.kode_poli,nama_poli from mpoli,mdokter where
mpoli.kode_poli=mdokter.kode_poli", Conn)
DR = CMD.ExecuteReader
cmbpoli.Items.Clear()
Do While DR.Read
cmbpoli.Items.Add(DR.Item(0) & Space(2) &
DR(1))
Loop
End Sub
Private Sub frmtpendaftaran_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Call Koneksi()
Call Kosongkan()
Call Tampilgrid()
Call Tampilpoli()
Call Tampilpasien()
End Sub
Private Sub BTNTutup_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNTutup.Click
Me.Close()
End Sub
Private Sub BTNBatal_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBatal.Click
Call Kosongkan()
End Sub
Sub CariPasien()
CMD = New OleDbCommand("select * from mpasien
where kode_pasien='" & cmbkodepasien.Text & "'", Conn)
DR = CMD.ExecuteReader
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
DR.Read()
If DR.HasRows Then
tnamapasien.Text = DR.Item("nama_pasien")
End If
End Sub
Private Sub cmbkodepasien_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles cmbkodepasien.SelectedIndexChanged
Call CariPasien()
End Sub
Sub Caridokter1()
CMD = New OleDbCommand("select
mdokter.kode_dokter,nama_dokter from mdokter,mpoli where
mdokter.kode_poli=mpoli.kode_poli and
mdokter.kode_poli='" &
Microsoft.VisualBasic.Left(cmbpoli.Text, 5) & "'", Conn)
DR = CMD.ExecuteReader
cmbdokter.Items.Clear()
Do While DR.Read
cmbdokter.Items.Add(DR.Item(0) & Space(2) &
DR(1))
Loop
End Sub
Private Sub cmbpoli_SelectedIndexChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
cmbpoli.SelectedIndexChanged
Call Caridokter1()
End Sub
Sub CariKodePendaftaran()
CMD = New OleDbCommand("select * from
Tpendaftaran where kode_pendaftaran='" & Tkode.Text & "'",
Conn)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Sub Caridokter2()
CMD = New OleDbCommand("select
mdokter.kode_dokter,nama_dokter from mdokter,tpendaftaran
where mdokter.kode_dokter=tpendaftaran.kode_dokter and
tpendaftaran.kode_pendaftaran='" & Tkode.Text & "'",
Conn)
DR = CMD.ExecuteReader
cmbdokter.Items.Clear()
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Do While DR.Read
cmbdokter.Items.Add(DR.Item(0) & Space(2) &
DR(1))
Loop
End Sub
Private Sub DGV_CellMouseClick(ByVal sender As
Object, ByVal e As
System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles DGV.CellMouseClick
On Error Resume Next
Tkode.Text = DGV.Rows(e.RowIndex).Cells(0).Value
TTanggal.Text =
DGV.Rows(e.RowIndex).Cells(1).Value
cmbkodepasien.Text =
DGV.Rows(e.RowIndex).Cells(2).Value
Call CariPasien()
Call Caridokter2()
End Sub
Private Sub BTNHapus_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNHapus.Click
If Tkode.Text = "" Then
MsgBox("Nomor harus diisi")
Exit Sub
End If
Call CariKodePendaftaran()
If Not DR.HasRows Then
MsgBox("Nomor tidak terdaftar")
Exit Sub
End If
If MessageBox.Show("yakin akan dihapus...?", "",
MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes
Then
Dim hapus As String = "delete * from
Tpendaftaran where nomor_registrasi='" & Tkode.Text & "'"
CMD = New OleDbCommand(hapus, Conn)
CMD.ExecuteNonQuery()
Call Tampilgrid()
Call Kosongkan()
Call kodeotomatis()
Else
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Call Kosongkan()
End If
End Sub
End Class
Imports System.Data.OleDb
Public Class frmtresep
Sub kodeotomatis()
CMD = New OleDbCommand("select kode_resep from
tresep order by 1 desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
Tkode.Text = "RSP00001"
Else
Tkode.Text = "RSP" +
Format(Microsoft.VisualBasic.Right(DR(0), 5) + 1,
"00000")
End If
Tkode.Enabled = False
End Sub
Sub Kosongkan()
Call kodeotomatis()
cmbpendaftaran.Text = "Pilih"
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Lpasien.Text = "-"
Ldokter.Text = "-"
Lpoli.Text = "-"
Tcariobat.Clear()
TTotalHarga.Text = 0
Tkeluhan.Text = "-"
Tdiagnosa.Text = "-"
Ttindakan.Text = "-"
DGV.Rows.Clear()
Call Tampilobat()
Call Tampilpendaftaran()
End Sub
Sub Tampilobat()
CMD = New OleDbCommand("select * from mobat where
stok_obat>0", Conn)
DR = CMD.ExecuteReader
ListObat.Items.Clear()
Do While DR.Read
ListObat.Items.Add(DR(0) & Space(2) & DR(1))
Loop
End Sub
Sub Tampilpendaftaran()
CMD = New OleDbCommand("select kode_pendaftaran
from tpendaftaran where status_pendaftaran='TERDAFTAR'",
Conn)
DR = CMD.ExecuteReader
cmbpendaftaran.Items.Clear()
Do While DR.Read
cmbpendaftaran.Items.Add(DR(0))
Loop
End Sub
Private Sub frmtresep_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Call Koneksi()
Call Kosongkan()
End Sub
Private Sub cmbpendaftaran_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles cmbpendaftaran.SelectedIndexChanged
CMD = New OleDbCommand("select
tpendaftaran.keluhan,mpasien.nama_pasien,mdokter.nama_dok
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
ter,mpoli.nama_Poli from
tpendaftaran,mpasien,mdokter,mpoli where
tpendaftaran.kode_pasien=mpasien.kode_pasien and
tpendaftaran.kode_dokter=mdokter.kode_dokter and
mpoli.kode_poli=mdokter.kode_poli and
tpendaftaran.kode_pendaftaran='" & cmbpendaftaran.Text &
"'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
Tkeluhan.Text = DR("keluhan")
Lpasien.Text = DR("nama_pasien")
Ldokter.Text = DR("nama_dokter")
Lpoli.Text = DR("nama_poli")
Dim kodepasien As String
CMD = New OleDbCommand("select kode_pasien
from mpasien where nama_pasien='" & Lpasien.Text & "'",
Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
kodepasien = DR(0)
End If
End If
End Sub
Private Sub ListObat_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListObat.SelectedIndexChanged
Dim baris As Integer = DGV.RowCount - 1
DGV.Rows.Add(Microsoft.VisualBasic.Left(ListObat.Text,
5))
For barisatas As Integer = 0 To DGV.RowCount - 1
For barisbawah As Integer = barisatas + 1 To
DGV.RowCount - 1
If DGV.Rows(barisbawah).Cells(0).Value =
DGV.Rows(barisatas).Cells(0).Value Then
DGV.Rows(barisatas).Cells(3).Value =
DGV.Rows(barisatas).Cells(3).Value + 1
DGV.Rows(barisatas).Cells(4).Value =
DGV.Rows(barisatas).Cells(2).Value *
DGV.Rows(barisatas).Cells(3).Value
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
DGV.Rows.RemoveAt(barisbawah)
Call HitungHarga()
Exit Sub
End If
Next
Next
CMD = New OleDbCommand("select * from mobat where
kode_obat='" & DGV.Rows(baris).Cells(0).Value & "'",
Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
DGV.Rows(baris).Cells(1).Value =
DR("nama_obat")
DGV.Rows(baris).Cells(2).Value =
DR("tarif_obat")
DGV.Rows(baris).Cells(3).Value = 1
DGV.Rows(baris).Cells(4).Value =
DGV.Rows(baris).Cells(2).Value *
DGV.Rows(baris).Cells(3).Value
End If
Call HitungHarga()
Tcariobat.Clear()
End Sub
Sub HitungHarga()
Dim x As Double
For baris As Integer = 0 To DGV.RowCount - 1
x = x + DGV.Rows(baris).Cells(4).Value
Next
TTotalHarga.Text = x
End Sub
Private Sub DGV_CellEndEdit(ByVal sender As Object,
ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DGV.CellEndEdit
If e.ColumnIndex = 3 Then
Try
DGV.Rows(e.RowIndex).Cells(4).Value =
DGV.Rows(e.RowIndex).Cells(2).Value *
DGV.Rows(e.RowIndex).Cells(3).Value
Catch ex As Exception
MsgBox("harus angka")
SendKeys.Send("{UP}")
DGV.Rows(e.RowIndex).Cells(3).Value = 1
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
DGV.Rows(e.RowIndex).Cells(4).Value =
DGV.Rows(e.RowIndex).Cells(2).Value *
DGV.Rows(e.RowIndex).Cells(3).Value
End Try
End If
Call HitungHarga()
End Sub
Private Sub DGV_KeyDown(ByVal sender As Object, ByVal
e As System.Windows.Forms.KeyEventArgs) Handles
DGV.KeyDown
On Error Resume Next
If e.KeyCode = Keys.Delete Or e.KeyCode =
Keys.Escape Then
DGV.Rows.Remove(DGV.CurrentRow)
Call HitungHarga()
End If
End Sub
Private Sub Tcariobat_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Tcariobat.TextChanged
Call Koneksi()
CMD = New OleDbCommand("select * from mobat where
nama_obat like '%" & Tcariobat.Text & "%'", Conn)
DR = CMD.ExecuteReader
ListObat.Items.Clear()
Do While DR.Read
ListObat.Items.Add(DR(0) & Space(2) & DR(1))
Loop
End Sub
Private Sub BTNBatal_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBatal.Click
Call Kosongkan()
End Sub
Private Sub BTNTutup_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNTutup.Click
Me.Close()
End Sub
End Class
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmtpembayaran
Sub kodeotomatis()
CMD = New OleDbCommand("select kode_pembayaran
from tpembayaran order by 1 desc", Conn)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
Tkode.Text = "BYR00001"
Else
Tkode.Text = "BYR" +
Format(Microsoft.VisualBasic.Right(DR(0), 5) + 1,
"00000")
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
End If
Tkode.Enabled = False
End Sub
Sub Kosongkan()
Call kodeotomatis()
cmbnomorresep.Text = "Pilih"
Lpasien.Text = "-"
Ldokter.Text = "-"
Lpoli.Text = "-"
TTotalHarga.Text = 0
Tdibayar.Text = 0
Tkembali.Text = 0
Tkeluhan.Text = "-"
Tdiagnosa.Text = "-"
Ttindakan.Text = "-"
DGV.Columns.Clear()
Call Tampilresep()
End Sub
Sub Tampilresep()
CMD = New OleDbCommand("select kode_resep from
tresep where status_pembayaran='BELUM LUNAS'", Conn)
DR = CMD.ExecuteReader
cmbnomorresep.Items.Clear()
Do While DR.Read
cmbnomorresep.Items.Add(DR(0))
Loop
End Sub
Private Sub frmtpembayaran_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.CenterToScreen()
Call Koneksi()
Call Kosongkan()
End Sub
Private Sub cmbnomorresep_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles cmbnomorresep.SelectedIndexChanged
CMD = New OleDbCommand("select
mpasien.nama_pasien,mdokter.nama_dokter,mpoli.nama_Poli,t
pendaftaran.keluhan, tresep.diagnosa,tindakan,total_harga
from tresep,tpendaftaran,mpasien,mdokter,mpoli where
tpendaftaran.kode_pasien=mpasien.kode_pasien and
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
tpendaftaran.kode_dokter=mdokter.kode_dokter and
mpoli.kode_poli=mdokter.kode_poli and
tpendaftaran.kode_pendaftaran=tresep.kode_pendaftaran and
tresep.kode_resep='" & cmbnomorresep.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
Tkeluhan.Text = DR("keluhan")
Lpasien.Text = DR("nama_pasien")
Ldokter.Text = DR("nama_dokter")
Lpoli.Text = DR("nama_poli")
Tdiagnosa.Text = DR("diagnosa")
Ttindakan.Text = DR("tindakan")
TTotalHarga.Text = DR("total_harga")
DA = New OleDbDataAdapter("select
tresepdetail.kode_obat,mobat.nama_obat,tresepdetail.harga
,jumlah,total from tresep,tresepdetail,mobat where
tresep.kode_resep=tresepdetail.kode_resep and
tresepdetail.kode_obat=mobat.kode_obat and
tresep.kode_resep='" & cmbnomorresep.Text & "'", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End If
End Sub
Sub HitungHarga()
Dim x As Double
For baris As Integer = 0 To DGV.RowCount - 1
x = x + DGV.Rows(baris).Cells(4).Value
Next
TTotalHarga.Text = x
End Sub
Private Sub BTNBatal_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBatal.Click
Call Kosongkan()
End Sub
Private Sub BTNTutup_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNTutup.Click
Me.Close()
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
End Sub
Private Sub Tdibayar_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Tdibayar.TextChanged
Tkembali.Text = Val(Tdibayar.Text) -
Val(TTotalHarga.Text)
If Tkembali.Text >= 0 Then
BTNSimpan.Focus()
End If
End Sub
End Class
Public Class frmtlaporanmaster
Private Sub BTNUser_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNUser.Click
laporan.Load("masterUser.rpt")
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNPoli_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNPoli.Click
laporan.Load("masterpoli.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNObat_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNObat.Click
laporan.Load("masterobat.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNDokter_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNDokter.Click
laporan.Load("masterdokter.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNPasien_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNPasien.Click
laporan.Load("masterpasien.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNTutup_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNTutup.Click
Me.Close()
End Sub
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Private Sub frmtlaporanmaster_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Call Koneksi()
End Sub
End Class
Imports System.Data.OleDb
Public Class frmtlaporanpendaftaran
Private Sub frmtlaporanpendaftaran_Load(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Call Koneksi()
CMD = New OleDbCommand("select distinct
year(tanggal_pendaftaran) from tpendaftaran", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox1.Items.Add(DR(0))
Loop
CMD = New OleDbCommand("select kode_pendaftaran
from tpendaftaran", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox2.Items.Add(DR(0))
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Loop
CMD = New OleDbCommand("select distinct
mdokter.nama_dokter from mdokter,tpendaftaran where
mdokter.kode_dokter=tpendaftaran.kode_dokter", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox3.Items.Add(DR(0))
Loop
CMD = New OleDbCommand("select distinct
mpoli.nama_poli from mpoli,mdokter,tpendaftaran where
mdokter.kode_dokter=tpendaftaran.kode_dokter and
mpoli.kode_poli=mdokter.kode_poli", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox4.Items.Add(DR(0))
Loop
End Sub
Private Sub BTNHarian_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNHarian.Click
CRV.SelectionFormula =
"{tpendaftaran.tanggal_pendaftaran} = date ('" &
DTPharian.Text & "')"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNMingguan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNMingguan.Click
CRV.SelectionFormula =
"{tpendaftaran.tanggal_pendaftaran} in date ('" &
DTPawal.Text & "') to date ('" & DTPakhir.Text & "')"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNBUlanan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBUlanan.Click
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
CRV.SelectionFormula =
"month({tpendaftaran.tanggal_pendaftaran}) = (" &
Month(DTPBUlanan.Text) & ") and
year({tpendaftaran.tanggal_pendaftaran}) = (" &
Year(DTPBUlanan.Text) & ") "
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox1.SelectedIndexChanged
CRV.SelectionFormula =
"year({tpendaftaran.tanggal_pendaftaran}) = (" &
(ListBox1.Text) & ")"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox2_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox2.SelectedIndexChanged
CRV.SelectionFormula =
"{tpendaftaran.kode_pendaftaran} = '" & ListBox2.Text &
"'"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub Button7_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button7.Click
Me.Close()
End Sub
Private Sub ListBox3_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox3.SelectedIndexChanged
CRV.SelectionFormula = "{mdokter.nama_dokter} =
'" & ListBox3.Text & "'"
laporan.Load("pendaftaran.rpt")
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox4_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox4.SelectedIndexChanged
CRV.SelectionFormula = "{mpoli.nama_poli} = '" &
ListBox4.Text & "'"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub Tnamapasien_KeyDown(ByVal sender As
Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Handles Tnamapasien.KeyDown
If e.KeyCode = Keys.Enter Then
CRV.SelectionFormula = "{mpasien.nama_pasien}
like '*" & Tnamapasien.Text & "*'"
laporan.Load("pendaftaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End If
End Sub
End Class
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmtlaporanresep
Private Sub frmtlaporanresep_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Call Koneksi()
CMD = New OleDbCommand("select distinct
year(tanggal_resep) from tresep", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox1.Items.Add(DR(0))
Loop
CMD = New OleDbCommand("select kode_resep from
tresep", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox2.Items.Add(DR(0))
Loop
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
CMD = New OleDbCommand("select distinct
mdokter.nama_dokter from mdokter,tresep,tpendaftaran
where mdokter.kode_dokter=tpendaftaran.kode_dokter and
tpendaftaran.kode_pendaftaran=tresep.kode_pendaftaran",
Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox3.Items.Add(DR(0))
Loop
CMD = New OleDbCommand("select distinct
mpoli.nama_poli from mpoli,mdokter,tresep,tpendaftaran
where mdokter.kode_dokter=tpendaftaran.kode_dokter and
mpoli.kode_poli=mdokter.kode_poli and
tpendaftaran.kode_pendaftaran=tresep.kode_pendaftaran",
Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox4.Items.Add(DR(0))
Loop
End Sub
Private Sub BTNHarian_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNHarian.Click
CRV.SelectionFormula = "{tresep.tanggal_resep} =
date ('" & DTPharian.Text & "')"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNMingguan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNMingguan.Click
CRV.SelectionFormula = "{tresep.tanggal_resep} in
date ('" & DTPawal.Text & "') to date ('" & DTPakhir.Text
& "')"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNBUlanan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBUlanan.Click
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
CRV.SelectionFormula =
"month({tresep.tanggal_resep}) = (" &
Month(DTPBUlanan.Text) & ") and
year({tresep.tanggal_resep}) = (" & Year(DTPBUlanan.Text)
& ") "
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox1.SelectedIndexChanged
CRV.SelectionFormula =
"year({tresep.tanggal_resep}) = (" & (ListBox1.Text) &
")"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox2_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox2.SelectedIndexChanged
CRV.SelectionFormula = "{tresep.kode_resep} = '"
& ListBox2.Text & "'"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub Button7_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button7.Click
Me.Close()
End Sub
Private Sub ListBox3_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox3.SelectedIndexChanged
CRV.SelectionFormula = "{mdokter.nama_dokter} =
'" & ListBox3.Text & "'"
laporan.Load("resep.rpt")
Call SetingLaporan()
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox4_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox4.SelectedIndexChanged
CRV.SelectionFormula = "{mpoli.nama_poli} = '" &
ListBox4.Text & "'"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub Tnamapasien_KeyDown(ByVal sender As
Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Handles Tnamapasien.KeyDown
If e.KeyCode = Keys.Enter Then
CRV.SelectionFormula = "{mpasien.nama_pasien}
like '*" & Tnamapasien.Text & "*'"
laporan.Load("resep.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End If
End Sub
End Class
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmtlaporanpembayaran
Private Sub frmtlaporanpembayaran_Load(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Call Koneksi()
CMD = New OleDbCommand("select distinct
year(tanggal_pembayaran) from tpembayaran", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox1.Items.Add(DR(0))
Loop
CMD = New OleDbCommand("select kode_pembayaran
from tpembayaran", Conn)
DR = CMD.ExecuteReader
Do While DR.Read
ListBox2.Items.Add(DR(0))
Loop
End Sub
Private Sub BTNHarian_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNHarian.Click
CRV.SelectionFormula =
"{tpembayaran.tanggal_pembayaran} = date ('" &
DTPharian.Text & "')"
laporan.Load("pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub BTNMingguan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNMingguan.Click
CRV.SelectionFormula =
"{tpembayaran.tanggal_pembayaran} in date ('" &
DTPawal.Text & "') to date ('" & DTPakhir.Text & "')"
laporan.Load("pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Private Sub BTNBUlanan_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BTNBUlanan.Click
CRV.SelectionFormula =
"month({tpembayaran.tanggal_pembayaran}) = (" &
Month(DTPBUlanan.Text) & ") and
year({tpembayaran.tanggal_pembayaran}) = (" &
Year(DTPBUlanan.Text) & ") "
laporan.Load("pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox1.SelectedIndexChanged
CRV.SelectionFormula =
"year({tpembayaran.tanggal_pembayaran}) = (" &
(ListBox1.Text) & ")"
laporan.Load("pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub ListBox2_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles ListBox2.SelectedIndexChanged
CRV.SelectionFormula =
"{tpembayaran.kode_pembayaran} = '" & ListBox2.Text & "'"
laporan.Load("pembayaran.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub Button7_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button7.Click
Me.Close()
End Sub
End Class
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
Imports System.Data.OleDb
Public Class frmtlaporanmedis
Private Sub frmtlaporanmedis_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Call Koneksi()
End Sub
Private Sub TnamaPasien_KeyDown(ByVal sender As
Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Handles TNamaPasien.KeyDown
If e.KeyCode = Keys.Enter Then
DA = New OleDbDataAdapter("select
tpendaftaran.tanggal_pendaftaran,keluhan,mpoli.nama_poli,
mdokter.nama_dokter,tresep.diagnosa,tindakan from
tpendaftaran,mpoli,tresep,mpasien,mdokter where
tpendaftaran.kode_pendaftaran=tresep.kode_pendaftaran and
mdokter.kode_poli=mpoli.kode_poli and
tpendaftaran.kode_pasien=mpasien.kode_pasien and
tpendaftaran.kode_dokter=mdokter.kode_dokter and
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
mpasien.nama_pasien like '%" & TNamaPasien.Text & "%'",
Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
CMD = New OleDbCommand("select kode_pasien
from mpasien where nama_pasien like '%" &
TNamaPasien.Text & "%'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TkodePasien.Text = DR(0)
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
CRV.SelectionFormula = "{mpasien.kode_pasien} ='"
& TkodePasien.Text & "'"
laporan.Load("rekam medis.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
Private Sub TkodePasien_KeyDown(ByVal sender As
Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Handles TkodePasien.KeyDown
If e.KeyCode = Keys.Enter Then
DA = New OleDbDataAdapter("select
tpendaftaran.tanggal_pendaftaran,keluhan,mpoli.nama_poli,
mdokter.nama_dokter,tresep.diagnosa,tindakan from
tpendaftaran,mpoli,tresep,mpasien,mdokter where
tpendaftaran.kode_pendaftaran=tresep.kode_pendaftaran and
mdokter.kode_poli=mpoli.kode_poli and
tpendaftaran.kode_pasien=mpasien.kode_pasien and
tpendaftaran.kode_dokter=mdokter.kode_dokter and
mpasien.kode_pasien ='" & TkodePasien.Text & "'", Conn)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
wwwwwwwwwwww....belajarvbbelajarvbbelajarvbbelajarvb....netnetnetnet Media Belajar VB.Net Online & Bimbingan Tugas Akhir - Skripsi
CMD = New OleDbCommand("select * from mpasien
where kode_pasien='" & TkodePasien.Text & "'", Conn)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TNamaPasien.Text = DR(1)
Else
TNamaPasien.Text = ""
End If
End If
End Sub
End Class