public IHttpActionResult Post(TMS_CashBidding tmsCashBidding)
        {
            if (tmsCashBidding == null)
            {
                return(Json(new { Msg = "0" }));
            }

            try
            {
                int s = _objCashBiddingBll.Insert(tmsCashBidding);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                return(Json(new { Msg = "0", Reason = "No row affected!" }));
            }
        }
        public IHttpActionResult UpdateCrmContact(int id, TMS_CashBidding tmsCashBidding)
        {
            if (!ModelState.IsValid)
            {
                //return BadRequest(ModelState);
                return(Json(new { Msg = "0" }));
            }

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

            try
            {
                int s = _objCashBiddingBll.Update(tmsCashBidding);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TmsCashBiddingExists(id))
                {
                    //return NotFound();
                    return(Json(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
Esempio n. 3
0
 public int Insert(TMS_CashBidding tmsCashBidding)
 {
     return(_repository.Insert(tmsCashBidding));
 }
Esempio n. 4
0
 public int Update(TMS_CashBidding tmsDisbursment)
 {
     return(_repository.Update(tmsDisbursment));
 }