//public static KeyLeversBuilder GenerateKeyLeversBS(VJChartInput input) //{ // KeyLeversBuilder response = new KeyLeversBuilder(); // input.lstCountryId = input.CountryId.Split(',').ToList(); // response = ChartListDSForPJ.GenerateKeyLeversDS(input); // return response; //} public static VJRadarModel GetVJRadarListBS(VJRadarInput input) { VJRadarModel response = new VJRadarModel(); input.lstCountryId = input.CountryId.Split(',').ToList(); input.lstProductId = input.ProductId.Split(',').ToList(); response = ChartListDSForPJ.GetVJRadarChartListDS(input); return(response); }
public static VJRadarModel GetVJRadarChartListDS(VJRadarInput input) { VJRadarModel response = new VJRadarModel(); string countryName = ""; string productName = ""; int productID, countryID = 0; using (PJEntities entity = new PJEntities()) { var countryData = from r in entity.Country_Master select r; var productData = from r in entity.Brand_Master select r; var patientJourneyData = from r in entity.Patient_Journey select r; var patientJourneyStagesData = from r in entity.Patient_Journey_Stages select r; var patientJourneyTransactionData = from r in entity.Patient_Journey_Transactions select r; List <PatientJourneyDataRadar> PatientJourneyDataRadarList = new List <PatientJourneyDataRadar>(); List <SelectedProductRadar> FproductListWithData = new List <SelectedProductRadar>(); for (int k = 0; k < input.lstProductId.Count; k++) { SelectedProductRadar selectedProduct = new BusinessModel.SelectedProductRadar(); int productIDs = Convert.ToInt32(input.lstProductId[k]); List <SelectedCountryRadar> FcountryListWithData = new List <SelectedCountryRadar>(); for (int i = 0; i < input.lstCountryId.Count; i++) { SelectedCountryRadar selectedCountry = new BusinessModel.SelectedCountryRadar(); int countryIds = Convert.ToInt32(input.lstCountryId[i]); int patientJourneyId = patientJourneyData.Where(x => x.Brand_Master_Id == productIDs && x.Country_Master_Id == countryIds && x.Status_Master_Id == 3) .Select(x => x.Patient_Journey_Id).FirstOrDefault(); var stagesId = patientJourneyStagesData.Where(x => x.Patient_Journey_Id == patientJourneyId).Select(x => x.Patient_Journey_Stages_Id).ToList(); List <BenchMarkDataListRadar> benchMarkListWithData = new List <BenchMarkDataListRadar>(); for (int j = 0; j < stagesId.Count; j++) { int stagesID = Convert.ToInt32(stagesId[j]); var transactionId = patientJourneyTransactionData.Where(x => x.Patient_Journey_Id == patientJourneyId && x.Patient_Journey_Stages_Id == stagesID && x.Transaction_Title == input.TransactionName).Select(x => x.Patient_Journey_Transactions_Id).ToList(); for (int n = 0; n < transactionId.Count; n++) { int TransactionId = Convert.ToInt32(transactionId[n]); response.benchMarkDataListRadar = (from kd in patientJourneyTransactionData where kd.Patient_Journey_Id == patientJourneyId where kd.Patient_Journey_Stages_Id == stagesID where kd.Patient_Journey_Transactions_Id == TransactionId select new BenchMarkDataListRadar() { PatientJourneyId = patientJourneyId, PatientJourneyStagesId = stagesID, PatientJourneyTransactionId = TransactionId, Transaction_Title = kd.Transaction_Title, HCP_Rating = kd.HCP_Rating, Patient_Rating = kd.Patient_Rating, Payer_Rating = kd.Payer_Rating, Feasibility_Rating = kd.Feasibility_Rating, Viability_Rating = kd.Viability_Rating }) .ToList(); benchMarkListWithData.AddRange(response.benchMarkDataListRadar); } } countryName = countryData.FirstOrDefault(ci => ci.Country_Master_Id == countryIds).Country_Name; selectedCountry.CountryName = countryName; selectedCountry.CountryID = countryIds; selectedCountry.benchMarkDataListRadar = benchMarkListWithData; FcountryListWithData.Add(selectedCountry); } productName = productData.FirstOrDefault(ci => ci.Brand_Master_Id == productIDs).Brand_Name; selectedProduct.ProductName = productName; selectedProduct.ProductId = productIDs; selectedProduct.selectedCountryListRadar = FcountryListWithData; FproductListWithData.Add(selectedProduct); } response.ProductlistRadar = FproductListWithData; return(response); } }