示例#1
0
        public IHttpActionResult Post(TMS_Machine_Status ad)
        {
            if (ad == null)
            {
                return(Json(new { Msg = "0" }));
            }

            try
            {
                int s = _msBll.Insert(ad);
                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, TMS_Machine_Status ac)
        {
            if (!ModelState.IsValid)
            {
                //return BadRequest(ModelState);
                return(Json(new { Msg = "0" }));
            }

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

            try
            {
                int s = _msBll.Update(ac);
                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(TMS_Machine_Status obj)
        {
            int d = _repository.Update(obj);

            return(d);
        }
示例#4
0
 public int Insert(TMS_Machine_Status obj)
 {
     return(_repository.Insert(obj));
 }