protected void btnLogin_Click(object sender, ImageClickEventArgs e) { if (rdoDoctor.Checked == true) { String sql = "select * from login where username='******' and password='******' and type='doctor'"; DataSet ds = dbe.getData(sql); if (ds.Tables[0].Rows.Count > 0) { Session["userid"] = txtUname.Text; Session["usertype"] = "Doctor"; Response.Redirect("dochome.aspx"); } else { lblLoginMsg.Text = "Invalid username/password"; } } else if (rdoHospital.Checked == true) { String sql = "select * from login where username='******' and password='******' and type='hospital'"; DataSet ds = dbe.getData(sql); if (ds.Tables[0].Rows.Count > 0) { Session["userid"] = txtUname.Text; Session["usertype"] = "Hospital"; Response.Redirect("hosphome.aspx"); } else { lblLoginMsg.Text = "Invalid username/password"; } } }
protected void Page_Load(object sender, EventArgs e) { dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); String bg = Request.QueryString["grp"]; String dist = Request.QueryString["dist"]; String sql = "select DonorName,Sex,Age,Phone,Mobile,District from BloodDonation where BloodGroup='" + bg + "'"; if (dist != "any") { sql += " and District='" + dist + "'"; } ds.Clear(); ds = dbe.getData(sql); if (ds.Tables[0].Rows.Count == 0) { lblMsg.Text = "No results found"; } else { gvResults.DataSource = ds.Tables[0]; gvResults.DataBind(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { String dob = Request.Form.Get("txtDOB"); if (txtDocName.Text == "" || txtAge.Text == "" || txtOnline_from.Text == "" || txtOnline_to.Text == "" || dob == "") { lblempty.Text = "Some required fields missing"; return; } String dname = txtDocName.Text; String age = txtAge.Text; String mstatus; if (rdoSingle.Checked == true) { mstatus = "Single"; } else { mstatus = "Maried"; } String sex; if (rdoMale.Checked == true) { sex = "Male"; } else { sex = "Female"; } String spec = ddlSpec.Text; String qlfn = ddlQlfn.Text; String con_from = txtConsult_from.Text; String con_to = txtConsult_to.Text; String online_from = txtOnline_from.Text; String online_to = txtOnline_to.Text; String regdate = DateTime.Now.ToShortDateString(); String sql = "select ID,hosp_name from hosp_reg where Username='******'"; DataSet ds = dbe.getData(sql); String hospID = ds.Tables[0].Rows[0]["ID"].ToString(); String hospName = ds.Tables[0].Rows[0]["hosp_name"].ToString(); sql = "insert into Hosp_DoctorsList(DoctorName,Age,DOB,Sex,Qualification,Specialization,MStatus," + "Consult_From,Consult_To,Online_From,Online_To,HospitalName,HospitalID,Regdate) values('" + dname + "'," + age + ",'" + dob + "','" + sex + "','" + qlfn + "','" + spec + "','" + mstatus + "','" + con_from + "','" + con_to + "','" + online_from + "','" + online_to + "','" + hospName + "'," + hospID + ",'" + regdate + "')"; int x = dbe.putData(sql); if (x > 0) { Response.Redirect("hosphome.aspx?id=0"); } else { lblErmsg.Text = "Submision operation failed"; } }
protected void Page_Load(object sender, EventArgs e) { dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); String sql = "select Name,Email,Description from ConsultInfo where CDate='" + DateTime.Now.ToShortDateString() + "'"; ds = dbe.getData(sql); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["userid"] == null) { Response.Redirect("index.aspx"); } dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); if (!IsPostBack) { String duserid = Session["userid"].ToString(); ds = dbe.getData("select ID from doc_reg where Username='******'"); String id = ds.Tables[0].Rows[0][0].ToString(); string sql = "select ClientName,Age,Sex,Address,City,State,CONVERT(CHAR(11), AppDate, 106) as AppDate from Doc_AppInfo where DoctorID=" + id; ds.Clear(); ds = dbe.getData(sql); gvTPL.DataSource = ds.Tables[0]; gvTPL.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["userid"] == null) { Response.Redirect("index.aspx"); } dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); if (!IsPostBack) { String huserid = Session["userid"].ToString(); ds = dbe.getData("select ID from hosp_reg where Username='******'"); String hid = ds.Tables[0].Rows.ToString(); String sql = "select DoctorName,Age,DOB,Sex,Qualification,Specialization,MStatus from Hosp_DoctorsList where HospitalID=" + hid; ds.Clear(); ds = dbe.getData(sql); gvDocList.DataSource = ds.Tables[0]; gvDocList.DataBind(); } }
protected void btnShow_Click(object sender, EventArgs e) { String sql = "Select DonorName,Sex,Contact,City,District,CONVERT(CHAR(11), Regdate, 106) as Regdate from Donation "; if (ddlOrgon.Text != "--Select--") { sql += " where Orgon='" + ddlOrgon.Text + "'"; } DataSet ds = dbe.getData(sql); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["userid"] == null) { Response.Redirect("index.aspx"); } dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); if (!IsPostBack) { String huserid = Session["userid"].ToString(); ds = dbe.getData("select ID from hosp_reg where Username='******'"); String id = ds.Tables[0].Rows[1][1].ToString(); string sql = "SELECT ClientName, Age, Sex, Address, City, State, " + "(SELECT DoctorName FROM Hosp_DoctorsList AS B WHERE (ID = A.DoctorName)) AS DoctorName," + "CONVERT(CHAR(11), AppDate, 106) AS AppDate FROM Hosp_Appnfo AS A WHERE (HospitalID = " + id + ")"; ds.Clear(); ds = dbe.getData(sql); gvTPL.DataSource = ds.Tables[0]; gvTPL.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { ddlSpec.Attributes.Add("onchange", "getHospNames(this.value)"); dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); if (!IsPostBack) { ddlSpec.Items.Add("--Select--"); DataSet ds = dbe.getData("select Distinct Specialization from Hosp_DoctorsList"); foreach (DataRow dr in ds.Tables[0].Rows) { ddlSpec.Items.Add(dr["Specialization"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); ddlSpec.Attributes.Add("onchange", "getDocNames(this.value)"); //ddlDocList.Attributes.Add("onchange", "getInfo(this.value)"); btnSave.Attributes.Add("onclick", "validateForm()"); if (!IsPostBack) { ddlSpec.Items.Add("--Select--"); DataSet ds = dbe.getData("select Distinct specialization from doc_reg"); foreach (DataRow dr in ds.Tables[0].Rows) { ddlSpec.Items.Add(dr["specialization"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { dbe = new DBExplorer(ConfigurationManager.ConnectionStrings["Fedora"].ConnectionString); dbe.OpenConnection(); ds = new DataSet(); string sql = "SELECT Provider,Address,Phone,Mobile,City,District from AmbulanceService "; if (Request.QueryString["id"] != "any") { sql += " where District='" + Request.QueryString["id"] + "'"; } ds.Clear(); ds = dbe.getData(sql); if (ds.Tables[0].Rows.Count == 0) { lblmsg.Text = "No results found"; return; } GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }