//For both Post (add) and Put (update) public void Post(BizEmployee employee) { if (employee != null) { BizEmployeeService.AddOrUpdate(employee); } }
public ActionResult Edit(BizStreet model) { if (ModelState.IsValid) { BizStreetRep.AddOrUpdate(model); return(RedirectToAction("Index")); } return(View(model)); }
public HttpResponseMessage Post([FromBody] EquipVendorDTO equipVendor) { EqVendors.AddOrUpdate(equipVendor); string tmp = string.Format($"{equipVendor.EquipVendorID} has been saved"); HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, tmp); string url = Url.Link("DefaultApi", new { id = equipVendor.EquipVendorID }); msg.Headers.Location = new Uri(url); return(msg); }
public HttpResponseMessage Post([FromBody] PREquipmentDTO pREquipmentDTO) { PREquipmentService.AddOrUpdate(pREquipmentDTO); string tmp = string.Format($"{pREquipmentDTO.PREquipID} has been saved"); HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, tmp); string url = Url.Link("DefaultApi", new { id = pREquipmentDTO.PREquipID }); msg.Headers.Location = new Uri(url); return(msg); }