public IHttpActionResult PostOOADClanoviTima(OOADClanoviTima oOADClanoviTima) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.OOADClanoviTimas.Add(oOADClanoviTima); try { db.SaveChanges(); } catch (DbUpdateException) { if (OOADClanoviTimaExists(oOADClanoviTima.Korisnik)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = oOADClanoviTima.Korisnik }, oOADClanoviTima)); }
public IHttpActionResult PutOOADClanoviTima(int id, OOADClanoviTima oOADClanoviTima) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != oOADClanoviTima.Korisnik) { return(BadRequest()); } db.Entry(oOADClanoviTima).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!OOADClanoviTimaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id); db.OOADClanoviTimas.Remove(oOADClanoviTima); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Korisnik,Tim")] OOADClanoviTima oOADClanoviTima) { if (ModelState.IsValid) { db.Entry(oOADClanoviTima).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(oOADClanoviTima)); }
public IHttpActionResult GetOOADClanoviTima(int id) { OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id); if (oOADClanoviTima == null) { return(NotFound()); } return(Ok(oOADClanoviTima)); }
public ActionResult Create([Bind(Include = "Korisnik,Tim")] OOADClanoviTima oOADClanoviTima) { if (ModelState.IsValid) { db.OOADClanoviTimas.Add(oOADClanoviTima); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(oOADClanoviTima)); }
public IHttpActionResult DeleteOOADClanoviTima(int id) { OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id); if (oOADClanoviTima == null) { return(NotFound()); } db.OOADClanoviTimas.Remove(oOADClanoviTima); db.SaveChanges(); return(Ok(oOADClanoviTima)); }
// GET: OOADClanoviTimas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id); if (oOADClanoviTima == null) { return(HttpNotFound()); } return(View(oOADClanoviTima)); }