Jumat, 18 November 2011

Latihan 40 APKOM 4 D3C

36 komentar:

  1. Public Class Latihan_40a_36109058
    Dim yunha As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb")
    Dim dt As New DataTable
    Dim dt1 As New DataTable
    Dim dset As New DataSet 'Deklarasi dataset'
    Dim Bsource1 As New BindingSource 'Deklarasi bindingsource'
    Dim Bsource2 As New BindingSource
    Public Sub yunhi()
    'Membersihkan detailtransaksi lalu mastertransaksi'
    dt1.Rows.Clear()
    dt.Rows.Clear()

    Dim B1 As New OleDb.OleDbDataAdapter
    B1 = New OleDb.OleDbDataAdapter("Select * From MASTERTRANSAKSI", yunha)
    B1.Fill(dt)

    B1 = New OleDb.OleDbDataAdapter("Select DETAILTRANSAKSI.NOTRANS, DETAILTRANSAKSI.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG", yunha)
    B1.Fill(dt1)

    B1.Dispose()
    End Sub

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

    'Memasukkan datatabel dalam dataset'
    dset.Tables.Add(dt)
    dset.Tables.Add(dt1)

    'Mengganti nama datatabel dalam dataset'
    dt.TableName = "T01"
    dt1.TableName = "T02"

    'Menambahkan relasi dalam dataset'
    dset.Relations.Add(New DataRelation("X", dset.Tables("T01").Columns("NOTRANS"), dset.Tables("T02").Columns("NOTRANS")))

    'Datasource dan membersource'
    Bsource1.DataSource = dset
    Bsource1.DataMember = "T01"
    Bsource2.DataSource = Bsource1
    Bsource2.DataMember = "X"

    'Memasukkan datatabel dari bindingsource ke dalam DVG'
    DataGridView1.DataSource = Bsource1
    DataGridView2.DataSource = Bsource2
    End Sub

    BalasHapus
  2. Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
    Dim z As New OleDb.OleDbCommand
    z = New OleDb.OleDbCommand("DELETE * FROM MASTERTRANSAKSI WHERE NOTRANS='" & DataGridView1.CurrentRow.Cells("NOTRANS").Value & "'", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()

    z = New OleDb.OleDbCommand("DELETE * FROM DETAILTRANSAKSI WHERE NOTRANS='" & DataGridView1.CurrentRow.Cells("NOTRANS").Value & "'", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()

    z.Dispose()

    yunhi ()
    End Sub

    Private Sub edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click
    If Latihan_40b_36109058.Visible = False Then
    Latihan_40b_36109058.Show()
    Else
    Latihan_40b_36109058.Activate()
    End If

    Latihan_40b_36109058.StatusStrip1.Text = DataGridView1.CurrentRow.Cells("NOTRANS").Value
    Latihan_40b_36109058.a058.Text = DataGridView1.CurrentRow.Cells("NOTRANS").Value
    Latihan_40b_36109058.b058.Text = DataGridView1.CurrentRow.Cells("JENISTRANSAKSI").Value

    Latihan_40b_36109058.dandy()
    Latihan_40b_36109058.TOTALJUMLAH()
    End Sub

    Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click
    If Latihan_40b_36109058.Visible = False Then
    Latihan_40b_36109058.Show()
    Else
    Latihan_40b_36109058.Activate()
    End If

    Latihan_40b_36109058.StatusStrip1.Text = "-"
    Latihan_40b_36109058.a058.Text = ""
    Latihan_40b_36109058.b058.Text = ""

    Latihan_40b_36109058.dandy()
    Latihan_40b_36109058.TOTALJUMLAH()

    End Sub
    End Class

    BalasHapus
  3. Public Class Latihan_40b_36109058
    Dim yunha As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb")
    Dim DATA As New DataTable
    Public Sub dandy()
    Dim X As New OleDb.OleDbDataAdapter
    X = New OleDb.OleDbDataAdapter("Select BARANG.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH from DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG WHERE NOTRANS= '" & a058.Text & "'", yunha)
    DATA.Rows.Clear()
    X.Fill(DATA)
    End Sub

    Private Sub Latihan_40b_36109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim dataPrimary(1) As DataColumn
    dataPrimary(0) = DATA.Columns("NOTRANS")
    DATA.PrimaryKey = dataPrimary

    DataGridView1.DataSource = DATA

    TOTALJUMLAH()
    End Sub
    Public Sub TOTALJUMLAH()
    Dim TOT As Double = 0
    For Each x As DataRow In DATA.Rows
    TOT = TOT + x("JUMLAH")
    Next
    c058.Text = TOT
    End Sub
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
    If DataGridView1.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
    'Cari nama barang'
    DataGridView1.CurrentRow.Cells("NAMABARANG").Value = ""
    DataGridView1.CurrentRow.Cells("UNIT").Value = 0
    DataGridView1.CurrentRow.Cells("HARGA").Value = 0
    DataGridView1.CurrentRow.Cells("JUMLAH").Value = 0

    Dim Pencari As New ByIskandar.CariKeDataBaseByIskandar
    Pencari.AturPencarianDataBase("BARANG", "KODEBARANG", DataGridView1.CurrentRow.Cells("KODEBARANG").Value, 1, yunha)
    'Menampilkan nama barang jika isi kolom kodebarang ditemukan oleh proses diatas'
    If Pencari.JumlanBaris > 0 Then
    DataGridView1.CurrentRow.Cells("NAMABARANG").Value = Pencari.DataTablenya.Rows(0).Item("NAMABARANG")
    Else
    DataGridView1.CurrentRow.Cells("KODEBARANG").Value = ""
    If latihan_383940058.ShowDialog = Windows.Forms.DialogResult.OK Then
    DataGridView1.CurrentRow.Cells("KODEBARANG").Value = latihan_383940058.DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    DataGridView1.CurrentRow.Cells("NAMABARANG").Value = latihan_383940058.DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    End If
    End If

    ElseIf DataGridView1.Columns(e.ColumnIndex).Name = "UNIT" Or DataGridView1.Columns(e.ColumnIndex).Name = "HARGA" Then
    'Hitung kolom jumlah'
    DataGridView1.CurrentRow.Cells("JUMLAH").Value = DataGridView1.CurrentRow.Cells("UNIT").Value * DataGridView1.CurrentRow.Cells("HARGA").Value
    End If

    TOTALJUMLAH()
    End Sub

    BalasHapus
  4. Private Sub simpan_tambah()
    If a058.Text.Length = 0 Then
    MsgBox("Maaf, Nomor transaksi harus diisi dulu")
    Exit Sub
    End If

    If b058.Text.Length = 0 Then
    MsgBox("Maaf, Jenis transaksi harus diisi dulu")
    Exit Sub
    End If

    If DATA.Rows.Count() = 0 Then
    MsgBox("Maaf, Proses tidak dapat dilanjutkan")
    Exit Sub
    End If

    If StatusStrip1.Text <> a058.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", a058.Text, 1, yunha)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Nomor transaksi sudah ada")
    Exit Sub
    End If
    End If

    Dim z As New OleDb.OleDbCommand
    z = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI(NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & a058.Text & "', #" & DateTimePicker1.Value.Month & "/" & DateTimePicker1.Value.Day & "/" & DateTimePicker1.Value.Year & "#, '" & b058.Text & "')", yunha)
    'Membuka koneksi'
    yunha.Open()
    'Eksekusi prose penyimpanan'
    z.ExecuteNonQuery()
    'Menutup koneksi'
    yunha.Close()

    'Memeriksa isi jumlah baris dalam object tabel'
    For Each X As DataRow In DATA.Rows
    'Mengatur perintah simpan'
    z = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & a058.Text & "', '" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()
    z.Dispose()
    Next

    StatusStrip1.Text = "-"
    a058.Text = ""
    b058.Text = ""

    DATA.Rows.Clear()

    TOTALJUMLAH()
    'Prosedur mengambil data dari Latihan40A017'
    Latihan_40a_36109058.yunhi()

    End Sub

    BalasHapus
  5. Private Sub simpan_edit()
    If a058.Text.Length = 0 Then
    MsgBox("Maaf, Nomor transaksi harus diisi dulu")
    Exit Sub
    End If

    If b058.Text.Length = 0 Then
    MsgBox("Maaf, Jenis transaksi harus diisi dulu")
    Exit Sub
    End If

    If DATA.Rows.Count() = 0 Then
    MsgBox("Maaf, Proses tidak dapat dilanjutkan")
    Exit Sub
    End If

    If StatusStrip1.Text <> a058.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", a058.Text, 1, yunha)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Nomor transaksi sudah ada")
    Exit Sub
    End If
    End If

    Dim z As New OleDb.OleDbCommand
    z = New OleDb.OleDbCommand("DELETE * FROM MASTERTRANSAKSI WHERE NOTRANS= '" & a058.Text & "'", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()

    z = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & a058.Text & "', #" & DateTimePicker1.Value.Month & "/" & DateTimePicker1.Value.Day & "/" & DateTimePicker1.Value.Year & "#, '" & b058.Text & "')", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()

    z = New OleDb.OleDbCommand("DELETE * FROM DETAILTRANSAKSI WHERE NOTRANS= '" & a058.Text & "'", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()

    'Memeriksa isi jumlah baris dalam object tabel'
    For Each XX As DataRow In DATA.Rows
    'Mengatur perintah simpan'
    z = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & a058.Text & "', '" & XX("KODEBARANG") & "', " & XX("UNIT") & ", " & XX("HARGA") & ")", yunha)
    yunha.Open()
    z.ExecuteNonQuery()
    yunha.Close()
    z.Dispose()
    Next

    StatusStrip1.Text = "-"
    a058.Text = ""
    b058.Text = ""

    DATA.Rows.Clear()

    TOTALJUMLAH()
    Latihan_40a_36109058.yunhi()
    End Sub

    Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click
    If StatusStrip1.Text = "-" Then
    simpan_tambah()
    Else
    simpan_edit()
    End If
    End Sub
    End Class

    BalasHapus
  6. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  7. http://kartika139.blogspot.com/2011/11/latihan-40.html

    BalasHapus
  8. http://kartika139.blogspot.com/2011/11/latihan-40b.html

    BalasHapus
  9. Muhammad Nur


    Public Class Latihan040A077

    Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb")
    Dim dt As New DataTable
    Dim dt1 As New DataTable
    Dim dset As New DataSet 'Deklarasi dataset'
    Dim Bsource1 As New BindingSource 'Deklarasi bindingsource'
    Dim Bsource2 As New BindingSource

    Public Sub ina()
    'Membersihkan detailtransaksi lalu mastertransaksi'
    dt1.Rows.Clear()
    dt.Rows.Clear()

    Dim B1 As New OleDb.OleDbDataAdapter
    B1 = New OleDb.OleDbDataAdapter("Select * From MASTERTRANSAKSI", n)
    B1.Fill(dt)

    B1 = New OleDb.OleDbDataAdapter("Select DETAILTRANSAKSI.NOTRANS, DETAILTRANSAKSI.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG", n)
    B1.Fill(dt1)

    B1.Dispose()

    End Sub

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

    ina()

    'Memasukkan datatabel dalam dataset'
    dset.Tables.Add(dt)
    dset.Tables.Add(dt1)

    'Mengganti nama datatabel dalam dataset'
    dt.TableName = "T01"
    dt1.TableName = "T02"

    'Menambahkan relasi dalam dataset'
    dset.Relations.Add(New DataRelation("X", dset.Tables("T01").Columns("NOTRANS"), dset.Tables("T02").Columns("NOTRANS")))

    'Datasource dan membersource'
    Bsource1.DataSource = dset
    Bsource1.DataMember = "T01"
    Bsource2.DataSource = Bsource1
    Bsource2.DataMember = "X"

    'Memasukkan datatabel dari bindingsource ke dalam DVG'
    DGV40A1.DataSource = Bsource1
    DGV40A2.DataSource = Bsource2
    End Sub

    Private Sub Hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapus.Click
    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("DELETE * FROM MASTERTRANSAKSI WHERE NOTRANS='" & DGV40A1.CurrentRow.Cells("NOTRANS").Value & "'", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()

    CM = New OleDb.OleDbCommand("DELETE * FROM DETAILTRANSAKSI WHERE NOTRANS='" & DGV40A1.CurrentRow.Cells("NOTRANS").Value & "'", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()

    CM.Dispose()

    ina()

    End Sub

    BalasHapus
  10. Private Sub Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Edit.Click
    If Latihan040B077.Visible = False Then
    Latihan040B077.Show()
    Else
    Latihan040B077.Activate()
    End If

    Latihan040B077.NO1.Text = DGV40A1.CurrentRow.Cells("NOTRANS").Value
    Latihan040B077.NOTRANS077.Text = DGV40A1.CurrentRow.Cells("NOTRANS").Value
    Latihan040B077.JT077.Text = DGV40A1.CurrentRow.Cells("JENISTRANSAKSI").Value

    Latihan040B077.NURLINA()
    Latihan040B077.TOTALJUMLAH()
    End Sub

    Private Sub Tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tambah.Click
    If Latihan040B077.Visible = False Then
    Latihan040B077.Show()
    Else
    Latihan040B077.Activate()
    End If

    Latihan040B077.NO1.Text = "-"
    Latihan040B077.NOTRANS077.Text = ""
    Latihan040B077.JT077.Text = ""

    Latihan040B077.NURLINA()
    Latihan040B077.TOTALJUMLAH()

    End Sub
    End Class

    BalasHapus
  11. http://krisnasaman-teddybear.blogspot.com/2011/12/latihan40a.html

    BalasHapus
  12. Muhammad Nur


    Public Class Latihan040B077

    Dim n As New OleDb.OleDbConnection("Provider=microsoft.ACE.OLEDB.12.0;data source=" & Application.StartupPath & "\DATAMAJEMUK.accdb")
    Dim DATA As New DataTable

    Public Sub NURLINA()
    Dim X As New OleDb.OleDbDataAdapter
    X = New OleDb.OleDbDataAdapter("Select BARANG.KODEBARANG, BARANG.NAMABARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, DETAILTRANSAKSI.UNIT*DETAILTRANSAKSI.HARGA AS JUMLAH from DETAILTRANSAKSI INNER JOIN BARANG ON DETAILTRANSAKSI.KODEBARANG=BARANG.KODEBARANG WHERE NOTRANS= '" & NOTRANS077.Text & "'", n)
    DATA.Rows.Clear()
    X.Fill(DATA)
    End Sub

    Private Sub Latihan040B077_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim dataPrimary(1) As DataColumn
    dataPrimary(0) = DATA.Columns("NOTRANS")
    DATA.PrimaryKey = dataPrimary

    DGV40B.DataSource = DATA

    TOTALJUMLAH()
    End Sub

    Public Sub TOTALJUMLAH()
    Dim TOT As Double = 0
    For Each x As DataRow In DATA.Rows
    TOT = TOT + x("JUMLAH")
    Next
    TOTAL077.Text = TOT

    End Sub

    Private Sub DGV40B_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV40B.CellEndEdit
    If DGV40B.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
    'Cari nama barang'
    DGV40B.CurrentRow.Cells("NAMABARANG").Value = ""
    DGV40B.CurrentRow.Cells("UNIT").Value = 0
    DGV40B.CurrentRow.Cells("HARGA").Value = 0
    DGV40B.CurrentRow.Cells("JUMLAH").Value = 0

    Dim Pencari As New ByIskandar.CariKeDataBaseByIskandar
    Pencari.AturPencarianDataBase("BARANG", "KODEBARANG", DGV40B.CurrentRow.Cells("KODEBARANG").Value, 1, n)
    'Menampilkan nama barang jika isi kolom kodebarang ditemukan oleh proses diatas'
    If Pencari.JumlanBaris > 0 Then
    DGV40B.CurrentRow.Cells("NAMABARANG").Value = Pencari.DataTablenya.Rows(0).Item("NAMABARANG")
    Else
    DGV40B.CurrentRow.Cells("KODEBARANG").Value = ""
    If Latihan0383940077.ShowDialog = Windows.Forms.DialogResult.OK Then
    DGV40B.CurrentRow.Cells("KODEBARANG").Value = Latihan0383940077.DGV38.CurrentRow.Cells("KODEBARANG").Value
    DGV40B.CurrentRow.Cells("NAMABARANG").Value = Latihan0383940077.DGV38.CurrentRow.Cells("NAMABARANG").Value
    End If
    End If

    ElseIf DGV40B.Columns(e.ColumnIndex).Name = "UNIT" Or DGV40B.Columns(e.ColumnIndex).Name = "HARGA" Then
    'Hitung kolom jumlah'
    DGV40B.CurrentRow.Cells("JUMLAH").Value = DGV40B.CurrentRow.Cells("UNIT").Value * DGV40B.CurrentRow.Cells("HARGA").Value
    End If

    TOTALJUMLAH()
    End Sub

    BalasHapus
  13. Private Sub Simpan_tambah()
    If NOTRANS077.Text.Length = 0 Then
    MsgBox("Maaf, Nomor transaksi harus diisi dulu")
    Exit Sub
    End If

    If JT077.Text.Length = 0 Then
    MsgBox("Maaf, Jenis transaksi harus diisi dulu")
    Exit Sub
    End If

    If DATA.Rows.Count() = 0 Then
    MsgBox("Maaf, Proses tidak dapat dilanjutkan")
    Exit Sub
    End If

    If NO1.Text <> NOTRANS077.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", NOTRANS077.Text, 1, n)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Nomor transaksi sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI(NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & NOTRANS077.Text & "', #" & DateTimePicker.Value.Month & "/" & DateTimePicker.Value.Day & "/" & DateTimePicker.Value.Year & "#, '" & JT077.Text & "')", n)
    'Membuka koneksi'
    n.Open()
    'Eksekusi prose penyimpanan'
    CM.ExecuteNonQuery()
    'Menutup koneksi'
    n.Close()

    'Memeriksa isi jumlah baris dalam object tabel'
    For Each X As DataRow In DATA.Rows
    'Mengatur perintah simpan'
    CM = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & NOTRANS077.Text & "', '" & X("KODEBARANG") & "'," & X("UNIT") & ", " & X("HARGA") & ")", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()
    CM.Dispose()
    Next

    NO1.Text = "-"
    NOTRANS077.Text = ""
    JT077.Text = ""

    DATA.Rows.Clear()

    TOTALJUMLAH()
    'Prosedur mengambil data dari Latihan40A017'
    Latihan040A077.ina()
    End Sub

    BalasHapus
  14. http://krisnasaman-teddybear.blogspot.com/2011/12/latihan40b.html

    BalasHapus
  15. Private Sub Simpan_edit()
    If NOTRANS077.Text.Length = 0 Then
    MsgBox("Maaf, Nomor transaksi harus diisi dulu")
    Exit Sub
    End If

    If JT077.Text.Length = 0 Then
    MsgBox("Maaf, Jenis transaksi harus diisi dulu")
    Exit Sub
    End If

    If DATA.Rows.Count() = 0 Then
    MsgBox("Maaf, Proses tidak dapat dilanjutkan")
    Exit Sub
    End If

    If NO1.Text <> NOTRANS077.Text Then
    Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
    pencari.AturPencarianDataBase("MASTERTRANSAKSI", "NOTRANS", NOTRANS077.Text, 1, n)
    If pencari.JumlanBaris > 0 Then
    MsgBox("Nomor transaksi sudah ada")
    Exit Sub
    End If
    End If

    Dim CM As New OleDb.OleDbCommand
    CM = New OleDb.OleDbCommand("DELETE * FROM MASTERTRANSAKSI WHERE NOTRANS= '" & NOTRANS077.Text & "'", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()

    CM = New OleDb.OleDbCommand("INSERT INTO MASTERTRANSAKSI (NOTRANS, TANGGALTRANSAKSI, JENISTRANSAKSI) VALUES ('" & NOTRANS077.Text & "', #" & DateTimePicker.Value.Month & "/" & DateTimePicker.Value.Day & "/" & DateTimePicker.Value.Year & "#, '" & JT077.Text & "')", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()

    CM = New OleDb.OleDbCommand("DELETE * FROM DETAILTRANSAKSI WHERE NOTRANS= '" & NOTRANS077.Text & "'", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()

    'Memeriksa isi jumlah baris dalam object tabel'
    For Each XX As DataRow In DATA.Rows
    'Mengatur perintah simpan'
    CM = New OleDb.OleDbCommand("INSERT INTO DETAILTRANSAKSI (NOTRANS, KODEBARANG, UNIT, HARGA) VALUES ('" & NOTRANS077.Text & "', '" & XX("KODEBARANG") & "', " & XX("UNIT") & ", " & XX("HARGA") & ")", n)
    n.Open()
    CM.ExecuteNonQuery()
    n.Close()
    CM.Dispose()
    Next

    NO1.Text = "-"
    NOTRANS077.Text = ""
    JT077.Text = ""

    DATA.Rows.Clear()

    TOTALJUMLAH()
    Latihan040A077.ina()
    End Sub
    Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
    If NO1.Text = "-" Then
    Simpan_tambah()
    Else
    Simpan_edit()
    End If
    End Sub
    End Class

    BalasHapus
  16. http://winnymatarru.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  17. http://winnymatarru.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  18. http://valenndut.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  19. http://valenndut.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  20. http://elayuck.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  21. http://elayuck.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  22. http://urimoktaviana.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  23. http://urimoktaviana.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  24. http://pute991.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  25. http://pute991.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  26. http://sarshe-sarshe.blogspot.com/2011/12/latihan-040a36109060.html

    BalasHapus
  27. http://sarshe-sarshe.blogspot.com/2011/12/latihan-040b36109060.html

    BalasHapus
  28. http://derielrangers.blogspot.com/2011/12/form-40a.html

    BalasHapus
  29. http://derielrangers.blogspot.com/2011/12/form-40b.html

    BalasHapus
  30. (36109057)
    fatma sari
    Latihan 40a
    http://fatmacmr.blogspot.com/2011/12/latihan-40a.html

    latihan 40b
    http://fatmacmr.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  31. http://meylin-meylanierlangga.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  32. http://meylin-meylanierlangga.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  33. http://parubakcatherine.blogspot.com/2011/12/latihan-40a.html

    BalasHapus
  34. http://parubakcatherine.blogspot.com/2011/12/latihan-40b.html

    BalasHapus
  35. 40a
    http://hantualis.blogspot.com/2011/12/form-40a-apkom-4.html

    dan

    40b
    http://hantualis.blogspot.com/2011/12/form-40b-apkom-4.html

    BalasHapus
  36. http://gunawanmustari.blogspot.com/2011/12/latihan-40.html

    BalasHapus