예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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"));
        }
예제 #4
0
        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"));
        }
예제 #5
0
        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"));
        }
예제 #6
0
        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));
        }
예제 #7
0
        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));
        }