public IHttpActionResult Post(TMS_Retailer_Setup tmsAdvertiseCash) { if (tmsAdvertiseCash == null) { return(Json(new { Msg = "0" })); } try { int s = _retailerSetupBll.Insert(tmsAdvertiseCash); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { return(Json(new { Msg = "0", Reason = "No row affected!" })); } }
public IHttpActionResult UpdateRetailerSetup(int id, TMS_Retailer_Setup tmsAdvertiseCash) { if (!ModelState.IsValid) { //return BadRequest(ModelState); return(Json(new { Msg = "0" })); } if (id != tmsAdvertiseCash.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _retailerSetupBll.Update(tmsAdvertiseCash); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!TmsAdvertiseCashExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public int Update(TMS_Retailer_Setup tmsAdvertiseCash) { return(_repository.Update(tmsAdvertiseCash)); }
public int Insert(TMS_Retailer_Setup tmsAdvertiseCash) { return(_repository.Insert(tmsAdvertiseCash)); }