public IHttpActionResult UpdateMachineDisposal(int id, TMS_Machine_Disposal tmsMachineDisposal)
        {
            if (tmsMachineDisposal == null)
            {
                return(Ok(new { Msg = "0" }));
            }

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

            try
            {
                int s = _objMachineDisposalBll.Update(tmsMachineDisposal);
                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;
                }
            }
        }
 public IHttpActionResult InsertMachineDisposal(TMS_Machine_Disposal tmsMachineDisposal)
 {
     if (tmsMachineDisposal == null)
     {
         return(Ok(new { Msg = "0" }));
     }
     try
     {
         int s = _objMachineDisposalBll.Insert(tmsMachineDisposal);
         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!" }));
     }
 }
Example #3
0
 public int Insert(TMS_Machine_Disposal tmsMachineDisposal)
 {
     return(_repository.Insert(tmsMachineDisposal));
 }
Example #4
0
 public int Update(TMS_Machine_Disposal tmsMachineDisposal)
 {
     return(_repository.Update(tmsMachineDisposal));
 }