private void AgregaAsignatura(object sender, RoutedEventArgs e) { //bool hay = cbCur.SelectedValue != null; if (Utilidades.Validar(txtNom,txtCve) ) { AsignaturaBLL asignas = new AsignaturaBLL(); _asignatura = new Asignatura() { IDCurso = 1, //IDDocente = ((Docente)cbDoc.SelectedValue).ID, //IDLab = ((Laboratorio)cbLab.SelectedValue).ID, Nombre = txtNom.Text, Clave = txtCve.Text }; if (asignas.Agregar(_asignatura) != -1) { MessageBox.Show(this, "Asignatura Agregada, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK,MessageBoxImage.Information); this.cargaCombos(); Utilidades.Limpiar(txtCve, txtNom); } else MessageBox.Show(this, "Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK,MessageBoxImage.Error); } else MessageBox.Show(this, "No debe de haber campos vacios" , appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); }
private void cargaCombos() { CursoBLL cursos = new CursoBLL(); DocenteBLL docentes = new DocenteBLL(); AsignaturaBLL asignaturas = new AsignaturaBLL(); //cbCur.ItemsSource = cursos.ObtenerAll(); cbDisp.ItemsSource = asignaturas.ObtenerAll(); //cbCur2.ItemsSource = cursos.ObtenerAll(); }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { LaboratorioBLL labs = new LaboratorioBLL(); DocenteBLL docentes = new DocenteBLL(); AsignaturaBLL asignaturas = new AsignaturaBLL(); GrupoBLL grupos = new GrupoBLL(); cbLab.ItemsSource = labs.ObtenerAll().OrderBy(s => s.ID); cbDoc.ItemsSource = docentes.ObtenerAll().OrderBy(s => s.Nombre); cbMat.ItemsSource = asignaturas.ObtenerAll().OrderBy(s => s.Nombre); cbGrp.ItemsSource = grupos.ObtenerAll().OrderBy(s=>s.Nombre); this.inicializarCtrls(); }
private void Prueba(object sender, RoutedEventArgs e) { Imagen ventana = new Imagen("Ingenieria en sistemas"); AsignaturaBLL _asigaturas = new AsignaturaBLL(); Asignatura _asigna = _asigaturas.ObtenerAll().FirstOrDefault(p => p.ID == 1); AgregarControl(1,_asigna); }
private void EliminaAsignatura(object sender, RoutedEventArgs e) { AsignaturaBLL asignaturas = new AsignaturaBLL(); if (asignaturas.Eliminar(_asignatura)) { MessageBox.Show(this,"Asignatura Eliminada, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK,MessageBoxImage.Information); this.cargaCombos(); Utilidades.Limpiar(txtCve2, txtNom2); } else MessageBox.Show(this, "Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); }
private void GuardarCambios(object sender, RoutedEventArgs e) { if (Utilidades.Validar(txtNom2, txtCve2)) { AsignaturaBLL asignaturas = new AsignaturaBLL(); _asignatura.Nombre = txtNom2.Text; _asignatura.Clave = txtCve2.Text; //_asignatura.IDCurso = ((Curso)cbCur2.SelectedValue).ID; //_asignatura.IDDocente = ((Docente)cbDoc2.SelectedValue).ID; //_asignatura.IDLab = ((Laboratorio)cbLab2.SelectedValue).ID; if (asignaturas.Modificar(_asignatura)) { MessageBox.Show(this,"Asignatura Modificada, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK,MessageBoxImage.Information); this.cargaCombos(); Utilidades.Limpiar(txtCve2, txtNom2); } else MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK,MessageBoxImage.Error); }else MessageBox.Show(this, "No debe de contener campos vacios", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); }