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