private void btnAceptar_Click(object sender, EventArgs e) { try { validarEntidad(); AlumnoService s = new AlumnoService(); if (this.alumno.Id != 0) { s.Update(alumno); } else { s.Insert(alumno); } CommonHelper.ShowInfo("Alumno guardado con éxito."); this.DialogResult = DialogResult.OK; } catch (WarningException ex) { CommonHelper.ShowWarning(ex.Message); } catch (Exception ex) { CommonHelper.ShowError(ex.Message); } }
public async Task <ActionResult> Update(int id, AlumnoUpdateDto model) { if (_AlumnoService.Existencia(id) == true) { await _AlumnoService.Update(id, model); return(NoContent()); } else { return(NotFound()); } }