Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TRI DES ITEMS PAR FOURNISSEUR + COMPARAISON
- public void ListProdLienProv()
- {
- List<Product> ListEprom = new List<Product>();
- List<Product> ListSynnex = new List<Product>();
- List<Product> ListDH = new List<Product>();
- List<Product> ListUpdate = new List<Product>();
- tempProdLienProv = RetrieveProdLienProv();
- //listBoxSQL.Items.Clear();
- var dictionary = new Dictionary<string, Product>();
- // TRI DES PRODUITS DANS LEUR LISTE CORRESPONDANTE
- foreach (var item in tempProdLienProv)
- {
- if (item.Dispo != "ACTIF")
- continue;
- if (dictionary.ContainsKey(item.ProductID))
- {
- //TODO : Changer le champ string Price pour un champ en decimal
- decimal.TryParse(dictionary[item.ProductID].Price, out var currentPrice);
- decimal.TryParse(dictionary[item.ProductID].Qte, out var Quantite);
- decimal.TryParse(item.Price, out var newPrice);
- decimal.TryParse(item.Qte, out var newQuantite);
- if (newPrice < currentPrice && newQuantite < Quantite)
- dictionary[item.ProductID] = item;
- }
- else
- dictionary.Add(item.ProductID, item);
- }
- //Ta nouvelle list est dans le dictionary:)
- foreach (var item in dictionary)
- {
- //item.Value
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement