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