private void btnEdit_Click(object sender, RoutedEventArgs e) { try { DataRowView dataRowView = (DataRowView)((Button)e.Source).DataContext; FormSupplier formSupplier = new FormSupplier("Edit", Convert.ToInt32(dataRowView[1].ToString())); formSupplier.txtNamaSupplier.Text = dataRowView[2].ToString(); formSupplier.txtNamaKontak.Text = dataRowView[3].ToString(); formSupplier.txtAlamat.Text = dataRowView[4].ToString(); formSupplier.txtNoTelp.Text = dataRowView[5].ToString(); formSupplier.txtBank.Text = dataRowView[6].ToString(); formSupplier.txtNoRekening.Text = dataRowView[7].ToString(); formSupplier.txtEmail.Text = dataRowView[8].ToString(); formSupplier.txtKeterangan.Text = dataRowView[9].ToString(); formSupplier.ShowDialog(); RefreshDataGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void button6_Click(object sender, EventArgs e) { FormSupplier openform = new FormSupplier(this); openform.Show(); this.Hide(); }
private void btnTambah_Click(object sender, RoutedEventArgs e) { FormSupplier formSupplier = new FormSupplier(); formSupplier.ShowDialog(); RefreshDataGrid(); }