Академический Документы
Профессиональный Документы
Культура Документы
com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir
Imports System.Data.OleDb
MenuUtama.Panel1.Text = DR.Item("kode_user")
MenuUtama.Panel2.Text = DR.Item("nama_user")
MenuUtama.Panel3.Text = DR.Item("pwd_user")
End Sub
Imports System.Data.OleDb
Sub NomorUserotomatis()
CMD = New OleDbCommand("select kode_User from tblUser order by
kode_User desc", CONN)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
TextBox1.Text = "USR" + "01"
Else
TextBox1.Text = "USR" +
Format(Microsoft.VisualBasic.Right(DR.Item("kode_User"), 2) + 1, "00")
End If
TextBox1.Enabled = False
End Sub
Sub Kosongkan()
Call NomorUserotomatis()
TextBox2.Clear()
TextBox3.Clear()
ComboBox1.Text = ""
TxtCari.Clear()
TextBox2.Focus()
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir
Sub DataBaru()
TextBox2.Clear()
TextBox3.Clear()
ComboBox1.Text = ""
TxtCari.Clear()
TextBox2.Focus()
End Sub
Sub TampilStatus()
CMD = New OleDbCommand("select distinct Status_user from tbluser",
CONN)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("Status_User"))
Loop
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("Select * from tblUser", CONN)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub Ketemu()
On Error Resume Next
TextBox2.Text = DR.Item(1)
TextBox3.Text = DR.Item(2)
ComboBox1.Text = DR.Item(3)
TextBox2.Focus()
End Sub
Sub CariKodeUser()
CMD = New OleDbCommand("Select * from tblUser where kode_User='" &
TextBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
End Sub
Call CariKodeUser()
If Not DR.HasRows Then
MsgBox("Kode User tidak terdaftar")
Exit Sub
End If
Imports System.Data.OleDb
Sub Nomorotomatis()
CMD = New OleDbCommand("select nomor_Pembayaran from TRpembayaran
order by nomor_pembayaran desc", CONN)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
TextBox1.Text = "00001"
Else
TextBox1.Text = Format(DR.Item("nomor_pembayaran") + 1, "00000")
End If
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir
Sub Kosongkan()
Dim x As Control
For Each x In Me.GroupBox1.Controls
If TypeOf x Is TextBox Or TypeOf x Is ComboBox Then
x.Text = ""
End If
Next x
TxtCari.Clear()
End Sub
Sub TampilGrid()
DA = New OleDbDataAdapter("select * from TRPembayaran", CONN)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub
Sub TampilRegistrasi()
CMD = New OleDbCommand("select * from TRRegistrasi where
status_Registrasi='TERDAFTAR'", CONN)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("NOMOR_REGISTRASI"))
Loop
End Sub
Sub CariPasien()
CMD = New OleDbCommand("select * from tblpasien where kode_pasien='"
& TextBox3.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox4.Text = DR.Item("nama_pasien")
End If
End Sub
Sub CariKamar()
CMD = New OleDbCommand("select * from tblkamar where kode_kamar='" &
TextBox5.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox6.Text = DR.Item("nama_kamar")
TextBox7.Text = DR.Item("tarif_kamar")
End If
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir
Sub Nol_kan()
TextBox11.Text = 0
TextBox12.Text = 0
TextBox13.Text = 0
TextBox14.Text = 0
TextBox15.Text = 0
TextBox16.Text = 0
TextBox17.Text = 0
TextBox18.Text = "-"
End Sub
Sub TotalBiayaAlat()
On Error Resume Next
CMD = New OleDbCommand("select sum(biaya) from
TRperawatan,TRperawatandetail,TRregistrasi where
trperawatan.nomor_perawatan=trperawatandetail.nomor_perawatan and
trperawatan.nomor_registrasi=trregistrasi.nomor_registrasi and
trperawatandetail.kode_alat<>'-' and trregistrasi.nomor_registrasi='" &
ComboBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox11.Text = DR.Item(0)
Else
TextBox11.Text = 0
End If
End Sub
Sub TotalBiayaDokter()
On Error Resume Next
CMD = New OleDbCommand("select sum(biaya) from
TRperawatan,TRperawatandetail,TRregistrasi where
trperawatan.nomor_perawatan=trperawatandetail.nomor_perawatan and
trperawatan.nomor_registrasi=trregistrasi.nomor_registrasi and
trperawatandetail.kode_dokter<>'-' and trregistrasi.nomor_registrasi='" &
ComboBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox12.Text = DR.Item(0)
Else
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir
TextBox12.Text = 0
End If
End Sub
Sub TotalBiayaObat()
On Error Resume Next
CMD = New OleDbCommand("select sum(biaya) from
TRperawatan,TRperawatandetail,TRregistrasi where
trperawatan.nomor_perawatan=trperawatandetail.nomor_perawatan and
trperawatan.nomor_registrasi=trregistrasi.nomor_registrasi and
trperawatandetail.kode_obat<>'-' and trregistrasi.nomor_registrasi='" &
ComboBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox13.Text = DR.Item(0)
Else
TextBox13.Text = 0
End If
End Sub
Sub TotalBiayaTindakan()
On Error Resume Next
CMD = New OleDbCommand("select sum(biaya) from
TRperawatan,TRperawatandetail,TRregistrasi where
trperawatan.nomor_perawatan=trperawatandetail.nomor_perawatan and
trperawatan.nomor_registrasi=trregistrasi.nomor_registrasi and
trperawatandetail.kode_tindakan<>'-' and trregistrasi.nomor_registrasi='" &
ComboBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
TextBox14.Text = DR.Item(0)
Else
TextBox14.Text = 0
End If
End Sub
Sub GrandBiaya()
TextBox15.Text = Val(TextBox10.Text) + Val(TextBox11.Text) +
Val(TextBox12.Text) + Val(TextBox13.Text) + Val(TextBox14.Text)
End Sub
TextBox2.Text = DR.Item("Tgl_registrasi")
TextBox3.Text = DR.Item("kode_pasien")
TextBox5.Text = DR.Item("kode_kamar")
Call CariPasien()
Call CariKamar()
TextBox8.Text = Today
TextBox9.Text = DateDiff(DateInterval.Day,
DateValue(TextBox2.Text), Today)
If TextBox9.Text = 0 Then
TextBox9.Text = 1
End If
TextBox10.Text = Val(TextBox7.Text) * Val(TextBox9.Text)
Call Nol_kan()
Call TotalBiayaAlat()
Call TotalBiayaDokter()
Call TotalBiayaObat()
Call TotalBiayaTindakan()
Call GrandBiaya()
TextBox16.Focus()
End If
End Sub
Call Kosongkan()
Call Nol_kan()
Call Nomorotomatis()
Call TampilGrid()
Call TampilRegistrasi()
End Sub