APLIKASI SALON KECANTIKAN MENGGUNAKAN VB.NET

 

Membuat 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 Rpt As New ReportDocument

    Public crtableLogoninfos As New TableLogOnInfos

    Public crtableLogoninfo As New TableLogOnInfo

    Public crConnectionInfo As New ConnectionInfo

    Public CrTables As Tables

 

    Public Sub TampilLaporan()

        With crConnectionInfo

            .ServerName = (Application.StartupPath.ToString & "\salondb.mdb")

            .DatabaseName = (Application.StartupPath.ToString & "\salondb.mdb")

            .UserID = ""

            '.Password = "132435"

        End With

 

        CrTables = Rpt.Database.Tables

        For Each CrTable In CrTables

            crtableLogoninfo = CrTable.LogOnInfo

            crtableLogoninfo.ConnectionInfo = crConnectionInfo

            CrTable.ApplyLogOnInfo(crtableLogoninfo)

        Next

    End Sub

 

    Public Sub Koneksi()

        Try

            Conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=salondb.mdb")

            Conn.Open()

        Catch ex As Exception

            MsgBox(ex.Message)

            End

        End Try

 

        For Each frm As Form In My.Application.OpenForms

            If frm.Name = "MenuUtama" Then

                frm.Text = "Menu Utama Aplikasi Salon Kecantikan - Uus Rusmawan"

            Else

                frm.Text = frm.Text + " - Uus Rusmawan"

            End If

        Next

 

    End Sub

End Module

 

 

 

Imports System.Data.OleDb

 

Public Class Login

 

    Private Sub TUser_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TUser.KeyPress

        If e.KeyChar = Chr(13) Then

            TPassword.Focus()

        End If

    End Sub

 

    Private Sub TPassword_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TPassword.KeyPress

        If e.KeyChar = Chr(13) Then

            OK.Focus()

        End If

    End Sub

 

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        Call Koneksi()

        CMD = New OleDbCommand("select * from tbluser where nama_user='" & TUser.Text & "' and pwd_USER='" & TPassword.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            MsgBox("Login gagal")

            TUser.Focus()

            Exit Sub

        Else

            Me.Visible = False

            MenuUtama.Show()

 

            MenuUtama.Panel1.Text = DR.Item("kode_user")

            MenuUtama.Panel2.Text = DR.Item("nama_user")

            MenuUtama.Panel3.Text = DR.Item("lEVEL_user")

 

            If MenuUtama.Panel1.Text = "ADMIN" Then

                'MenuUtama.UserToolStripMenuItem.Visible = False

            End If

        End If

 

    End Sub

 

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click

        Me.Close()

    End Sub

 

 

    Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

    End Sub

End Class

 

 

 

 

 

Imports System.Data.OleDb

 

Public Class User

 

    Sub Notis()

        'call koneksi()

        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 = "U01"

        Else

            TextBox1.Text = "U" + Format(Microsoft.VisualBasic.Right(DR("kode_User"), 2) + 1, "00")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        Call tampilstatususer()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_User")

        ComboBox1.Text = DR("level_user")

        TextBox3.Text = DR("pwd_user")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblUser", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Sub tampilstatususer()

        'call koneksi()

        CMD = New OleDbCommand("select distinct level_user from tblUser", Conn)

        DR = CMD.ExecuteReader

        ComboBox1.Items.Clear()

        Do While DR.Read

            ComboBox1.Items.Add(DR("level_user"))

        Loop

    End Sub

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblUser where kode_User='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub User_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus

        ComboBox1.Text = UCase(ComboBox1.Text)

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblUser where kode_User='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblUser values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & UCase(ComboBox1.Text) & "','" & TextBox3.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblUser set nama_User='" & TextBox2.Text & "',level_user='" & UCase(ComboBox1.Text) & "',pwd_user='" & TextBox3.Text & "' where kode_User='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_User").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_User").Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells("level_user").Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells("pwd_user").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode User harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "UPDATE tblUser SET STATUS_USER='TIDAK AKTIF' where kode_User='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

    Private Sub Combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblUser where nama_User like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Barang

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_Barang from tblBarang order by kode_Barang desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "B001"

        Else

            TextBox1.Text = "B" + Format(Microsoft.VisualBasic.Right(DR("kode_Barang"), 3) + 1, "000")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        Call TampilSatuanBarang()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_Barang")

        ComboBox1.Text = DR("Satuan_Barang")

        TextBox3.Text = DR("Harga_barang")

        TextBox4.Text = DR("stok_barang")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblBarang", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Sub TampilSatuanBarang()

        'call koneksi()

        CMD = New OleDbCommand("select distinct Satuan_Barang from tblBarang", Conn)

        DR = CMD.ExecuteReader

        ComboBox1.Items.Clear()

        Do While DR.Read

            ComboBox1.Items.Add(DR("Satuan_Barang"))

        Loop

    End Sub

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblBarang where kode_Barang='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Barang_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus

        ComboBox1.Text = UCase(ComboBox1.Text)

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblBarang where kode_Barang='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblBarang values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & UCase(ComboBox1.Text) & "','" & TextBox3.Text & "','" & TextBox4.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblBarang set nama_Barang='" & TextBox2.Text & "',Satuan_Barang='" & UCase(ComboBox1.Text) & "',Harga_barang='" & TextBox3.Text & "',stok_barang='" & TextBox4.Text & "' where kode_Barang='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_barang").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_barang").Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells("satuan_barang").Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells("Harga_barang").Value

        TextBox4.Text = DGV.Rows(e.RowIndex).Cells("Stok_barang").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode Barang harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "update tblBarang set status_barang='TIDAK AKTIF' where kode_Barang='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

    Private Sub Combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox4.Focus()

        End If

 

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

    Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress

        'TextBox1.MaxLength = 5

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

 

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

 

    End Sub

 

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblBarang where nama_Barang like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Produk

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_Produk from tblProduk order by kode_Produk desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "P001"

        Else

            TextBox1.Text = "P" + Format(Microsoft.VisualBasic.Right(DR("kode_Produk"), 3) + 1, "000")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        Call TampilSatuanProduk()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_Produk")

        ComboBox1.Text = DR("Satuan_Produk")

        TextBox3.Text = DR("Harga_Produk")

        TextBox4.Text = DR("stok_Produk")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblProduk", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Sub TampilSatuanProduk()

        'call koneksi()

        CMD = New OleDbCommand("select distinct Satuan_Produk from tblProduk", Conn)

        DR = CMD.ExecuteReader

        ComboBox1.Items.Clear()

        Do While DR.Read

            ComboBox1.Items.Add(DR("Satuan_Produk"))

        Loop

    End Sub

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblProduk where kode_Produk='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Produk_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus

        ComboBox1.Text = UCase(ComboBox1.Text)

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblProduk where kode_Produk='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblProduk values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & UCase(ComboBox1.Text) & "','" & TextBox3.Text & "','" & TextBox4.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblProduk set nama_Produk='" & TextBox2.Text & "',Satuan_Produk='" & UCase(ComboBox1.Text) & "',Harga_Produk='" & TextBox3.Text & "',stok_Produk='" & TextBox4.Text & "' where kode_Produk='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_Produk").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_Produk").Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells("satuan_Produk").Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells("Harga_Produk").Value

        TextBox4.Text = DGV.Rows(e.RowIndex).Cells("Stok_Produk").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode Produk harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "UPDATE tblProduk set status_produk='TIDAK AKTIF' where kode_Produk='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

    Private Sub Combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox4.Focus()

        End If

 

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

    Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress

        'TextBox1.MaxLength = 5

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

 

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

 

    End Sub

 

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblProduk where nama_Produk like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Layanan

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_Layanan from tblLayanan order by kode_Layanan desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "L01"

        Else

            TextBox1.Text = "L" + Format(Microsoft.VisualBasic.Right(DR("kode_Layanan"), 2) + 1, "00")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_Layanan")

        TextBox3.Text = DR("Harga_Layanan")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblLayanan", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblLayanan where kode_Layanan='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Layanan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblLayanan where kode_Layanan='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblLayanan values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblLayanan set nama_Layanan='" & TextBox2.Text & "',Harga_Layanan='" & TextBox3.Text & "' where kode_Layanan='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_Layanan").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_Layanan").Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells("Harga_Layanan").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode Layanan harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "update tblLayanan set status_Layanan='TIDAK AKTIF' where kode_Layanan='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

 

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblLayanan where nama_Layanan like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Customer

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_Customer from tblCustomer order by kode_Customer desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "C0001"

        Else

            TextBox1.Text = "C" + Format(Microsoft.VisualBasic.Right(DR("kode_Customer"), 4) + 1, "0000")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        'Call TampilstatusCustomer()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_Customer")

        ComboBox1.Text = DR("status_Member")

        TextBox3.Text = DR("alamat_Customer")

        TextBox4.Text = DR("HP_Customer")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblCustomer", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblCustomer where kode_Customer='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Customer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus

        ComboBox1.Text = UCase(ComboBox1.Text)

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblCustomer where kode_Customer='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblCustomer values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & UCase(ComboBox1.Text) & "','" & TextBox3.Text & "','" & TextBox4.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblCustomer set nama_Customer='" & TextBox2.Text & "',status_MEMBER='" & UCase(ComboBox1.Text) & "',alamat_Customer='" & TextBox3.Text & "',HP_Customer='" & TextBox4.Text & "' where kode_Customer='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_Customer").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_Customer").Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells("status_member").Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells("alamat_Customer").Value

        TextBox4.Text = DGV.Rows(e.RowIndex).Cells("HP_Customer").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode Customer harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "update tblCustomer set status_Customer='TIDAK AKTIF' where kode_Customer='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

    Private Sub Combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            TextBox4.Focus()

        End If

 

    End Sub

 

    Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress

 

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

 

    End Sub

 

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblCustomer where nama_Customer like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Stylist

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_stylist from tblstylist order by kode_stylist desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "S01"

        Else

            TextBox1.Text = "S" + Format(Microsoft.VisualBasic.Right(DR("kode_stylist"), 2) + 1, "00")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        TextBox2.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        TextBox2.Text = DR("nama_stylist")

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblstylist", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblstylist where kode_stylist='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub stylist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

 

    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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblstylist where kode_stylist='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblstylist values ('" & TextBox1.Text & "','" & TextBox2.Text & "','AKTIF')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblstylist set nama_stylist='" & TextBox2.Text & "' where kode_stylist='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_stylist").Value

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells("nama_stylist").Value

        TextBox2.Focus()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode stylist harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("yakin akan dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            'call koneksi()

            Dim hapus As String = "UPDATE tblstylist SET STATUS_stylist='TIDAK AKTIF' where kode_stylist='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, Conn)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 4

        If e.KeyChar = Chr(13) Then

            If Not DR.HasRows Then

                Call DataBaru()

            Else

                Call Ketemu()

            End If

        End If

    End Sub

 

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

    Private Sub textbox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblstylist where nama_stylist like '%" & TextBox5.Text & "%'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

    End Sub

 

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Pendaftaran

 

    Sub Notis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_Pendaftaran from tblPendaftaran order by kode_Pendaftaran desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TextBox1.Text = "00001"

        Else

            TextBox1.Text = Format(Microsoft.VisualBasic.Right(DR("kode_Pendaftaran"), 5) + 1, "00000")

        End If

    End Sub

 

    Sub Kosongkan()

        Call Notis()

        TextBox1.Enabled = False

        ComboBox1.Text = ""

        TextBox2.Clear()

        Tanggal.Focus()

        Call tampilkodecustomer()

        Call TampilGrid()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        TextBox1.Enabled = False

        Tanggal.Text = DR("tanggal_pendaftaran")

        ComboBox1.Text = DR("kode_customer")

        'call koneksi()

        CMD = New OleDbCommand("select nama_customer from tblcustomer where kode_customer='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            TextBox2.Text = ComboBox1.Text = DR("nama_customer")

        End If

        TextBox2.Focus()

    End Sub

 

    Sub TampilGrid()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from tblPendaftaran", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Sub tampilkodecustomer()

        'call koneksi()

        CMD = New OleDbCommand("select kode_customer from tblcustomer", Conn)

        DR = CMD.ExecuteReader

        ComboBox1.Items.Clear()

        Do While DR.Read

            ComboBox1.Items.Add(DR("kode_customer"))

        Loop

    End Sub

 

    Sub CariKode()

        'call koneksi()

        CMD = New OleDbCommand("select * from tblPendaftaran where kode_Pendaftaran='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub Pendaftaran_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Kosongkan()

    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 ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus

        ComboBox1.Text = UCase(ComboBox1.Text)

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'call koneksi()

        CMD = New OleDbCommand("select * from tblPendaftaran where kode_Pendaftaran='" & TextBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        Try

            If Not DR.HasRows Then

                'call koneksi()

                Dim simpan As String = "insert into tblPendaftaran values ('" & TextBox1.Text & "','" & Format(DateValue(Tanggal.Text), "MM/dd/yyyy") & "','" & UCase(ComboBox1.Text) & "','TERDAFTAR')"

                CMD = New OleDbCommand(simpan, Conn)

                CMD.ExecuteNonQuery()

            Else

                'call koneksi()

                Dim edit As String = "update tblPendaftaran set TANGGAL_Pendaftaran='" & Tanggal.Text & "',kode_customer='" & UCase(ComboBox1.Text) & "' where kode_Pendaftaran='" & TextBox1.Text & "'"

                CMD = New OleDbCommand(edit, Conn)

                CMD.ExecuteNonQuery()

            End If

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

        Call Kosongkan()

    End Sub

 

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Enabled = False

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells("Kode_Pendaftaran").Value

        Tanggal.Text = DGV.Rows(e.RowIndex).Cells("tanggal_pendaftaran").Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells("kode_customer").Value

        Tanggal.Focus()

    End Sub

 

    Private Sub Combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress

        'TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

 

    Private Sub Tanggal_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Tanggal.KeyDown

        If e.KeyCode = Keys.Enter Then

            ComboBox1.Focus()

        End If

    End Sub

 

 

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

        'call koneksi()

        CMD = New OleDbCommand("select * from tblcustomer where kode_customer='" & ComboBox1.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            TextBox2.Text = DR("nama_customer")

        Else

            MsgBox("kode customer tidak terdaftar")

        End If

    End Sub

End Class

 

 

 

Imports System.Data.OleDb

 

Public Class Pembayaran

 

    Sub Bersihkan()

        LstatusMember.Text = ""

        LhargaAkhir.Text = ""

        tbarisbarang.Text = ""

        tbarisjasa.Text = ""

        cmbPendaftaran.Text = ""

        TNamaCustomer.Text = "-"

        TTLBiayaProduk.Text = 0

        TTLBiayaLayanan.Text = 0

        LHargaAwal.Text = 0

        TDibayar.Text = 0

        TKembali.Text = 0

        TCariProduk.Clear()

        TCariLayanan.Clear()

        DGVJasa.Rows.Clear()

        DGVBarang.Rows.Clear()

        Call TampilPendaftaran()

        cmbStylist.Text = ""

        DGV1.Enabled = False

        DGV2.Enabled = False

    End Sub

 

    Sub Otomatis()

        'call koneksi()

        CMD = New OleDbCommand("select kode_pembayaran from tblpembayaran order by kode_pembayaran desc", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TNomor.Text = "00001"

        Else

            TNomor.Text = Format(Microsoft.VisualBasic.Right(DR.Item("kode_pembayaran"), 5) + 1, "00000")

        End If

    End Sub

 

    Sub TampilPendaftaran()

        'call koneksi()

        CMD = New OleDbCommand("select kode_pendaftaran from TBLpendaftaran where status_pendaftaran='TERDAFTAR'", Conn)

        DR = CMD.ExecuteReader

        cmbPendaftaran.Items.Clear()

        Do While DR.Read

            cmbPendaftaran.Items.Add(DR(0))

        Loop

    End Sub

 

    Sub TampilLayanan()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from TBLLayanan where status_layanan='AKTIF'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV1.DataSource = DS.Tables(0)

        DGV1.ReadOnly = True

    End Sub

 

    Sub tampilProduk()

        'call koneksi()

        DA = New OleDbDataAdapter("select * from TBLProduk where stok_produk>0 AND STATUS_produk='AKTIF'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV2.DataSource = DS.Tables(0)

        DGV2.ReadOnly = True

    End Sub

 

    Sub TampilStylist()

        'call koneksi()

        CMD = New OleDbCommand("select * from TBLstylist where status_stylist='AKTIF'", Conn)

        DR = CMD.ExecuteReader

        cmbStylist.Items.Clear()

        Do While DR.Read

            cmbStylist.Items.Add(DR(0) & Space(2) & DR(1))

        Loop

    End Sub

 

 

    Private Sub Transaksi_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.CenterToScreen()

        Call Koneksi()

        Call Bersihkan()

        Call Otomatis()

        TTanggal.Text = Today

        Call tampilProduk()

        Call TampilLayanan()

        Call TampilStylist()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Call Bersihkan()

    End Sub

 

    Sub TotalBiayaLayanan()

        Dim hitung As Integer = 0

        For baris As Integer = 0 To DGVJasa.RowCount - 1

            hitung = hitung + DGVJasa.Rows(baris).Cells(2).Value

            TTLBiayaLayanan.Text = FormatNumber(hitung, 0)

        Next

        tbarisjasa.Text = DGVJasa.RowCount - 1

    End Sub

 

    Sub TotalBiayaProduk()

        Dim hitung As Integer = 0

        For baris As Integer = 0 To DGVBarang.RowCount - 1

            hitung = hitung + DGVBarang.Rows(baris).Cells(4).Value

            TTLBiayaProduk.Text = FormatNumber(hitung, 0)

        Next

        tbarisbarang.Text = DGVBarang.RowCount - 1

    End Sub

 

    Sub HitungTotal()

        LHargaAwal.Text = Val(Microsoft.VisualBasic.Str(TTLBiayaLayanan.Text)) + Val(Microsoft.VisualBasic.Str(TTLBiayaProduk.Text))

        LHargaAwal.Text = FormatNumber(LHargaAwal.Text, 0)

    End Sub

 

    Sub HitungHargaAkhir()

        On Error Resume Next

        Dim hasildiskon As Double

        hasildiskon = Val(Microsoft.VisualBasic.Str(LHargaAwal.Text)) * Val(Tdiskon.Text) / 100

        LhargaAkhir.Text = Val(Microsoft.VisualBasic.Str(LHargaAwal.Text)) - Val(hasildiskon)

        LhargaAkhir.Text = FormatNumber(LhargaAkhir.Text, 0)

        TDibayar.Text = 0

        If Tdiskon.Text = 0 Then

            LhargaAkhir.Text = LHargaAwal.Text

        End If

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Me.Close()

    End Sub

 

    Private Sub TCariLayanan_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TCariLayanan.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from TBLLayanan where nama_layanan like '%" & TCariLayanan.Text & "%' AND STATUS_LAYANAN='AKTIF'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV1.DataSource = DS.Tables(0)

        DGV1.ReadOnly = True

    End Sub

 

    Private Sub TCariProduk_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TCariProduk.TextChanged

        'call koneksi()

        DA = New OleDbDataAdapter("select * from TBLProduk where nama_produk like '%" & TCariProduk.Text & "%' AND STATUS_PRODUK='AKTIF'", Conn)

        DS = New DataSet

        DA.Fill(DS)

        DGV2.DataSource = DS.Tables(0)

        DGV2.ReadOnly = True

 

    End Sub

 

    Private Sub TDibayar_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TDibayar.KeyPress

        If e.KeyChar = Chr(13) Then

            TDibayar.Text = FormatNumber(TDibayar.Text, 0)

            If Val(Microsoft.VisualBasic.Str(TDibayar.Text)) < Val(Microsoft.VisualBasic.Str(LhargaAkhir.Text)) Then

                MsgBox("Pembayaran kurang")

                Exit Sub

            ElseIf Val(Microsoft.VisualBasic.Str(TDibayar.Text)) >= Val(Microsoft.VisualBasic.Str(LhargaAkhir.Text)) Then

                TKembali.Text = Val(Microsoft.VisualBasic.Str(TDibayar.Text)) - Val(Microsoft.VisualBasic.Str(LhargaAkhir.Text))

                TKembali.Text = FormatNumber(TKembali.Text, 0)

                'Button1.Enabled = True

            End If

            cmbStylist.Focus()

        End If

 

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

 

    Private Sub cmbpendaftaran_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)

        If e.KeyChar = Chr(13) Then

            cmbPendaftaran.Text = UCase(cmbPendaftaran.Text)

            TNamaCustomer.Focus()

        End If

    End Sub

 

    Private Sub DGVLayanan_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DGVJasa.KeyPress

        On Error Resume Next

        If e.KeyChar = Chr(27) Then

            DGVJasa.Rows.RemoveAt(DGVJasa.CurrentCell.RowIndex)

            Call TotalBiayaLayanan()

            Call HitungTotal()

        End If

 

    End Sub

 

    Private Sub DGVProduk_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGVBarang.CellEndEdit

        If e.ColumnIndex = 3 Then

            Try

                DGVBarang.Rows(e.RowIndex).Cells(4).Value = DGVBarang.Rows(e.RowIndex).Cells(3).Value * DGVBarang.Rows(e.RowIndex).Cells(2).Value

            Catch ex As Exception

                MsgBox("harus angka")

                SendKeys.Send("{UP}")

                DGVBarang.Rows(e.RowIndex).Cells(3).Value = 1

                DGVBarang.Rows(e.RowIndex).Cells(4).Value = DGVBarang.Rows(e.RowIndex).Cells(3).Value * DGVBarang.Rows(e.RowIndex).Cells(2).Value

            End Try

        End If

        Call TotalBiayaProduk()

        Call HitungTotal()

        Call HitungHargaAkhir()

    End Sub

 

 

    Private Sub DGVProduk_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DGVBarang.KeyPress

        On Error Resume Next

        If e.KeyChar = Chr(27) Then

            DGVBarang.Rows.RemoveAt(DGVBarang.CurrentCell.RowIndex)

            Call TotalBiayaProduk()

            Call HitungTotal()

        End If

    End Sub

 

    Private Sub DGV1_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV1.CellMouseClick

        On Error Resume Next

        Dim baris As Integer = DGVJasa.RowCount - 1

        DGVJasa.Rows.Add(DGV1.Rows(e.RowIndex).Cells(0).Value)

 

        For i As Integer = 0 To DGVJasa.RowCount - 1

            For j As Integer = i + 1 To DGVJasa.RowCount - 1

                If DGVJasa.Rows(j).Cells(0).Value = DGVJasa.Rows(i).Cells(0).Value Then

                    MsgBox("data sudah dientri")

                    DGVJasa.Rows.RemoveAt(j)

                    Exit Sub

                End If

            Next

        Next

 

        'call koneksi()

        CMD = New OleDbCommand("select * from TBLLayanan where kode_layanan='" & DGVJasa.Rows(baris).Cells(0).Value & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            DGVJasa.Rows(baris).Cells(1).Value = DR.Item("nama_layanan")

            DGVJasa.Rows(baris).Cells(2).Value = DR.Item("harga_layanan")

            DGVJasa.Columns(2).DefaultCellStyle.Format = "###,###,###"

            DGVJasa.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        End If

        Call TotalBiayaLayanan()

        Call HitungTotal()

        Call HitungHargaAkhir()

        TCariLayanan.Clear()

 

    End Sub

 

    Private Sub DGV2_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV2.CellMouseClick

        Dim baris As Integer = DGVBarang.RowCount - 1

        DGVBarang.Rows.Add(DGV2.Rows(e.RowIndex).Cells(0).Value)

 

        For i As Integer = 0 To DGVBarang.RowCount - 1

            For j As Integer = i + 1 To DGVBarang.RowCount - 1

                If DGVBarang.Rows(j).Cells(0).Value = DGVBarang.Rows(i).Cells(0).Value Then

                    MsgBox("data sudah dientri")

                    DGVBarang.Rows.RemoveAt(j)

                    Exit Sub

                End If

            Next

        Next

 

        'call koneksi()

        CMD = New OleDbCommand("select * from TBLProduk where kode_produk='" & DGVBarang.Rows(baris).Cells(0).Value & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            DGVBarang.Rows(baris).Cells(1).Value = DR.Item("nama_produk")

            DGVBarang.Rows(baris).Cells(2).Value = DR.Item("harga_produk")

            DGVBarang.Columns(2).DefaultCellStyle.Format = "###,###,###"

            DGVBarang.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

            DGVBarang.Rows(baris).Cells(3).Value = 1

            DGVBarang.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter

            DGVBarang.Rows(baris).Cells(4).Value = DGVBarang.Rows(baris).Cells(2).Value * DGVBarang.Rows(baris).Cells(3).Value

            DGVBarang.Columns(4).DefaultCellStyle.Format = "###,###,###"

            DGVBarang.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        End If

        Call TotalBiayaProduk()

        Call HitungTotal()

        Call HitungHargaAkhir()

        TCariProduk.Clear()

    End Sub

 

    Private Sub cmbPendaftaran_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbPendaftaran.SelectedIndexChanged

        If cmbPendaftaran.Text = "" Then

            DGV1.Enabled = False

            DGV2.Enabled = False

        Else

            DGV1.Enabled = True

            DGV2.Enabled = True

        End If

 

        'call koneksi()

        CMD = New OleDbCommand("select nama_customer,Status_member from tblcustomer,tblpendaftaran where tblcustomer.kode_customer=tblpendaftaran.kode_customer and tblpendaftaran.kode_pendaftaran='" & cmbPendaftaran.Text & "'", Conn)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            TNamaCustomer.Text = DR(0)

            LstatusMember.Text = DR(1)

        End If

 

        If LstatusMember.Text = "MEMBER" Then

            Tdiskon.Enabled = True

        Else

            Tdiskon.Enabled = False

            Tdiskon.Text = 0

            Call HitungHargaAkhir()

        End If

    End Sub

 

    Private Sub Tdiskon_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Tdiskon.KeyDown

        If e.KeyCode = Keys.Enter Then

            'Dim hasildiskon As Double

            Tdiskon.Text = FormatNumber(Tdiskon.Text, 0)

            'hasildiskon = Val(Microsoft.VisualBasic.Str(LHargaAwal.Text)) - Val(Microsoft.VisualBasic.Str(Tdiskon.Text))

            LhargaAkhir.Text = Val(Microsoft.VisualBasic.Str(LHargaAwal.Text)) - Val(Microsoft.VisualBasic.Str(Tdiskon.Text))

            LhargaAkhir.Text = FormatNumber(LhargaAkhir.Text, 0)

            TDibayar.Focus()

        End If

    End Sub

 

    Private Sub Tdiskon_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Tdiskon.KeyPress

        If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then

            e.Handled = True

        End If

    End Sub

 

    Private Sub cmbStylist_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cmbStylist.KeyDown

        If e.KeyCode = Keys.Enter Then

            Button1.Focus()

        End If

    End Sub

 

   

    Private Sub cmbStylist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbStylist.SelectedIndexChanged

        Button1.Focus()

    End Sub

End Class

 

 

 

 

Public Class LaporanMaster

 

    Private Sub LaporanMaster_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.WindowState = FormWindowState.Maximized

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

        Rpt.Load("user.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Rpt.Load("barang.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Rpt.Load("produk.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Rpt.Load("layanan.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Rpt.Load("customer.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click

        Rpt.Load("stylist.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        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

 

 

 

 

Imports System.Data.OleDb

 

Public Class LaporanTransaksi

 

    Private Sub LaporanTransaksi_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.WindowState = FormWindowState.Maximized

        Call Koneksi()

        CMD = New OleDbCommand("select distinct tanggal_pendaftaran from tblpendaftaran", Conn)

        DR = CMD.ExecuteReader

        ListBox1.Items.Clear()

        Do While DR.Read

            ListBox1.Items.Add(DR(0))

        Loop

 

        'call koneksi()

        CMD = New OleDbCommand("select distinct status_pendaftaran from tblpendaftaran", Conn)

        DR = CMD.ExecuteReader

        ListBox2.Items.Clear()

        Do While DR.Read

            ListBox2.Items.Add(DR(0))

        Loop

 

 

        'call koneksi()

        CMD = New OleDbCommand("select distinct tanggal_pembayaran from tblpembayaran", Conn)

        DR = CMD.ExecuteReader

        ListBox3.Items.Clear()

        Do While DR.Read

            ListBox3.Items.Add(DR(0))

        Loop

 

        'call koneksi()

        CMD = New OleDbCommand("select distinct nama_customer from tblcustomer,tblpendaftaran where tblcustomer.kode_customer=tblpendaftaran.kode_customer", Conn)

        DR = CMD.ExecuteReader

        ListBox4.Items.Clear()

        Do While DR.Read

            ListBox4.Items.Add(DR(0))

        Loop

 

        'call koneksi()

        CMD = New OleDbCommand("select distinct nama_stylist from tblstylist,tblpembayaran where tblstylist.kode_stylist=tblpembayaran.kode_stylist", Conn)

        DR = CMD.ExecuteReader

        ListBox5.Items.Clear()

        Do While DR.Read

            ListBox5.Items.Add(DR(0))

        Loop

 

 

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Rpt.Load("pendaftaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

        CRV.SelectionFormula = "totext({tblpendaftaran.tanggal_pendaftaran})='" & ListBox1.Text & "'"

        Rpt.Load("pendaftaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged

        CRV.SelectionFormula = "{tblpendaftaran.status_pendaftaran}='" & ListBox2.Text & "'"

        Rpt.Load("pendaftaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox3.SelectedIndexChanged

        CRV.SelectionFormula = "totext({tblpembayaran.tanggal_pembayaran})='" & ListBox3.Text & "'"

       

        Rpt.Load("rekap pembayaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Rpt.Load("rekap pembayaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox4.SelectedIndexChanged

        CRV.SelectionFormula = "{tblcustomer.nama_customer}='" & ListBox4.Text & "'"

        Rpt.Load("rekap pembayaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox5.SelectedIndexChanged

        CRV.SelectionFormula = "{tblstylist.nama_stylist}='" & ListBox5.Text & "'"

        Rpt.Load("rekap pembayaran.rpt")

        Call TampilLaporan() 'panggil seting dari module

        CRV.ReportSource = Rpt

        CRV.RefreshReport()

    End Sub

End Class