Beispiel #1
0
        public IHttpActionResult PutCYCCycleMST(long id, CYCCycleMST cYCCycleMST)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cYCCycleMST.CYCCycleMSTId)
            {
                return(BadRequest());
            }

            db.Entry(cYCCycleMST).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CYCCycleMSTExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult GetCYCCycleMST(long id)
        {
            CYCCycleMST cYCCycleMST = db.CYCCycleMSTs.Find(id);

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

            return(Ok(cYCCycleMST));
        }
Beispiel #3
0
        public IHttpActionResult PostCYCCycleMST(CYCCycleMST cYCCycleMST)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CYCCycleMSTs.Add(cYCCycleMST);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = cYCCycleMST.CYCCycleMSTId }, cYCCycleMST));
        }
Beispiel #4
0
        public IHttpActionResult DeleteCYCCycleMST(long id)
        {
            CYCCycleMST cYCCycleMST = db.CYCCycleMSTs.Find(id);

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

            db.CYCCycleMSTs.Remove(cYCCycleMST);
            db.SaveChanges();

            return(Ok(cYCCycleMST));
        }