public async Task <IActionResult> PutEventConfirmation([FromRoute] int id, [FromBody] EventConfirmation eventConfirmation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != eventConfirmation.Id) { return(BadRequest()); } _context.Entry(eventConfirmation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventConfirmationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEventInfo(int id, EventInfo eventInfo) { if (id != eventInfo.Id) { return(BadRequest()); } _context.Entry(eventInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,CityName,CityDescription,Population,Lada")] City city) { if (ModelState.IsValid) { db.Entry(city).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(city)); }
public ActionResult Edit([Bind(Include = "Id,NombreEvento,Seguridad,FechaEventoInicio,FechaEventoFinal")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Edit([Bind(Include = "Id,CiudadName,CiudadDescription,PostalCode")] Ciudad ciudad) { if (ModelState.IsValid) { db.Entry(ciudad).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ciudad)); }
public ActionResult Edit([Bind(Include = "ID,Nombre,Capacidad,Invitado,Fecha,Negocio")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Edit([Bind(Include = "Id,nombreevento,fechaevento,artistas,comida")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Edit([Bind(Include = "Id,Nombre,CodigoPostal")] City city) { if (ModelState.IsValid) { db.Entry(city).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(city)); }
public ActionResult Edit([Bind(Include = "Title,description,StartDate,StartTime,EndDate,EndTime,Location,eventType,OrganizerName,ContactIndo,MaxTickets,AvailableTickets")] Event eventt) { if (ModelState.IsValid) { db.Entry(eventt).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eventt)); }
public ActionResult Edit([Bind(Include = "Id,Nombre,Description,Fecha,Organisador,CityId")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Citys, "Id", "Nombre", @event.CityId); return(View(@event)); }
public ActionResult Edit([Bind(Include = "Id,EventName,EventDescription,Fecha,Quota,Availability,CityId")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Cities, "Id", "CityName", @event.CityId); return(View(@event)); }
public ActionResult Edit([Bind(Include = "Id,Nombre,Descripcion,Fecha,CiudadesId")] Evento evento) { if (ModelState.IsValid) { db.Entry(evento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CiudadesId = new SelectList(db.Ciudads, "Id", "CiudadName", evento.CiudadesId); return(View(evento)); }
public ActionResult Edit([Bind(Include = "id,Title,Date,Place,CityId")] Evento evento) { if (ModelState.IsValid) { db.Entry(evento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Cities, "id", "Name", evento.CityId); return(View(evento)); }
public ActionResult Edit([Bind(Include = "Id,Title,Place,TypeEvent,DayEvent,Capacity,CityId")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Citys, "Id", "Name", "PostalCode", @event.CityId); return(View(@event)); }
public void InsertOrUpdate(Event ev) { if (ev.Id == 0) { // New entity context.Events.Add(ev); } else { // Existing entity context.Entry(ev).State = System.Data.Entity.EntityState.Modified; } }
public async Task <IActionResult> PutEvents(int id, [FromBody] Event events) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != events.Id) { return(BadRequest(Response)); } //events.EventUser = _userManager.GetUserId(User); _context.Entry(events).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public virtual void Update(TEntity entityToUpdate) { dbSet.Attach(entityToUpdate); _db.Entry(entityToUpdate).State = EntityState.Modified; }