public ICollection <Buse> ListerTotaleBuseAccueil() { IGestionEtatDAO IGEDAO = new GestionEtatDAO(); Etat e_Energie = IGEDAO.RechercherDernierEtat("Energie", "b"); Etat e_STB1 = IGEDAO.RechercherDernierEtat("STB1", "b"); Etat e_STB2 = IGEDAO.RechercherDernierEtat("STB2", "b"); Etat e_ATR = IGEDAO.RechercherDernierEtat("ATR", "b"); Etat e_Indus = IGEDAO.RechercherDernierEtat("Indus", "b"); ICollection <Buse> Buses = new List <Buse>(); for (int j = 0; j < 33; j++) { var energie = 0;; var stb1 = 0; var stb2 = 0; var atr = 0; var indus = 0; if (e_Energie.Buses != null) { energie = e_Energie.Buses.ElementAt(j).Quantite; } if (e_ATR.Buses != null) { atr = e_ATR.Buses.ElementAt(j).Quantite; } if (e_Indus.Buses != null) { indus = e_Indus.Buses.ElementAt(j).Quantite; } if (e_STB1.Buses != null) { stb1 = e_STB1.Buses.ElementAt(j).Quantite; } if (e_STB2.Buses != null) { stb2 = e_STB2.Buses.ElementAt(j).Quantite; } Buses.Add(new Buse { Quantite = energie + stb1 + stb2 + atr + indus, BuseID = "TB" + (j + 1) }); } return(Buses); }
public ICollection <Feeder> ListerTotaleFeederAccueil() { IGestionEtatDAO IGEDAO = new GestionEtatDAO(); Etat e_Energie = IGEDAO.RechercherDernierEtat("Energie", "f"); Etat e_STB1 = IGEDAO.RechercherDernierEtat("STB1", "f"); Etat e_STB2 = IGEDAO.RechercherDernierEtat("STB2", "f"); Etat e_ATR = IGEDAO.RechercherDernierEtat("ATR", "f"); Etat e_Indus = IGEDAO.RechercherDernierEtat("Indus", "f"); int[] T1 = new int[6]; int[] T2 = new int[6]; int[] T3 = new int[6]; int[] T4 = new int[6]; int[] T5 = new int[6]; int i = 0; foreach (var item in e_Energie.Feeders) { T1[i] = item.Quantite; i++; } i = 0; foreach (var item in e_STB1.Feeders) { T2[i] = item.Quantite; i++; } i = 0; foreach (var item in e_STB2.Feeders) { T3[i] = item.Quantite; i++; } i = 0; foreach (var item in e_ATR.Feeders) { T4[i] = item.Quantite; i++; } i = 0; foreach (var item in e_Indus.Feeders) { T5[i] = item.Quantite; i++; } ICollection <Feeder> Fedders = new List <Feeder>(); for (int j = 0; j < 6; j++) { Fedders.Add(new Feeder { Quantite = T1[j] + T2[j] + T3[j] + T4[j] + T5[j], FedderID = "TF" + (j + 1) }); } return(Fedders); }
public ICollection <Buse> ListerTotaleBuseAccueil(string date, string poste, string type) { IGestionEtatDAO IGEDAO = new GestionEtatDAO(); Etat e_Energie = IGEDAO.GetEtat("ENERGIE", date, poste, type); Etat e_STB1 = IGEDAO.GetEtat("STB1", date, poste, type); Etat e_STB2 = IGEDAO.GetEtat("STB2", date, poste, type); Etat e_ATR = IGEDAO.GetEtat("ATR", date, poste, type); Etat e_Indus = IGEDAO.GetEtat("Indus", date, poste, type); int[] T1 = new int[33]; int[] T2 = new int[33]; int[] T3 = new int[33]; int[] T4 = new int[33]; int[] T5 = new int[33]; int i = 0; if (e_Energie.Buses != null) { foreach (var item in e_Energie.Buses) { T1[i] = item.Quantite; i++; } } i = 0; if (e_STB1.Buses != null) { foreach (var item in e_STB1.Buses) { T2[i] = item.Quantite; i++; } } i = 0; if (e_STB2.Buses != null) { foreach (var item in e_STB2.Buses) { T3[i] = item.Quantite; i++; } } i = 0; if (e_ATR.Buses != null) { foreach (var item in e_ATR.Buses) { T4[i] = item.Quantite; i++; } } i = 0; if (e_Indus.Buses != null) { foreach (var item in e_Indus.Buses) { T5[i] = item.Quantite; i++; } } ICollection <Buse> Buses = new List <Buse>(); for (int j = 0; j < 33; j++) { Buses.Add(new Buse { Quantite = T1[j] + T2[j] + T3[j] + T4[j] + T5[j], BuseID = "TF" + (j + 1) }); } return(Buses); }