public IHttpActionResult UpdateAdvertScheduling(int id, TMS_AdvertScheduling tmsDisbursment)
        {
            if (tmsDisbursment == null)
            {
                return(Ok(new { Msg = "0" }));
            }

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

            try
            {
                int s = _advertSchedulingBll.Update(tmsDisbursment);
                if (s == 1)
                {
                    return(Ok(new { Msg = "1", Reason = "Record Update Successfull!" }));
                }
                return(Ok(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TmsAdvertCashExists(id))
                {
                    //return NotFound();
                    return(Ok(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
        public IHttpActionResult InsertAdvertScheduling(TMS_AdvertScheduling tmsDisbursment)
        {
            if (tmsDisbursment == null)
            {
                return(Ok(new { Msg = "0" }));
            }

            try
            {
                int s = _advertSchedulingBll.Insert(tmsDisbursment);
                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 Update(TMS_AdvertScheduling tmsDisbursment)
 {
     return(_repository.Update(tmsDisbursment));
 }
Пример #4
0
 public int Insert(TMS_AdvertScheduling tmsDisbursment)
 {
     return(_repository.Insert(tmsDisbursment));
 }