public List<DiseaseWise> getreportInfoList(string fromdate, string todate, string diseaseName) { List<TreatmentGiven> calculateList = DiseaseWiseList(fromdate, todate, diseaseName); List<DiseaseWise> reportList = new List<DiseaseWise>(); int count = 0; foreach (TreatmentGiven aTreatementGiven in calculateList) { int id = aTreatementGiven.DistrictID; if (NumberofPatient(id, fromdate, todate, diseaseName)>1 && (count!=1)) { DiseaseWise aDiseaseWise = new DiseaseWise(); int disId = aTreatementGiven.DistrictID; string disName = GetDistrictByID(disId); aDiseaseWise.Name = disName; aDiseaseWise.NumberOfPatient = NumberofPatient(disId, fromdate, todate, diseaseName); int over = (aDiseaseWise.NumberOfPatient*100)/GetTotalPopulationOfDistrict(disId); aDiseaseWise.OverPopulation = over; reportList.Add(aDiseaseWise); count = 1; } if (NumberofPatient(id, fromdate, todate, diseaseName) == 1) { DiseaseWise aDiseaseWise = new DiseaseWise(); int disId = aTreatementGiven.DistrictID; string disName = GetDistrictByID(disId); aDiseaseWise.Name = disName; aDiseaseWise.NumberOfPatient = 1; int over = (aDiseaseWise.NumberOfPatient * 100) / GetTotalPopulationOfDistrict(disId); aDiseaseWise.OverPopulation = over; reportList.Add(aDiseaseWise); } } return reportList; }
public List <DiseaseWise> getreportInfoList(string fromdate, string todate, string diseaseName) { List <TreatmentGiven> calculateList = DiseaseWiseList(fromdate, todate, diseaseName); List <DiseaseWise> reportList = new List <DiseaseWise>(); int count = 0; foreach (TreatmentGiven aTreatementGiven in calculateList) { int id = aTreatementGiven.DistrictID; if (NumberofPatient(id, fromdate, todate, diseaseName) > 1 && (count != 1)) { DiseaseWise aDiseaseWise = new DiseaseWise(); int disId = aTreatementGiven.DistrictID; string disName = GetDistrictByID(disId); aDiseaseWise.Name = disName; aDiseaseWise.NumberOfPatient = NumberofPatient(disId, fromdate, todate, diseaseName); int over = (aDiseaseWise.NumberOfPatient * 100) / GetTotalPopulationOfDistrict(disId); aDiseaseWise.OverPopulation = over; reportList.Add(aDiseaseWise); count = 1; } if (NumberofPatient(id, fromdate, todate, diseaseName) == 1) { DiseaseWise aDiseaseWise = new DiseaseWise(); int disId = aTreatementGiven.DistrictID; string disName = GetDistrictByID(disId); aDiseaseWise.Name = disName; aDiseaseWise.NumberOfPatient = 1; int over = (aDiseaseWise.NumberOfPatient * 100) / GetTotalPopulationOfDistrict(disId); aDiseaseWise.OverPopulation = over; reportList.Add(aDiseaseWise); } } return(reportList); }