예제 #1
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataRowView dataRowView = (DataRowView)((Button)e.Source).DataContext;
                FormMember  formMember  = new FormMember("Edit", dataRowView[1].ToString());

                formMember.txtIdMember.Text   = dataRowView[1].ToString();
                formMember.txtNIK.Text        = dataRowView[2].ToString();
                formMember.txtNamaMember.Text = dataRowView[3].ToString();
                if (dataRowView[4].ToString() == "Laki-Laki")
                {
                    formMember.rdLaki.IsChecked = true;
                }
                else
                {
                    formMember.rdPerempuan.IsChecked = true;
                }
                formMember.txtNoTelp.Text = dataRowView[5].ToString();

                formMember.ShowDialog();

                RefreshDataGrid();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
예제 #2
0
        private void btnTambah_Click(object sender, RoutedEventArgs e)
        {
            FormMember formMember = new FormMember();

            formMember.ShowDialog();

            RefreshDataGrid();
        }