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(); }
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(); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } EstudiantesRepository.AgregarEstudiante(Estudiante); /* _context.Estudiante.Add(Estudiante); * await _context.SaveChangesAsync(); * /=*/ return(RedirectToPage("./Index")); }