Esempio n. 1
0
    private string getCommodities()
    {
        CommodityCRUD    commodity_CRUD  = new CommodityCRUD();
        List <Commodity> listCommodities = (List <Commodity>)commodity_CRUD.readAll();

        return(JsonConvert.SerializeObject(listCommodities));
    }
Esempio n. 2
0
    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);
    }