Exemple #1
0
        //Added items from Electro--------------------------------------------------------------------------------------
        public void completeHphonesItem(string table)
        {
            List <String> titles       = new List <String>();
            List <String> mic          = new List <String>();
            List <String> type         = new List <String>();
            List <int>    workingHours = new List <int>();
            List <int>    resistance   = new List <int>();
            List <int>    price        = new List <int>();
            List <int>    quantity     = new List <int>();

            workServerOnMainInterface.createInfoHphonesArray(table, ref titles, ref mic, ref type, ref workingHours, ref resistance, ref price, ref quantity);
            if (titles.Count == mic.Count && titles.Count == type.Count && titles.Count == workingHours.Count && titles.Count == resistance.Count &&
                titles.Count == price.Count && titles.Count == quantity.Count)
            {
                flowLayoutPanel.Controls.Clear();
                manageHphones = new ManageHphones();
                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();
                    }
                    manageHphones.createHphones(titles[i], mic[i], type[i], workingHours[i], resistance[i], price[i], quantity[i], quantityCombo, basketItems, table);
                }

                for (int i = 0; i < manageHphones.getAllHphones().Count; i++)
                {
                    flowLayoutPanel.Controls.Add(manageHphones.getAllHphones()[i]);
                }
            }
        }
Exemple #2
0
 public void addHphoneToBasket(ManageHphones manageHphones)
 {
     for (int i = 0; i < manageHphones.getAllHphones().Count; i++)
     {
         int newQuantityItems = manageHphones.getAllHphones()[i].infoComboQuantitySelected();
         if (newQuantityItems > 0)
         {
             if (!basketItems.checkSimilarAddedHphones(manageHphones.getAllHphones()[i]))
             {
                 basketItems.addHphones(manageHphones.getAllHphones()[i]);
             }
         }
     }
 }