public IHttpActionResult Post(TMS_DepositeBag accountsDepositBagDetails) { if (ModelState.IsValid) { int c = _bagBll.Insert(accountsDepositBagDetails); if (c == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } else { return(Json(new { Msg = "0" })); } }
public IHttpActionResult UpdateDepositBag(int id, TMS_DepositeBag accountsDepositBagDetails) { if (!ModelState.IsValid) { //return BadRequest(ModelState); return(Json(new { Msg = "0" })); } if (id != accountsDepositBagDetails.Id) { //return BadRequest(); return(Json(new { Msg = "0" })); } try { int s = _bagBll.Update(accountsDepositBagDetails); if (s == 1) { return(Json(new { Msg = "1" })); } return(Json(new { Msg = "0" })); } catch (DbUpdateConcurrencyException) { if (!DepositBagMappingExists(id)) { //return NotFound(); return(Json(new { Msg = "0", Reason = "No row affected!" })); } else { throw; } } }
public int Update(TMS_DepositeBag bag) { return(_reposirory.Update(bag)); }
public int Insert(TMS_DepositeBag bag) { return(_reposirory.Insert(bag)); }