Ejemplo n.º 1
0
        public IHttpActionResult UpdateQueryPayment(int id, TMS_QueryPayment queryPayment)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { Msg = "0" }));
            }

            if (id != queryPayment.Id)
            {
                //return BadRequest();
                return(Json(new { Msg = "0" }));
            }

            try
            {
                int s = _queryPaymentBll.Update(queryPayment);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DeleteQueryPaymentExists(id))
                {
                    //return NotFound();
                    return(Json(new { Msg = "0", Reason = "Exception!" }));
                }
                else
                {
                    throw;
                }
            }
        }
Ejemplo n.º 2
0
 public IHttpActionResult Post(TMS_QueryPayment queryPayment)
 {
     if (ModelState.IsValid)
     {
         int c = _queryPaymentBll.Insert(queryPayment);
         if (c == 1)
         {
             return(Json(new { Msg = "1" }));
         }
         return(Json(new { Msg = "0" }));
     }
     else
     {
         return(Json(new { Msg = "0" }));
     }
 }
 public int Update(TMS_QueryPayment queryPayment)
 {
     return(_repository.Update(queryPayment));
 }
 public int Insert(TMS_QueryPayment queryPayment)
 {
     return(_repository.Insert(queryPayment));
 }