コード例 #1
0
        public IHttpActionResult Post(Asset_FixedAssets tmsAdvertiseCash)
        {
            if (tmsAdvertiseCash == null)
            {
                return(Json(new { Msg = "0" }));
            }

            try
            {
                int s = _machineProfillingBll.Insert(tmsAdvertiseCash);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                return(Json(new { Msg = "0", Reason = "No row affected!" }));
            }
        }
コード例 #2
0
        public IHttpActionResult UpdateMachineProfilling(int id, Asset_FixedAssets tmsAdvertiseCash)
        {
            if (!ModelState.IsValid)
            {
                //return BadRequest(ModelState);
                return(Json(new { Msg = "0" }));
            }

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

            try
            {
                int s = _machineProfillingBll.Update(tmsAdvertiseCash);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TmsAdvertiseCashExists(id))
                {
                    //return NotFound();
                    return(Json(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
コード例 #3
0
 public int Update(Asset_FixedAssets tmsAdvertiseCash)
 {
     return(_repository.Update(tmsAdvertiseCash));
 }
コード例 #4
0
 public int Insert(Asset_FixedAssets tmsAdvertiseCash)
 {
     return(_repository.Insert(tmsAdvertiseCash));
 }