Ejemplo n.º 1
0
 private void AgregaDocente(object sender, RoutedEventArgs e)
 {
     if (Utilidades.Validar(txtNom, txtDes))
     {
         DocenteBLL docentes = new DocenteBLL();
         _docente = new Docente()
         {
             Nombre = txtNom.Text,
             Descripcion = txtDes.Text,
             RutaImg = almacenaImagen(txtNom.Text)
         };
         if (docentes.Agregar(_docente) != -1)
         {
             MessageBox.Show(this, "Docente Agregado, OK ", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
             this.CargaDocentes();
             Utilidades.Limpiar(txtDes, txtNom);
             imgFoto2.Source = new BitmapImage(new Uri("Imagenes\\MrX.jpg", UriKind.RelativeOrAbsolute));
             nomImg = string.Empty;
         }
         else
             MessageBox.Show(this, "Se produjo un Error, Fail", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else MessageBox.Show(this,"No debe haber campos vacios", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Error);
 }
Ejemplo n.º 2
0
        public IHttpActionResult GetUserByName(string username)
        {
            var respuesta = new DocenteBLL().getDocentes(username);

            if (respuesta != null)
            {
                return(Ok(respuesta));
            }
            return(NotFound());
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        public IHttpActionResult Create(DocenteDTO model)
        {
            ResponseDTO result = new DocenteBLL().Insertar(model);

            return(Ok(result));
        }
Ejemplo n.º 6
0
        private void GuardarCambios(object sender, RoutedEventArgs e)
        {
            if (Utilidades.Validar(txtNom2, txtDes2))
            {
                DocenteBLL docentes = new DocenteBLL();
                _docente.Nombre = txtNom2.Text;
                _docente.Descripcion = txtDes2.Text;
                if (FotoBytex != null)
                    _docente.RutaImg = almacenaImagen(_docente.Nombre);

                if (docentes.Modificar(_docente))
                {
                    MessageBox.Show(this,"Docente Modificado Correctamente", appInfo.AssemblyProduct,
                        MessageBoxButton.OK,MessageBoxImage.Information);
                    this.CargaDocentes();
                    Utilidades.Limpiar(txtDes2, txtNom2);
                    imgFoto2.Source = new BitmapImage(new Uri("Imagenes\\MrX.jpg", UriKind.RelativeOrAbsolute));
                    nomImg = string.Empty;
                }
                else
                    MessageBox.Show(this, "Se produjo un error", appInfo.AssemblyProduct,
                        MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else MessageBox.Show(this, "No debe haber campos vacios", appInfo.AssemblyProduct,
                        MessageBoxButton.OK, MessageBoxImage.Error);
        }
Ejemplo n.º 7
0
 private void EliminaDocente(object sender, RoutedEventArgs e)
 {
     DocenteBLL docentes = new DocenteBLL();
     if (docentes.Eliminar(_docente))
     {
         MessageBox.Show(this, "Docente Eliminado, OK ", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
         this.CargaDocentes();
         Utilidades.Limpiar(txtNom2, txtDes2);
     }
     else
         MessageBox.Show(this, "Se produjo un Error, Fail", appInfo.AssemblyProduct,
                 MessageBoxButton.OK, MessageBoxImage.Information);
 }
Ejemplo n.º 8
0
 private void CargaDocentes()
 {
     DocenteBLL docentes = new DocenteBLL();
     cbDisp.ItemsSource = docentes.ObtenerAll();
 }