protected void CheckApp_Click(object sender, EventArgs e) { try { string query = "select DoctorId,SlotId from BookingDetails where PatientId = " + Session["userid"] + " and Date = '" + datepicker.Text + "'"; ds = all.ExeAdapter(query, "temp"); DocId = (int)ds.Tables["temp"].Rows[0][0]; SlotId = (int)ds.Tables["temp"].Rows[0][1]; // AppDocTimeLbl.Text = SlotId.ToString(); if (SlotId < 13) { string query1 = "select slot_time from doc_slots where slot_id = " + SlotId + ""; object dc = all.ExeScalar(query1); AppDocTimeLbl.Text = dc.ToString() + " AM"; } else { string query1 = "select slot_time from doc_slots where slot_id = " + SlotId + ""; object dc = all.ExeScalar(query1); AppDocTimeLbl.Text = dc.ToString() + " PM"; } string query2 = "select Name from DoctorDetails where UserId = " + DocId + ""; object dn = all.ExeScalar(query2); AppDocNameLbl.Text = "DR. " + dn.ToString(); } catch { AppDocNameLbl.Text = "NO bookings for" + datepicker.Text; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["user"].ToString() != "") { SignLbl.Text = Session["user"].ToString(); } } catch (Exception ex) { Response.Redirect("LoginReg.aspx"); } DocNameLbl.Text = Session["user"].ToString(); temp = Convert.ToInt32(Session["userid"]); query = "select Email from DoctorDetails where UserId=" + temp + ""; docemail = all.ExeScalar(query).ToString(); string query1 = "select Phone,City,Exprience,Degree1,Degree2,Degree3,Region,Landline1,Fees,Address from DoctorDetails where Email='" + docemail + "'"; ds = all.ExeAdapter(query1, "tempTable"); DocEditPhoneTxt.Text = ds.Tables["temptable"].Rows[0][0].ToString(); DocEditCityTxt.Text = ds.Tables["temptable"].Rows[0][1].ToString(); DocEditExprienceTxt.Text = ds.Tables["temptable"].Rows[0][2].ToString(); DocEditDegree1Txt.Text = ds.Tables["temptable"].Rows[0][3].ToString(); DocEditDegree2Txt.Text = ds.Tables["temptable"].Rows[0][4].ToString(); DocEditDegree3Txt.Text = ds.Tables["temptable"].Rows[0][5].ToString(); DocEditRegionTxt.Text = ds.Tables["temptable"].Rows[0][6].ToString(); DocEditLandlineTxt.Text = ds.Tables["temptable"].Rows[0][7].ToString(); DocEditFeeTxt.Text = ds.Tables["temptable"].Rows[0][8].ToString(); DocEditAddressTxt.Text = ds.Tables["temptable"].Rows[0][9].ToString(); }
protected void CheckApp_Click(object sender, EventArgs e) { string query = "select DoctorId from BookingDetails where PatientId = 10001 and Date = '" + datepicker.Text + "'"; string Did = all.ExeScalar(query).ToString(); string query1 = "select Name from DoctorDetails where UserId = " + Did + " "; DocName.Text = "DR "+ all.ExeScalar(query1).ToString(); string query2 = "select Prescription, Status from PharmacyPrescription where PatientId = 10001 and Date = '" + datepicker.Text + "'"; ds = all.ExeAdapter(query2, "temp"); PrescriptionTxt.Text = ds.Tables["temp"].Rows[0][0].ToString(); string Sts = ds.Tables["temp"].Rows[0][1].ToString(); if (Sts.Equals("paid")) { PaymentChkBox.Checked = true; SubmitBtn.Enabled = false; } }
protected void LRTestNameDrpdwn_SelectedIndexChanged(object sender, EventArgs e) { string query4 = "select PaymentReceived, Status from PathologyTestDetail where TestName = '" + LRTestNameDrpdwn.SelectedItem.ToString() + "' and PatientId = 10001 and Date = '" + datepicker.Text + "'"; ds = all.ExeAdapter(query4, "temp"); AmountTxt.Text = ds.Tables["temp"].Rows[0][0].ToString(); string Sts = ds.Tables["temp"].Rows[0][1].ToString(); if (Sts.Equals("done")) { PaymentChkBox.Checked = true; SubmitBtn.Enabled = false; ReportTxt.Text = Sts; } else { ReportTxt.Text = "this test is yet has to be done"; } }
protected void LogindBtn_Click(object sender, EventArgs e) { string email = LoginEmailTxt.Text; string pwd = LoginPasswordTxt.Text; if (LoginEmailTxt.Text == null || LoginEmailTxt.Text == "" || LoginPasswordTxt.Text == null || LoginPasswordTxt.Text == "") { LoginMsglbl.Text = "Please fill all the fields"; } else { string query = "select Email from EmailPasswordDetails where Email='" + email + "'"; object firstelement = all.ExeScalar(query); try { if (firstelement.ToString() == email) { string query1 = "select * from EmailPasswordDetails where Email='" + email + "'"; ds = all.ExeAdapter(query1, "EmailPwdTable"); if (pwd != ds.Tables["EmailPwdTable"].Rows[0][2].ToString()) { LoginMsglbl.Text = "Password does not Matches"; } else { if (Convert.ToInt32(Session["state"]) == 1) { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); string query2 = "insert into BookingDetails(PatientId,DoctorId,SlotId,Date)values(@patientid,@doctorid,@slotid,@date)"; SqlParameter[] parameter = new SqlParameter[] { new SqlParameter("@patientid", Convert.ToInt32(Session["userid"])), new SqlParameter("@doctorid", Convert.ToInt32(Session["docid"])), new SqlParameter("@slotid", Convert.ToInt32(Session["slotid"])), new SqlParameter("@date", Session["date"].ToString()) }; int x = all.ExeNonQuery(query2, parameter); ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Booking is successfull')", true); Response.Redirect("PatientAfterLogin.aspx"); } else { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); Response.Redirect("Find.aspx"); } } } } catch (Exception ex) { LoginMsglbl.Text = "Email is not Registered"; } } }
protected void LogindBtn_Click(object sender, EventArgs e) { string email = LoginEmailTxt.Text; string pwd = LoginPasswordTxt.Text; if (LoginEmailTxt.Text == null || LoginEmailTxt.Text == "" || LoginPasswordTxt.Text == null || LoginPasswordTxt.Text == "") { LoginMsglbl.Text = "Please fill all the fields"; LoginEmailTxt.Text = string.Empty; LoginPasswordTxt.Text = string.Empty; } else { string query = "select Email from EmailPasswordDetails where Email='" + email + "'"; object firstelement = all.ExeScalar(query); try { if (firstelement.ToString() == email) { string query1 = "select * from EmailPasswordDetails where Email='" + email + "'"; ds = all.ExeAdapter(query1, "EmailPwdTable"); if (pwd != ds.Tables["EmailPwdTable"].Rows[0][2].ToString()) { LoginMsglbl.Text = "Password does not Matches"; } else { if (Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][4]) == 1) { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); Response.Redirect("PatientAfterLogin.aspx"); } else if (Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][4]) == 2) { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); Response.Redirect("DoctorAfterLogin.aspx"); } else if (Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][4]) == 3) { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); Response.Redirect("PathologyAfterLogin.aspx"); } else { Session["user"] = ds.Tables["EmailPwdTable"].Rows[0][3].ToString(); Session["userid"] = Convert.ToInt32(ds.Tables["EmailPwdTable"].Rows[0][0]); Response.Redirect("PharmacyAfterLogin.aspx"); } } } } catch (Exception ex) { LoginMsglbl.Text = "Email is not Registered"; } } }