Esempio n. 1
0
        protected void Show_Click(object sender, EventArgs e)
        {
            string     districtName = districtDropDownList.Text;
            int        districtId   = aDistrictThanaManager.GetDistrictId(districtName);
            List <int> thanalList   = aDistrictThanaManager.GetThanaIDList(districtId);
            List <int> centerList   = new List <int>();

            foreach (int i in thanalList)
            {
                List <int> aList = aCenterManager.GetCenterListByThanaID(i);
                foreach (int i1 in aList)
                {
                    centerList.Add(i1);
                }
            }

            DataTable dt = new DataTable();

            dt.Columns.Add("Data", Type.GetType("System.String"));
            dt.Columns.Add("Value1", Type.GetType("System.Int32"));

            DataTable didt = aDiseaseManager.GetAllDisease();

            foreach (DataRow dr in didt.Rows)
            {
                int diseaseId = Convert.ToInt32(dr["Serial No"].ToString());
                int total     = 0;
                foreach (int i in centerList)
                {
                    total += aTreatementManager.GetTotalByCenterDisease(i, diseaseId, startTextBox.Text, endTextBox.Text);
                }
                DataRow dr1 = dt.NewRow();
                dr1["Data"]   = dr["Name"];
                dr1["Value1"] = total;

                dt.Rows.Add(dr1);
            }
            LoadChartData(dt);
        }
Esempio n. 2
0
        protected void selectButton_Click(object sender, EventArgs e)
        {
            List <string> disList = aDistrictThanaManager.GetDistrictList();
            DataTable     dt      = new DataTable();

            dt.Columns.Add("District Name");
            dt.Columns.Add("Total Patient");
            dt.Columns.Add("% On Population");
            for (int j = 1; j < disList.Count; j++)
            {
                string     s          = disList[j];
                int        districtId = aDistrictThanaManager.GetDistrictId(s);
                List <int> thanalList = aDistrictThanaManager.GetThanaIDList(districtId);
                List <int> centerList = new List <int>();
                foreach (int i in thanalList)
                {
                    List <int> aList = aCenterManager.GetCenterListByThanaID(i);
                    foreach (int i1 in aList)
                    {
                        centerList.Add(i1);
                    }
                }
                int total     = 0;
                int diseaseId = aDiseaseManager.GetDiseaseId(selectDropDownList.Text);

                foreach (int i in centerList)
                {
                    total += aTreatementManager.GetTotalByCenterDisease(i, diseaseId, startTextBox.Text, endTextBox.Text);
                }
                int totalpopulation = aDistrictThanaManager.GetPopulation(districtId);

                double per = ((double)total / totalpopulation) * 100;

                dt.Rows.Add(s, total, per);
            }
            diseaseGridView.DataSource = dt;
            diseaseGridView.DataBind();
        }