private void btnSimpan_Click(object sender, EventArgs e) { if (isNewData) { pelanggan = new tbl_pelanggan(); } pelanggan.kd_pelanggan = textBox1.Text; pelanggan.namapelanggan = textBox2.Text; pelanggan.alamat = textBox3.Text; pelanggan.notlp = textBox4.Text; int result = 0; if (isNewData) { result = controller.Create(pelanggan); if (result > 0) { OnCreate(pelanggan); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox1.Focus(); } } else { result = controller.Update(pelanggan); if (result > 0) { OnUpdate(pelanggan); this.Close(); } } }