public IHttpActionResult UpdateMachineLocation(int id, TMS_Machine_Locations tmsMachineLocations) { if (tmsMachineLocations == null) { return(Ok(new { Msg = "0" })); } if (id != tmsMachineLocations.Id) { //return BadRequest(); return(Ok(new { Msg = "0" })); } try { int s = _objMachineLocationBll.Update(tmsMachineLocations); if (s == 1) { return(Ok(new { Msg = "1", Reason = "Record Update Successfull!" })); } return(Ok(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!TmsMobilityExists(id)) { //return NotFound(); return(Ok(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public IHttpActionResult InsertMachineLocation(TMS_Machine_Locations tmsMachineLocations) { if (tmsMachineLocations == null) { return(Ok(new { Msg = "0" })); } try { int s = _objMachineLocationBll.Insert(tmsMachineLocations); if (s == 1) { return(Ok(new { Msg = "1", Reason = "Record Update Successfull!" })); } return(Ok(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { return(Ok(new { Msg = "0", Reason = "Exception!" })); } }
public int Insert(TMS_Machine_Locations tmsMachineLocations) { return(_repository.Insert(tmsMachineLocations)); }
public int Update(TMS_Machine_Locations tmsMachineLocations) { return(_repository.Update(tmsMachineLocations)); }