private void BtnNuevo_Click(object sender, RoutedEventArgs e) { SubCategoria subcat = new SubCategoria(); subcat.TipoAccion = 0; subcat.ShowDialog(); MostrarCategorias(); }
private void BtnActualizar_Click(object sender, RoutedEventArgs e) { if (dgCategorias.SelectedItem != null) { object item = dgCategorias.SelectedItem; string id = (dgCategorias.SelectedCells[2].Column.GetCellContent(item) as TextBlock).Text; SubCategoria subcat = new SubCategoria(); subcat.IdCategoria = id; subcat.NombreCategoria = (dgCategorias.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text; subcat.DescripcionCategoria = (dgCategorias.SelectedCells[1].Column.GetCellContent(item) as TextBlock).Text; subcat.TipoAccion = 1; subcat.ShowDialog(); MostrarCategorias(); //MessageBox.Show(id.ToString()); } }
private void BtnMantenimiento_Click(object sender, RoutedEventArgs e) { SubCategoria subcategoria1 = new SubCategoria(); subcategoria1.ShowDialog(); }