public IHttpActionResult PutSTATUS_STAVKE_DNEVNOG_REDA(int id, STATUS_STAVKE_DNEVNOG_REDA sTATUS_STAVKE_DNEVNOG_REDA) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sTATUS_STAVKE_DNEVNOG_REDA.ID) { return(BadRequest()); } db.Entry(sTATUS_STAVKE_DNEVNOG_REDA).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!STATUS_STAVKE_DNEVNOG_REDAExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostSTATUS_STAVKE_DNEVNOG_REDA(STATUS_STAVKE_DNEVNOG_REDA sTATUS_STAVKE_DNEVNOG_REDA) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.STATUS_STAVKE_DNEVNOG_REDA.Add(sTATUS_STAVKE_DNEVNOG_REDA); try { db.SaveChanges(); } catch (DbUpdateException) { if (STATUS_STAVKE_DNEVNOG_REDAExists(sTATUS_STAVKE_DNEVNOG_REDA.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = sTATUS_STAVKE_DNEVNOG_REDA.ID }, sTATUS_STAVKE_DNEVNOG_REDA)); }
public async Task <ActionResult> Edit(int id, STATUS_STAVKE_DNEVNOG_REDA Emp) { HttpResponseMessage responseMessage = await client.PutAsJsonAsync(url + "/" + id, Emp); if (responseMessage.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(RedirectToAction("Error")); }
public async Task <ActionResult> Create(STATUS_STAVKE_DNEVNOG_REDA tipGlasa) { HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, tipGlasa); if (responseMessage.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(RedirectToAction("Error")); }
public async Task <ActionResult> Delete(int id, STATUS_STAVKE_DNEVNOG_REDA tipGlasa) { HttpResponseMessage responseMessage = await client.DeleteAsync(url + "/" + id); if (responseMessage.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(RedirectToAction("Error")); }
public IHttpActionResult GetSTATUS_STAVKE_DNEVNOG_REDA(int id) { STATUS_STAVKE_DNEVNOG_REDA sTATUS_STAVKE_DNEVNOG_REDA = db.STATUS_STAVKE_DNEVNOG_REDA.Find(id); if (sTATUS_STAVKE_DNEVNOG_REDA == null) { return(NotFound()); } return(Ok(sTATUS_STAVKE_DNEVNOG_REDA)); }
public IHttpActionResult DeleteSTATUS_STAVKE_DNEVNOG_REDA(int id) { STATUS_STAVKE_DNEVNOG_REDA sTATUS_STAVKE_DNEVNOG_REDA = db.STATUS_STAVKE_DNEVNOG_REDA.Find(id); if (sTATUS_STAVKE_DNEVNOG_REDA == null) { return(NotFound()); } db.STATUS_STAVKE_DNEVNOG_REDA.Remove(sTATUS_STAVKE_DNEVNOG_REDA); db.SaveChanges(); return(Ok(sTATUS_STAVKE_DNEVNOG_REDA)); }