private string getCommodities() { CommodityCRUD commodity_CRUD = new CommodityCRUD(); List <Commodity> listCommodities = (List <Commodity>)commodity_CRUD.readAll(); return(JsonConvert.SerializeObject(listCommodities)); }
private Commodity getCommodityByID_InList(long commodityID) { if (allCommoditiesList == null) { allCommoditiesList = (List <Commodity>)commodity_CRUD.readAll(); } foreach (Commodity commodityLocal in allCommoditiesList) { if (commodityLocal.Id == commodityID) { return(commodityLocal); } } return(null); }