Example #1
0
 /// <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();
 }
Example #2
0
        // 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);
        }
Example #3
0
        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));
            }
        }