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