Jumat, 18 November 2011

Latihan 39 APKOM 4 D3A

11 komentar:

  1. Amelia Indahsari
    361 09 023

    http://heiamee.blogspot.com/2011/12/form-39.html

    BalasHapus
  2. RUSNANINGSI R
    36109010

    http://rusnaningsi.blogspot.com/2011/12/latihan-39-apkom-4.html

    BalasHapus
  3. Ismi Febriani A
    3a D3
    361 09 005

    http://ismifebriani.blogspot.com/2011/12/apkom-4-latihan-39.html

    BalasHapus
  4. ridhayanti saleh
    36109015

    http://ridhacayoo-ridhaahmad.blogspot.com/2011/12/tugas-39.html

    BalasHapus
  5. Public Class Form39_36109003
    Dim arman As New ByIskandar.CariKeDataBaseByIskandar
    Dim anto As New DataTable
    Dim soe As New OleDb.OleDbCommand
    Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DataMajemuk.accdb'")

    Private Sub Form39_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim r As New OleDb.OleDbDataAdapter
    r = New OleDb.OleDbDataAdapter("select barang.KODEBARANG, barang.NAMABARANG, detailtransaksi.UNIT, detailtransaksi.HARGA, detailtransaksi.unit*harga as JUMLAH from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang where notrans ='" & nt_36109003.Text & "'", ndut)
    anto.Rows.Clear()
    r.Fill(anto)
    r.Dispose()

    dgv_36109003.DataSource = anto

    Dim sudar(1) As DataColumn
    sudar(0) = anto.Columns("kodebarang")
    anto.PrimaryKey = sudar
    End Sub

    Private Sub dgv_36109003_Cellendedit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv_36109003.CellEndEdit
    If dgv_36109003.Columns(e.ColumnIndex).Name = "KODEBARANG" Then

    dgv_36109003.CurrentRow.Cells("NAMABARANG").Value = ""
    dgv_36109003.CurrentRow.Cells("UNIT").Value = 0
    dgv_36109003.CurrentRow.Cells("HARGA").Value = 0
    dgv_36109003.CurrentRow.Cells("JUMLAH").Value = 0

    arman.AturPencarianDataBase("barang", "kodebarang", dgv_36109003.CurrentRow.Cells("KODEBARANG").Value, 1, ndut)
    If arman.JumlanBaris > 0 Then
    dgv_36109003.CurrentRow.Cells("NAMABARANG").Value = arman.DataTablenya.Rows(0).Item("NAMABARANG")
    Else
    dgv_36109003.CurrentRow.Cells("NAMABARANG").Value = ""
    If form38_39_40_36109003.ShowDialog = Windows.Forms.DialogResult.OK Then
    dgv_36109003.CurrentRow.Cells("KODEBARANG").Value = form38_39_40_36109003.dgv_36109003.CurrentRow.Cells("KODEBARANG").Value
    dgv_36109003.CurrentRow.Cells("NAMABARANG").Value = form38_39_40_36109003.dgv_36109003.CurrentRow.Cells("NAMABARANG").Value
    End If
    End If

    ElseIf dgv_36109003.Columns(e.ColumnIndex).Name = "UNIT" Or dgv_36109003.Columns(e.ColumnIndex).Name = "HARGA" Then
    dgv_36109003.CurrentRow.Cells("JUMLAH").Value = dgv_36109003.CurrentRow.Cells("UNIT").Value * dgv_36109003.CurrentRow.Cells("HARGA").Value
    anra()
    End If
    End Sub

    BalasHapus
  6. Private Sub anra()
    Dim anra1 As Integer = 0
    For Each anra2 As DataRow In anto.Rows
    anra1 += anra2("JUMLAH")
    Next
    total_36109003.Text = anra1
    End Sub

    Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click
    If nt_36109003.Text.Length = 0 Then
    MsgBox("nomor transaksi harus terisi")
    ElseIf jt_36109003.Text.Length = 0 Then
    MsgBox("Isi rong Jenis Transaksi na..")
    ElseIf anto.Rows.Count = 0 Then
    MsgBox("data table tidak boleh kosong")
    Exit Sub
    End If

    arman.AturPencarianDataBase("mastertransaksi", "notrans", nt_36109003.Text, 1, ndut)
    If arman.JumlanBaris > 0 Then
    MsgBox("nomor transaksi telah ada")
    Exit Sub
    End If

    soe = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & nt_36109003.Text & "',#" & tgl_36109003.Value.Month & "/" & tgl_36109003.Value.Day & "/" & tgl_36109003.Value.Year & "#,'" & jt_36109003.Text & "')", ndut)
    ndut.Open()
    soe.ExecuteNonQuery()
    ndut.Close()

    For Each x As DataRow In anto.Rows
    soe = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & nt_36109003.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", ndut)
    ndut.Open()
    soe.ExecuteNonQuery()
    ndut.Close()
    Next
    soe.Dispose()

    nt_36109003.Text = ""
    jt_36109003.Text = ""
    total_36109003.Text = ""

    anto.Rows.Clear()
    anra()
    End Sub
    End Class

    BalasHapus
  7. http://uphy-iftah.blogspot.com/search/label/apkom4

    BalasHapus
  8. iwan
    361 09 026
    3A-D3

    latihan 39 apkom4


    http://iwandinejad.blogspot.com/#!/2012/01/latihan-39-apkom-4.html

    BalasHapus
  9. Muhammad Harun Hamid
    361 09 006

    http://h4r0en.blogspot.com/2012/01/script-visual-basic-apkomp-4-pnup_2604.html

    BalasHapus
  10. http://aminurul.blogspot.com/2012/01/apkom4-form-35-40b.html

    BalasHapus
  11. NURFAHNY
    361 09 013

    http://fanykecil.blogspot.com/2012/01/latihan39.html

    BalasHapus