コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id);

            db.OOADClanoviTimas.Remove(oOADClanoviTima);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #4
0
 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));
 }
コード例 #5
0
        public IHttpActionResult GetOOADClanoviTima(int id)
        {
            OOADClanoviTima oOADClanoviTima = db.OOADClanoviTimas.Find(id);

            if (oOADClanoviTima == null)
            {
                return(NotFound());
            }

            return(Ok(oOADClanoviTima));
        }
コード例 #6
0
        public ActionResult Create([Bind(Include = "Korisnik,Tim")] OOADClanoviTima oOADClanoviTima)
        {
            if (ModelState.IsValid)
            {
                db.OOADClanoviTimas.Add(oOADClanoviTima);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(oOADClanoviTima));
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        // 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));
        }