public async Task <ActionResult <GrupoInvestigacion> > Post(GrupoInvestigacion item) { await _context.SaveChangesAsync(); _context.GrupoInvestigacion.Add(item); return(CreatedAtAction(nameof(GetGrupoInvestigacion), new { id = item.id }, item)); }
private void butActualizar_Click(object sender, EventArgs e) { String nombre = txtNombre.Text; String codigo = txtCodigo.Text; String ciudad = txtCiudad.Text; String clasificacion = txtClasificacion.Text; String articulos = txtArticulos.Text; String areaInvestigacion = txtArea.Text; String region = txtRegion.Text; GrupoInvestigacion nuevo = ventana.Buscar(codigo); if (nuevo == null) { MessageBox.Show("El codigo de los grupos no se puede modificar"); } else { var lista = articulos.Split(' ').Select(i => Int32.Parse(i)); List <int> art = new List <int>(); List <int> listaNueva = art.Union(lista).ToList <int>(); nuevo.Nombre = nombre; nuevo.Ciudad = ciudad; nuevo.Clasificacion = clasificacion; nuevo.ArtFrecuentados = listaNueva; nuevo.AreaInvestigacion = areaInvestigacion; nuevo.Region = region; ventana.ActualizarGrupo(nuevo); limpiar limpiarBox = new limpiar(); limpiarBox.borrarCampos(this); ventana.gMapControl1_Load(sender, e); } }
private void button1_Click(object sender, EventArgs e) { // Botón BuscarMapa string codigo = Microsoft.VisualBasic.Interaction.InputBox("Ingresar el codigo del grupo que desea buscar :"); GrupoInvestigacion a = Buscar(codigo); if (a == null) { MessageBox.Show("No existe el grupo que desea señalar"); } else { double x1 = a.x1; double x2 = a.x2; double y1 = a.y1; double y2 = a.y2; if (x1 != 0 && x2 != 0 && y1 != 0 && y2 != 0) { double x = (x1 - x2) + x2; double y = (y1 - y2) + y2; GMapMarker marker = new GMarkerGoogle(new PointLatLng(y, x), GMarkerGoogleType.yellow); marker.IsVisible = (true); marker.ToolTipMode = MarkerTooltipMode.OnMouseOver; marker.ToolTipText = string.Format("Nombre:\n {0} \n Codigo: \n {1}", a.Nombre, a.Codigo); overlay.Markers.Add(marker); gMapControl1.Overlays.Add(overlay); } } }
public async Task <IActionResult> Put(int id, GrupoInvestigacion item) { if (id != item.id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public void ActualizarGrupo(GrupoInvestigacion a) { modelo.ActualizarGrupo(a); MessageBox.Show("Grupo Actualizado"); }