public ActionResult GetSinComprar(int id) { EcomData_ = new EcomData(StringConnectio); try { EcomData_.Connect(); Ecom_Producto_ = (Ecom_Producto)EcomData_.GetObject(DataModel.Producto); List <Ecom_Producto> result = Ecom_Producto_.GetByPedido(id); return(Ok(result.Where(item => item.Estatus == 1 || item.PrecioCompra == 0).ToList())); } catch (Ecom_Exception ex) { return(BadRequest(ex.Message)); } finally { if (EcomData_ != null) { EcomData_.Disconnect(); } } }
public ActionResult Index(int id) { EcomData_ = new EcomData(StringConnectio); try { EcomData_.Connect(); Ecom_Producto_ = (Ecom_Producto)EcomData_.GetObject(DataModel.Producto); List <Ecom_Producto> result = Ecom_Producto_.GetByPedido(id); return(Ok(result)); } catch (Ecom_Exception ex) { return(BadRequest(ex.Message)); } finally { if (EcomData_ != null) { EcomData_.Disconnect(); } } }