/// <summary> /// Delete registers based on class values informed. MinValues and nulls are skipped. /// Must have "MultipleActiveResultSets=True" on connection string. /// </summary> /// <param name="parOrdersInfo">Item to delete</param> /// <param name="transaction">Transaction context</param> /// <param name="errorMessage">Error message</param> public virtual void Delete(OrdersInfo parOrdersInfo, DbTransaction transaction, out string errorMessage) { errorMessage = string.Empty; OrdersDAO.Delete(parOrdersInfo, transaction, out errorMessage); //By default, the caller of this method will do the commit. //motor.Commit(); //motor.CloseConnection(); }
// DELETE: api/Order/DeleteOrderTable?ID=11077 public HttpResponseMessage DeleteOrder(int ID) { HttpResponseMessage resp; Orders ord = new Orders(); var data = _ordersDAO.Get(ID); if (data == null) { return(null); } _ordersDAO.Delete(ID); var result = data; resp = Request.CreateResponse(HttpStatusCode.OK, result); return(resp); }
public IActionResult DeleteOrder(int ID) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var data = _ordersDAO.Get(ID); if (data == null) { return(NotFound(data)); } return(Ok(_ordersDAO.Delete(ID))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }