private void buttonUbah_Click(object sender, EventArgs e) { Supplier sup = new Supplier(textBoxIdSupplier.Text, textBoxNama.Text, textBoxAlamat.Text); // Panggil static method UbahData di class kategori string hasilUbah = Supplier.UbahData(sup); if (hasilUbah == "1") { MessageBox.Show("Data Supplier telah diubah.", "Informasi"); frmDaftar.FormDaftarSupplier_Load(sender, e); buttonKosongi_Click(sender, e); } else { MessageBox.Show("Gagal mengubah Supplier. Pesan kesalahan: " + hasilUbah); } }
private void buttonSimpan_Click(object sender, EventArgs e) { // Ciptakan objek yg akan ditambahkan Supplier pel = new Supplier(textBoxIdSupplier.Text, textBoxNama.Text, textBoxAlamat.Text); // Panggil static method TambahData di class kategori string hasilTambah = Supplier.TambahData(pel); if (hasilTambah == "1") { MessageBox.Show("Supplier telah tersimpan.", "Informasi"); frmDaftar.FormDaftarSupplier_Load(sender, e); FormTambahSupplier_Load(sender, e); } else { MessageBox.Show("Gagal menambah Supplier. Pesan kesalahan: " + hasilTambah); } }