Ejemplo n.º 1
0
        private void BtnNuevo_Click(object sender, RoutedEventArgs e)
        {
            AgregarCategoria agregarCategoria = new AgregarCategoria(0);

            agregarCategoria.ShowDialog();
            Cargar();
        }
Ejemplo n.º 2
0
        private void DgvCategoria_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int idCategoria;
            var item = (Categoria)dgvCategoria.SelectedItem;

            if (null == item)
            {
                return;
            }
            idCategoria = Convert.ToInt32(item.IdCatgoria);
            //Coloco 0 porque es uno nuevo
            AgregarCategoria agregarCategoria = new AgregarCategoria(idCategoria);

            agregarCategoria.ShowDialog();
            Cargar();
        }