예제 #1
0
 void BtnCrear_Click(object sender, EventArgs e)
 {
     estudiante = new Estudiante();
     estudiante.Calificacion  = Convert.ToInt32(edtCalifDeseada.Text);
     estudiante.Nombre        = edtNombre.Text;
     estudiante.NumeroControl = edtNumControl.Text;
     repo.AgregarEstudiante(estudiante);
     Finish();
 }
예제 #2
0
        private void BtnCrear_Click(object sender, EventArgs e)
        {
            var newEstudiante = new Estudiante()
            {
                Nombre        = NombreText.Text,
                NumeroControl = NumeroCText.Text,
                Calificacion  = Convert.ToInt32(CalifText.Text)
            };

            repo.AgregarEstudiante(newEstudiante);
            Finish();
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            EstudiantesRepository.AgregarEstudiante(Estudiante);

            /*  _context.Estudiante.Add(Estudiante);
             * await _context.SaveChangesAsync();
             * /=*/
            return(RedirectToPage("./Index"));
        }