private void EstudianteForm_Load(object sender, EventArgs e)
 {
     this.misDatos = DatosEstudiante.AbrirDatosEstudiante();
     this.parentezcoComboBox.BeginUpdate();
     this.parentezcoComboBox.DataSource    = this.misDatos.ObtenerTiposDeApoderados();
     this.parentezcoComboBox.DisplayMember = "descripcion";
     this.parentezcoComboBox.ValueMember   = "id_tipoapoderado";
     this.parentezcoComboBox.EndUpdate();
     if (this.Alumno != null)
     {
         this.rutEstudianteTextBox.Text       = this.Alumno.RutEstudiante;
         this.nombreEstudianteTextBox.Text    = Alumno.Nombre;
         this.apellidosEstudianteTextBox.Text = this.Alumno.Apellidos;
         this.rutApoderadoTextBox.Text        = this.Alumno.Apoderado.Rut;
         this.nombreApoderadoTextBox.Text     = this.Alumno.Apoderado.Nombre;
         this.apellidosApoderadoTextBox.Text  = this.Alumno.Apoderado.Apellidos;
         this.emailTextBox.Text       = this.Alumno.Apoderado.Email;
         this.parentezcoComboBox.Text = this.Alumno.Apoderado.Tipo;
     }
     else
     {
         this.Alumno = new Estudiante();
         this.rutEstudianteTextBox.Text       = string.Empty;
         this.nombreEstudianteTextBox.Text    = string.Empty;
         this.apellidosEstudianteTextBox.Text = string.Empty;
         this.rutApoderadoTextBox.Text        = string.Empty;
         this.nombreApoderadoTextBox.Text     = string.Empty;
         this.apellidosApoderadoTextBox.Text  = string.Empty;
         this.emailTextBox.Text = string.Empty;
         this.parentezcoComboBox.SelectedIndex = 0;
     }
     this.rutEstudianteTextBox.Focus();
 }
        public async Task <IActionResult> Edit(int id, [Bind("IdEstudiante,Nombre,Apellido,Activo,Carrera")] DatosEstudiante datosEstudiante)
        {
            if (id != datosEstudiante.IdEstudiante)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(datosEstudiante);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DatosEstudianteExists(datosEstudiante.IdEstudiante))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(datosEstudiante));
        }
Exemple #3
0
        private void listadoDataGridView_SelectionChanged(object sender, EventArgs e)
        {
            DataGridViewRow myRow = this.listadoDataGridView.CurrentRow;

            if (myRow == null)
            {
                return;
            }
            this.idCliente = int.Parse(myRow.Cells[0].Value.ToString());
            this.nombreCursoTextBox.Text        = myRow.Cells[1].Value.ToString();
            this.establecimientoTextBox.Text    = myRow.Cells[2].Value.ToString();
            this.representanteTextBox.Tag       = myRow.Cells[3].Value.ToString();
            this.representanteTextBox.Text      = myRow.Cells[4].Value.ToString();
            this.tipoRepresentanteComboBox.Text = myRow.Cells[6].Value.ToString();
            this.habilitarCheckBox.Checked      = (myRow.Cells[8].Value.ToString() == "Si" ? true : false);
            this.emailTextBox.Text = (string.IsNullOrEmpty(myRow.Cells[9].Value.ToString())?string.Empty: myRow.Cells[9].Value.ToString());
            DatosEstudiante datosEstudiantes = DatosEstudiante.AbrirDatosEstudiante();

            this.alumnosDataTable = datosEstudiantes.ObtenerNominaDeCurso(this.idCliente);
            this.alumnosDataGridView.DataSource = null;
            this.alumnosDataGridView.DataSource = alumnosDataTable;
            this.OcultarColumnasAlumnos();
            if (this.alumnosDataGridView.Rows.Count > 0)
            {
                this.alumnosDataGridView.Rows[0].Selected = true;
                this.alumnosDataGridView.CurrentCell      = this.alumnosDataGridView.Rows[0].Cells[0];
            }
        }
 private void EstadoDelCursoForm_Load(object sender, EventArgs e)
 {
     this.misDatos = DatosEstudiante.AbrirDatosEstudiante();
     this.MostrarDatosCurso();
     this.MostrarProducto();
     this.MostrarInfoDePago();
 }
        public async Task <IActionResult> Create([Bind("IdEstudiante,Nombre,Apellido,Activo,Carrera")] DatosEstudiante datosEstudiante)
        {
            if (ModelState.IsValid)
            {
                _context.Add(datosEstudiante);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(datosEstudiante));
        }
Exemple #6
0
 public static Estudiante GuardarEstudianteNegocio2(Estudiante estudiante)
 {
     //Logica de negocio
     if (estudiante.Cedula != " ")
     {
         return(DatosEstudiante.GuardarEstudianteDatos2(estudiante));
     }
     else
     {
         return(null);
     }
 }
Exemple #7
0
        private void PrincipalClienteForm_Load(object sender, EventArgs e)
        {
            DatosEstudiante misDatos    = DatosEstudiante.AbrirDatosEstudiante();
            DataTable       myDataTable = misDatos.ObtenerInformacionEstudiante(Usuario.RutEstudiante);

            if (myDataTable.Rows.Count.Equals(0))
            {
                return;
            }
            DataRow myRow = myDataTable.Rows[0];

            this.usuarioLabel.Text       = myRow["Nombre_apoderado"].ToString() + "   (" + myRow["Parentezco"].ToString() + ")";
            this.estudianteLabel.Text    = (Usuario.Tipo.Equals(9) ? "Apoderado" : "Representante") + " de " + myRow["Nombre_estudiante"].ToString();
            this.cursoLabel.Text         = (Usuario.Tipo.Equals(9) ? "Alumno" : "Representante") + " del curso " + myRow["Curso"].ToString() + " del establecimiento " + myRow["Establecimiento"].ToString();
            this.representanteLabel.Text = "Representante del curso: " + myRow["Representante"].ToString() + "  (" + myRow["Cargo"].ToString();
        }
        /// <summary>
        /// ViewResult para pocesar los datos ingresados en el formulario
        /// del estudiante, este será implementado en el action del submit del fomulario
        /// en la vista CapturarDatosEstudiante
        /// </summary>
        /// <returns>
        /// Encapsulamiento de los datos capturados siguiendo el model DatosEstudiante
        /// </returns>
        public ViewResult ProcesarFormularioEstudiante()
        {
            DatosEstudiante       registroEstudiante     = new DatosEstudiante();
            OperacionesEstudiante controladorOperaciones = new OperacionesEstudiante();

            string nombreEstudiante   = "";
            string apellidoEstudiante = "";
            int    nota1 = 0;
            int    nota2 = 0;
            int    nota3 = 0;
            int    nota4 = 0;

            try
            {
                System.Diagnostics.Debug.WriteLine("************************************");
                System.Diagnostics.Debug.WriteLine("************************************");
                System.Diagnostics.Debug.WriteLine("Procesando el request: " + Request.Form.ToString());
                System.Diagnostics.Debug.WriteLine("************************************");
                System.Diagnostics.Debug.WriteLine("************************************");
                //*****************************************************
                //*****************************************************
                nombreEstudiante   = Request.Form["txt_Nombre"].ToString();
                apellidoEstudiante = Request.Form["txt_Apellido"].ToString();
                nota1 = Convert.ToInt32(Request.Form["txt_Nota1"].ToString());
                nota2 = Convert.ToInt32(Request.Form["txt_Nota2"].ToString());
                nota3 = Convert.ToInt32(Request.Form["txt_Nota3"].ToString());
                nota4 = Convert.ToInt32(Request.Form["txt_Nota4"].ToString());
                //*****************************************************
                //*****************************************************
                //realizando las operaciones necesarias

                double valorNota1     = controladorOperaciones.CalcularNotaPrimerCorte(nota1);
                double valorNota2     = controladorOperaciones.CalcularNotaSegundoCorte(nota2);
                double valorNota3     = controladorOperaciones.CalcularNotaTercerCorte(nota3);
                double valorNota4     = controladorOperaciones.CalcularNotaCuartoCorte(nota4);
                double valorNotaTotal =
                    controladorOperaciones.CalcularNotaTotal(valorNota1, valorNota2, valorNota3, valorNota4);


                ViewData["ValorNota1"] = nota1;
                ViewData["ValorNota2"] = nota2;
                ViewData["ValorNota3"] = nota3;
                ViewData["ValorNota4"] = nota4;



                //Encapsulamos
                registroEstudiante.Nombre    = nombreEstudiante;
                registroEstudiante.Apellido  = apellidoEstudiante;
                registroEstudiante.Nota1     = valorNota1;
                registroEstudiante.Nota2     = valorNota2;
                registroEstudiante.Nota3     = valorNota3;
                registroEstudiante.Nota4     = valorNota4;
                registroEstudiante.NotaTotal = valorNotaTotal;

                //*****************************************************
                //*****************************************************
                System.Diagnostics.Debug.WriteLine("************************************");
                System.Diagnostics.Debug.WriteLine("************************************");
            }

            catch (Exception errorProcesamientoControlador)
            {
                System.Diagnostics.Debug.WriteLine("Error en el controlador: " + errorProcesamientoControlador.Message);
                System.Diagnostics.Debug.WriteLine("Error detallado: " + errorProcesamientoControlador.ToString());
            }

            return(View("MostrarDatosEstudiante", registroEstudiante));
        }
Exemple #9
0
 public static Estudiante GetEstudianteporCedula(string cedula)
 {
     return(DatosEstudiante.GetEstudianteporCedula(cedula));
 }
Exemple #10
0
 public static List <Estudiante> DevolverListaEstudiantesBuscarNegocio(string cadena)
 {
     return(DatosEstudiante.DevolverListaEstudianteDatosBuscar(cadena));
 }
Exemple #11
0
 public static List <Estudiante> DevolverListaEstudiantesNegocio()
 {
     return(DatosEstudiante.DevolverListaEstudianteDatos());
 }