1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| public List<Sites> GetAllSites()
{
var result = from cr in bd.Sites
let totalAppelSortant =
(from cr1 in bd.Staxe
where cr1.Site == cr.Site
select cr1
).Count()
let totalAppelSortantLocaux =
(from cr1 in bd.Staxe
where cr1.Nature_Comm == "L"
&& cr1.Site == cr.Site
select cr1
).Count()
let totalAppelSortantNationaux =
(from cr1 in bd.Staxe
where cr1.Nature_Comm == "N"
&& cr1.Site == cr.Site
select cr1
).Count()
let totalAppelSortantInternationaux =
(from cr1 in bd.Staxe
where cr1.Nature_Comm == "I"
&& cr1.Site == cr.Site
select cr1
).Count()
let totalAppelSortantGSM =
(from cr1 in bd.Staxe
where cr1.Nature_Comm == "M"
&& cr1.Site == cr.Site
select cr1
).Count()
select new
{
CodeSite = cr.Site,
LibelleSite = cr.Libellé,
TotalAppelSortant = totalAppelSortant,
TotalAppelSortantLocaux = totalAppelSortantLocaux,
TotalAppelSortantNationaux = totalAppelSortantNationaux,
TotalAppelSortantInternationaux = totalAppelSortantInternationaux,
TotalAppelSortantGSM = totalAppelSortantGSM
};
return result.ToList();
//return bd.Sites.ToList();
} |
Partager