public IHttpActionResult Post(TMS_LanguageResources language) { if (ModelState.IsValid) { int c = _languageResourcesBll.Insert(language); if (c == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } else { return(Json(new { Msg = "0" })); } }
public IHttpActionResult UpdateLanguageResources(int id, TMS_LanguageResources language) { if (!ModelState.IsValid) { //return BadRequest(ModelState); return(Json(new { Msg = "0" })); } if (id != language.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _languageResourcesBll.Update(language); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!LanguageResourcesMappingExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public int Update(TMS_LanguageResources language) { return(_reposirory.Update(language)); }
public int Insert(TMS_LanguageResources language) { return(_reposirory.Insert(language)); }