public void completeSmartWatch(string table) { List <String> titles = new List <String>(); List <String> compatibleOS = new List <String>(); List <String> sensors = new List <String>(); List <String> screenResolution = new List <String>(); List <int> price = new List <int>(); List <int> quantity = new List <int>(); workServerOnMainInterface.createInfoSmartWatchArray(table, ref titles, ref compatibleOS, ref sensors, ref screenResolution, ref price, ref quantity); if (titles.Count == compatibleOS.Count && titles.Count == sensors.Count && titles.Count == screenResolution.Count && titles.Count == price.Count && titles.Count == quantity.Count) { flowLayoutPanel.Controls.Clear(); manageSmartWatch = new ManageSmartWatch(); 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(); } manageSmartWatch.createSmartWatch(titles[i], compatibleOS[i], sensors[i], screenResolution[i], price[i], quantity[i], quantityCombo, basketItems, table); } for (int i = 0; i < manageSmartWatch.getAllSmartWatch().Count; i++) { flowLayoutPanel.Controls.Add(manageSmartWatch.getAllSmartWatch()[i]); } } }
public void addSmartWatchesToBasket(ManageSmartWatch manageSmartWatch) { for (int i = 0; i < manageSmartWatch.getAllSmartWatch().Count; i++) { int newQuantityItems = manageSmartWatch.getAllSmartWatch()[i].infoComboQuantitySelected(); if (newQuantityItems > 0) { if (!basketItems.checkSimilarAddedSmartWatches(manageSmartWatch.getAllSmartWatch()[i])) { basketItems.addSmartWatch(manageSmartWatch.getAllSmartWatch()[i]); } } } }