示例#1
0
        public IActionResult cotizacionId(int id)
        {
            servsbs = new servicesSbs();
            var response = servsbs.getCotizacionId(id);
            var json     = response.Content.ReadAsStringAsync();

            if (!response.IsSuccessStatusCode)
            {
                Console.WriteLine("Se presento un Error");
                return(BadRequest(json.Result));
            }
            else
            {
                Console.WriteLine("Success");
                return(Ok(json.Result));
            }
        }
示例#2
0
        public IActionResult createProduct(productos product)
        {
            servsbs = new servicesSbs();
            var response = servsbs.createProduct(product);
            var json     = response.Content.ReadAsStringAsync();

            if (!response.IsSuccessStatusCode)
            {
                Console.WriteLine("Se presento un Error");
                return(BadRequest(json.Result));
            }
            else
            {
                Console.WriteLine("Success");
                return(Ok(json.Result));
            }
        }