Exemple #1
0
        private void Populate_Helpline(string dist_code)
        {
            try
            {
                dbname = GetDatabaseNameUsingXML("Ranchi");
                DataSet ds = new DataSet();
                ds = DaObj.Execute_SP("Get_Helpline_Data '" + dist_code + "'", dbname);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        GvHospital.DataSource = ds.Tables[0];
                        GvHospital.DataBind();
                    }
                    else
                    {
                        GvHospital.DataSource = null;
                        GvHospital.DataBind();
                        lblNoHospital.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[1].Rows.Count > 0)
                    {
                        GvOxygen.DataSource = ds.Tables[1];
                        GvOxygen.DataBind();
                    }
                    else
                    {
                        GvOxygen.DataSource = null;
                        GvOxygen.DataBind();
                        lblNoOxy.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[2].Rows.Count > 0)
                    {
                        GvPlazma.DataSource = ds.Tables[2];
                        GvPlazma.DataBind();
                    }
                    else
                    {
                        GvPlazma.DataSource = null;
                        GvPlazma.DataBind();
                        lblNoPlazma.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[3].Rows.Count > 0)
                    {
                        GvDoctor.DataSource = ds.Tables[3];
                        GvDoctor.DataBind();
                    }
                    else
                    {
                        GvDoctor.DataSource = null;
                        GvDoctor.DataBind();
                        lblNoDoctor.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[4].Rows.Count > 0)
                    {
                        GvAmbulance.DataSource = ds.Tables[4];
                        GvAmbulance.DataBind();
                    }
                    else
                    {
                        GvAmbulance.DataSource = null;
                        GvAmbulance.DataBind();
                        lblAmbulance.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[5].Rows.Count > 0)
                    {
                        GvFood.DataSource = ds.Tables[5];
                        GvFood.DataBind();
                    }
                    else
                    {
                        GvFood.DataSource = null;
                        GvFood.DataBind();
                        lblNoFood.Text = "Sorry! No Data Available";
                    }
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "alertMessage", "swal('Error!', 'No Table Available', 'error')", true);
                }
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alertMessage", "swal('Error!', '" + ex.Message.ToString() + "', 'error')", true);
            }
        }
        private void Populate_Helpline(string dist_code)
        {
            try
            {
                dbname = GetDatabaseNameUsingXML("Ranchi");
                DataSet ds = new DataSet();
                ds = DaObj.Execute_SP("Get_Helpline_Data '" + dist_code + "'", dbname);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        GvHospital.DataSource = ds.Tables[0];
                        GvHospital.DataBind();
                    }
                    else
                    {
                        GvHospital.DataSource = null;
                        GvHospital.DataBind();
                        lblNoHospital.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[1].Rows.Count > 0)
                    {
                        GvOxygen.DataSource = ds.Tables[1];
                        GvOxygen.DataBind();
                    }
                    else
                    {
                        GvOxygen.DataSource = null;
                        GvOxygen.DataBind();
                        lblNoOxy.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[2].Rows.Count > 0)
                    {
                        GvPlazma.DataSource = ds.Tables[2];
                        GvPlazma.DataBind();
                    }
                    else
                    {
                        GvPlazma.DataSource = null;
                        GvPlazma.DataBind();
                        lblNoPlazma.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[3].Rows.Count > 0)
                    {
                        GvDoctor.DataSource = ds.Tables[3];
                        GvDoctor.DataBind();
                    }
                    else
                    {
                        GvDoctor.DataSource = null;
                        GvDoctor.DataBind();
                        lblNoDoctor.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[4].Rows.Count > 0)
                    {
                        GvAmbulance.DataSource = ds.Tables[4];
                        GvAmbulance.DataBind();
                    }
                    else
                    {
                        GvAmbulance.DataSource = null;
                        GvAmbulance.DataBind();
                        lblAmbulance.Text = "Sorry! No Data Available";
                    }

                    if (ds.Tables[5].Rows.Count > 0)
                    {
                        GvFood.DataSource = ds.Tables[5];
                        GvFood.DataBind();
                    }
                    else
                    {
                        GvFood.DataSource = null;
                        GvFood.DataBind();
                        lblNoFood.Text = "Sorry! No Data Available";
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "ShowMessage('No Table Available','" + MessageType.Error + "');", true);
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message.Replace("'", ""), MessageType.Error);
            }
        }