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