Home » » Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net

Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net

Written By Mesran on Monday, 3 June 2013 | 19:06

Terdapat 4 hal yang anda buat pada jawaban anda di postingan anda (KHUSUS D3), yaitu :

0. Judul postingan Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net
1. Judul tugas akhir di link kan ke Cara Menjawab Quiz Online Pemrograman Database VB dot Net (D3)

2. Tampilkan Program Menu, Form Input, Cetak Laporan beserta semua program pada form tersebut

3. Pada Bagian bawah postingan buat seperti ini

Demikilahlah postingan saya  Nama : Ita Purnama Sari NPM : 01293717

Selamat Belajar VB Net  ( Belajar VB Net di LINK ke http://mesran.net )

4. Terakhir kirimkan koment anda di Cara Menjawab Quiz Online Pemrograman Database VB dot Net (D3) dengan menuliskan Nama, NPM, Link Postingannya.


OK ! Lihat bentuknya.
___________________________________________________________________________

Judul Tugas Akhir
Sistem informasi data siswa dan penilaian siswa pada sekolah SMA AL-WASHLIYA 3 MEDAN

1. Form Menu


Listing Program Menu
Private Sub GURUToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GURUToolStripMenuItem.Click
        form3.Show()
    End Sub
    Private Sub KELUARPROGRAMToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KELUARPROGRAMToolStripMenuItem.Click
        End
    End Sub
    Private Sub LAPORANGURUToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LAPORANGURUToolStripMenuItem.Click
        Dim laporan As New Rptguru
        cetak.CrystalReportViewer1.ReportSource = laporan
        cetak.Show()
    End Sub

2. Form Input

End Class

Listing Program Input
Imports MySql.Data.MySqlClient
Public Class form3
    Public DB As New MySql.Data.MySqlClient.MySqlConnection
    Public SQL As String
    Public cmd As MySqlCommand
    Public rs As MySqlDataReader
    Public Sub Opendb()
        SQL = “server=localhost;uid=root;pwd;database=dbguru”
        Try
            DB.ConnectionString = SQL
            DB.Open()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
    Sub bersih()
        Kode.Text = “”
        Nama.Text = “”
        Nip.Text = “”
        Tempat_lahir.Text = “”
        Tanggal_lahir.Text = “”
        Jenis_kelamin.Text = “”
        pendidikan.Text = “”
    End Sub
    Sub RUBAHBUTTON(ByVal Btn1 As Boolean, ByVal Btn2 As Boolean, ByVal Btn3 As Boolean, ByVal Btn4 As Boolean, ByVal Btn5 As Boolean, ByVal Btn6 As Boolean)
        Btn_baru.Enabled = Btn1
        Btn_simpan.Enabled = Btn2
        Btn_edit.Enabled = Btn3
        Btn_hapus.Enabled = Btn4
        Btn_Batal.Enabled = Btn5
        Btn_keluar.Enabled = Btn6
    End Sub
    Sub buattabel()
        Lv.Columns.Add(“kode”, 80, HorizontalAlignment.Center)
        lv.Columns.Add(“nama”, 180, HorizontalAlignment.Left)
        LV.Columns.Add(“Nip”, 80, HorizontalAlignment.Left)
        LV.Columns.Add(“Tempat_lahir”, 80, HorizontalAlignment.Left)
        LV.Columns.Add(“Tanggal_lahir”, 180, HorizontalAlignment.Left)
        LV.Columns.Add(“Jenis_kelamin”, 80, HorizontalAlignment.Left)
        LV.Columns.Add(“Pendidikan”, 180, HorizontalAlignment.Left)
        lv.GridLines = True
        lv.FullRowSelect = True
        lv.View = View.Details
    End Sub
    Sub isitabel()
        LV.Items.Clear()
        SQL = “select * from guru”
        cmd = New MySqlCommand(SQL, DB)
        rs = cmd.ExecuteReader
        Try
            While rs.Read
                Dim ist As New ListViewItem
                ist.Text = rs(“Kode”)
                ist.SubItems.Add(rs(“Nama”))
                ist.SubItems.Add(rs(“Nip”))
                ist.SubItems.Add(rs(“Tempat lahir”))
                ist.SubItems.Add(rs(“Tanggal lahir”))
                ist.SubItems.Add(rs(“Jenis kelamin”))
                ist.SubItems.Add(rs(“Pendidikan”))
                LV.Items.Add(ist)
            End While
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        rs.Close()
    End Sub
    Sub prosesdb(ByVal log As Integer)
        Dim pesan As String = “”
        Select Case log
            Case 0
                SQL = “insert into pesanan(kode, nama, harga)” & _
                      “values (‘” & Kode.Text & _
                      “‘,’” & Nama.Text & _
                      “‘,’” & Nip.Text & _
                      “‘,’” & Tempat_lahir.Text & _
                      “‘,’” & Tanggal_lahir.Text & _
                      “‘,’” & Jenis_kelamin.Text & _
                      “‘,’” & pendidikan.Text & _
                pesan = “data telah disimpan”
            Case 1
                SQL = “update pesanan set nama=’” & Nama.Text & “‘, ” & _
                        “Nip=’” & Nip.Text & “‘,” & _
                        “Tempat_lahir=’” & Tempat_lahir.Text & “‘,” & _
                        “Tanggal_lahir=’” & Tanggal_lahir.Text & “‘,” & _
                        “Jenis_kelamin=’” & Jenis_kelamin.Text & “‘,” & _
                        “Pendidikan=’” & pendidikan.Text & “‘,” & _
                       “where kode=’” & Kode.Text & “‘”
                pesan = “telah di update”
            Case 2
                SQL = “delete from pesanan where kode=’” & Kode.Text & “‘”
                pesan = “data telah dihapus”
        End Select
        Try
            cmd = New MySqlCommand(SQL, DB)
            cmd.ExecuteNonQuery()
            MsgBox(pesan, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, “konfirmasi”)
            Call bersih()
            Call ISITABEL()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
    Sub showdb()
        rs.Read()
        Kode.Text = rs(“Kode”)
        Nama.Text = rs(“Nama”)
        Nip.Text = rs(“Nip”)
        Tempat_lahir.Text = rs(“Tempat_lahir”)
        Tanggal_lahir.Text = rs(“Tanggal_lahir”)
        Jenis_kelamin.Text = rs(“Jenis_kelamin”)
        pendidikan.Text = rs(“pendidikan”)
        RUBAHBUTTON(False, False, True, True, True, False)
        Btn_edit.Text = “”
        Kode.Enabled = False
    End Sub
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Call Opendb()
        Call bersih()
        Call ISITABEL()
        Call buattabel()
    End Sub
    Private Sub Btn_baru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_baru.Click
        Call bersih()
        Kode.Focus()
    End Sub
    Private Sub Btn_edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_edit.Click
        If Btn_edit.Text = “edit” Then prosesdb(0) Else prosesdb(1)
    End Sub
    Private Sub Btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_hapus.Click
        Dim x As String
        x = MsgBox(“anda yakin ingin menghapus”, MsgBoxStyle.Information + MsgBoxStyle.YesNo, “hapus”)
        If x = vbYes Then
            Call prosesdb(2)
        End If
    End Sub
    Private Sub Btn_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_keluar.Click
        Me.Close()
    End Sub
    Private Sub Btn_Batal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Batal.Click
        Call bersih()
        Kode.Focus()
    End Sub
    Private Sub Btn_simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_simpan.Click
        If Btn_simpan.Text = “simpan” Then prosesdb(0) Else prosesdb(1)
    End Sub
    Private Sub Kode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Kode.KeyPress
        Dim tombol As Integer = Asc(e.KeyChar)
        If tombol = 13 Then
            Dim x As String
            If Kode.Text = “” Then
                MsgBox(“isi kode terlebih dahulu”)
            Else
                SQL = “select* from guru where kode=’” & Kode.Text & “‘”
                cmd = New MySqlCommand(SQL, DB)
                rs = cmd.ExecuteReader
                Try
                    Call showdb()
                Catch ex As Exception
                    x = Kode.Text
                    bersih()
                    Kode.Text = x
                    RUBAHBUTTON(False, True, False, False, True, False)
                    Btn_simpan.Text = “”
                End Try
                Nama.Focus()
                rs.Close()
            End If
        End If
    End Sub
End Class


2. Tampilan Form Cetak Laporan

Demikilahlah postingan saya  Nama : Ita Purnama Sari NPM : 01293717

Selamat Belajar VB Net

_________________________________________________________________

Seperti itulah yang saya harapkan dari postingan anda, jika belum seperti itu, silahkan edit postingan anda sesuai dengan instruksi saya di Cara Menjawab Quiz Online Pemrograman Database VB dot Net (D3)

Silahkan memperbaiki postingan anda, sebelum saya melakukan penilaian.



0 comments:

Post a Comment

Terima kasih apabila sudah memberikan komentar yang baik dan sopan :)