public IHttpActionResult PutXL_DANG_KY_PHE_DUYET(int id, XL_DANG_KY_PHE_DUYET xL_DANG_KY_PHE_DUYET)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != xL_DANG_KY_PHE_DUYET.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult GetXL_DANG_KY_PHE_DUYET(int id)
        {
            XL_DANG_KY_PHE_DUYET xL_DANG_KY_PHE_DUYET = db.XL_DANG_KY_PHE_DUYET.Find(id);

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

            return(Ok(xL_DANG_KY_PHE_DUYET));
        }
Beispiel #3
0
        public IHttpActionResult PostXL_DANG_KY_PHE_DUYET(XL_DANG_KY_PHE_DUYET xL_DANG_KY_PHE_DUYET)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.XL_DANG_KY_PHE_DUYET.Add(xL_DANG_KY_PHE_DUYET);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = xL_DANG_KY_PHE_DUYET.ID }, xL_DANG_KY_PHE_DUYET));
        }
        public IHttpActionResult DeleteXL_DANG_KY_PHE_DUYET(int id)
        {
            XL_DANG_KY_PHE_DUYET xL_DANG_KY_PHE_DUYET = db.XL_DANG_KY_PHE_DUYET.Find(id);

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

            db.XL_DANG_KY_PHE_DUYET.Remove(xL_DANG_KY_PHE_DUYET);
            db.SaveChanges();

            return(Ok(xL_DANG_KY_PHE_DUYET));
        }
        public IHttpActionResult PostXL_DANG_KY_PHE_DUYET(XL_DANG_KY_PHE_DUYET xL_DANG_KY_PHE_DUYET)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            XL_DANG_KY_PHE_DUYET newpheduyet = new XL_DANG_KY_PHE_DUYET();

            newpheduyet.MA_PHE_DUYET    = xL_DANG_KY_PHE_DUYET.MA_PHE_DUYET;
            newpheduyet.NGUOI_PHE_DUYET = xL_DANG_KY_PHE_DUYET.NGUOI_PHE_DUYET;
            newpheduyet.TRUC_THUOC      = xL_DANG_KY_PHE_DUYET.TRUC_THUOC;
            newpheduyet.GHI_CHU         = xL_DANG_KY_PHE_DUYET.GHI_CHU;
            db.XL_DANG_KY_PHE_DUYET.Add(newpheduyet);
            db.SaveChanges();

            return(Ok(newpheduyet));
        }