public IHttpActionResult PostMA_SUCURSALES(MA_SUCURSALES mA_SUCURSALES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_SUCURSALES.Add(mA_SUCURSALES); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_SUCURSALESExists(mA_SUCURSALES.C_codigo)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_SUCURSALES.C_codigo }, mA_SUCURSALES)); }
public IHttpActionResult PutMA_SUCURSALES(string id, MA_SUCURSALES mA_SUCURSALES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_SUCURSALES.C_codigo) { return(BadRequest()); } db.Entry(mA_SUCURSALES).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_SUCURSALESExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_SUCURSALES(string id) { MA_SUCURSALES mA_SUCURSALES = db.MA_SUCURSALES.Find(id); if (mA_SUCURSALES == null) { return(NotFound()); } return(Ok(mA_SUCURSALES)); }
public IHttpActionResult DeleteMA_SUCURSALES(string id) { MA_SUCURSALES mA_SUCURSALES = db.MA_SUCURSALES.Find(id); if (mA_SUCURSALES == null) { return(NotFound()); } db.MA_SUCURSALES.Remove(mA_SUCURSALES); db.SaveChanges(); return(Ok(mA_SUCURSALES)); }