public void Put(Arte Arte) { if (ApplicationDbContext.applicationDbContext.Arte.Count(e => e.Id == Arte.Id) == 0) { throw new NoEncontradoException("No he encontrado la entidad"); } ApplicationDbContext.applicationDbContext.Entry(Arte).State = EntityState.Modified; }
public IHttpActionResult PostArte(Arte Arte) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Arte = ArteService.Create(Arte); return(CreatedAtRoute("DefaultApi", new { id = Arte.Id }, Arte)); }
public IHttpActionResult GetArte(long id) { Arte Arte = ArteService.Get(id); if (Arte == null) { return(NotFound()); } return(Ok(Arte)); }
public Arte Delete(long id) { Arte Arte = ApplicationDbContext.applicationDbContext.Arte.Find(id); if (Arte == null) { throw new NoEncontradoException("No he encontrado la entidad"); } ApplicationDbContext.applicationDbContext.Arte.Remove(Arte); return(Arte); }
private void PressMotive(short motive) { ReasonId = motive; switch (motive) { case 5: Medidas.SetBackgroundResource(Resource.Drawable.ButtonPresses); Clausurado.SetBackgroundResource(Resource.Drawable.Blue_Button); Arrendamiento.SetBackgroundResource(Resource.Drawable.Blue_Button); Arte.SetBackgroundResource(Resource.Drawable.Blue_Button); Otros.SetBackgroundResource(Resource.Drawable.Blue_Button); break; case 6: Medidas.SetBackgroundResource(Resource.Drawable.Blue_Button); Clausurado.SetBackgroundResource(Resource.Drawable.ButtonPresses); Arrendamiento.SetBackgroundResource(Resource.Drawable.Blue_Button); Arte.SetBackgroundResource(Resource.Drawable.Blue_Button); Otros.SetBackgroundResource(Resource.Drawable.Blue_Button); break; case 7: Medidas.SetBackgroundResource(Resource.Drawable.Blue_Button); Clausurado.SetBackgroundResource(Resource.Drawable.Blue_Button); Arrendamiento.SetBackgroundResource(Resource.Drawable.ButtonPresses); Arte.SetBackgroundResource(Resource.Drawable.Blue_Button); Otros.SetBackgroundResource(Resource.Drawable.Blue_Button); break; case 8: Medidas.SetBackgroundResource(Resource.Drawable.Blue_Button); Clausurado.SetBackgroundResource(Resource.Drawable.Blue_Button); Arrendamiento.SetBackgroundResource(Resource.Drawable.Blue_Button); Arte.SetBackgroundResource(Resource.Drawable.ButtonPresses); Otros.SetBackgroundResource(Resource.Drawable.Blue_Button); break; case 9: Medidas.SetBackgroundResource(Resource.Drawable.Blue_Button); Clausurado.SetBackgroundResource(Resource.Drawable.Blue_Button); Arrendamiento.SetBackgroundResource(Resource.Drawable.Blue_Button); Arte.SetBackgroundResource(Resource.Drawable.Blue_Button); Otros.SetBackgroundResource(Resource.Drawable.ButtonPresses); break; } }
public IHttpActionResult PutArte(long id, Arte Arte) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != Arte.Id) { return(BadRequest()); } try { ArteService.Put(Arte); } catch (NoEncontradoException) { return(NotFound()); } return(StatusCode(HttpStatusCode.NoContent)); }
public Arte Create(Arte Arte) { return(ApplicationDbContext.applicationDbContext.Arte.Add(Arte)); }
public void Put(Arte Arte) { ArteReposistory.Put(Arte); }
public Arte Create(Arte Arte) { return(ArteReposistory.Create(Arte)); }