public IHttpActionResult UpdateSwitchSetup(int id, TMS_SwitchSetup switchSetup) { if (!ModelState.IsValid) { return(Json(new { Msg = "0" })); } if (id != switchSetup.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _switchSetupBll.Update(switchSetup); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!DeleteSwitchSetupExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "Exception!" })); } else { throw; } } }
public IHttpActionResult Post(TMS_SwitchSetup switchSetup) { if (ModelState.IsValid) { int c = _switchSetupBll.Insert(switchSetup); if (c == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } else { return(Json(new { Msg = "0" })); } }
public int Update(TMS_SwitchSetup switchSetup) { return(_repository.Update(switchSetup)); }
public int Insert(TMS_SwitchSetup switchSetup) { return(_repository.Insert(switchSetup)); }