Exemple #1
0
        public void viewProducts(OrderedDoublyLinkedList odl)
        {
            Node current    = odl.getFirst();
            int  xCount     = 0;
            int  totalCount = 0;

            while (current != null)
            {
                productView pv = new productView(current.getItem(), f1);
                if (xCount < 6)
                {
                    pv.Location = new Point(x, y);
                    panel1.Controls.Add(pv);
                    x      += 205;
                    current = current.getNext();
                    xCount++;
                    totalCount++;
                }
                else
                {
                    if (totalCount % 6 == 0)
                    {
                        y          += 210;
                        x           = 10;
                        pv.Location = new Point(10, y);
                        panel1.Controls.Add(pv);
                        current = current.getNext();
                        xCount  = 0;
                    }
                }
            }
        }
Exemple #2
0
        public OrderedDoublyLinkedList listToOrdered(List <Product> list)
        {
            OrderedDoublyLinkedList odl2 = new OrderedDoublyLinkedList();
            int i;

            for (i = 0; i < list.Count; i++)
            {
                Product p = list[i];
                odl2.insert(p);
            }
            return(odl2);
        }
Exemple #3
0
        public void viewProducts(OrderedDoublyLinkedList odl)
        {
            Node            current = odl.getFirst();
            adminSeeProduct asp;

            while (current != null)
            {
                asp = new adminSeeProduct(current.getItem(), this);
                panel1.Controls.Add(asp);
                asp.Location = new Point(0, y);
                y           += 151;
                current      = current.getNext();
            }
        }