protected void PatientRegGetStartedBtn_Click(object sender, EventArgs e)
    {
        string Email = PatientRegEmailTxt.Text;

        if (PatientRegEmailTxt.Text == "" || PatientRegNameTxt.Text == "" || PatientRegPhoneTxt.Text == "" ||
            PatientRegGenderRdo.SelectedValue == "")
        {
            PatientRegMsgLbl.Text = "Fill all the field";
        }
        else
        {
            string query        = "select Email from PatientDetails where Email='" + PatientRegEmailTxt.Text + "'";
            object firstElement = all.ExeScalar(query);

            try
            {
                if (firstElement.ToString() == Email)
                {
                    PatientRegMsgLbl.Text = "Email is already registered";
                }
            }
            catch (Exception ex)
            {
                if (PatientRegPwdTxt.Text != PatientRegCnfPwdTxt.Text)
                {
                    PatientRegMsgLbl.Text = "Password does not match";
                }
                else
                {
                    query = "insert into PatientDetails(Name,Email,Phone,Gender)values(@name,@email,@phone,@gender)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@name", PatientRegNameTxt.Text),
                        new SqlParameter("@email", PatientRegEmailTxt.Text),
                        new SqlParameter("@phone", PatientRegPhoneTxt.Text),
                        new SqlParameter("@gender", PatientRegGenderRdo.SelectedItem.Value)
                    };
                    int x = all.ExeNonQuery(query, parameter);

                    string query1 = "select UserId from PatientDetails where Email='" + PatientRegEmailTxt.Text + "'";
                    object userid = all.ExeScalar(query1);
                    query = "insert into EmailPasswordDetails(UserId,Email,Password,Name,CustId)values(@useid,@email,@password,@name,@custid)";
                    SqlParameter[] parameter1 = new SqlParameter[]
                    {
                        new SqlParameter("@useid", Convert.ToInt32(userid)),
                        new SqlParameter("@email", PatientRegEmailTxt.Text),
                        new SqlParameter("@password", PatientRegPwdTxt.Text),
                        new SqlParameter("@name", PatientRegNameTxt.Text),
                        new SqlParameter("@custid", 1)
                    };
                    x = all.ExeNonQuery(query, parameter1);
                    Response.Redirect("PatientAfterLogin.aspx");
                }
            }
            finally
            {
                PatientRegMsgLbl.Text = "Email is already registered";
            }
        }
    }
    protected void LabRegGetStatedBtn_Click(object sender, EventArgs e)
    {
        string Email = LabRegEmailTxt.Text;

        if (LabRegEmailTxt.Text == "" || LabRegNameTxt.Text == "" || LabRegPhoneTxt.Text == "")
        {
            LabRegMsgLbl.Text = "Fill all the field";
        }
        else
        {
            string query        = "select Email from LabDetails where Email='" + LabRegEmailTxt.Text + "'";
            object firstElement = all.ExeScalar(query);

            try
            {
                if (firstElement.ToString() == Email)
                {
                    LabRegMsgLbl.Text = "Email is already registered";
                }
            }
            catch (Exception ex)

            {
                if (LabRegPwdTxt.Text != LabRegCnfPwdTxt.Text)
                {
                    LabRegMsgLbl.Text = "Password does not match";
                }
                else
                {
                    query = "insert into LabDetails(Name,Email,Phone,PathologyName,City)values(@Name,@Email,@Phone,@pathology,@city)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@Name", LabRegNameTxt.Text),
                        new SqlParameter("@Email", LabRegEmailTxt.Text),
                        new SqlParameter("@Phone", LabRegPhoneTxt.Text),
                        new SqlParameter("@pathology", LabRegPathologyNameTxt.Text),
                        new SqlParameter("@city", LabRegCityTxt.Text)
                    };
                    int x = all.ExeNonQuery(query, parameter);

                    string query1 = "select UserId from LabDetails where Email='" + LabRegEmailTxt.Text + "'";
                    object userid = all.ExeScalar(query1);

                    query = "insert into EmailPasswordDetails(UserId,Email,Password,Name,CustId)values(@useid,@email,@password,@name,@custid)";
                    SqlParameter[] parameter1 = new SqlParameter[]
                    {
                        new SqlParameter("@useid", Convert.ToInt32(userid)),
                        new SqlParameter("@email", LabRegEmailTxt.Text),
                        new SqlParameter("@password", LabRegPwdTxt.Text),
                        new SqlParameter("@name", LabRegNameTxt.Text),
                        new SqlParameter("@custid", 3)
                    };
                    x = all.ExeNonQuery(query, parameter1);

                    Response.Redirect("PathologyAfterLogin.aspx");
                }
            }
        }
    }
    protected void DocRegGetStartedBtn_Click(object sender, EventArgs e)
    {
        string Email = DocRegEmailTxt.Text;

        if (DocRegEmailTxt.Text == "" || DocRegNameTxt.Text == "" || DocRegPhoneTxt.Text == "" || DocRegGenderRdo.SelectedValue == "")
        {
            DocRegMsgLbl.Text = "Fill all the field";
        }
        else
        {
            string query        = "select Email from DoctorDetails where Email='" + DocRegEmailTxt.Text + "'";
            object firstElement = all.ExeScalar(query);

            try
            {
                if (firstElement.ToString() == Email)
                {
                    DocRegMsgLbl.Text = "Email is already registered";
                }
            }
            catch (Exception ex)
            {
                if (DocRegPwdTxt.Text != DocRegCnfPwdTxt.Text)
                {
                    DocRegMsgLbl.Text = "Password does not match";
                }
                else
                {
                    query = "insert into DoctorDetails(Name,Email,Phone,Gender,Specialization,City)values(@Name,@Email,@Phone,@Gender,@specialization,@city)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@Name", DocRegNameTxt.Text),
                        new SqlParameter("@Email", DocRegEmailTxt.Text),
                        new SqlParameter("@Phone", DocRegPhoneTxt.Text),
                        new SqlParameter("@Gender", DocRegGenderRdo.SelectedItem.Value),
                        new SqlParameter("@specialization", DocSpecializationTxt.Text),
                        new SqlParameter("@city", DocCityText.Text)
                    };
                    int x = all.ExeNonQuery(query, parameter);

                    string query1 = "select UserId from DoctorDetails where Email='" + DocRegEmailTxt.Text + "'";
                    object userid = all.ExeScalar(query1);

                    query = "insert into EmailPasswordDetails(UserId,Email,Password,Name,CustId)values(@useid,@email,@password,@name,@custid)";
                    SqlParameter[] parameter1 = new SqlParameter[]
                    {
                        new SqlParameter("@useid", Convert.ToInt32(userid)),
                        new SqlParameter("@email", DocRegEmailTxt.Text),
                        new SqlParameter("@password", DocRegPwdTxt.Text),
                        new SqlParameter("@name", DocRegNameTxt.Text),
                        new SqlParameter("@custid", 2)
                    };
                    x = all.ExeNonQuery(query, parameter1);
                    Response.Redirect("DoctorAfterLogin.aspx");
                }
            }
        }
    }
Ejemplo n.º 4
0
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        string query1 = "select UserId from PatientDetails where Email='" + EmailLbl.Text + "'";
        object ui     = all.ExeScalar(query1);
        string query  = "insert into PharmacyPrescription(PatientId,DoctorId,PharmacyId,Prescription,Date)values(@patid,@docid,@pharid,@pres,@date)";

        SqlParameter[] parameter = new SqlParameter[] {
            new SqlParameter("@patid", Convert.ToInt32(ui)),
            new SqlParameter("@docid", Session["userid"]),
            new SqlParameter("@pharid", PharmacyNameDrpdwn.SelectedItem.Value),
            new SqlParameter("@pres", PrescriptionTxt.Text),
            new SqlParameter("@date", picker.Text)
        };
        int x = all.ExeNonQuery(query, parameter);
    }
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {    


        if (PaymentChkBox.Checked)
        {
            string query = "UPDATE PharmacyPrescription SET PaymentReceived='" + AmountTxt.Text + "', Status='paid' WHERE PatientId = 10001 and Date = '" + datepicker.Text + "'";
            int i = all.ExeNonQuery(query);

        }
        else
        {

            AmountTxt.Text = "Upaid";
        }
    }
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        string query2 = "update DoctorDetails set Phone=@phone, City=@city, Exprience=@exprience, Degree1=@degree1, Degree2=@degree2, Degree3=@degree3, Region=@region, Landline1=@landline, Fees=@fees, Address=@address where Email=@email";

        SqlParameter[] parameter = new SqlParameter[] {
            new SqlParameter("@phone", DocEditPhoneTxt.Text),
            new SqlParameter("@city", DocEditCityTxt.Text),
            new SqlParameter("@exprience", DocEditExprienceTxt.Text),
            new SqlParameter("@degree1", DocEditDegree1Txt.Text),
            new SqlParameter("@degree2", DocEditDegree2Txt.Text),
            new SqlParameter("@degree3", DocEditDegree3Txt.Text),
            new SqlParameter("@region", DocEditRegionTxt.Text),
            new SqlParameter("@landline", DocEditLandlineTxt.Text),
            new SqlParameter("@fees", DocEditFeeTxt.Text),
            new SqlParameter("@address", DocEditAddressTxt.Text),
            new SqlParameter("@email", docemail)
        };
        int x = all.ExeNonQuery(query2, parameter);

        Response.Redirect("DoctorAfterLogin.aspx");
    }
Ejemplo n.º 7
0
    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 ReviewSubmitBtn_Click(object sender, EventArgs e)
    {
        string query = "select DoctorId from BookingDetails where PatientId = " + Session["userid"] + " and Date = '" + datepicker.Text + "'";

        ds = all.ExeAdapter(query, "temp");
        int DocId1 = (int)ds.Tables["temp"].Rows[0][0];

        char[] num  = HiddenField1.Value.ToCharArray();
        int    val1 = (int)Char.GetNumericValue(num[0]);

        query = "select Reviewed from ReviewDone where PatientI=" + Session["userid"] + " and DocId=" + DocId1 + "";
        ds    = all.ExeAdapter(query, "temp2");

        try
        {
            int rev = (int)ds.Tables["temp2"].Rows[0][0];
            if (rev == 1)
            {
                ReviewedLbl.Text        = "Already Reviewed";
                ReviewSubmitBtn.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            switch (val1)
            {
            case 1:
                int n;
                query = "select One from StarRate where DocId=" + DocId1 + "";
                try
                {
                    ds    = all.ExeAdapter(query, "temp1");
                    n     = (int)ds.Tables["temp1"].Rows[0][0];
                    n     = n + 1;
                    query = "update StarRate set One=" + n + " where DocId=" + DocId1 + "";
                    int y = all.ExeNonQuery(query);
                }
                catch (Exception ex1)
                {
                    query = "insert into StarRate(DocId,One)values(@docid,@one)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@docid", DocId1),
                        new SqlParameter("@one", 1)
                    };
                    int x = all.ExeNonQuery(query, parameter);
                }

                break;

            case 2:

                query = "select Two from StarRate where DocId=" + DocId1 + "";
                try
                {
                    ds    = all.ExeAdapter(query, "temp1");
                    n     = (int)ds.Tables["temp1"].Rows[0][0];
                    n     = n + 1;
                    query = "update StarRate set Two=" + n + " where DocId=" + DocId1 + "";
                    int y = all.ExeNonQuery(query);
                }
                catch (Exception ex1)
                {
                    query = "insert into StarRate(DocId,Two)values(@docid,@two)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@docid", DocId1),
                        new SqlParameter("@two", 1)
                    };
                    int x = all.ExeNonQuery(query, parameter);
                }

                break;

            case 3:

                query = "select Three from StarRate where DocId=" + DocId1 + "";
                try
                {
                    ds    = all.ExeAdapter(query, "temp1");
                    n     = (int)ds.Tables["temp1"].Rows[0][0];
                    n     = n + 1;
                    query = "update StarRate set Three=" + n + " where DocId=" + DocId1 + "";
                    int y = all.ExeNonQuery(query);
                }
                catch (Exception ex1)
                {
                    query = "insert into StarRate(DocId,Three)values(@docid,@three)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@docid", DocId1),
                        new SqlParameter("@three", 1)
                    };
                    int x = all.ExeNonQuery(query, parameter);
                }

                break;

            case 4:

                query = "select Four from StarRate where DocId=" + DocId1 + "";
                try
                {
                    ds    = all.ExeAdapter(query, "temp1");
                    n     = (int)ds.Tables["temp1"].Rows[0][0];
                    n     = n + 1;
                    query = "update StarRate set Four=" + n + " where DocId=" + DocId1 + "";
                    int y = all.ExeNonQuery(query);
                }
                catch (Exception ex1)
                {
                    query = "insert into StarRate(DocId,Four)values(@docid,@four)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@docid", DocId1),
                        new SqlParameter("@four", 1)
                    };
                    int x = all.ExeNonQuery(query, parameter);
                }

                break;

            case 5:

                query = "select Five from StarRate where DocId=" + DocId1 + "";
                try
                {
                    ds    = all.ExeAdapter(query, "temp1");
                    n     = (int)ds.Tables["temp1"].Rows[0][0];
                    n     = n + 1;
                    query = "update StarRate set Five=" + n + " where DocId=" + DocId1 + "";
                    int y = all.ExeNonQuery(query);
                }
                catch (Exception ex1)
                {
                    query = "insert into StarRate(DocId,Five)values(@docid,@five)";
                    SqlParameter[] parameter = new SqlParameter[]
                    {
                        new SqlParameter("@docid", DocId1),
                        new SqlParameter("@five", 1)
                    };
                    int x = all.ExeNonQuery(query, parameter);
                }

                break;
            }

            query = "insert into ReviewDone(PatientI,DocId,Reviewed)values(@patid,@docid,@review)";
            SqlParameter[] parameter1 = new SqlParameter[]
            {
                new SqlParameter("@patid", Session["userid"]),
                new SqlParameter("@docid", DocId1),
                new SqlParameter("@review", 1)
            };
            all.ExeNonQuery(query, parameter1);

            query = "insert into DocReview(PatientName,PatientId,Review,DocId)values(@patname,@patid,@rev,@docid)";
            SqlParameter[] parameter2 = new SqlParameter[] {
                new SqlParameter("@patname", Session["user"]),
                new SqlParameter("@patid", Session["userid"]),
                new SqlParameter("@rev", DocReviewTxt.Text),
                new SqlParameter("@docid", DocId1)
            };
            all.ExeNonQuery(query, parameter2);
        }
    }