Ejemplo n.º 1
0
        private void AgregaGrupo(object sender, RoutedEventArgs e)
        {
            if (Utilidades.Validar(txtNom) && !string.IsNullOrEmpty(cbCar1.Text))
            {
                GrupoBLL grupos = new GrupoBLL();
                //var x = (Curso)cbCurso.SelectedValue;

                grup = new Grupo()
                {
                    Nombre = txtNom.Text,
                    Carrera = cbCar1.Text,
                    IDCurso = 1
                };

                if (grupos.Agregar(grup) != -1)
                {
                    MessageBox.Show(this, "Grupo Agregado, OK ", appInfo.AssemblyProduct,
                        MessageBoxButton.OK, MessageBoxImage.Information);
                    this.cargaCombos();
                    Utilidades.Limpiar(txtNom);
                }
                else
                    MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct,
                        MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
                MessageBox.Show(this,"No debe haber campos vacios", appInfo.AssemblyProduct,
                        MessageBoxButton.OK, MessageBoxImage.Information);
        }