public IHttpActionResult PostCadVendor(CadVendor cadVendor) { System.Data.Entity.Core.Objects.ObjectParameter op = new System.Data.Entity.Core.Objects.ObjectParameter("VendorId_OUTPUT", typeof(Int32)); using (var procDb = new Upwork_20171101_LocationValidationEntities()) { var res = procDb.wsp_CadVendor_CRUD("INSERT_DBO_CADVENDOR", null, op, cadVendor.VendorName, cadVendor.VendorAbbreviation, cadVendor.Description); } return(CreatedAtRoute("DefaultApi", new { id = cadVendor.VendorId }, cadVendor)); }
public async Task <IHttpActionResult> GetCadVendor(int id) { CadVendor cadVendor = await db.CadVendors.FindAsync(id); if (cadVendor == null) { return(NotFound()); } return(Ok(cadVendor)); }
public async Task <IHttpActionResult> PutCadVendor(int id, CadVendor cadVendor) { try { System.Data.Entity.Core.Objects.ObjectParameter op = new System.Data.Entity.Core.Objects.ObjectParameter("VendorId_OUTPUT", typeof(Int32)); using (var procDb = new Upwork_20171101_LocationValidationEntities()) { var res = procDb.wsp_CadVendor_CRUD("UPDATE_DBO_CADVENDOR", cadVendor.VendorId, op, cadVendor.VendorName, cadVendor.VendorAbbreviation, cadVendor.Description); } } catch (DbUpdateConcurrencyException) { if (!CadVendorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }