private void txtKodeSupplier_Validated(object sender, EventArgs e) { if (txtKodeSupplier.Text.Length > 0) { String strSQL, noNotaBaru = txtNoNotaBeli.Text.Trim(); Tabel Supplier = new Tabel("Supplier", "inventory_tigger"); int baris = Supplier.getBs().Find("KodeSupplier", txtKodeSupplier.Text.Trim()); if (baris >= 0) { String noNotaBeli, kd, sqlStr; noNotaBeli = txtNoNotaBeli.Text.Trim(); kd = txtKodeSupplier.Text.Trim(); sqlStr = "Update NotaBeli SET KodeSupplier='{0}' where noNotaBeli='{1}'"; sqlStr = String.Format(sqlStr, kd, noNotaBeli); notaBeli.eksekusiSQL(sqlStr); baris = notaBeli.getBs().Find("noNotaBeli", noNotaBaru); notaBeli.getBs().Position = baris; } else { //MessageBox.Show("KodeSupplier : " + txtKodeSupplier.Text.Trim() + " tidak ada !!"); FormCariSupplier fcs = new FormCariSupplier(); fcs.ShowDialog(); txtKodeSupplier.Text = fcs.KodeSupplier; txtKodeSupplier.Focus(); } } }
private void txtKodeBaranag_Validated(object sender, EventArgs e) { Tabel Barang = new Tabel("barang", "Inventoryku"); int baris = Barang.getBs().Find("kodeBarang", txtKodeBaranag.Text.Trim()); if (baris >= 0) { Barang.getBs().Position = baris; txtNamaBarang.Text = ((DataRowView)Barang.getBs().Current).Row["namaBarang"].ToString(); txtHarga.Text = ((DataRowView)Barang.getBs().Current).Row["hargaJual"].ToString(); // current digunkan yaitu objek yang bisa diconvet yang dapat data rowview dan akhirnya punya rows txtQty.Focus(); } else { MessageBox.Show("kode : " + txtKodeBaranag.Text + "tidak ditemukan"); hapus(); } }
private void txtKodeBaranag_Validated(object sender, EventArgs e) { if (txtKodeBaranag.Text.Length > 0) { Tabel barang = new Tabel("barang", "inventory_tigger"); int brs = barang.getBs().Find("kodeBarang", txtKodeBaranag.Text.Trim()); if (brs >= 0) { barang.getBs().Position = brs; txtNamaBarang.Text = ((DataRowView)barang.getBs().Current).Row["namaBarang"].ToString(); txtHarga.Text = ((DataRowView)barang.getBs().Current).Row["hargaBeli"].ToString(); } else { MessageBox.Show("Kode : " + txtKodeBaranag.Text + " tidak ditemukan"); txtKodeBaranag.Text = ""; txtKodeBaranag.Focus(); } } }