Lampiran 1. Formulir kuisioner pertama
KUISIONER PENGUMPULAN DATA INFORMASI AGROWISATA BELIMBING TAMAN BUAH MEKARSARI (PT. MEKAR UNGGUL SARI) CILEUNGSI-BOGOR Sebagai pengumpulan bahan dan data dalam rangka perancangan sistem informasi agrowisara studi kasus tanaman belimbing di Taman Buah Mekarsari (PT. Mekar Unggul sari) Cileungsi-Bogor. Apakah media pencatatan yang digunakan untuk menyimpan informasi dari tanaman: a. Buku besar c. Arsip b. Komputer Bagaimana proses perpindahan informasi dari tanaman dari setiap bagian yang membutuhkannya: a. Dengan menggunakan buku besar c. Dengan menggunakan media lepas b. Dengan menggunakan arsip Bagaimana cara perawatan dan penyimpanan data yang telah dikumpulkan: a. Disimpan dalam buku besar c. Disimpan dalam media komputer b. Disimpan dalam arsip tanaman Dengan cara menggunakan apa penyajian informasi dari data yang telah ada: a. Dengan menggunakan arsip c. Dengan menggunakan buku besar b. Dengan menggunakan grafik d. Dengan menggunakan flow chart Apakah terdapat tenaga ahli yang dapat menggunakan computer a. Ya ada c. Ada dengan jumlah terbatas b. Tidak ada d. Ada dengan jumlah banyak Apakah diperlukan suatu sistem yang dapat mempermudah dalam perawatan dan penyajian data: a. Ya, diperlukan c. Ragu-ragu b. Tidak diperlukan d. Tidak tahu
39
Lampiran 2. Formulir kuisioner kedua
KUISIONER PENGUJIAN SISTEM INFORMASI AGROWISATA BELIMBING TAMAN BUAH MEKARSARI (PT. MEKAR UNGGUL SARI) CILEUNGSI-BOGOR Sebelum mengisi kuisoner ini terlebih dahulu Anda mencoba Sistem informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari), Cileungsi-Bogor Kendala untuk membuka program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat mudah c. Biasa e. Sangat sulit b. Mudah d. Sulit Informasi riwayat tanaman yang diberikan oleh program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat lengkap c. Biasa e. Sangat tidak lengkap b. Lengkap d. Kurang lengkap Informasi perawatan tanaman yang diberikan oleh program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat lengkap c. Biasa e. Sangat tidak lengkap b. Lengkap d. Kurang lengkap Informasi hama yang diberikan oleh program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat lengkap c. Biasa e. Sangat tidak lengkap b. Lengkap d. Kurang lengkap Informasi penyakit yang diberikan oleh program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat lengkap c. Biasa e. Sangat tidak lengkap b. Lengkap d. Kurang lengkap Sistem cara pemasukan data pada program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari): a. Sangat mudah c. Agak sulit e. Sangat sulit b. Mudah d. Sulit Saran Anda untuk perbaikan program Sistem Informasi Agrowisata Belimbing Taman Buah Mekarsari (PT. Mekar Unggul Sari) baik berupa data, informasi maupun tampilan program yaitu: ……………………………………....…….……………………………………………………………
40
Lampiran 3. Penggalan syntax programming untuk form administrator Public Class Form_Admin Private Sub Form_Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'PrototipeDataSet.Perompesan' table. You can move, or remove it, as needed. Me.PerompesanTableAdapter.Fill(Me.PrototipeDataSet.Perompesan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pembungkusan' table. You can move, or remove it, as needed. Me.PembungkusanTableAdapter.Fill(Me.PrototipeDataSet.Pembungkusan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pemangkasan' table. You can move, or remove it, as needed. Me.PemangkasanTableAdapter.Fill(Me.PrototipeDataSet.Pemangkasan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pemangkasan' table. You can move, or remove it, as needed. Me.PemangkasanTableAdapter.Fill(Me.PrototipeDataSet.Pemangkasan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Penyiraman' table. You can move, or remove it, as needed. Me.PenyiramanTableAdapter.Fill(Me.PrototipeDataSet.Penyiraman) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pemupukan' table. You can move, or remove it, as needed. Me.PemupukanTableAdapter.Fill(Me.PrototipeDataSet.Pemupukan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pangkas' table. You can move, or remove it, as needed. Me.PangkasTableAdapter.Fill(Me.PrototipeDataSet.Pangkas) 'TODO: This line of code loads data into the 'PrototipeDataSet.Pupuk' table. You can move, or remove it, as needed. Me.PupukTableAdapter.Fill(Me.PrototipeDataSet.Pupuk) 'TODO: This line of code loads data into the 'PrototipeDataSet.Perawatan' table. You can move, or remove it, as needed. Me.PerawatanTableAdapter.Fill(Me.PrototipeDataSet.Perawatan) 'TODO: This line of code loads data into the 'PrototipeDataSet.Produksi' table. You can move, or remove it, as needed. Me.ProduksiTableAdapter.Fill(Me.PrototipeDataSet.Produksi) 'TODO: This line of code loads data into the 'PrototipeDataSet.Lokasi' table. You can move, or remove it, as needed. Me.LokasiTableAdapter.Fill(Me.PrototipeDataSet.Lokasi) 'TODO: This line of code loads data into the 'PrototipeDataSet.Tanaman' table. You can move, or remove it, as needed. Me.TanamanTableAdapter.Fill(Me.PrototipeDataSet.Tanaman) End Sub Private Sub handling_error() MsgBox("Terjadi kesalahan penginputan data. Silahkan periksa kembali.") End Sub
41
Lampiran 3. Penggalan syntax programming untuk form administrator lanjutan Private Sub TanamanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TanamanBindingNavigatorSaveItem.Click Try Me.Validate() Me.TanamanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub ProduksiBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProduksiBindingNavigatorSaveItem.Click Try Me.Validate() Me.ProduksiBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PerawatanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerawatanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PerawatanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PupukBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PupukBindingNavigatorSaveItem.Click Try Me.Validate() Me.PupukBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub
42
Lampiran 3. Penggalan syntax programming untuk form administrator lanjutan Private Sub PangkasBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PangkasBindingNavigatorSaveItem.Click Try Me.Validate() Me.PangkasBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PemupukanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PemupukanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PemupukanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PenyiramanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PenyiramanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PenyiramanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PemangkasanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PemangkasanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PemangkasanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub
43
Lampiran 3. Penggalan syntax programming untuk form administrator lanjutan Private Sub PembungkusanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PembungkusanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PembungkusanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub Private Sub PerompesanBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerompesanBindingNavigatorSaveItem.Click Try Me.Validate() Me.PerompesanBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() Private Sub LokasiBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LokasiBindingNavigatorSaveItem.Click Try Me.Validate() Me.LokasiBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.PrototipeDataSet) Catch ex As Exception handling_error() End Try End Sub End Class
44
Lampiran 4. Penggalan syntax programming untuk form map Public Class Form_Map Dim banyak_wilayah = 15 Private Sub refresh_peta_lokasi() 'fungsi untuk mengatur radio button di peta lokasi Dim sumOfRecords As Integer = Me.TanamanBindingSource.Count Dim rdbtn_lokasi(sumOfRecords) As RadioButton 'Dim kd As String Dim i, pos_x, pos_y As Integer Dim width_interval As Decimal = Panel_peta_lokasi.Width / banyak_wilayah Dim height_interval As Decimal = Panel_peta_lokasi.Height / banyak_wilayah For i = 0 To sumOfRecords - 1 'kd = Me.PrototipeDataSet.Tables("Lokasi").Rows(i).Item("ID_tanaman") pos_x = Me.PrototipeDataSet.Tables("Lokasi").Rows(i).Item("Titik_X") pos_y = Me.PrototipeDataSet.Tables("Lokasi").Rows(i).Item("Titik_Y") rdbtn_lokasi(i) = New RadioButton rdbtn_lokasi(i).SetBounds((pos_x - 1) * width_interval + 6, (pos_y - 1) * height_interval + 3, 20, 15) rdbtn_lokasi(i).BackColor = Color.GreenYellow rdbtn_lokasi(i).Enabled = False 'rdbtn_lokasi(i).Name = "rdbtn_lokasi~" & kd 'rdbtn_lokasi(i).Text = kd & "~" & pos_x & "~" & pos_y & "~" & i Me.Panel_peta_lokasi.Controls.Add(rdbtn_lokasi(i)) Next i End Sub Private Sub Form_Map_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'TODO: This line of code loads data into the 'PrototipeDataSet.Lokasi' table. You can move, or remove it, as needed. Me.LokasiTableAdapter.Fill(Me.PrototipeDataSet.Lokasi) 'TODO: This line of code loads data into the 'PrototipeDataSet.Tanaman' table. You can move, or remove it, as needed. Me.TanamanTableAdapter.Fill(Me.PrototipeDataSet.Tanaman) refresh_peta_lokasi() End Sub
45
Lampiran 4. Penggalan syntax programming untuk form map lanjutan Private Sub Panel_peta_lokasiPaint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel_peta_lokasi.Paint Dim width_interval As Decimal = Panel_peta_lokasi.Width / banyak_wilayah Dim height_interval As Decimal = Panel_peta_lokasi.Height / banyak_wilayah Dim i As Integer 'membuat garis vertikal : For i = 1 To banyak_wilayah Me.Panel_peta_lokasi.CreateGraphics.DrawLine(Pens.Black, i * width_interval, 0, i * width_interval, Panel_peta_lokasi.Height) Next 'membuat garis horizontal : For i = 1 To banyak_wilayah Me.Panel_peta_lokasi.CreateGraphics.DrawLine(Pens.Black, 0, i * height_interval, Panel_peta_lokasi.Width, i * height_interval) Next End Sub Private Sub Button_Refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Refresh.Click Me.Panel_peta_lokasi.Controls.Clear() 'TODO: This line of code loads data into the 'PrototipeDataSet.Lokasi' table. You can move, or remove it, as needed. Me.LokasiTableAdapter.Fill(Me.PrototipeDataSet.Lokasi) 'TODO: This line of code loads data into the 'PrototipeDataSet.Tanaman' table. You can move, or remove it, as needed. Me.TanamanTableAdapter.Fill(Me.PrototipeDataSet.Tanaman) refresh_peta_lokasi() End Sub End Class
46
Lampiran 5. Informasi Taman Buah Mekarsari Taman Buah Mekarsari dibangun atas prakarsa Alm. Ibu Siti Hartinah Soeharto, yang dilandasi oleh keinginan luhur: 1. Meningkatkan harkat dan martabat kaum tani melalui pembangunan industri yang kuat dengan dukungan pertanian yang tangguh 2. Meningkatkan derajat buah-buahan Indonesia baik di dalam negeri maupun di mata dunia Kehadiran Taman Buah Mekarsari yang diresmikan bertepatan dengan peringatan Hari Pangan Sedunia XV tanggal 14 Oktober 1995, menandai awal dari era kebangkitan buah-buahan di Indonesia. Taman Buah Mekarsari dalam pelaksanaan kesehariannya dijalankan oleh General Manager yang mempunyai tugas antara lain melaksanakan dan mengkoordinasi seluruh kegiatan diperusahaan, mewakili perusahaan dalam urusannya dengan pihak eksternal, dan bertanggung jawab langsung kepada direktur utama. Divisi Penelitian dan Laboratorium membawahi satu Bagian Penelitian dan Laboratorium yang membawahi lagi tiga seksi. Masing-masing seksi tersebut mempunyai tugas antara lain melaksanakan riset terutama perbanyakan melalui teknik kultur jaringan, mengembangkan teknologi budidaya tanaman, melakukan upaya-upaya dalam menghasilkan kultivar-kultivar baru, mengidentifikasi dan menaggulangi hama penyakit tanaman, serta mencari alternatif pengembangan dan perbanyakan produksi tanaman melalui teknik kultur jaringan. Divisi agrowisata membawahi dua bagian, yaitu Bagian pelayanan Wisata dan Bagian Pengembangan Wisata. Bagian Pelayanan Wisata membawahi tiga seksi yang masing-masing bertugas antara lain mengatur dan mengolah taman dan lingkungan sebagai objek wisata di Taman Buah Mekarsari. Sedangkan Bagian Pengembangan Wisata membawahi dua seksi yang antara lain bertugas melakukan riset dalam mencari alternatif pengembangan wisata dan mengelola urusan penjualan dan promosi wisata. Divisi Produksi (Bibit Tanaman dan Buah) membawahi dua bagian, yaitu Bagian Produksi Bibit dan Tanaman dan Bagian Produksi Buah. Bagian Produksi Bibit dan Tanaman membawahi dua seksi yang masing-masing bertugas antara lain mengatur dan mengelola usaha produksi bibit di Taman Buah Mekarsari. Bagian Produksi Buah membawahi tiga seksi yang bertugas antara lain mengatur dan mengelola semua kegiatan dalam pelaksanaan pasca panen dan mengawasi standar mutu layak bagi suatu produk. Divisi Pemasaran (Bibit Tanaman dan Buah) membawahi dua bagian, yaitu Bagian Pemasaran Bibit dan Tanaman dan Bagian Pemasaran Buah. Bagian Pemasaran Bibit dan Tanaman membawahi tiga seksi yang masing-masing tugasnya antara lain mencari alternatif pengembangan dalam pemasaran, melakukan riset pasar akan kebutuhan bibit/tanaman, dan mengadakan promosi terhadap buah yang akan dijual. Divisi Keuangan dan Umum membawahi tiga bagian dan satu seksi yang setara yaitu, Bagian Sarana dan Pemeliharaan, Bagian Umum dan Bagian Akutansi dan Keuangan serta Seksi yang masing-masing tugasnya antara lain mengatur semua urusan mekanik dan elektrik, mengatur pengadaan listrik, menjaga kebersihan lingkungan dan mengelola semua kegiatan pembangunan di Taman Buah Mekarsari dan kontruksinya. Selain itu mengembangkan sistem informasi, mengatur dalam pengadaan komputer untuk semua unit dan mengadakan pelatihan komputerisai untuk karyawan di Taman Buah Mekarsari.
47
Lampiran 5. Informasi Taman Buah Mekarsari lanjutan Di Mekarsari untuk pengelolaan tanaman terutama tanaman belimbing diatur oleh bagian pelayanan wisata dari divisi agrowisata. Pada bagian pelayanan wisata terdapat tiga seksi yaitu seksi pelayanan pengunjung, seksi program wisata dan seksi area wisata dan tata lingkungan. Untuk memenuhi kebutuhan pengunjung yaitu dapat memetik buah secara langsung dari pohonnya, diperlukan peran dari seksi area wisata dan tata lingkungan yang memberikan informasi setiap areal dari kebun belimbing yang telah siap dipanen secara langsung kepada seksi program wisata. Seksi program wisata bertugas untuk mengolah data yang diterima menjadi jadwal kunjungan bagi para pengunjung untuk setiap komoditas tanaman yang ada di Mekarsari terutama belimbing. Data-data disimpan dengan menggunakan suatu buku besar catatan secara konvensional, sehingga ada kemungkinan untuk terjadinya kehilangan ataupun terjadinya salah pencatatan yang disebabkan faktor kelelahan. Pencatatan data dilakukan oleh pengelola kebun belimbing yang disimpan pada suatu buku lapang, kemudian buku lapang ini akan diberikan kepada pimpinan seksi area wisata dan tata lingkungan, buku lapang ini akan dikembalikan kembali kepada pengelola kebun setelah seluruh informasi yang ada dicatat kedalam buku besar oleh seksi area wisata dan tata lingkungan. Informasi yang dikumpulkan melingkupi jumlah bunga dan buah belimbing siap panen pada pohon belimbing sebagai indikator dalam pengambilan tindakan pembungkusan dan perawatan pada belimbing. Sedangkan untuk melakukan tindakan pencegahan maupun penanganan hama dan penyakit pengelola kebun mengumpulkan informasi tanaman yang dianggap akan terkena maupun yang telah terkena serangan dari hama dan penyakit.
48
Lampiran 6. Peta Taman Buah Mekarsari
Gambar 23. Peta keseluruhan Taman Buah Mekarsari Cileungsi-Bogor (Google Earth, 2010)
49
Lampiran 7. Tutorial fungsi tombol pada fitur peta Tombol Zoom In Tombol untuk memperdekat (Zoom In) tampilan peta pada Map Object. Klik dan Drag pada peta sehingga membentuk kotak, kotak ini nanti yang merupakan area tampilan zoom out Tombol Zoom In Tombol untuk memperjauh (Zoom Out) tampilan peta pada Map Object. Klik sekali pada peta sebagai titik tengah (pusat) tampilan zoom out Tombol Tambah Point (Lokasi) Tombol untuk menambah lokasi tanaman pada tampilan peta pada Map Object, lokasi berupa point koordinta X, Y Klik sekali pada peta sehingga muncul titik berwarna kuning dan koordinat X, Y akan muncul pada panel Riwayat Tanaman, di kolom X dan Y Tombol Pan (Geser) Tombol untuk menggeser area pada tampilan peta pada Map Object Klik dan drag pada peta area gambar pada peta bergeser ke kiri dan kekanan. Tombol tidak berpengaruh jika area gambar peta sudah mencukupi luasnya pada tampilan Map Object Tombol Informasi Tombol untuk menampilkan informasi hama dan penyakit tanaman yang ada pada point (titik) di peta Klik sekali pada point peta, lalu point tersebut berkedip 3 kali, kemudian muncul box informasi hama dan tanaman yang menyerang tanaman tersebut. Tombol ini hanya berkedip 3 kali jika diklik pada point yang berwarna hijau (tanaman sehat, tidak terkena hama maupun penyakit) Tombol Default Tombol untuk mengembalikan semua posisi tombol ke tombol semula sehingga pada peta hanya menunjukkan pointer defaultnya, dan tidak berpengaruh apapun jika mengklik ataupun menggeser peta Tombol Extent (mengembalikan tampilan area pada peta) Tombol untuk mengembalikan area gambar pada peta sehingga memuat satu gambar yang cukup pada sisi kiri dan kanan pada tampilan Map Object. Setelah meng-klik tombol ini, otomatis tombol Pan tidak berpengaruh pada area peta.
50
Option Explicit On Public Class fMain 'Database Private cnKebun As New ADODB.Connection Private rsRT As New ADODB.Recordset Private rsTmp As New ADODB.Recordset 'Peta Private mDc As New MapObjects2.DataConnection Private mLyR As MapObjects2.MapLayer Private RcT As MapObjects2.Rectangle Private pT As New MapObjects2.Point Private tSm As New MapObjects2.TextSymbol Private Rs As MapObjects2.Recordset Private LbL, Lb2 As New Label Private sTm As String, sTh As String, PiL As String = " " Private sJp As Single Private BiL, iAb, iRc As Integer Private isAdd As Boolean = False, isAdmin As Boolean = False 'Password admin Private Const pWd As String = "admin" Private Sub form_main_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing rsRT.Close() rsRT = Nothing rsTmp = Nothing cnKebun.Close() cnKebun = Nothing mDc.Disconnect() mDc = Nothing pT = Nothing tSm = Nothing LbL.Dispose() Lb2.Dispose() End Sub Private Sub form_main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cnKebun.Provider = "Microsoft.Jet.OLEDB.4.0" sTm = Application.StartupPath & "\dbkebun.mdb" cnKebun.Open(sTm, "admin", "") mDc.Database = Application.StartupPath mLyR = New MapObjects2.MapLayer mLyR.GeoDataset = mDc.FindGeoDataset("peta") mLyR.Symbol.Color = &H80A0C0 Peta.Layers.Add(mLyR) Peta.TrackingLayer.SymbolCount = 5 sIm(0, MapObjects2.ColorConstants.moGreen) sIm(1, MapObjects2.ColorConstants.moYellow) sIm(2, MapObjects2.ColorConstants.moBlue) sIm(3, MapObjects2.ColorConstants.moRed) sIm(4, MapObjects2.ColorConstants.moPurple) Static tF As New stdole.StdFont tF.Name = "Arial Narrow"
tF.Size = 10 tF.Bold = True With tSm .Font = tF .Color = &H805050 .HorizontalAlignment = MapObjects2.AlignmentConstants.moAlignLeft .VerticalAlignment = MapObjects2.AlignmentConstants.moAlignCenter .Fitted = True End With rsRT.Open("tbl_riwayat_tanaman", cnKebun, _ ADODB.CursorTypeEnum.adOpenKeyset, _ ADODB.LockTypeEnum.adLockOptimistic) If rsRT.RecordCount > 0 Then rsRT.MoveLast() iRc = rsRT.RecordCount - 1 nPoint() Else bRe.Enabled = False End If End Sub Private Sub form_main_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove LBox(LbL, True) End Sub Private Sub bCL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCL.Click CLPan(pRT) End Sub Private Sub bCL2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCL2.Click CLPan(pPw) End Sub Private Sub bCL3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bCL3.Click CLPan(pHm) End Sub Private Sub bCL4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCL4.Click CLPan(pPn) End Sub Private Sub bCL5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCL5.Click CLPan(pTgL) End Sub Private Sub bCLd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCLd.Click cLd.ShowDialog() BiL = cLd.Color.ToArgb() bCLd.BackColor = Color.FromArgb(BiL) End Sub Private Sub bDeL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDeL.Click If MsgBox("Yakin data ini akan di-Delete", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.No Then Exit Sub If ckPr.Checked Then
rsTmp.Delete() cbPr.Items.RemoveAt(cbPr.SelectedIndex) Else rsRT.Delete() iRc -= 1 If rsRT.RecordCount > 0 Then rsRT.MoveFirst() IsiRT() nPoint() Else bRe.Enabled = False KsRT() AxCbeM.Visible = False Peta.TrackingLayer.ClearEvents() End If End If End Sub Private Sub bDeL2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDeL2.Click If DeLIsi(rsTmp) Then IsiPw() Else KsPw() End If End Sub Private Sub bDeL3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDeL3.Click If DeLIsi(rsTmp) Then IsiHm() Else KsHm() End If End Sub Private Sub bDeL4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDeL4.Click If DeLIsi(rsTmp) Then IsiPn() Else KsPn() End If End Sub Private Sub bDeL5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bDeL5.Click If DeLIsi(rsTmp) Then IsiPt() Else KsTgL() End If End Sub Private Sub bNn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bNn.Click If MovNx(rsTmp) Then IsiPn() End Sub Private Sub bNx_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNx.Click If MovNx(rsRT) Then IsiRT()
End Sub Private Sub bNxH_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bNxH.Click If MovNx(rsTmp) Then IsiHm() End Sub Private Sub bNxT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNxT.Click If MovNx(rsTmp) Then IsiPt() End Sub Private Sub bNxW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNxW.Click If MovNx(rsTmp) Then IsiPw() End Sub Private Sub bPre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bPre.Click If MovPr(rsRT) Then IsiRT() End Sub Private Sub bPrH_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bPrH.Click If MovPr(rsTmp) Then IsiHm() End Sub Private Sub bPrN_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bPrN.Click If MovPr(rsTmp) Then IsiPn() End Sub Private Sub bPrT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bPrT.Click If MovPr(rsTmp) Then IsiPt() End Sub Private Sub bPrW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bPrW.Click If MovPr(rsTmp) Then IsiPw() End Sub Private Sub bRe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bRe.Click If rsRT.RecordCount > 0 Then nPoint() End Sub Private Sub bTb2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTb2.Click If Tambah(bTb2, rsTmp, pPw) Then KsPw() Else IsiPw() End If End Sub Private Sub bTb3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTb3.Click If Tambah(bTb3, rsTmp, pHm) Then KsHm() Else IsiHm() End If End Sub Private Sub bTb4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTb4.Click If Tambah(bTb4, rsTmp, pPn) Then
KsPn() Else IsiPn() End If End Sub Private Sub bTb5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTb5.Click If Tambah(bTb5, rsTmp, pTgL) Then KsTgL() Else IsiPt() End If End Sub Private Sub bTbh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTbh.Click If ckPr.Checked Then sTh = InputBox("Input Tahun", "Tahun") If Trim(sTh) = "" Then Exit Sub sTm = InputBox("Input Jumlah Produksi", "Jumlah") If Trim(sTm) = "" Then Exit Sub sJp = CSng(sTm) If sJp < 0 Then Exit Sub rsTmp.AddNew() rsTmp(0).Value = rsRT(0).Value rsTmp(1).Value = sTh rsTmp(2).Value = sJp rsTmp.Update() cbPr.Items.Add(sTh) rsTmp.MoveLast() AxCbeM.Column = 1 AxCbeM.RowCount += 1 AxCbeM.Row = AxCbeM.RowCount AxCbeM.RowLabel = rsTmp(1).Value AxCbeM.Data = rsTmp(2).Value Exit Sub End If If Tambah(bTbh, rsRT, pRT) Then KsRT() Else IsiRT() End If End Sub Private Sub bTp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bTp.Click pInfo.Visible = False End Sub Private Sub bUp2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp2.Click If Trim(cbIW.Text) = "" Then MsgBox("ID Tanaman tidak boleh kosong", MsgBoxStyle.Exclamation) cbIW.Focus() Exit Sub End If If isAdd Then rsTmp.AddNew() rsTmp(0).Value = cbIW.Text
UpPw() KsPw() Else If rsTmp.RecordCount < 1 Then Exit Sub If MsgBox("Yakin data ini akan di-Update", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.Yes Then UpPw() End If End Sub Private Sub bUp3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp3.Click If Trim(cbIh.Text) = "" Then MsgBox("ID Tanaman tidak boleh kosong", MsgBoxStyle.Exclamation) cbIh.Focus() Exit Sub End If If isAdd Then rsTmp.AddNew() rsTmp(0).Value = cbIh.Text upHm() Kshm() Else If rsTmp.RecordCount < 1 Then Exit Sub If MsgBox("Yakin data ini akan di-Update", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.Yes Then Uphm() End If End Sub Private Sub bUp4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp4.Click If Trim(cbIn.Text) = "" Then MsgBox("ID Tanaman tidak boleh kosong", MsgBoxStyle.Exclamation) cbIn.Focus() Exit Sub End If If isAdd Then rsTmp.AddNew() rsTmp(0).Value = cbIn.Text UpPn() KsPn() Else If rsTmp.RecordCount < 1 Then Exit Sub If MsgBox("Yakin data ini akan di-Update", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.Yes Then UpPn() End If End Sub Private Sub bUp5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUp5.Click If Trim(cbIT.Text) = "" Then MsgBox("ID Tanaman tidak boleh kosong", MsgBoxStyle.Exclamation) cbIT.Focus() Exit Sub End If If isAdd Then rsTmp.AddNew() rsTmp(0).Value = cbIT.Text UpTgL() KsTgL()
Else If rsTmp.RecordCount < 1 Then Exit Sub If MsgBox("Yakin data ini akan di-Update", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.Yes Then uptgl() End If End Sub Private Sub bUpd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bUpd.Click If ckPr.Checked Then If Trim(fRT7.Text) = "" Then Exit Sub sTm = InputBox("Input Tahun", "Tahun") If Trim(sTm) = "" Then Exit Sub rsTmp(1).Value = sTm rsTmp(2).Value = fRT7.Text rsTmp.Update() cbPr.Items.Item(cbPr.SelectedIndex) = sTm Exit Sub End If If Trim(fRT0.Text) = "" Then MsgBox("ID Tanaman tidak boleh kososng", MsgBoxStyle.Exclamation) fRT0.Focus() Exit Sub End If If isAdd Then iRc += 1 rsRT.AddNew() rsRT(0).Value = fRT0.Text rsRT(1).Value = Now UpRT() KsRT() Else If rsRT.RecordCount < 1 Then Exit Sub If MsgBox("Yakin data ini akan di-Update", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.Yes Then UpRT() End If End Sub Private Sub cbIh_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbIh.TextChanged CarId(cbIh, tXh, tYh) End Sub Private Sub cbIn_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbIn.TextChanged CarId(cbIn, tXn, tYn) End Sub Private Sub cbIW_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbIW.TextChanged CarId(cbIW, tXw, tYw) End Sub Private Sub cbPr_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbPr.SelectedIndexChanged rsTmp.AbsolutePosition = cbPr.SelectedIndex + 1 fRT7.Text = rsTmp(2).Value
End Sub Private Sub Def_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Def.Click PiL = " " pInfo.Visible = False Lb2.BorderStyle = BorderStyle.None Lb2.BackColor = Color.Transparent Peta.MousePointer = MapObjects2.MousePointerConstants.moDefault End Sub Private Sub Def_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Def.MouseMove If Def.BorderStyle <> BorderStyle.FixedSingle Then LBox(Def, False) End Sub Private Sub fLxT_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles fLxT.MouseMove If fLxT.BorderStyle <> BorderStyle.FixedSingle Then LBox(fLxT, False) End Sub Private Sub fLxT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fLxT.Click Peta.Extent = Peta.FullExtent End Sub Private Sub Info_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Info.Click SeLpiL(Info, MapObjects2.MousePointerConstants.moIdentify) End Sub Private Sub Info_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Info.MouseMove If Info.BorderStyle <> BorderStyle.FixedSingle Then LBox(Info, False) End Sub Private Sub Loc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Loc.Click SeLpiL(Loc, MapObjects2.MousePointerConstants.moCross) End Sub Private Sub Loc_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Loc.MouseMove If Loc.BorderStyle <> BorderStyle.FixedSingle Then LBox(Loc, False) End Sub Private Sub msAdm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msAdm.Click sTm = InputBox("Input Paswword Admin", "Password") If sTm = pWd Then isAdmin = True Else MsgBox("Password admin salah..!", MsgBoxStyle.Exclamation) End If End Sub Private Sub msEx_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msEx.Click Close() End Sub
Private Sub msHama_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msHama.Click If pHm.Visible = True Then Exit Sub If pRT.Visible = True Or pPw.Visible = True Or pPn.Visible = True Or pTgL.Visible = True Then MsgBox("Tutup Panel yang ada untuk membuka Panel Hama", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If isAdmin Then bTb3.Enabled = True bUp3.Enabled = True bDeL3.Enabled = True Else bTb3.Enabled = False bUp3.Enabled = False bDeL3.Enabled = False End If IsiCb(cbIh) rsTmp.Open("tbl_hama", cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() IsiHm() End If pHm.Visible = True End Sub Private Sub msPen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msPen.Click If pPn.Visible = True Then Exit Sub If pRT.Visible = True Or pPw.Visible = True Or pHm.Visible = True Or pTgL.Visible = True Then MsgBox("Tutup Panel yang ada untuk membuka Panel Penyakit", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If isAdmin Then bTb4.Enabled = True bUp4.Enabled = True bDeL4.Enabled = True Else bTb4.Enabled = False bUp4.Enabled = False bDeL4.Enabled = False End If IsiCb(cbIn) rsTmp.Open("tbl_penyakit", cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() IsiPn() End If pPn.Visible = True End Sub Private Sub msPer_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msPer.Click If pPw.Visible = True Then Exit Sub If pRT.Visible = True Or pHm.Visible = True Or pPn.Visible = True Or pTgL.Visible = True Then
MsgBox("Tutup Panel yang ada untuk membuka Panel Perawatan", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If isAdmin Then bTb2.Enabled = True bUp2.Enabled = True bDeL2.Enabled = True Else bTb2.Enabled = False bUp2.Enabled = False bDeL2.Enabled = False End If IsiCb(cbIW) rsTmp.Open("tbl_perawatan", cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() IsiPw() End If pPw.Visible = True End Sub Private Sub msRT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msRT.Click If pRT.Visible = True Then Exit Sub If pPw.Visible = True Or pHm.Visible = True Or pPn.Visible = True Or pTgL.Visible = True Then MsgBox("Tutup Panel yang ada untuk membuka Panel Riwayat Tanaman", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If isAdmin Then bTbh.Enabled = True bUpd.Enabled = True bDeL.Enabled = True ckPr.Enabled = True Else bTbh.Enabled = False bUpd.Enabled = False bDeL.Enabled = False ckPr.Enabled = False End If If rsRT.RecordCount > 0 Then rsRT.MoveFirst() IsiRT() End If pRT.Visible = True End Sub Private Sub msSb_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msSb.Click splash.Show() End Sub Private Sub msSt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msSt.Click splash.Close() End Sub
Private Sub msTgL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msTgL.Click If pTgL.Visible = True Then Exit Sub If pRT.Visible = True Or pHm.Visible = True Or pPn.Visible = True Or pPw.Visible = True Then MsgBox("Tutup Panel yang ada untuk membuka Panel Perawatan", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If isAdmin Then bTb5.Enabled = True bUp5.Enabled = True bDeL5.Enabled = True Else bTb5.Enabled = False bUp5.Enabled = False bDeL5.Enabled = False End If IsiCb(cbIT) rsTmp.Open("tbl_kegiatan", cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() IsiPt() End If pTgL.Visible = True End Sub Private Sub Pan_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Pan.MouseMove If Pan.BorderStyle <> BorderStyle.FixedSingle Then LBox(Pan, False) End Sub Private Sub Pan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Pan.Click SeLpiL(Pan, MapObjects2.MousePointerConstants.moPan) End Sub Private Sub Peta_AfterTrackingLayerDraw(ByVal sender As Object, ByVal e As AxMapObjects2._DMapEvents_AfterTrackingLayerDrawEvent) Handles Peta.AfterTrackingLayerDraw For Me.BiL = 0 To iRc Peta.DrawText(Peta.TrackingLayer.Event(BiL).Tag, Peta.TrackingLayer.Event(BiL).shape, tSm) Next End Sub Private Sub Peta_MouseDownEvent(ByVal sender As Object, ByVal e As AxMapObjects2._DMapEvents_MouseDownEvent) Handles Peta.MouseDownEvent If Peta.MousePointer <> MapObjects2.MousePointerConstants.moPan _ Or Peta.MousePointer <> MapObjects2.MousePointerConstants.moZoomIn Then _ pT = Peta.ToMapPoint(e.x, e.y) Select Case Peta.MousePointer Case MapObjects2.MousePointerConstants.moCross If e.button = 1 Then Peta.TrackingLayer.AddEvent(pT, 1) If pRT.Visible = True Then fRT1.Text = pT.X fRT2.Text = pT.Y End If
ElseIf e.button = 2 Then If rsRT.RecordCount > 0 Then nPoint() End If Case MapObjects2.MousePointerConstants.moIdentify For Me.BiL = 0 To iRc If pT.DistanceTo(Peta.TrackingLayer.Event(BiL).shape) < 0.001 Then Exit For Next sTh = Peta.TrackingLayer.Event(BiL).Tag.Trim If rsRT.RecordCount > 0 And pRT.Visible = True Then rsTmp.Close() LHm.Items.Clear() sTm = "SELECT nama_hama FROM tbl_hama WHERE id_tanaman = '" & sTh & "'" rsTmp.Open(sTm, cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockReadOnly) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() While Not rsTmp.EOF LHm.Items.Add(rsTmp(0).Value) rsTmp.MoveNext() End While End If LPn.Items.Clear() rsTmp.Close() sTm = "SELECT nama_penyakit FROM tbl_penyakit WHERE id_tanaman = '" & sTh & "'" rsTmp.Open(sTm, cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockReadOnly) If rsTmp.RecordCount > 0 Then rsTmp.MoveFirst() While Not rsTmp.EOF LPn.Items.Add(rsTmp(0).Value) rsTmp.MoveNext() End While End If If pRT.Visible = False Then rsTmp.Close() Peta.FlashShape(Peta.TrackingLayer.Event(BiL).shape, 3) If LHm.Items.Count = 0 And LPn.Items.Count = 0 Then pInfo.Visible = False Exit Sub End If LId.Text = sTh pInfo.Left = Peta.Left + e.x + 4 pInfo.Top = Peta.Top + e.y + 4 pInfo.Visible = True Case MapObjects2.MousePointerConstants.moPan Peta.Pan() Case MapObjects2.MousePointerConstants.moZoomIn RcT = Peta.TrackRectangle Peta.Extent = RcT Case MapObjects2.MousePointerConstants.moZoomOut RcT = Peta.Extent RcT.Right = pT.X + Peta.Extent.Width RcT.Left = pT.X - Peta.Extent.Width RcT.Top = pT.Y + Peta.Extent.Height RcT.Bottom = pT.Y - Peta.Extent.Height Peta.Extent = RcT End Select End Sub
Private Sub ZmIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZmIn.Click SeLpiL(ZmIn, MapObjects2.MousePointerConstants.moZoomIn) End Sub Private Sub ZmIn_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ZmIn.MouseMove If ZmIn.BorderStyle <> BorderStyle.FixedSingle Then LBox(ZmIn, False) End Sub Private Sub ZmOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZmOut.Click SeLpiL(ZmOut, MapObjects2.MousePointerConstants.moZoomOut) End Sub Private Sub ZmOut_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ZmOut.MouseMove If ZmOut.BorderStyle <> BorderStyle.FixedSingle Then LBox(ZmOut, False) End Sub Private Sub CarId(ByVal Cb As ComboBox, ByVal tX As TextBox, ByVal tY As TextBox) rsRT.MoveFirst() rsRT.Find("id_tanaman = '" & Cb.Text & "'") If rsRT.EOF Then Exit Sub tX.Text = rsRT(2).Value tY.Text = rsRT(3).Value End Sub Private Sub CLPan(ByVal PnL As Panel) rsTmp.Close() If isAdd Then isAdd = False tCat.Text = "" PnL.Visible = False End Sub Private Function DeLIsi(ByVal Rs As ADODB.Recordset) As Boolean If MsgBox("Yakin data ini akan di-Delete", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi") = MsgBoxResult.No Then Exit Function Rs.Delete() If Rs.RecordCount > 0 Then Rs.MoveFirst() DeLIsi = True Else DeLIsi = False End If End Function Private Sub IsiCb(ByVal cB As ComboBox) cB.Items.Clear() If rsRT.RecordCount < 1 Then Exit Sub rsRT.MoveFirst() For Me.BiL = 0 To iRc cB.Items.Add(rsRT(0).Value) rsRT.MoveNext() Next End Sub
Private Sub IsiFLd(ByVal Rfd As ADODB.Field, ByVal Tx As TextBox) If IsDBNull(Rfd.Value) Then Tx.Text = " " Else Tx.Text = Rfd.Value End If End Sub Private Sub IsiHm() cbIh.Text = rsTmp(0).Value IsiFLd(rsTmp(1), fHm1) IsiFLd(rsTmp(2), fHm2) IsiFLd(rsTmp(3), fHm3) IsiFLd(rsTmp(4), fHm4) IsiFLd(rsTmp(5), fHm5) tCat.Text = rsTmp(6).Value End Sub Private Sub IsiPn() cbIn.Text = rsTmp(0).Value IsiFLd(rsTmp(1), fPn1) IsiFLd(rsTmp(2), fPn2) IsiFLd(rsTmp(3), fPn3) IsiFLd(rsTmp(4), fPn4) IsiFLd(rsTmp(5), fPn5) tCat.Text = rsTmp(6).Value End Sub Private Sub IsiPt() cbIT.Text = rsTmp(0).Value dpKg.Value = rsTmp(1).Value IsiFLd(rsTmp(2), fPn2) IsiFLd(rsTmp(3), fPn3) tCat.Text = rsTmp(4).Value End Sub Private Sub IsiPw() cbIW.Text = rsTmp(0).Value IsiFLd(rsTmp(1), fPw1) IsiFLd(rsTmp(2), fPw2) fPw3.CheckState = rsTmp(3).Value IsiFLd(rsTmp(4), fPw4) IsiFLd(rsTmp(5), fPw5) fPw6.CheckState = rsTmp(6).Value IsiFLd(rsTmp(7), fPw7) IsiFLd(rsTmp(8), fPw8) fPw9.CheckState = rsTmp(9).Value IsiFLd(rsTmp(10), fPw10) IsiFLd(rsTmp(11), fPw11) IsiFLd(rsTmp(12), fPw12) IsiFLd(rsTmp(13), fPw13) bCLd.BackColor = Color.FromArgb(rsTmp(14).Value) IsiFLd(rsTmp(15), tCat) End Sub
Private Sub IsiRT() If pRT.Visible = True Then rsTmp.Close() sTm = "SELECT * FROM tbl_produksi WHERE id_tanaman = '" & rsRT(0).Value & "'" rsTmp.Open(sTm, cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, _ ADODB.LockTypeEnum.adLockOptimistic) cbPr.Items.Clear() BiL = CInt(Format(Now, "yyyy")) BiL -= CInt(Format(rsRT(1).Value, "yyyy")) fRT5.Text = BiL If rsTmp.RecordCount < 1 Then fRT6.Text = "" fRT7.Text = "" If AxCbeM.Visible = True Then AxCbeM.Visible = False Else sJp = 0 BiL = 0 AxCbeM.Column = 1 AxCbeM.RowCount = 0 rsTmp.MoveFirst() While Not rsTmp.EOF cbPr.Items.Add(rsTmp(1).Value) sJp += rsTmp(2).Value BiL += 1 AxCbeM.RowCount += 1 AxCbeM.Row = AxCbeM.RowCount AxCbeM.RowLabel = rsTmp(1).Value AxCbeM.Data = rsTmp(2).Value rsTmp.MoveNext() End While fRT6.Text = sJp / BiL If AxCbeM.Visible = False Then AxCbeM.Visible = True End If IsiFLd(rsRT(0), fRT0) IsiFLd(rsRT(2), fRT1) IsiFLd(rsRT(3), fRT2) IsiFLd(rsRT(4), fRT3) IsiFLd(rsRT(5), fRT4) IsiFLd(rsRT(6), tCat) fRT7.Text = "" End Sub Private Sub KsHm() cbIh.Text = "" tXh.Text = "" tYh.Text = "" fHm1.Text = " " fHm2.Text = " " fHm3.Text = " " fHm4.Text = " " fHm5.Text = " " tCat.Text = " " cbIh.Focus() End Sub Private Sub KsPn() cbIn.Text = ""
tXn.Text = "" tYn.Text = "" fPn1.Text = " " fPn2.Text = " " fPn3.Text = " " fPn4.Text = " " fPn5.Text = " " tCat.Text = " " cbIn.Focus() End Sub Private Sub KsPw() cbIW.Text = "" tXw.Text = "" tYw.Text = "" fPw1.Text = " " fPw2.Text = " " fPw3.Checked = False fPw4.Text = " " fPw5.Text = " " fPw6.Checked = False fPw7.Text = " " fPw8.Text = " " fPw9.Checked = False fPw10.Text = " " fPw11.Text = " " fPw12.Text = " " fPw13.Text = " " bCLd.BackColor = Color.Silver tCat.Text = " " cbIW.Focus() End Sub Private Sub KsRT() fRT0.Text = "" fRT1.Text = " " fRT2.Text = " " fRT3.Text = " " fRT4.Text = " " fRT5.Text = "" fRT6.Text = "" fRT7.Text = "" tCat.Text = " " fRT0.Focus() End Sub Private Sub KsTgL() cbIT.Text = "" tXt.Text = "" tYt.Text = "" dpKg.Value = Now fKg1.Text = " " fKg2.Text = " " End Sub Private Sub LBox(ByVal mLbL As Label, ByVal frm As Boolean)
If LbL.Name <> PiL Then LbL.BorderStyle = BorderStyle.None LbL.BackColor = Color.Transparent End If If frm Then Exit Sub LbL = mLbL LbL.BorderStyle = BorderStyle.FixedSingle LbL.BackColor = Color.FloralWhite End Sub Private Function MovNx(ByVal Rs As ADODB.Recordset) As Boolean BiL = Rs.RecordCount If Rs.RecordCount > 0 And Rs.AbsolutePosition < BiL Then Rs.MoveNext() MovNx = True Else MovNx = False End If End Function Private Function MovPr(ByVal rs As ADODB.Recordset) As Boolean BiL = rs.RecordCount If rs.RecordCount > 0 And rs.AbsolutePosition > 1 Then rs.MovePrevious() MovPr = True Else MovPr = False End If End Function Private Sub nPoint() If ckPr.Checked Then Exit Sub If pPw.Visible = True Or pHm.Visible = True Or pPn.Visible = True Or pTgL.Visible = True Then MsgBox("Tutup Panel yang ada untuk me-Refresh Legend Tanaman", MsgBoxStyle.Exclamation, "Konfirmasi") Exit Sub End If If pRT.Visible = True And isAdd = False Then iAb = rsRT.AbsolutePosition Peta.TrackingLayer.ClearEvents() rsRT.MoveFirst() For Me.BiL = 0 To iRc sJp = 0 If pRT.Visible = True Then rsTmp.Close() sTm = "SELECT id_tanaman FROM tbl_hama WHERE id_tanaman = '" & rsRT(0).Value & "'" rsTmp.Open(sTm, cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, _ ADODB.LockTypeEnum.adLockReadOnly) If rsTmp.RecordCount > 0 Then sJp = 2 rsTmp.Close() sTm = "SELECT id_tanaman FROM tbl_penyakit WHERE id_tanaman = '" & rsRT(0).Value & "'" rsTmp.Open(sTm, cnKebun, ADODB.CursorTypeEnum.adOpenKeyset, _ ADODB.LockTypeEnum.adLockReadOnly) If rsTmp.RecordCount > 0 Then If sJp = 0 Then sJp = 3 Else sJp = 4
End If End If If pRT.Visible = False Then rsTmp.Close() sTm = rsRT(0).Value pT.X = rsRT(2).Value pT.Y = rsRT(3).Value Peta.TrackingLayer.AddEvent(pT, sJp) Peta.TrackingLayer.Event(BiL).Tag = " " & sTm rsRT.MoveNext() Next If pRT.Visible = True And isAdd = False Then rsRT.AbsolutePosition = iAb End Sub Private Sub SeLpiL(ByVal sLbL As Label, ByVal MoPo As MapObjects2.MousePointerConstants) Lb2.BorderStyle = BorderStyle.None Lb2.BackColor = Color.Transparent PiL = sLbL.Name Lb2 = sLbL Peta.MousePointer = MoPo End Sub Private Sub sIm(ByVal sIn As Integer, ByVal wRn As MapObjects2.ColorConstants) With Peta.TrackingLayer.Symbol(sIn) .SymbolType = MapObjects2.SymbolTypeConstants.moPointSymbol .Color = wRn .Style = MapObjects2.MarkerStyleConstants.moCircleMarker End With End Sub Private Function Tambah(ByVal bTn As Button, ByVal Rs As ADODB.Recordset, ByVal PnL As Panel) As Boolean If isAdd Then isAdd = False bTn.Text = "Tambah" If Rs.RecordCount < 1 Then Tambah = True Else Rs.MoveFirst() Tambah = False End If PnL.BackColor = Color.FromArgb(-2830136) Else Tambah = True bTn.Text = "Batal" isAdd = True PnL.BackColor = Color.LightSteelBlue End If End Function Private Sub UpHm() rsTmp(1).Value = fHm1.Text rsTmp(2).Value = fHm2.Text rsTmp(3).Value = fHm3.Text rsTmp(4).Value = fHm4.Text rsTmp(5).Value = fHm5.Text rsTmp(6).Value = tCat.Text
rsTmp.Update() End Sub Private Sub UpPn() rsTmp(1).Value = fPn1.Text rsTmp(2).Value = fPn2.Text rsTmp(3).Value = fPn3.Text rsTmp(4).Value = fPn4.Text rsTmp(5).Value = fPn5.Text rsTmp(6).Value = tCat.Text rsTmp.Update() End Sub Private Sub UpPw() rsTmp(1).Value = fPw1.Text rsTmp(2).Value = fPw2.Text rsTmp(3).Value = fPw3.CheckState rsTmp(4).Value = fPw4.Text rsTmp(5).Value = fPw5.Text rsTmp(6).Value = fPw6.CheckState rsTmp(7).Value = fPw7.Text rsTmp(8).Value = fPw8.Text rsTmp(9).Value = fPw9.CheckState rsTmp(10).Value = fPw10.Text rsTmp(11).Value = fPw11.Text rsTmp(12).Value = fPw12.Text rsTmp(13).Value = fPw13.Text rsTmp(14).Value = bCLd.BackColor.ToArgb rsTmp(15).Value = tCat.Text rsTmp.Update() End Sub Private Sub UpRT() rsRT(2).Value = fRT1.Text rsRT(3).Value = fRT2.Text rsRT(4).Value = fRT3.Text rsRT(5).Value = fRT4.Text rsRT(6).Value = tCat.Text rsRT.Update() nPoint() End Sub Private Sub UpTgL() rsTmp(1).Value = dpKg.Value rsTmp(2).Value = fKg1.Text rsTmp(3).Value = fKg2.Text rsTmp(4).Value = tCat.Text rsTmp.Update() End Sub End Class