Example #1
0
    public void PreencherInfo(Comanda.Produto produto)
    {
        Produto = produto;

        LblNome.text       = produto.infoProduto.nome;
        LblQuantidade.text = produto.quantidade + "x";
        LblValor.text      = produto.precoTotal.ToString("C2", CultureInfo.GetCultureInfo("pt-BR"));
    }
Example #2
0
    private void modificarProdutoDoGrupo(Comanda.Produto produto)
    {
        ItemComandaObj itemComandaObj = lstProdutosComanda.Find(x => x.Produto.infoProduto._id == produto.infoProduto._id);

        if (itemComandaObj != null)
        {
            itemComandaObj.PreencherInfo(produto);
        }
    }
Example #3
0
    private void removerProdutoDoGrupo(Comanda.Produto produto)
    {
        ItemComandaObj itemComandaObj = lstProdutosComanda.Find(x => x.Produto.infoProduto._id == produto.infoProduto._id);

        if (itemComandaObj != null)
        {
            Destroy(itemComandaObj.gameObject);
            lstProdutosComanda.Remove(itemComandaObj);
        }
    }
Example #4
0
        private Comanda.Produto tratarSnapshotProduto(DataSnapshot ds)
        {
            Comanda.Produto produto = new Comanda.Produto
            {
                infoProduto = JsonConvert.DeserializeObject <Comanda.InfoProduto>(ds.Child("produto").GetRawJsonValue()),
                preco       = Convert.ToDouble(ds.Child("preco").Value),
                precoTotal  = Convert.ToDouble(ds.Child("precoTotal").Value),
                quantidade  = Convert.ToInt32(ds.Child("quantidade").Value)
            };

            return(produto);
        }
Example #5
0
    private void adicionarProdutoAoGrupo(Comanda.Produto produto)
    {
        if (produto != null)
        {
            ItemComandaObj itemComandaObj = Instantiate(ItensComandaRef, ScvItensComanda);

            Main.Instance.ObterIcones(produto.infoProduto.icon, FileManager.Directories.produto, (textura) =>
            {
                if (textura != null)
                {
                    itemComandaObj.PreencherIcone(textura);
                }
            });
            itemComandaObj.PreencherInfo(produto);
            lstProdutosComanda.Add(itemComandaObj);
        }
    }