Example #1
0
        //public DocVenda GetOrder(string numdoc)
        //{
        //    DocVenda docvenda = Comercial.Get_Order(numdoc);
        //    if (docvenda == null)
        //    {
        //        throw new HttpResponseException(
        //                Request.CreateResponse(HttpStatusCode.NotFound));

        //    }
        //    else
        //    {
        //        return docvenda;
        //    }
        //}

        public IEnumerable <Order> Get(string id)
        {
            IEnumerable <Order> docsvenda = Comercial.Get_Orders_Client(id);

            if (docsvenda == null)
            {
                throw new HttpResponseException(
                          Request.CreateResponse(HttpStatusCode.NotFound, "O cliente não tem nehuma encomenda"));
            }
            else
            {
                return(docsvenda);
            }
        }