コード例 #1
0
        private void PopulateItens()
        {
            ItemCarrinho[]        itemCarrinhos        = new ItemCarrinho[10];
            ItemCarrinhoDetalhe[] itemCarrinhosdetalhe = new ItemCarrinhoDetalhe[11];
            flowLayoutPanelCarrinho.AutoSize = false;
            //flowLayoutPanelCarrinho.MaximumSize = new System.Drawing.Size(40, 15);
            //flowLayoutPanelCarrinho.MaximumSize.Width = 1;
            flowLayoutPanelCarrinho.Controls.Clear();
            for (int i = 0; i < itemCarrinhos.Length; i++)
            {
                itemCarrinhos[i]        = new ItemCarrinho();
                itemCarrinhosdetalhe[i] = new ItemCarrinhoDetalhe();

                if (i < 1)
                {
                    flowLayoutPanelCarrinho.Controls.Add(itemCarrinhos[i]);
                }
                flowLayoutPanelCarrinho.Controls.Add(itemCarrinhosdetalhe[i]);
                flowLayoutPanelCarrinho.Controls.Add(itemCarrinhosdetalhe[i + 1]);
            }
        }
コード例 #2
0
        private void PopulateItens()
        {
            flowLayoutPanelCarrinho.Controls.Clear();
            //flowLayoutPanelCarrinho.Click += new System.EventHandler();

            //foreach (var item in infoPlaDtos)
            //{
            //    Debug.WriteLine(item.ToString() + " - " + item.DataAceite.ToString() + " - " + item.minimoMultiplo.ToString());
            //}
            QuantTotalItens    = 0;
            QuantTotalTonoDese = 0;
            QuantTotalTonoDisp = 0;
            emitirPedidoList   = new List <EmitirPedidoItemDto>();

            infoPlaDtos.Sort((x, y) => x.RefClient.CompareTo(y.RefClient));

            int        i            = 0;
            InfoPlaDto itemAnterior = new InfoPlaDto();

            foreach (var item in infoPlaDtos)
            {
                Debug.WriteLine(item.ToString() + " - " + item.DataAceite.ToString() + " - " + item.minimoMultiplo.ToString());
                //popula o carrinho de acordo com o decendio
                if (item.RefClient == itemAnterior.RefClient)
                {
                    if (item.D1 != "" && item.D1 != "0")
                    {
                        addItemPedido(item, "D2");
                    }
                    if (item.D2 != "" && item.D2 != "0")
                    {
                        addItemPedido(item, "D2");
                    }
                    if (item.D3 != "" && item.D3 != "0")
                    {
                        addItemPedido(item, "D3");
                    }
                }
                else
                {
                    var Cabecalho = new ItemCarrinho();
                    Cabecalho.DetalCabecalho = item.detalheItem.ToString();
                    Cabecalho.DetalParNumber = item.RefClient;
                    flowLayoutPanelCarrinho.Controls.Add(Cabecalho);
                    if (item.D1 != "" && item.D1 != "0")
                    {
                        addItemPedido(item, "D1");
                    }
                    if (item.D2 != "" && item.D2 != "0")
                    {
                        addItemPedido(item, "D2");
                    }
                    if (item.D3 != "" && item.D3 != "0")
                    {
                        addItemPedido(item, "D3");
                    }
                }


                itemAnterior = item;
                i++;
            }
        }