Latihan 60
Public Class Latihan060_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ismi As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim x As New ByIskandar.MengaturDataBaseCrystalReport
ismi = x.AturDatabase(New Latihan_059_46109023, Application.StartupPath, "data report.accdb")
Latihan_053_46109023.honda.SelectionFormula = "{detailtransaksi.notrans} = '" & NT46109023.Text & "'"
Latihan_053_46109023.honda.ReportSource = ismi
ismi.SetParameterValue("Dwitya", NK46109023.Text)
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Else
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Selasa, 17 Januari 2012
Latihan 58
Public Class Latihan058_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cimi As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim x As New ByIskandar.MengaturDataBaseCrystalReport
cimi = x.AturDatabase(New Latihan_050_46109023, Application.StartupPath, "data report.accdb")
Latihan_053_46109023.honda.ReportSource = cimi
Latihan_053_46109023.honda.SelectionFormula = "{MASTERTRANSAKSI.TANGGALTRANSAKSI} >= #" & DT46109023.Value.Month & "/" & DT46109023.Value.Day & "/" & DT46109023.Value.Year & "# and {MASTERTRANSAKSI.TANGGALTRANSAKSI} <= #" & DT46109023.Value.Month & "/" & DT46109023.Value.Day & "/" & DT46109023.Value.Year & "#"
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Else
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Public Class Latihan058_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cimi As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim x As New ByIskandar.MengaturDataBaseCrystalReport
cimi = x.AturDatabase(New Latihan_050_46109023, Application.StartupPath, "data report.accdb")
Latihan_053_46109023.honda.ReportSource = cimi
Latihan_053_46109023.honda.SelectionFormula = "{MASTERTRANSAKSI.TANGGALTRANSAKSI} >= #" & DT46109023.Value.Month & "/" & DT46109023.Value.Day & "/" & DT46109023.Value.Year & "# and {MASTERTRANSAKSI.TANGGALTRANSAKSI} <= #" & DT46109023.Value.Month & "/" & DT46109023.Value.Day & "/" & DT46109023.Value.Year & "#"
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Else
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Latihan 57
Public Class Latihan057_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.SelectionFormula = "(detailtransaksi.harga) <=" & cimi46109023.Text & ""
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Public Class Latihan057_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.SelectionFormula = "(detailtransaksi.harga) <=" & cimi46109023.Text & ""
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Latihan 56
Public Class Latihan056_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.SelectionFormula = "{barang.kodebarang}='" & cimi46109023.Text & "'"
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Public Class Latihan056_46109023
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.SelectionFormula = "{barang.kodebarang}='" & cimi46109023.Text & "'"
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Latihan 55
Public Class Latihan_055_46109023
Private Sub p46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles p46109023.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Dim x As New ByIskandar.MengaturDataBaseCrystalReport
laporan = x.AturDatabase(New Latihan_045_46109023, Application.StartupPath, "data report.accdb")
Latihan_053_46109001.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Public Class Latihan_055_46109023
Private Sub p46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles p46109023.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Dim x As New ByIskandar.MengaturDataBaseCrystalReport
laporan = x.AturDatabase(New Latihan_045_46109023, Application.StartupPath, "data report.accdb")
Latihan_053_46109001.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Latihan 53
Crystal Report Viewer = HONDA
Latihan 54
Public Class Latihan_054_46109023
Private Sub p46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles p46109023.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Crystal Report Viewer = HONDA
Latihan 54
Public Class Latihan_054_46109023
Private Sub p46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles p46109023.Click
Dim laporan As New CrystalDecisions.CrystalReports.Engine.ReportDocument
laporan = New Latihan_045_46109023
Latihan_053_46109023.honda.ReportSource = laporan
If Latihan_053_46109023.Visible = False Then
Latihan_053_46109023.Show()
Latihan_053_46109023.Activate()
End If
End Sub
End Class
Latihan 48
NO
KODEBARANG
NAMABARANG
PERSEDIAANAWAL
HARGAJUAL
Jumlah
dan NOmor, Caranya :
Klik kanan pada Formula Fields,pilih NEW,akan muncul kotak dialog dan isi kolom NAME dgn kata NOMOR/NO, kemudian pilih USE EDITOR, Akan muncul kotak dialog FORMULA WORKSHOP-Formula EDITOR, kilk Barang kemudian klik 2x pada Pers.awal dan pers.awal dan akan muncul {BARANG.PERSEDIAANAWAL}/{BARANG.PERSEDIAAN AWAL} dan tambahkan tanda BINTANG(/) diantaranya, kemudian pilih Save and Close pada bagian kiri kotak dialog.
Setelah itu klik kanan pada RunningTotal, kemudian NEW,akan muncul Create Running Total Field, Running Total name isi dgn NOMOR/NO,kemudian field to summary @NO.lalu OK.
NO
KODEBARANG
NAMABARANG
PERSEDIAANAWAL
HARGAJUAL
Jumlah
dan NOmor, Caranya :
Klik kanan pada Formula Fields,pilih NEW,akan muncul kotak dialog dan isi kolom NAME dgn kata NOMOR/NO, kemudian pilih USE EDITOR, Akan muncul kotak dialog FORMULA WORKSHOP-Formula EDITOR, kilk Barang kemudian klik 2x pada Pers.awal dan pers.awal dan akan muncul {BARANG.PERSEDIAANAWAL}/{BARANG.PERSEDIAAN AWAL} dan tambahkan tanda BINTANG(/) diantaranya, kemudian pilih Save and Close pada bagian kiri kotak dialog.
Setelah itu klik kanan pada RunningTotal, kemudian NEW,akan muncul Create Running Total Field, Running Total name isi dgn NOMOR/NO,kemudian field to summary @NO.lalu OK.
Latihan 47
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pers.Awal + SUM Pers.Awal
Harga Jual
Jumlah, Caranya : Klik kanan pada Formula Fields,pilih NEW,akan muncul kotak dialog dan isi kolom NAME dgn kata JUMLAH, kemudian pilih USE EDITOR, Akan muncul kotak dialog FORMULA WORKSHOP-Formula EDITOR, kilk Barang kemudian klik 2x pada Pers.awal dan harga jual dan akan muncul {BARANG.PERSEDIAANAWAL}*{BARANG.HARGAJUAL} dan tambahkan tanda BINTANG(*) diantaranya, kemudian pilih Save and Close pada bagian kiri kotak dialog.
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pers.Awal + SUM Pers.Awal
Harga Jual
Jumlah, Caranya : Klik kanan pada Formula Fields,pilih NEW,akan muncul kotak dialog dan isi kolom NAME dgn kata JUMLAH, kemudian pilih USE EDITOR, Akan muncul kotak dialog FORMULA WORKSHOP-Formula EDITOR, kilk Barang kemudian klik 2x pada Pers.awal dan harga jual dan akan muncul {BARANG.PERSEDIAANAWAL}*{BARANG.HARGAJUAL} dan tambahkan tanda BINTANG(*) diantaranya, kemudian pilih Save and Close pada bagian kiri kotak dialog.
Latihan 46
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pesediaan Awal
Harga Jual
Dan Jumlah Pers.Awal dan Harga jual
**SUM Pers.Awal (Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih SUM, setelah itu pilih OK)
**AVG Harga Jual(Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih Average, setelah itu pilih OK)
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pesediaan Awal
Harga Jual
Dan Jumlah Pers.Awal dan Harga jual
**SUM Pers.Awal (Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih SUM, setelah itu pilih OK)
**AVG Harga Jual(Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih Average, setelah itu pilih OK)
Latihan 46
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pesediaan Awal
Harga Jual
Dan Jumlah Pers.Awal dan Harga jual
**SUM Pers.Awal (Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih SUM, setelah itu pilih OK)
**AVG Harga Jual(Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih Average, setelah itu pilih OK)
Menampilkan Daftar Barang
Kode Barang
Nama Barang
Pesediaan Awal
Harga Jual
Dan Jumlah Pers.Awal dan Harga jual
**SUM Pers.Awal (Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih SUM, setelah itu pilih OK)
**AVG Harga Jual(Klik kanan pada Pers.Awal pd Section 3,kemudian pilih insert - summary, pada bagian calculate this summary pilih Average, setelah itu pilih OK)
Senin, 16 Januari 2012
Kamis, 05 Januari 2012
Public Class Form040A_46109023
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Dim cim1 As New DataTable
Dim cim2 As New DataTable
Dim yuni As New DataSet
Dim cimi1 As New BindingSource
Dim cimi2 As New BindingSource
Public Sub sri1()
Dim bunga As New OleDb.OleDbDataAdapter
cim2.Rows.Clear()
cim1.Rows.Clear()
bunga = New OleDb.OleDbDataAdapter("select * from mastertransaksi", conect)
bunga.Fill(cim1)
bunga = New OleDb.OleDbDataAdapter("select detailtransaksi.notrans, barang.kodebarang, barang.namabarang, detailtransaksi.unit, detailtransaksi.harga, detailtransaksi.unit*harga as jumlah from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang", conect)
bunga.Fill(cim2)
End Sub
Private Sub Latihan40A_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sri1()
yuni.Tables.Add(cim1)
yuni.Tables.Add(cim2)
cim1.TableName = "amri"
cim2.TableName = "amri2"
yuni.Relations.Add(New DataRelation("bunga", yuni.Tables("amri").Columns("notrans"), yuni.Tables("amri2").Columns("notrans")))
cimi1.DataSource = yuni
cimi1.DataMember = "ical"
cimi2.DataSource = cimi1
cimi2.DataMember = "bunga"
Dim dc(1) As DataColumn
dc(0) = cim1.Columns("notrans")
cim1.PrimaryKey = dc
DATA1_46109023.DataSource = cimi1
DATA2_46109023.DataSource = cimi2
End Sub
Private Sub H46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles H46109023.Click
Dim cimcim As New OleDb.OleDbCommand
cimcim = New OleDb.OleDbCommand("delete * from mastertransaksi where notrans = '" & DATA1_46109023.CurrentRow.Cells("notrans").Value & "'", conect)
conect.Open()
cimcim.ExecuteNonQuery()
conect.Close()
cimcim = New OleDb.OleDbCommand("delete * from detailtransaksi where notrans = '" & DATA1_46109023.CurrentRow.Cells("notrans").Value & "'", conect)
conect.Open()
cimcim.ExecuteNonQuery()
conect.Close()
cimcim.Dispose()
sri1()
End Sub
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If Form40B_46109023.Visible = False Then
Form40B_46109023.Show()
Else
Form40B_46109023.Activate()
End If
Form40B_46109023.NT46109023.Text = ""
Form40B_46109023.JT46109023.Text = ""
Form40B_46109023.TS46109001.Text = "-"
Form40B_46109023.saadah2()
Form40B_46109023.saadah3()
End Sub
Private Sub E46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109023.Click
If Form40B_46109023.Visible = False Then
Form40B_46109023.Show()
Else
Form40B_46109023.Activate()
End If
Form40B_46109023.NT46109023.Text = DATA1_46109023.CurrentRow.Cells("notrans").Value
Form40B_46109023.T46109023.Value = DATA1_46109023.CurrentRow.Cells("tanggaltransaksi").Value
Form40B_46109023.JT46109023.Text = DATA1_46109023.CurrentRow.Cells("jenistransaksi").Value
Form40B_46109023.TS46109001.Text = DATA1_46109023.CurrentRow.Cells("notrans").Value
Form40B_46109023.sri2()
Form40B_46109023.sri3()
End Sub
Private Sub DATA1_46109023_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA1_46109023.CellContentClick
End Sub
End Class
Public Class Form40B_46109023
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Dim ismi As New DataTable
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim cimi As New OleDb.OleDbCommand
Public Sub sri2()
Dim bunga As New OleDb.OleDbDataAdapter
bunga = New OleDb.OleDbDataAdapter("select barang.KODEBARANG, barang.NAMABARANG, detailtransaksi.UNIT, detailtransaksi.HARGA, detailtransaksi.unit * detailtransaksi.harga as JUMLAH from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang where notrans = '" & NT46109023.Text & "'", conect)
ismi.Rows.Clear()
bunga.Fill(ismi)
End Sub
Public Sub sri3()
Dim total As Integer = 0
For Each x As DataRow In ismi.Rows
total += x("Jumlah")
Next
TOT46109023.Text = total
End Sub
Private Sub sri4()
If NT46109023.Text.Length = 0 Then
MsgBox("Isi rong itu Notransnya..")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("Isi rong itu Jenis Transaksinya..")
Exit Sub
End If
If ismi.Rows.Count = 0 Then
MsgBox("Isi rong itu datatable k..")
Exit Sub
End If
End Sub
Private Sub tambah()
sri4()
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu..")
Exit Sub
End If
cimi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#, '" & JT46109023.Text & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
cimi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "') ", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
Next
cimi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
TS46109001.Text = "-"
ismi.Rows.Clear()
Form040A_46109023.sri1()
End Sub
Public Sub edit()
sri4()
If NT46109023.Text <> TS46109001.Text Then
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("Adami Notrans seperti itu,,mohon ganti..")
Exit Sub
End If
End If
cimi = New OleDb.OleDbCommand("delete * from mastertransaksi where notrans = '" & TS46109001.Text & "'", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
cimi = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#, '" & JT46109023.Text & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
cimi = New OleDb.OleDbCommand("delete * from detailtransaksi where notrans = '" & TS46109001.Text & "'", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
cimi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
Next
cimi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
TS46109001.Text = "-"
ismi.Rows.Clear()
Form040A_46109023.sri1()
End Sub
Private Sub Form040A_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sri2()
Dim dc(1) As DataColumn
dc(0) = ismi.Columns("kodebarang")
ismi.PrimaryKey = dc
ismi.Columns("unit").DefaultValue = 0
ismi.Columns("harga").DefaultValue = 0
ismi.Columns("jumlah").DefaultValue = 0
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109023_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellEndEdit
If DATA46109023.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
DATA46109023.CurrentRow.Cells("UNIT").Value = 0
DATA46109023.CurrentRow.Cells("HARGA").Value = 0
DATA46109023.CurrentRow.Cells("JUMLAH").Value = 0
sri.AturPencarianDataBase("barang", "kodebarang", DATA46109023.CurrentRow.Cells("KODEBARANG").Value, 1, conect)
If sri.JumlanBaris > 0 Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
DATA46109023.CurrentRow.Cells("KODEBARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("KODEBARANG").Value
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("NAMABARANG").Value
End If
End If
ElseIf DATA46109023.Columns(e.ColumnIndex).Name = "UNIT" Or DATA46109023.Columns(e.ColumnIndex).Name = "HARGA" Then
DATA46109023.CurrentRow.Cells("JUMLAH").Value = DATA46109023.CurrentRow.Cells("UNIT").Value * DATA46109023.CurrentRow.Cells("HARGA").Value
sri3()
End If
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If S46109023.Text = "-" Then
tambah()
Else
edit()
End If
End Sub
Private Sub DATA46109023_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DATA46109023.DataError
MsgBox("Terjadi sedikit kesalahan...")
End Sub
End Class
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=ngekngek")
Dim cim1 As New DataTable
Dim cim2 As New DataTable
Dim yuni As New DataSet
Dim cimi1 As New BindingSource
Dim cimi2 As New BindingSource
Public Sub sri1()
Dim bunga As New OleDb.OleDbDataAdapter
cim2.Rows.Clear()
cim1.Rows.Clear()
bunga = New OleDb.OleDbDataAdapter("select * from mastertransaksi", conect)
bunga.Fill(cim1)
bunga = New OleDb.OleDbDataAdapter("select detailtransaksi.notrans, barang.kodebarang, barang.namabarang, detailtransaksi.unit, detailtransaksi.harga, detailtransaksi.unit*harga as jumlah from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang", conect)
bunga.Fill(cim2)
End Sub
Private Sub Latihan40A_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sri1()
yuni.Tables.Add(cim1)
yuni.Tables.Add(cim2)
cim1.TableName = "amri"
cim2.TableName = "amri2"
yuni.Relations.Add(New DataRelation("bunga", yuni.Tables("amri").Columns("notrans"), yuni.Tables("amri2").Columns("notrans")))
cimi1.DataSource = yuni
cimi1.DataMember = "ical"
cimi2.DataSource = cimi1
cimi2.DataMember = "bunga"
Dim dc(1) As DataColumn
dc(0) = cim1.Columns("notrans")
cim1.PrimaryKey = dc
DATA1_46109023.DataSource = cimi1
DATA2_46109023.DataSource = cimi2
End Sub
Private Sub H46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles H46109023.Click
Dim cimcim As New OleDb.OleDbCommand
cimcim = New OleDb.OleDbCommand("delete * from mastertransaksi where notrans = '" & DATA1_46109023.CurrentRow.Cells("notrans").Value & "'", conect)
conect.Open()
cimcim.ExecuteNonQuery()
conect.Close()
cimcim = New OleDb.OleDbCommand("delete * from detailtransaksi where notrans = '" & DATA1_46109023.CurrentRow.Cells("notrans").Value & "'", conect)
conect.Open()
cimcim.ExecuteNonQuery()
conect.Close()
cimcim.Dispose()
sri1()
End Sub
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If Form40B_46109023.Visible = False Then
Form40B_46109023.Show()
Else
Form40B_46109023.Activate()
End If
Form40B_46109023.NT46109023.Text = ""
Form40B_46109023.JT46109023.Text = ""
Form40B_46109023.TS46109001.Text = "-"
Form40B_46109023.saadah2()
Form40B_46109023.saadah3()
End Sub
Private Sub E46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109023.Click
If Form40B_46109023.Visible = False Then
Form40B_46109023.Show()
Else
Form40B_46109023.Activate()
End If
Form40B_46109023.NT46109023.Text = DATA1_46109023.CurrentRow.Cells("notrans").Value
Form40B_46109023.T46109023.Value = DATA1_46109023.CurrentRow.Cells("tanggaltransaksi").Value
Form40B_46109023.JT46109023.Text = DATA1_46109023.CurrentRow.Cells("jenistransaksi").Value
Form40B_46109023.TS46109001.Text = DATA1_46109023.CurrentRow.Cells("notrans").Value
Form40B_46109023.sri2()
Form40B_46109023.sri3()
End Sub
Private Sub DATA1_46109023_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA1_46109023.CellContentClick
End Sub
End Class
Public Class Form40B_46109023
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Dim ismi As New DataTable
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim cimi As New OleDb.OleDbCommand
Public Sub sri2()
Dim bunga As New OleDb.OleDbDataAdapter
bunga = New OleDb.OleDbDataAdapter("select barang.KODEBARANG, barang.NAMABARANG, detailtransaksi.UNIT, detailtransaksi.HARGA, detailtransaksi.unit * detailtransaksi.harga as JUMLAH from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang where notrans = '" & NT46109023.Text & "'", conect)
ismi.Rows.Clear()
bunga.Fill(ismi)
End Sub
Public Sub sri3()
Dim total As Integer = 0
For Each x As DataRow In ismi.Rows
total += x("Jumlah")
Next
TOT46109023.Text = total
End Sub
Private Sub sri4()
If NT46109023.Text.Length = 0 Then
MsgBox("Isi rong itu Notransnya..")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("Isi rong itu Jenis Transaksinya..")
Exit Sub
End If
If ismi.Rows.Count = 0 Then
MsgBox("Isi rong itu datatable k..")
Exit Sub
End If
End Sub
Private Sub tambah()
sri4()
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("Adami notrans seperti itu..")
Exit Sub
End If
cimi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#, '" & JT46109023.Text & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
cimi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "') ", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
Next
cimi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
TS46109001.Text = "-"
ismi.Rows.Clear()
Form040A_46109023.sri1()
End Sub
Public Sub edit()
sri4()
If NT46109023.Text <> TS46109001.Text Then
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("Adami Notrans seperti itu,,mohon ganti..")
Exit Sub
End If
End If
cimi = New OleDb.OleDbCommand("delete * from mastertransaksi where notrans = '" & TS46109001.Text & "'", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
cimi = New OleDb.OleDbCommand("insert into mastertransaksi(notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#, '" & JT46109023.Text & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
cimi = New OleDb.OleDbCommand("delete * from detailtransaksi where notrans = '" & TS46109001.Text & "'", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
cimi = New OleDb.OleDbCommand("insert into detailtransaksi(notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "')", conect)
conect.Open()
cimi.ExecuteNonQuery()
conect.Close()
Next
cimi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
TS46109001.Text = "-"
ismi.Rows.Clear()
Form040A_46109023.sri1()
End Sub
Private Sub Form040A_46109023_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sri2()
Dim dc(1) As DataColumn
dc(0) = ismi.Columns("kodebarang")
ismi.PrimaryKey = dc
ismi.Columns("unit").DefaultValue = 0
ismi.Columns("harga").DefaultValue = 0
ismi.Columns("jumlah").DefaultValue = 0
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109023_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellEndEdit
If DATA46109023.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
DATA46109023.CurrentRow.Cells("UNIT").Value = 0
DATA46109023.CurrentRow.Cells("HARGA").Value = 0
DATA46109023.CurrentRow.Cells("JUMLAH").Value = 0
sri.AturPencarianDataBase("barang", "kodebarang", DATA46109023.CurrentRow.Cells("KODEBARANG").Value, 1, conect)
If sri.JumlanBaris > 0 Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
DATA46109023.CurrentRow.Cells("KODEBARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("KODEBARANG").Value
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("NAMABARANG").Value
End If
End If
ElseIf DATA46109023.Columns(e.ColumnIndex).Name = "UNIT" Or DATA46109023.Columns(e.ColumnIndex).Name = "HARGA" Then
DATA46109023.CurrentRow.Cells("JUMLAH").Value = DATA46109023.CurrentRow.Cells("UNIT").Value * DATA46109023.CurrentRow.Cells("HARGA").Value
sri3()
End If
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If S46109023.Text = "-" Then
tambah()
Else
edit()
End If
End Sub
Private Sub DATA46109023_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DATA46109023.DataError
MsgBox("Terjadi sedikit kesalahan...")
End Sub
End Class
Public Class Form383940_46109023
Dim ismi As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form3839400_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cimi As New OleDb.OleDbDataAdapter
cimi = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", conect)
ismi.Rows.Clear()
cimi.Fill(ismi)
cimi.Dispose()
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109001_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellContentClick
End Sub
End Class
Dim ismi As New DataTable
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form3839400_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cimi As New OleDb.OleDbDataAdapter
cimi = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", conect)
ismi.Rows.Clear()
cimi.Fill(ismi)
cimi.Dispose()
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109001_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellContentClick
End Sub
End Class
Public Class Form39
Dim ismi As New DataTable
Dim sri As New OleDb.OleDbCommand
Dim cimi As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form39_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 = '" & NT46109023.Text & "'", conect)
ismisriwahyuni.Fill(ismi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = ismi.Columns("kodebarang")
ismi.PrimaryKey = dpc
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109023_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellEndEdit
If DATA46109023.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
DATA46109023.CurrentRow.Cells("UNIT").Value = 0
DATA46109023.CurrentRow.Cells("HARGA").Value = 0
DATA46109023.CurrentRow.Cells("JUMLAH").Value = 0
cimi.AturPencarianDataBase("barang", "kodebarang", DATA46109023.CurrentRow.Cells("KODEBARANG").Value, 1, conect)
If cimi.JumlanBaris > 0 Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = cimi.DataTablenya.Rows(0).Item("NAMABARANG")
Else
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
DATA46109023.CurrentRow.Cells("KODEBARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("KODEBARANG").Value
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("NAMABARANG").Value
End If
End If
ElseIf DATA46109023.Columns(e.ColumnIndex).Name = "UNIT" Or DATA46109023.Columns(e.ColumnIndex).Name = "HARGA" Then
DATA46109023.CurrentRow.Cells("JUMLAH").Value = DATA46109023.CurrentRow.Cells("UNIT").Value * DATA46109023.CurrentRow.Cells("HARGA").Value
cim()
End If
End Sub
Private Sub cim()
Dim cim1 As Integer = 0
For Each cim2 As DataRow In ismi.Rows
cim1 += cim2("JUMLAH")
Next
TOT46109023.Text = cim1
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksinya")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("Isi Jenis Transaksinya")
Exit Sub
End If
If ismi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
cimi.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If cimi.JumlanBaris > 0 Then
MsgBox("notrans sudah ada")
Exit Sub
End If
sri = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
sri.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
sri = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "')", conect)
conect.Open()
sri.ExecuteNonQuery()
conect.Close()
Next
sri.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
ismi.Rows.Clear()
cim()
End Sub
End Class
Dim ismi As New DataTable
Dim sri As New OleDb.OleDbCommand
Dim cimi As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form39_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 = '" & NT46109023.Text & "'", conect)
ismisriwahyuni.Fill(ismi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = ismi.Columns("kodebarang")
ismi.PrimaryKey = dpc
DATA46109023.DataSource = ismi
End Sub
Private Sub DATA46109023_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DATA46109023.CellEndEdit
If DATA46109023.Columns(e.ColumnIndex).Name = "KODEBARANG" Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
DATA46109023.CurrentRow.Cells("UNIT").Value = 0
DATA46109023.CurrentRow.Cells("HARGA").Value = 0
DATA46109023.CurrentRow.Cells("JUMLAH").Value = 0
cimi.AturPencarianDataBase("barang", "kodebarang", DATA46109023.CurrentRow.Cells("KODEBARANG").Value, 1, conect)
If cimi.JumlanBaris > 0 Then
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = cimi.DataTablenya.Rows(0).Item("NAMABARANG")
Else
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = ""
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
DATA46109023.CurrentRow.Cells("KODEBARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("KODEBARANG").Value
DATA46109023.CurrentRow.Cells("NAMABARANG").Value = Form383940_46109023.DATA46109023.CurrentRow.Cells("NAMABARANG").Value
End If
End If
ElseIf DATA46109023.Columns(e.ColumnIndex).Name = "UNIT" Or DATA46109023.Columns(e.ColumnIndex).Name = "HARGA" Then
DATA46109023.CurrentRow.Cells("JUMLAH").Value = DATA46109023.CurrentRow.Cells("UNIT").Value * DATA46109023.CurrentRow.Cells("HARGA").Value
cim()
End If
End Sub
Private Sub cim()
Dim cim1 As Integer = 0
For Each cim2 As DataRow In ismi.Rows
cim1 += cim2("JUMLAH")
Next
TOT46109023.Text = cim1
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksinya")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("Isi Jenis Transaksinya")
Exit Sub
End If
If ismi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
cimi.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If cimi.JumlanBaris > 0 Then
MsgBox("notrans sudah ada")
Exit Sub
End If
sri = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
sri.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In ismi.Rows
sri = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "', '" & x("kodebarang") & "', '" & x("unit") & "', '" & x("harga") & "')", conect)
conect.Open()
sri.ExecuteNonQuery()
conect.Close()
Next
sri.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
TOT46109023.Text = ""
ismi.Rows.Clear()
cim()
End Sub
End Class
Public Class Form38
Dim cimi As New DataTable
Dim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form38_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 ='" & NT46109023.Text & "'", conect)
cimi.Rows.Clear()
ismisriwahyuni.Fill(cimi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = cimi.Columns("kodebarang")
cimi.PrimaryKey = dpc
DATA46109023.DataSource = cimi
End Sub
Private Sub cim()
Dim cim1 As Integer = 0
For Each cim2 As DataRow In cimi.Rows
cim1 += cim2("JUMLAH")
Next
TOT46109023.Text = cim1
End Sub
Private Sub UN46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UN46109023.TextChanged, HR46109023.TextChanged
JM46109023.Text = Val(UN46109023.Text) * Val(HR46109023.Text)
End Sub
Private Sub KB46109023_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB46109023.TextChanged
NB46109023.Text = ""
HR46109023.Text = ""
UN46109023.Text = ""
End Sub
Private Sub KB46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB46109023.Leave
If KB46109023.Text.Length = 0 Then
Exit Sub
End If
sri.AturPencarianDataBase("barang", "kodebarang", KB46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
KB46109023.Text = sri.DataTablenya.Rows(0).Item("KODEBARANG")
NB46109023.Text = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Kode barang seperti itu tidak ada..")
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
KB46109023.Text = Form383940_46109023.DATA46109023.CurrentRow.Cells("kodebarang").Value
NB46109023.Text = Form383940_46109023.DATA46109023.CurrentRow.Cells("namabarang").Value
Else
KB46109023.Text = ""
End If
End If
End Sub
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Isi Kode Barang")
Exit Sub
End If
If Val(UN46109023.Text) = 0 Then
MsgBox("Isi Unit Barang")
Exit Sub
End If
If Val(HR46109023.Text) = 0 Then
MsgBox("Isi Harga Barang")
Exit Sub
End If
Dim cimot As DataRow
cimot = cimi.Rows.Find(KB46109023.Text)
If cimot Is Nothing Then
cimot = cimi.NewRow
cimot("KODEBARANG") = KB46109023.Text
cimot("NAMABARANG") = NB46109023.Text
cimot("UNIT") = Val(UN46109023.Text)
cimot("HARGA") = Val(HR46109023.Text)
cimot("JUMLAH") = Val(JM46109023.Text)
cimi.Rows.Add(cimot)
KB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain...")
End If
cim()
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksi")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("isi Jenis Transaksi")
Exit Sub
End If
If cimi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("No Trans sudah ada")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In cimi.Rows
ismi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
Next
ismi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
cimi.Rows.Clear()
cim()
End Sub
End Class
Dim cimi As New DataTable
Dim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form38_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 ='" & NT46109023.Text & "'", conect)
cimi.Rows.Clear()
ismisriwahyuni.Fill(cimi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = cimi.Columns("kodebarang")
cimi.PrimaryKey = dpc
DATA46109023.DataSource = cimi
End Sub
Private Sub cim()
Dim cim1 As Integer = 0
For Each cim2 As DataRow In cimi.Rows
cim1 += cim2("JUMLAH")
Next
TOT46109023.Text = cim1
End Sub
Private Sub UN46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UN46109023.TextChanged, HR46109023.TextChanged
JM46109023.Text = Val(UN46109023.Text) * Val(HR46109023.Text)
End Sub
Private Sub KB46109023_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB46109023.TextChanged
NB46109023.Text = ""
HR46109023.Text = ""
UN46109023.Text = ""
End Sub
Private Sub KB46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB46109023.Leave
If KB46109023.Text.Length = 0 Then
Exit Sub
End If
sri.AturPencarianDataBase("barang", "kodebarang", KB46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
KB46109023.Text = sri.DataTablenya.Rows(0).Item("KODEBARANG")
NB46109023.Text = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Kode barang seperti itu tidak ada..")
If Form383940_46109023.ShowDialog = Windows.Forms.DialogResult.OK Then
KB46109023.Text = Form383940_46109023.DATA46109023.CurrentRow.Cells("kodebarang").Value
NB46109023.Text = Form383940_46109023.DATA46109023.CurrentRow.Cells("namabarang").Value
Else
KB46109023.Text = ""
End If
End If
End Sub
Private Sub TM46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Isi Kode Barang")
Exit Sub
End If
If Val(UN46109023.Text) = 0 Then
MsgBox("Isi Unit Barang")
Exit Sub
End If
If Val(HR46109023.Text) = 0 Then
MsgBox("Isi Harga Barang")
Exit Sub
End If
Dim cimot As DataRow
cimot = cimi.Rows.Find(KB46109023.Text)
If cimot Is Nothing Then
cimot = cimi.NewRow
cimot("KODEBARANG") = KB46109023.Text
cimot("NAMABARANG") = NB46109023.Text
cimot("UNIT") = Val(UN46109023.Text)
cimot("HARGA") = Val(HR46109023.Text)
cimot("JUMLAH") = Val(JM46109023.Text)
cimi.Rows.Add(cimot)
KB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain...")
End If
cim()
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksi")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("isi Jenis Transaksi")
Exit Sub
End If
If cimi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("No Trans sudah ada")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In cimi.Rows
ismi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
Next
ismi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
cimi.Rows.Clear()
cim()
End Sub
End Class
Public Class Form37
Dim cimi As New DataTable
Dim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form37_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 ='" & NT46109023.Text & "'", conect)
cimi.Rows.Clear()
ismisriwahyuni.Fill(cimi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = cimi.Columns("kodebarang")
cimi.PrimaryKey = dpc
DATA46109023.DataSource = cimi
End Sub
Private Sub cim()
Dim cimi1 As Integer = 0
For Each cimi2 As DataRow In cimi.Rows
cimi1 += cimi2("JUMLAH")
Next
TOT46109023.Text = cimi1
End Sub
Private Sub UN46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UN46109023.TextChanged, HR46109023.TextChanged
JM46109023.Text = Val(UN46109023.Text) * Val(HR46109023.Text)
End Sub
Private Sub KB46109023_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB46109023.Leave
If KB46109023.Text.Length = 0 Then
Exit Sub
End If
sri.AturPencarianDataBase("barang", "kodebarang", KB46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
KB46109023.Text = sri.DataTablenya.Rows(0).Item("KODEBARANG")
NB46109023.Text = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Kode barang itu tidak ada..")
Exit Sub
End If
End Sub
Private Sub KB46109001_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB46109023.TextChanged
NB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
End Sub
Private Sub TM46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Isi Kode Barang")
Exit Sub
End If
If Val(UN46109023.Text) = 0 Then
MsgBox("Isi Unit Barang")
Exit Sub
End If
If Val(HR46109023.Text) = 0 Then
MsgBox("Isi Harga Barang")
Exit Sub
End If
Dim cimcim As DataRow
cimcim = cimi.Rows.Find(KB46109023.Text)
If cimcim Is Nothing Then
cimcim = cimi.NewRow
cimcim("KODEBARANG") = KB46109023.Text
cimcim("NAMABARANG") = NB46109023.Text
cimcim("UNIT") = Val(UN46109023.Text)
cimcim("HARGA") = Val(HR46109023.Text)
cimcim("JUMLAH") = Val(JM46109023.Text)
cimi.Rows.Add(cimcim)
KB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain...")
End If
cim()
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksi")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("isi Jenis Transaksi")
Exit Sub
End If
If cimi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("No Trans sudah ada")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In cimi.Rows
ismi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
Next
ismi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
cimi.Rows.Clear()
cim()
End Sub
End Class
Dim cimi As New DataTable
Dim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datamajemuk.accdb;Jet OLEDB:Database Password=cimi")
Private Sub Form37_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ismisriwahyuni As New OleDb.OleDbDataAdapter
ismisriwahyuni = 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 ='" & NT46109023.Text & "'", conect)
cimi.Rows.Clear()
ismisriwahyuni.Fill(cimi)
ismisriwahyuni.Dispose()
Dim dpc(1) As DataColumn
dpc(0) = cimi.Columns("kodebarang")
cimi.PrimaryKey = dpc
DATA46109023.DataSource = cimi
End Sub
Private Sub cim()
Dim cimi1 As Integer = 0
For Each cimi2 As DataRow In cimi.Rows
cimi1 += cimi2("JUMLAH")
Next
TOT46109023.Text = cimi1
End Sub
Private Sub UN46109023_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UN46109023.TextChanged, HR46109023.TextChanged
JM46109023.Text = Val(UN46109023.Text) * Val(HR46109023.Text)
End Sub
Private Sub KB46109023_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles KB46109023.Leave
If KB46109023.Text.Length = 0 Then
Exit Sub
End If
sri.AturPencarianDataBase("barang", "kodebarang", KB46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
KB46109023.Text = sri.DataTablenya.Rows(0).Item("KODEBARANG")
NB46109023.Text = sri.DataTablenya.Rows(0).Item("NAMABARANG")
Else
MsgBox("Kode barang itu tidak ada..")
Exit Sub
End If
End Sub
Private Sub KB46109001_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KB46109023.TextChanged
NB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
End Sub
Private Sub TM46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TM46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Isi Kode Barang")
Exit Sub
End If
If Val(UN46109023.Text) = 0 Then
MsgBox("Isi Unit Barang")
Exit Sub
End If
If Val(HR46109023.Text) = 0 Then
MsgBox("Isi Harga Barang")
Exit Sub
End If
Dim cimcim As DataRow
cimcim = cimi.Rows.Find(KB46109023.Text)
If cimcim Is Nothing Then
cimcim = cimi.NewRow
cimcim("KODEBARANG") = KB46109023.Text
cimcim("NAMABARANG") = NB46109023.Text
cimcim("UNIT") = Val(UN46109023.Text)
cimcim("HARGA") = Val(HR46109023.Text)
cimcim("JUMLAH") = Val(JM46109023.Text)
cimi.Rows.Add(cimcim)
KB46109023.Text = ""
UN46109023.Text = ""
HR46109023.Text = ""
Else
MsgBox("Kode barang itu sudah ada, mohon ganti dengan kode barang yang lain...")
End If
cim()
End Sub
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If NT46109023.Text.Length = 0 Then
MsgBox("Isi No Transaksi")
Exit Sub
End If
If JT46109023.Text.Length = 0 Then
MsgBox("isi Jenis Transaksi")
Exit Sub
End If
If cimi.Rows.Count = 0 Then
MsgBox("Isi datatable")
Exit Sub
End If
sri.AturPencarianDataBase("mastertransaksi", "notrans", NT46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("No Trans sudah ada")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & NT46109023.Text & "',#" & T46109023.Value.Month & "/" & T46109023.Value.Day & "/" & T46109023.Value.Year & "#,'" & JT46109023.Text & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
For Each x As DataRow In cimi.Rows
ismi = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga) values ('" & NT46109023.Text & "','" & x("kodebarang") & "','" & x("unit") & "','" & x("harga") & "')", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
Next
ismi.Dispose()
NT46109023.Text = ""
JT46109023.Text = ""
cimi.Rows.Clear()
cim()
End Sub
End Class
Langganan:
Postingan (Atom)