コード例 #1
0
        public IHttpActionResult UpdateMobility(int id, TMS_Mobility tmsMobility)
        {
            if (tmsMobility == null)
            {
                return(Ok(new { Msg = "0" }));
            }

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

            try
            {
                int s = _objTmsMobilityBll.Update(tmsMobility);
                if (s == 1)
                {
                    return(Ok(new { Msg = "1", Reason = "Record Update Successfull!" }));
                }
                return(Ok(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TmsMobilityExists(id))
                {
                    //return NotFound();
                    return(Ok(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
コード例 #2
0
        public IHttpActionResult Post(TMS_Mobility tmsMobility)
        {
            if (tmsMobility == null)
            {
                return(Ok(new { Msg = "0" }));
            }


            try
            {
                int s = _objTmsMobilityBll.Insert(tmsMobility);
                if (s == 1)
                {
                    return(Ok(new { Msg = "1", Reason = "Record Update Successfull!" }));
                }
                return(Ok(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                return(Ok(new { Msg = "0", Reason = "No row affected!" }));
            }
        }
コード例 #3
0
 public int Insert(TMS_Mobility tmsMobility)
 {
     return(_repository.Insert(tmsMobility));
 }
コード例 #4
0
        public int Update(TMS_Mobility obj)
        {
            int d = _repository.Update(obj);

            return(d);
        }