コード例 #1
0
        public Order Add(Order order)
        {
            try
            {
                var bo = new OrderBusiness();
                order.OrderDate = System.DateTime.Now;
                return(bo.Add(order));
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
コード例 #2
0
        public Order Add(Order Order)
        {
            try
            {
                //instancia de la business
                var bc = new OrderBusiness();
                return(bc.Add(Order));
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }