Esempio n. 1
0
        private void PatientProfileById(int Id, string OTP)
        {
            string FirstName = string.Empty;
            string LastName  = string.Empty;
            string Email     = string.Empty;
            string MailBody  = string.Empty;

            SqlParameter[] parameterList =
            {
                new SqlParameter("@Id", Id)
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadPatientProfileById", parameterList);
            if (ds.Tables[0].Rows.Count > 0)
            {
                FirstName = ds.Tables["Table"].Rows[0]["First_Name"].ToString();
                LastName  = ds.Tables["Table"].Rows[0]["Last_Name"].ToString();
            }

            MailBody = FirstName + " " + LastName + "'s OTP is " + OTP;
            SendMail(txtEmail.Value.Trim(), FirstName, LastName, "EHR OTP", MailBody);
        }
Esempio n. 2
0
        private void CountNewRequest()
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Account_Id", Session["AccountId"].ToString()),
                new SqlParameter("@Status",     Status.Request.New)
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_CountAllRequest", parameterList);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Int32 i = Convert.ToInt32(ds.Tables[0].Rows[0]["TotalNewRequests"]);
                if (i > 0)
                {
                    hyplnkCount.Text = "You have  " + ds.Tables[0].Rows[0]["TotalNewRequests"] + "  New Request";
                }
                else
                {
                    hyplnkCount.Visible = false;
                }
            }
        }
Esempio n. 3
0
        private void LoadPatients()
        {
            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadAllPatients");
            grvPatients.DataSource = ds;
            grvPatients.DataBind();
        }
Esempio n. 4
0
        private void LoadRequests()
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Account_Id", Session["AccountId"].ToString())
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadRequests", parameterList);
            grvRequests.DataSource = ds;
            grvRequests.DataBind();
        }
Esempio n. 5
0
        private void LoadPatientProfile(int Id)
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Id", Id)
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            //Byte[] data = new Byte[0];


            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadPatientProfileById", parameterList);
            Byte[] imgbyte = (Byte[])(ds.Tables[0].Rows[0]["Image"]);
            Response.BinaryWrite(imgbyte);
        }
Esempio n. 6
0
        private void LoadMedication(int FromId, int ToId)
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Account_Id", FromId),
                new SqlParameter("@ToId",       ToId)
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadMedication", parameterList);
            if (ds.Tables[0].Rows.Count > 0)
            {
                grvMedication.DataSource = ds;
                grvMedication.DataBind();
            }
        }
Esempio n. 7
0
        private void LoadDoctorProfile(int Id)
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Id", Id)
            };

            dbConnection db = new dbConnection();
            DataSet      ds = new DataSet();

            ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_LoadDoctorProfileById", parameterList);
            if (ds.Tables[0].Rows.Count > 0)
            {
                lblFirstName.Text = ds.Tables["Table"].Rows[0]["First_Name"].ToString();
                lblLastName.Text  = ds.Tables["Table"].Rows[0]["Last_Name"].ToString();
                lblHospital.Text  = ds.Tables["Table"].Rows[0]["Hospital_Name"].ToString();
                lblPhone.Text     = ds.Tables["Table"].Rows[0]["Phone"].ToString();
                txtEmail.Value    = ds.Tables["Table"].Rows[0]["Email"].ToString();
            }
        }
Esempio n. 8
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Session.RemoveAll();

            DataSet ds = new DataSet();

            SqlParameter[] parameterList =
            {
                new SqlParameter("@Email", txtEmail.Text.Trim()),
                new SqlParameter("@Pwd",   EHRDataManager.Encrypt(txtPassword.Text.Trim(),"gftj-5dx7-lsavv1")),
                new SqlParameter("@Role",  hdnRole.Value.Trim())
            };

            dbConnection db = new dbConnection();

            #region Patient Login
            // 1 Means Patient
            if (Convert.ToInt32(hdnRole.Value.Trim()) == 1)
            {
                ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_PatientLogin", parameterList);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["Account_Id"]) != 0)
                    {
                        Session["AccountId"] = ds.Tables[0].Rows[0]["Id"];
                        Session["Role"]      = ds.Tables[0].Rows[0]["Role"];
                        Response.Redirect("frmMyDoctors.aspx");
                    }
                    else
                    {
                        Response.Redirect("frmPatientProfile.aspx");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Invalid User');</script>");
                }
            }
            #endregion

            #region Doctor Login
            // 2 Means Doctor
            if (Convert.ToInt32(hdnRole.Value.Trim()) == 2)
            {
                ds = db.ExecuteQuery(CommandType.StoredProcedure, "usp_DoctorLogin", parameterList);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["Account_Id"]) != 0)
                    {
                        Session["AccountId"] = ds.Tables[0].Rows[0]["Id"];
                        Session["Role"]      = ds.Tables[0].Rows[0]["Role"];
                        Response.Redirect("frmMyPatients.aspx");
                    }
                    else
                    {
                        Response.Redirect("frmDoctorProfile.aspx");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Invalid User');</script>");
                }
            }
            #endregion
        }