private async void getData(int v) { IsBusy = true; //KM V_Project_totalLengths_project_contractor = await rcs.get_V_Project_totalLengths_project_contractor_Async(v); if (V_Project_totalLengths_project_contractor.Count > 0) { KMGridNo = "1"; IsTitelVisible = true; IsKMChartVisible = true; IsLableVisible = false; ProjectName = "المشروع: " + V_Project_totalLengths_project_contractor.First().projectName; } //Amount V_Project_totalAmounts_project_contractor = await rcs.get_V_Project_totalAmounts_project_contractor_Async(v); if (V_Project_totalAmounts_project_contractor.Count > 0) { if (V_Project_totalLengths_project_contractor.Count > 0) { AmountGridNo = "2"; } else { AmountGridNo = "1"; } IsTitelVisible = true; IsAmountChartVisible = true; IsLableVisible = false; ProjectName = "المشروع: " + V_Project_totalAmounts_project_contractor.First().projectName; } //Percent V_Project_percentOfAchievement_contractors = await rcs.get_V_Project_percentOfAchievement_contractors_Async(v); foreach (var item in V_Project_percentOfAchievement_contractors) { item.remaining = 100 - item.averagePercentageOfAchievementBasedOnWeights; } if (V_Project_percentOfAchievement_contractors.Count > 0) { if (V_Project_totalLengths_project_contractor.Count > 0) { if (V_Project_totalAmounts_project_contractor.Count > 0) { PercentGridNo = "3"; } else { PercentGridNo = "2"; } } else if (V_Project_totalAmounts_project_contractor.Count > 0) { PercentGridNo = "2"; } else { PercentGridNo = "1"; } IsTitelVisible = true; IsPercentChartVisible = true; IsLableVisible = false; ProjectName = "المشروع: " + V_Project_percentOfAchievement_contractors.First().projectName; } if (V_Project_totalAmounts_project_contractor.Count == 0 && V_Project_totalLengths_project_contractor.Count == 0) { IsTitelVisible = false; IsKMChartVisible = false; IsPercentChartVisible = false; IsLableVisible = true; IsAmountChartVisible = false; } IsBusy = false; }