Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Image1.Attributes.Add(Constants.UseMapKey, Constants.UseMapDistricSecretaryValue);

            if (!IsPostBack)
            {
                string       pgConnectionString = ConfigurationManager.AppSettings[PgConnectionKey];
                PgConnection pgCon = new PgConnection(pgConnectionString);

                DataTable table = pgCon.RunSql(GetYearsSql);

                DropDownList2.DataSource     = table;
                DropDownList2.DataTextField  = table.Columns[0].ToString();
                DropDownList2.DataValueField = table.Columns[0].ToString();
                DropDownList2.DataBind();

                string sqlConnectionString = ConfigurationManager.AppSettings[SqlConnectionKey];
                SqlServerConnection sqlCon = new SqlServerConnection(sqlConnectionString);

                table = sqlCon.RunSql(GetDieseasesSql);

                DropDownList1.DataSource     = table;
                DropDownList1.DataTextField  = table.Columns[1].ToString();
                DropDownList1.DataValueField = table.Columns[0].ToString();
                DropDownList1.DataBind();

                selectMostSuitableDiesease();
            }
        }
Beispiel #2
0
        private DataTable getData()
        {
            string sqlConnectionString = ConfigurationManager.AppSettings[Constants.SqlConnectionKey];
            SqlServerConnection sqlCon = new SqlServerConnection(sqlConnectionString);

            DataTable table = sqlCon.RunSql(Convert.ToString(ChartConfigurations[ChartConfigurationKeys.QUERY.ToString()]));

            return(table);
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            dic = new Dictionary <string, object>();

            dic = new Dictionary <string, object>();
            dic[ChartConfigurationKeys.HEIGHT.ToString()]    = 500;
            dic[ChartConfigurationKeys.WIDTH.ToString()]     = 800;
            dic[ChartConfigurationKeys.XVALARRAY.ToString()] = "MONTH";
            dic[ChartConfigurationKeys.YVALARRAY.ToString()] = new List <string> {
                "MALECOUNT", "FEMALECOUNT", "CHILDCOUNT"
            };
            dic[ChartConfigurationKeys.XTITLE.ToString()]          = "Month";
            dic[ChartConfigurationKeys.YTITLE.ToString()]          = "Patients";
            dic[ChartConfigurationKeys.TYPE.ToString()]            = SeriesChartType.Column;
            dic[ChartConfigurationKeys.LEGEND.ToString()]          = "Gender";
            dic[ChartConfigurationKeys.VIEWLEGEND.ToString()]      = true;
            dic[ChartConfigurationKeys.NOOFCHARTSERIES.ToString()] = 3;
            dic[ChartConfigurationKeys.SERIESNAMES.ToString()]     = new List <string> {
                "Male", "Female", "Children"
            };

            if (!IsPostBack)
            {
                string sqlConnectionString = ConfigurationManager.AppSettings[SqlConnectionKey];
                SqlServerConnection sqlCon = new SqlServerConnection(sqlConnectionString);

                DataTable table = sqlCon.RunSql(Constants.GetDieseasesSql);

                DropDownList1.DataSource     = table;
                DropDownList1.DataTextField  = table.Columns[1].ToString();
                DropDownList1.DataValueField = table.Columns[0].ToString();
                DropDownList1.DataBind();

                DropDownList1.Items.Insert(0, new ListItem()
                {
                    Value = "ALL", Text = "All"
                });

                table = sqlCon.RunSql(Constants.GetYearsStatSql);

                DropDownList2.DataSource     = table;
                DropDownList2.DataTextField  = table.Columns[0].ToString();
                DropDownList2.DataValueField = table.Columns[0].ToString();
                DropDownList2.DataBind();

                dic[ChartConfigurationKeys.QUERY.ToString()] = string.Format(ChartDataSql, DropDownList2.Items[0].Value, "ALL");
                dic[ChartConfigurationKeys.TITLE.ToString()] = string.Format(TitleFormat, DropDownList1.Items[0].Text, DropDownList2.Items[0].Value);

                ChartContainer1.ChartConfigurations = dic;
            }

            if (IsPostBack)
            {
                dic[ChartConfigurationKeys.QUERY.ToString()] = string.Format(ChartDataSql, DropDownList2.SelectedValue, DropDownList1.SelectedValue);
                dic[ChartConfigurationKeys.TITLE.ToString()] = string.Format(TitleFormat, DropDownList1.SelectedItem.Text, DropDownList2.SelectedValue);

                ChartContainer1.ChartConfigurations = dic;
            }

            dic = new Dictionary <string, object>();

            dic[ChartConfigurationKeys.QUERY.ToString()]     = string.Format(Constants.GetDieseaseVsPcountForCurrentYear, DateTime.Now.Year);
            dic[ChartConfigurationKeys.HEIGHT.ToString()]    = 500;
            dic[ChartConfigurationKeys.WIDTH.ToString()]     = 700;
            dic[ChartConfigurationKeys.XVALARRAY.ToString()] = "NAME";
            dic[ChartConfigurationKeys.YVALARRAY.ToString()] = new List <string> {
                "PCOUNT"
            };
            dic[ChartConfigurationKeys.XTITLE.ToString()]          = "Diesease";
            dic[ChartConfigurationKeys.YTITLE.ToString()]          = "Patients";
            dic[ChartConfigurationKeys.TYPE.ToString()]            = SeriesChartType.Pie;
            dic[ChartConfigurationKeys.LEGEND.ToString()]          = "Diesease";
            dic[ChartConfigurationKeys.TITLE.ToString()]           = "Dieseases Vs. Patients";
            dic[ChartConfigurationKeys.VIEWLEGEND.ToString()]      = true;
            dic[ChartConfigurationKeys.PIELABELSTYLE.ToString()]   = "Outside";
            dic[ChartConfigurationKeys.NOOFCHARTSERIES.ToString()] = 1;
            dic[ChartConfigurationKeys.SERIESNAMES.ToString()]     = new List <string> {
                "DieseasesVsPatients"
            };

            ChartContainer2.ChartConfigurations = dic;

            dic = new Dictionary <string, object>();
            dic[ChartConfigurationKeys.QUERY.ToString()]     = Constants.GetPatientBreakDownAgeGenderAndYear;
            dic[ChartConfigurationKeys.HEIGHT.ToString()]    = 500;
            dic[ChartConfigurationKeys.WIDTH.ToString()]     = 700;
            dic[ChartConfigurationKeys.XVALARRAY.ToString()] = "YEAR";
            dic[ChartConfigurationKeys.YVALARRAY.ToString()] = new List <string> {
                "MALECOUNT", "FEMALECOUNT", "CHILDCOUNT"
            };
            dic[ChartConfigurationKeys.XTITLE.ToString()]          = "Year";
            dic[ChartConfigurationKeys.YTITLE.ToString()]          = "Patients";
            dic[ChartConfigurationKeys.TYPE.ToString()]            = SeriesChartType.Column;
            dic[ChartConfigurationKeys.LEGEND.ToString()]          = "Gender";
            dic[ChartConfigurationKeys.TITLE.ToString()]           = "Year Vs. Patients";
            dic[ChartConfigurationKeys.VIEWLEGEND.ToString()]      = true;
            dic[ChartConfigurationKeys.NOOFCHARTSERIES.ToString()] = 3;
            dic[ChartConfigurationKeys.SERIESNAMES.ToString()]     = new List <string> {
                "Male", "Female", "Children"
            };
            ChartContainer3.ChartConfigurations = dic;
        }