private void pnl_Bank_Click(object sender, int idBank) { crud_modal.Visibility = System.Windows.Visibility.Visible; cntrl.bank objBank = new cntrl.bank(); bankViewSource.View.MoveCurrentTo(entity.db.app_bank.Where(x => x.id_bank == idBank).FirstOrDefault()); objBank.app_bankViewSource = bankViewSource; objBank._entity = entity; crud_modal.Children.Add(objBank); }
private void btnNew_Click(object sender, RoutedEventArgs e) { crud_modal.Visibility = System.Windows.Visibility.Visible; cntrl.bank objBank = new cntrl.bank(); app_bank app_bank = new app_bank(); entity.db.app_bank.Add(app_bank); bankViewSource.View.MoveCurrentToLast(); objBank.app_bankViewSource = bankViewSource; objBank._entity = entity; crud_modal.Children.Add(objBank); }