コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 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" }));
     }
 }
コード例 #3
0
 public int Update(TMS_PaymentSchedule paymentSchedule)
 {
     return(_repository.Update(paymentSchedule));
 }
コード例 #4
0
 public int Insert(TMS_PaymentSchedule paymentSchedule)
 {
     return(_repository.Insert(paymentSchedule));
 }