コード例 #1
0
ファイル: PODSController.cs プロジェクト: kenkaohy/DIPS
        public IHttpActionResult PutLK_InPatient_List(string id, LK_InPatient_List lK_InPatient_List)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != lK_InPatient_List.URN)
            {
                return BadRequest();
            }

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }
コード例 #2
0
ファイル: PODSController.cs プロジェクト: kenkaohy/DIPS
        public IHttpActionResult PostLK_InPatient_List(LK_InPatient_List lK_InPatient_List)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.LK_InPatient_List.Add(lK_InPatient_List);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (LK_InPatient_ListExists(lK_InPatient_List.URN))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = lK_InPatient_List.URN }, lK_InPatient_List);
        }