private void txtRek_KeyUp(object sender, KeyEventArgs e) { fCari cari; if (e.KeyData == Keys.F8) { if ((cari = (fCari)alat.FormSudahDibuat(typeof(fCari))) == null) { cari = new fCari(); //System.Windows.Forms.ListView lvTampil = (System.Windows.Forms.ListView)cari.Controls["groupBox1"].Controls["lvTampil"]; //fillTheSearchTable(lvTampil); //cari.Size = new System.Drawing.Size(lebarLayar, tinggiLayar); cari.groupBox1.Text = "REKENING"; cari.status = 2; cari.query = "SELECT id_Reken, Kd_Reken, Rekening, NamaKpa FROM A_REKENING a, A_KPA b WHERE" + " b.Id_Kpa = a.Id_Kpa AND Kd_Reken LIKE '%" + alat.FilterMBox(txtRek.Text).Trim() + "%'"; cari.StartPosition = FormStartPosition.CenterScreen; cari.lvTampil.View = View.Details; cari.lvTampil.AllowColumnReorder = true; cari.lvTampil.FullRowSelect = true; cari.lvTampil.GridLines = true; cari.lvTampil.Sorting = System.Windows.Forms.SortOrder.Ascending; cari.lvTampil.MultiSelect = false; ColumnHeader headeridKet = cari.lvTampil.Columns.Add("id_ket", 0 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerkdRek = cari.lvTampil.Columns.Add("No Rekening", 30 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerUraian = cari.lvTampil.Columns.Add("Uraian", 30 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerKpa = cari.lvTampil.Columns.Add("KPA", 25 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); cari.lvTampil.Font = new Font("VERDANA", 11, FontStyle.Bold | FontStyle.Italic); cari.TopMost = true; cari.ShowDialog(); } else { //System.Windows.Forms.ListView lvTampil = (System.Windows.Forms.ListView)cari.Controls["groupBox1"].Controls["lvTampil"]; //fillTheSearchTable(lvTampil); cari.TopMost = true; cari.Select(); } } }
public void TampilFormCari(TextBox namatxt, string namaTabel, string pKey1, string pkey2, Form namaForm) { fCari dfCARI = new fCari(); TextBox txtCari = (TextBox)dfCARI.Controls["groupBox1"].Controls["txtCari"]; TextBox txtNamaTabel = (TextBox)dfCARI.Controls["txtNamaTabel"]; TextBox txtPKey1 = (TextBox)dfCARI.Controls["txtPKey1"]; TextBox txtPKey2 = (TextBox)dfCARI.Controls["txtPKey2"]; TextBox txtNamaForm = (TextBox)dfCARI.Controls["txtNamaForm"]; txtCari.Text = namatxt.Text; txtNamaTabel.Text = namaTabel; txtPKey1.Text = pKey1; txtPKey2.Text = pkey2; dfCARI.MdiParent = namaForm.MdiParent; txtNamaForm.Text = namaForm.Name; if (namaForm.Name != "fDetKorek") { dfCARI.WindowState = FormWindowState.Maximized; dfCARI.TopLevel = false; dfCARI.Dock = DockStyle.Fill; dfCARI.Parent = namaForm.Parent; dfCARI.BringToFront(); dfCARI.TopMost = true; } dfCARI.Show(); txtCari.Focus(); // GET ON TOP PROPERTY !!!! }
private void bCari_Click(object sender, EventArgs e) { if ((cari = (fCari)alat.FormSudahDibuat(typeof(fCari))) == null) { cari = new fCari(); //System.Windows.Forms.ListView lvTampil = (System.Windows.Forms.ListView)cari.Controls["groupBox1"].Controls["lvTampil"]; //fillTheSearchTable(lvTampil); //cari.Size = new System.Drawing.Size(lebarLayar, tinggiLayar); cari.groupBox1.Text = "KWITANSI"; if (statusCari == 2) cari.query = "SELECT id_Bayar_Mst, CONVERT(CHAR(10), TglBayar, 103), NoBayar, kd_Reken, ketBayar, NamaSupp, PPnRp, PPhRp, JmlRp, lunas, kdSumber, Jenis " + "FROM A_PENGELUARAN a, A_REKENING b, A_SUPPLIER c, A_JENIS d, A_SUMBER_DANA e WHERE " + "((b.id_reken = a.id_reken AND c.id_Supplier = a.id_supplier AND d.id_jenis = a.id_jenis) AND (lunas = 0 AND batal = 0 AND kwi = 0 AND e.idSumber = a.idSumber) AND NoBayar LIKE '" + textBox10.Text + "%')"; else if (statusCari == 1) cari.query = "SELECT id_Bayar_Mst, CONVERT(CHAR(10), TglBayar, 103), NoBayar, kd_Reken, ketBayar, NamaSupp, PPnRp, PPhRp, JmlRp, lunas, kdSumber, Jenis " + "FROM A_PENGELUARAN a, A_REKENING b, A_SUPPLIER c, A_JENIS d, A_SUMBER_DANA e WHERE " + "((b.id_reken = a.id_reken AND c.id_Supplier = a.id_supplier AND d.id_jenis = a.id_jenis) AND (lunas = 0 AND batal = 0 AND kwi = 0 AND e.idSumber = a.idSumber) AND (TglBayar BETWEEN '" + dtpEnBayar.Text + "' AND '" + dtpEnBayar.Text + "'))"; else if (statusCari == 3) cari.query = "SELECT id_Bayar_Mst, CONVERT(CHAR(10), TglBayar, 103), NoBayar, kd_Reken, ketBayar, NamaSupp, PPnRp, PPhRp, JmlRp, lunas, kdSumber, Jenis " + "FROM A_PENGELUARAN a, A_REKENING b, A_SUPPLIER c, A_JENIS d, A_SUMBER_DANA e WHERE " + "((b.id_reken = a.id_reken AND c.id_Supplier = a.id_supplier AND d.id_jenis = a.id_jenis) AND (lunas = 0 AND batal = 0 AND kwi = 0 AND e.idSumber = a.idSumber) AND (a.Id_Supplier = " + idSupp + "))"; cari.StartPosition = FormStartPosition.CenterScreen; cari.lvTampil.View = View.Details; cari.lvTampil.AllowColumnReorder = true; cari.lvTampil.FullRowSelect = true; cari.lvTampil.GridLines = true; cari.lvTampil.Sorting = System.Windows.Forms.SortOrder.Ascending; cari.lvTampil.MultiSelect = false; ColumnHeader headerIdBayar = cari.lvTampil.Columns.Add("id_bayar", 0 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerTgl2 = cari.lvTampil.Columns.Add("Tanggal", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerNoKwi2 = cari.lvTampil.Columns.Add("No Bukti", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerNoRek2 = cari.lvTampil.Columns.Add("No Rekening", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerKetRek2 = cari.lvTampil.Columns.Add("Uraian", 20 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerSupp2 = cari.lvTampil.Columns.Add("Supplier", 20 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerPPn2 = cari.lvTampil.Columns.Add("PPn (Rp)", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerPPh2 = cari.lvTampil.Columns.Add("PPh (Rp)", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerJum2 = cari.lvTampil.Columns.Add("Jumlah", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerStatus2 = cari.lvTampil.Columns.Add("Status", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerSubFung2 = cari.lvTampil.Columns.Add("Sumber", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); ColumnHeader headerJenis2 = cari.lvTampil.Columns.Add("Jenis", 10 * Convert.ToInt16(lvTampil.Font.SizeInPoints), HorizontalAlignment.Center); cari.lvTampil.Font = new Font("VERDANA", 11, FontStyle.Bold | FontStyle.Italic); cari.TopMost = true; cari.ShowDialog(); } else { //System.Windows.Forms.ListView lvTampil = (System.Windows.Forms.ListView)cari.Controls["groupBox1"].Controls["lvTampil"]; //fillTheSearchTable(lvTampil); cari.TopMost = true; cari.Select(); } }