private void Bind_District() { try { //dbname = GetDatabaseNameUsingXML("Ranchi"); DataSet ds = new DataSet(); ds = DaObj.Execute_SP("Get_All_district", ViewState["dbname"].ToString()); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { ddldistrict.DataSource = ds.Tables[0]; ddldistrict.DataBind(); } else { ddldistrict.DataSource = null; ddldistrict.DataBind(); } } } catch (Exception ex) { ClientScript.RegisterClientScriptBlock(this.GetType(), "alertMessage", "swal('Error!', '" + ex.Message.ToString() + "', 'error')", true); } }
protected void btnLogin_ServerClick(object sender, EventArgs e) { string username = txtUsername.Value; string Role = ddlRole.SelectedItem.Value; string Password = txtpassword.Value; try { if (Role == "1") { Role = "AD"; } else { Role = "OR"; } string dbname = GetDatabaseNameUsingXML("Ranchi"); DataSet ds = new DataSet(); ds = DaObj.Execute_SP("Authenticate_User '" + username + "', '" + Role + "', '" + Password + "'", dbname); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Exist"].ToString() == "1") { Response.Redirect("volunteer.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "swal('Invalid Username or Password!', 'Please Try Again...', 'warning')", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "swal('Oops..!', 'No Data Available...', 'warning')", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "swal('Oops..!', 'Table Not Found...', 'warning')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "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 { 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); } }