示例#1
0
        public void completeSmartPhone(string table)
        {
            List <String> titles           = new List <String>();
            List <int>    internalMemory   = new List <int>();
            List <int>    ram              = new List <int>();
            List <int>    cameraResolution = new List <int>();
            List <double> screenDiagonal   = new List <double>();
            List <int>    capacity         = new List <int>();
            List <int>    price            = new List <int>();
            List <int>    quantity         = new List <int>();

            workServerOnMainInterface.createInfoSmartPhones(table, ref titles, ref internalMemory, ref ram, ref cameraResolution,
                                                            ref screenDiagonal, ref capacity, ref price, ref quantity);
            if (titles.Count == internalMemory.Count && titles.Count == ram.Count && titles.Count == cameraResolution.Count && titles.Count == screenDiagonal.Count &&
                titles.Count == capacity.Count && titles.Count == price.Count && titles.Count == quantity.Count)
            {
                manageSmartPhone = new ManageSmartPhone();
                flowLayoutPanel.Controls.Clear();
                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();
                    }
                    manageSmartPhone.createSmartPhone(titles[i], internalMemory[i], ram[i], cameraResolution[i], screenDiagonal[i], capacity[i],
                                                      price[i], quantity[i], quantityCombo, basketItems, table);
                }

                for (int i = 0; i < manageSmartPhone.getAllSmartPhones().Count; i++)
                {
                    flowLayoutPanel.Controls.Add(manageSmartPhone.getAllSmartPhones()[i]);
                }
            }
        }
示例#2
0
 public void addSmarPhonesToBasket(ManageSmartPhone manageSmartPhone)
 {
     for (int i = 0; i < manageSmartPhone.getAllSmartPhones().Count; i++)
     {
         int newQuantityItems = manageSmartPhone.getAllSmartPhones()[i].infoComboQuantitySelected();
         if (newQuantityItems > 0)
         {
             if (!basketItems.checkSimilarAddedSmartPhones(manageSmartPhone.getAllSmartPhones()[i]))
             {
                 basketItems.addSmartPhone(manageSmartPhone.getAllSmartPhones()[i]);
             }
         }
     }
 }