public IHttpActionResult PutView_PartyPayment(int id, View_PartyPayment view_PartyPayment) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != view_PartyPayment.Id) { return BadRequest(); } db.Entry(view_PartyPayment).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!View_PartyPaymentExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostView_PartyPayment(View_PartyPayment view_PartyPayment) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.View_PartyPayment.Add(view_PartyPayment); try { db.SaveChanges(); } catch (DbUpdateException) { if (View_PartyPaymentExists(view_PartyPayment.Id)) { return Conflict(); } else { throw; } } return CreatedAtRoute("DefaultApi", new { id = view_PartyPayment.Id }, view_PartyPayment); }