public IHttpActionResult UpdateMobility(int id, TMS_Mobility tmsMobility) { if (tmsMobility == null) { return(Ok(new { Msg = "0" })); } if (id != tmsMobility.Id) { //return BadRequest(); return(Ok(new { Msg = "0" })); } try { int s = _objTmsMobilityBll.Update(tmsMobility); 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 Post(TMS_Mobility tmsMobility) { if (tmsMobility == null) { return(Ok(new { Msg = "0" })); } try { int s = _objTmsMobilityBll.Insert(tmsMobility); 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 = "No row affected!" })); } }
public int Insert(TMS_Mobility tmsMobility) { return(_repository.Insert(tmsMobility)); }
public int Update(TMS_Mobility obj) { int d = _repository.Update(obj); return(d); }