Exemplo n.º 1
0
 public Shipping Add(Shipping ship)
 {
     try
     {
         var shipbs = new ShippingBusiness();
         return(shipbs.nuevo(ship));
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Exemplo n.º 2
0
        public List <Shipping> List()
        {
            try
            {
                var shipbs = new ShippingBusiness();
                return(shipbs.ListarTodas());
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
Exemplo n.º 3
0
        public Shipping GetbyCookie(string cookie)
        {
            try
            {
                var shipbs = new ShippingBusiness();
                return(shipbs.GetbyCookie(cookie));
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
Exemplo n.º 4
0
        public void Remove(int id)
        {
            try
            {
                var shipbs = new ShippingBusiness();
                var ship   = shipbs.GetbyID(id);
                shipbs.Borrar(ship);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }