private void pnl_CostCenter_Click(object sender, int intCostCenterId) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.cost_center cost_center = new cntrl.Curd.cost_center(); cost_centerViewSource.View.MoveCurrentTo(entity.db.app_cost_center.Where(x => x.id_cost_center == intCostCenterId).FirstOrDefault()); cost_center.app_cost_centerViewSource = cost_centerViewSource; cost_center.entity = entity; crud_modal.Children.Add(cost_center); }
private void btnNew_Click(object sender, RoutedEventArgs e) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.cost_center cost_center = new cntrl.Curd.cost_center(); app_cost_center app_cost_center = new app_cost_center(); entity.db.app_cost_center.Add(app_cost_center); cost_centerViewSource.View.MoveCurrentToLast(); cost_center.app_cost_centerViewSource = cost_centerViewSource; cost_center.entity = entity; crud_modal.Children.Add(cost_center); }