示例#1
0
 public void addLaptopsPcsToBasket(ManageLaptopsPcs manageLaptopsPcs)
 {
     for (int i = 0; i < manageLaptopsPcs.getAllManageLaptops().Count; i++)
     {
         int newQuantityItems = manageLaptopsPcs.getAllManageLaptops()[i].infoComboQuantitySelected();
         if (newQuantityItems > 0)
         {
             if (!basketItems.checkSimilarAddedLaptopsPcs(manageLaptopsPcs.getAllManageLaptops()[i]))
             {
                 basketItems.addLaptopsPcsItems(manageLaptopsPcs.getAllManageLaptops()[i]);
             }
         }
     }
 }
示例#2
0
        public void completeLaptopsPcsItem(string table)
        {
            List <String> titles   = new List <String>();
            List <String> cpu      = new List <String>();
            List <int>    ram      = new List <int>();
            List <int>    hdd      = new List <int>();
            List <int>    ssd      = new List <int>();
            List <String> gpu      = new List <String>();
            List <String> os       = new List <String>();
            List <int>    price    = new List <int>();
            List <int>    quantity = new List <int>();

            workServerOnMainInterface.createInfoLaptopsPcsArray(table, ref titles, ref cpu, ref ram, ref hdd, ref ssd, ref gpu, ref os, ref price, ref quantity);
            if (titles.Count == cpu.Count && titles.Count == ram.Count && titles.Count == hdd.Count && titles.Count == ssd.Count &&
                titles.Count == gpu.Count && titles.Count == os.Count &&
                titles.Count == price.Count && titles.Count == quantity.Count)
            {
                flowLayoutPanel.Controls.Clear();
                manageLaptopPcs = new ManageLaptopsPcs();
                for (int i = 0; i < titles.Count; i++)
                {
                    string[] quantityCombo = new string[quantity[i] + 1];
                    for (int j = 0; j < quantityCombo.Length; j++)
                    {
                        quantityCombo[j] = (j).ToString();
                    }
                    manageLaptopPcs.createLaptopPcs(titles[i], cpu[i], ram[i], hdd[i], ssd[i], gpu[i], os[i], price[i], quantity[i],
                                                    quantityCombo, basketItems, table);
                }

                for (int i = 0; i < manageLaptopPcs.getAllManageLaptops().Count; i++)
                {
                    flowLayoutPanel.Controls.Add(manageLaptopPcs.getAllManageLaptops()[i]);
                }
            }
        }