public IHttpActionResult UpdateMachineDocument(int id, TMS_Machine_Documents tmsMachineDocuments) { if (tmsMachineDocuments == null) { return(Ok(new { Msg = "0" })); } if (id != tmsMachineDocuments.Id) { //return BadRequest(); return(Ok(new { Msg = "0" })); } try { int s = _objMachineDocumentBll.Update(tmsMachineDocuments); 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 InsertMachineDocument(TMS_Machine_Documents tmsMachineDocuments) { if (tmsMachineDocuments == null) { return(Ok(new { Msg = "0" })); } try { int s = _objMachineDocumentBll.Insert(tmsMachineDocuments); 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!" })); } }
public int Insert(TMS_Machine_Documents tmsMachineDocuments) { return(_repository.Insert(tmsMachineDocuments)); }
public int Update(TMS_Machine_Documents tmsMachineDocuments) { return(_repository.Update(tmsMachineDocuments)); }