public String getHospitalInfos() { System.IO.TextWriter tw = new System.IO.StringWriter(); DBClient dbc = new DBClient(); dbc.getHospitalInfo().WriteXml(tw); return tw.ToString(); }
protected void Page_Load(object sender, EventArgs e) { String id = Request.QueryString["hos_id"]; DBClient dbc = new DBClient(); DataTable dt = dbc.findHospitalById(id); lbl_name.Text = dt.Rows[0]["f_name"].ToString(); lbl_phone.Text = dt.Rows[0]["f_phoneNumber"].ToString(); lbl_state.Text = dt.Rows[0]["f_add_state"].ToString(); lbl_add.Text = dt.Rows[0]["f_add_street_1"].ToString(); lbl_city.Text = dt.Rows[0]["f_add_city"].ToString(); lbl_introduction.Text = dt.Rows[0]["f_intro"].ToString(); img_hos.ImageUrl = "assets/img/" + id + ".jpg"; }
protected void Page_Load(object sender, EventArgs e) { DBClient dbc = new DBClient(); DataTable dt = dbc.getFirstAidInfo(); StringBuilder sb = new StringBuilder(); foreach (DataRow dr in dt.Rows) { sb.Append("<div class=\"panel msg\">"); sb.Append("<div class=\"panel-heading\">"); sb.Append("<b>" + dr["f_title"] + "</b>"); sb.Append("</div>"); sb.Append("<div class=\"panel-body\">"); sb.Append(dr["f_detail"]); sb.Append("</div>"); sb.Append("</div>"); } lit_firstaid.Text = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { String docId = Request.Form["ctl00$ContentPlaceHolder1$hid_docId"]; if (docId == null) { img_doc.ImageUrl = "assets/img/default-doctor.png"; lbl_msg.Text = "You need to find a doctor at first!"; } else { img_doc.ImageUrl = "assets/img/doc1.png"; DBC.DBClient dbc = new DBC.DBClient(); DataTable dt = dbc.findDoctorById(docId); lbl_doctor.Text = dt.Rows[0]["f_name"].ToString(); lbl_hospital.Text = dt.Rows[0]["f_name1"].ToString(); lbl_specialty.Text = dt.Rows[0]["f_spec_name"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { DBClient dbc = new DBClient(); if (!txb_name.Text.Equals("") || !txb_hos.Text.Equals("") || !ddl_spec.SelectedValue.Equals("") || !ddl_gender.SelectedValue.Equals("")) { String name = txb_name.Text; String hospital = txb_hos.Text; String spec = ddl_spec.SelectedValue; String gender = ddl_gender.SelectedValue; String isAvailable = ddl_avl.SelectedValue; DataTable dt_doc = dbc.findDoctor(name, gender, spec, hospital, isAvailable); dt_doc.Columns.Add("link"); foreach (DataRow dr in dt_doc.Rows) { dr.SetField("link", "docProfile.aspx?docId=" + dr["f_id"]); } gv_doctor.DataSource = dt_doc; gv_doctor.DataBind(); } DataTable dt_spec = dbc.getDoctorType(); ddl_spec.DataSource = dt_spec; ddl_spec.DataTextField = "f_spec_name"; ddl_spec.DataValueField = "f_spec_id"; ddl_spec.DataBind(); DataTable dt_gender = new DataTable(); dt_gender.Columns.Add("text"); dt_gender.Rows.Add("male"); dt_gender.Rows.Add("female"); ddl_gender.DataSource = dt_gender; ddl_gender.DataTextField = "text"; ddl_gender.DataValueField = "text"; ddl_gender.DataBind(); DataTable dt_avl = new DataTable(); dt_avl.Columns.Add("text"); dt_avl.Rows.Add("true"); dt_avl.Rows.Add("false"); ddl_avl.DataSource = dt_avl; ddl_avl.DataTextField = "text"; ddl_avl.DataValueField = "text"; ddl_avl.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string docId = Request.QueryString["docId"].ToString(); img_doc.ImageUrl = "assets/img/doc1.png"; DBC.DBClient dbc = new DBC.DBClient(); DataTable dt = dbc.findDoctorById(docId); lbl_name.Text = dt.Rows[0]["f_name"].ToString(); lbl_phone.Text = "Phone: " + dt.Rows[0]["f_phoneNumber"].ToString(); lbl_spec.Text = "Specialty: " + dt.Rows[0]["f_spec_name"].ToString(); lbl_hos.Text = "Hospital: " + dt.Rows[0]["f_name1"].ToString(); if (dt.Rows[0]["f_available"].ToString().Equals("True")) { lbl_avl.Text = "Appointment: Available"; } else { lbl_avl.Text = "Appointment: Full"; } lbl_profile.Text = lbl_name.Text + " have thirty years experience on " + dt.Rows[0]["f_spec_name"].ToString(); hid_docId.Value = docId; }
protected void Page_Load(object sender, EventArgs e) { if (txb_hos.Text.Equals("")) { } else { String hosName = txb_hos.Text; DBClient dbc = new DBClient(); DataTable dt = dbc.findHospitalByName(hosName); dt.Columns.Add("link"); foreach (DataRow dr in dt.Rows) { dr.SetField("link", "HosDetail.aspx?hos_id=" + dr["f_id"]); } gv_hospital.DataSource = dt; gv_hospital.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { DBClient dbc = new DBClient(); DataTable dt = dbc.getMsg(); int count = 0; String rowStart = "<div class=\"row\">"; String rowEnd = "</div>"; String colStart = "<div class=\"col-md-4\">"; String colEnd = "</div>"; StringBuilder sb = new StringBuilder(); foreach (DataRow dr in dt.Rows) { if (count++ % 3 == 0) { sb.Append(rowStart); } sb.Append(colStart); sb.Append("<div class=\"panel msg\">"); sb.Append("<div class=\"panel-body\">"); sb.Append("<div>"); sb.Append("From: " + dr["f_location"]); sb.Append("</div>"); sb.Append("<div>"); sb.Append("Snd At: " + dr["f_snd_time"]); sb.Append("</div>"); sb.Append("<div>"); sb.Append("Rvd At: " + dr["f_rec_time"]); sb.Append("</div>"); sb.Append("<p>"); sb.Append(dr["f_content"]); sb.Append("</p>"); sb.Append("</div>"); sb.Append("</div>"); sb.Append(colEnd); if (count % 3 == 0) { sb.Append(rowEnd); } lit_msgs.Text = sb.ToString(); } }
public DataTable getHospitalInfo() { DBClient dbc = new DBClient(); return dbc.getHospitalInfo(); }
public DataTable findDoctorByName(String name) { DBClient dbc = new DBClient(); return dbc.findDoctorByName(name); }
public DataTable findDoctor(String name, String gender, String specialty, String hos_id, String isAvailable) { DBClient dbc = new DBClient(); return dbc.findDoctor(name, gender, specialty, hos_id, isAvailable); }