Esempio n. 1
0
    public ProductComputationyInDay getProductByName(string nameProduct)
    {
        LinkedList <ProductComputationyInDay> products = allDay_Now.getProductCompInDays();

        foreach (ProductComputationyInDay prod in products)
        {
            if (prod.getNameProduct().Equals(nameProduct))
            {
                return(prod);
            }
        }
        return(null);
    }
Esempio n. 2
0
    public WWWForm parseAllDay(AllDay allDay)
    {
        var data = new WWWForm();

        LinkedList <ProductComputationyInDay> tempProdComps = allDay.getProductCompInDays();
        AllDayDTO allDayDTO = new AllDayDTO(allDay);

        int count = 1;

        data.AddField("AllDay", JsonUtility.ToJson(allDayDTO).ToString());
        ProductCompDTO productCompDTO = null;

        foreach (ProductComputationyInDay prodComp in tempProdComps)
        {
            productCompDTO = new ProductCompDTO(prodComp);
            data.AddField("ProductComp_" + count, JsonUtility.ToJson(productCompDTO).ToString());
            count++;
        }
        //data.add

        /*
         * foreach (Product prod in products)
         * {
         *  tempProdDto = new ProductDTO(prod.uniqueProduct_id, prod.name, prod.coffSV, prod.coffWater, prod.coffMetana, prod.valueGas);
         *  data.AddField("Product_" + count, JsonUtility.ToJson(tempProdDto).ToString());
         *  count++;
         * }
         */

        return(data);
    }
Esempio n. 3
0
    //For beta ver 1

    public void SaveProductComp_inFile()
    {
        SaveProductComp_inFile(allDay_ObjectForSaveOrLoad.getProductCompInDays(), DateTime.Now.ToString("dd.MM.yyyy"), pathProductComps);
    }