public async Task <IHttpActionResult> PutTiposServiciosDetalle(int id, TiposServiciosDetalle tiposServiciosDetalle) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tiposServiciosDetalle.TipoServDeta_ID) { return(BadRequest()); } db.Entry(tiposServiciosDetalle).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TiposServiciosDetalleExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> DeleteConfirmed(int id) { TiposServiciosDetalle tiposServiciosDetalle = await db.TiposServiciosDetalles.FindAsync(id); db.TiposServiciosDetalles.Remove(tiposServiciosDetalle); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <IHttpActionResult> GetTiposServiciosDetalle(int id) { TiposServiciosDetalle tiposServiciosDetalle = await db.TiposServiciosDetalles.FindAsync(id); if (tiposServiciosDetalle == null) { return(NotFound()); } return(Ok(tiposServiciosDetalle)); }
public async Task <IHttpActionResult> PostTiposServiciosDetalle(TiposServiciosDetalle tiposServiciosDetalle) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TiposServiciosDetalles.Add(tiposServiciosDetalle); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = tiposServiciosDetalle.TipoServDeta_ID }, tiposServiciosDetalle)); }
public async Task <ActionResult> Edit([Bind(Include = "TipoServDeta_ID,TipoServ_ID,TipoServDeta_Nombre,TipoServDeta_Descripcion,TipoServDeta_Precio")] TiposServiciosDetalle tiposServiciosDetalle) { if (ModelState.IsValid) { db.Entry(tiposServiciosDetalle).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.TipoServ_ID = new SelectList(db.TiposServicios, "TipoServ_ID", "TipoServ_Nombre", tiposServiciosDetalle.TipoServ_ID); return(View(tiposServiciosDetalle)); }
public async Task <IHttpActionResult> DeleteTiposServiciosDetalle(int id) { TiposServiciosDetalle tiposServiciosDetalle = await db.TiposServiciosDetalles.FindAsync(id); if (tiposServiciosDetalle == null) { return(NotFound()); } db.TiposServiciosDetalles.Remove(tiposServiciosDetalle); await db.SaveChangesAsync(); return(Ok(tiposServiciosDetalle)); }
// GET: TiposServiciosDetalles/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TiposServiciosDetalle tiposServiciosDetalle = await db.TiposServiciosDetalles.FindAsync(id); if (tiposServiciosDetalle == null) { return(HttpNotFound()); } return(View(tiposServiciosDetalle)); }
// GET: TiposServiciosDetalles/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TiposServiciosDetalle tiposServiciosDetalle = await db.TiposServiciosDetalles.FindAsync(id); if (tiposServiciosDetalle == null) { return(HttpNotFound()); } ViewBag.TipoServ_ID = new SelectList(db.TiposServicios, "TipoServ_ID", "TipoServ_Nombre", tiposServiciosDetalle.TipoServ_ID); return(View(tiposServiciosDetalle)); }