Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             if (Request.QueryString["ReqId"] != null)
             {
                 Session.Remove("ReqId");
                 Session["ReqId"] = EHRDataManager.Decrypt(Request.QueryString["ReqId"], "gftj-5dx7-lsavv1");
                 LoadPatientProfile(Convert.ToInt32(Session["ReqId"]));
                 LoadMedication(Convert.ToInt32(Session["AccountId"]), Convert.ToInt32(Session["ToId"]));
             }
         }
         catch (Exception ex)
         { }
     }
 }
Exemplo n.º 2
0
        protected void btnVerify_Click(object sender, EventArgs e)
        {
            SqlParameter[] parameterList =
            {
                new SqlParameter("@Id",  txtHidden.Value.Trim()),
                new SqlParameter("@OTP", txtOTP.Text.Trim())
            };

            // string sstr = Server.UrlEncode(EHRDataManager.Encrypt(txtHidden.Value.Trim(), "gftj-5dx7-lsavv1"));
            dbConnection db = new dbConnection();
            int          i  = db.ExecuteNonQuery(CommandType.StoredProcedure, "usp_verifyOTP", parameterList);

            if (i == 1)
            {
                Response.Redirect("frmView.aspx?ReqId='" + Server.UrlEncode(EHRDataManager.Encrypt(txtHidden.Value.Trim(), "gftj-5dx7-lsavv1")) + "'");
            }
            ;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    if (Request.QueryString["ReqId"] != null)
                    {
                        Session.Remove("ReqId");
                        Session["ReqId"] = EHRDataManager.Decrypt(Request.QueryString["ReqId"], "gftj-5dx7-lsavv1");
                        LoadDoctorProfile(Convert.ToInt32(Session["ReqId"]));

                        // Change Request Status  from 'New' to 'Read'
                        UpdateRequestStatus(Convert.ToInt32(Session["ReqId"]), Convert.ToInt32(Status.Request.Read));
                    }
                }
                catch (Exception ex)
                { }
            }
        }
Exemplo n.º 4
0
 protected void btnSignUp_Click(object sender, EventArgs e)
 {
     try
     {
         SqlConnection con = new SqlConnection("Data Source=JIJI;Initial Catalog=EHR;User Id=sa;Password=podanarisa");
         SqlCommand    cmd = new SqlCommand("usp_CreateAccount", con);
         con.Open();
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@Email", txtEmail.Text.Trim());
         cmd.Parameters.AddWithValue("@Pwd", EHRDataManager.Encrypt(txtPwd.Text.Trim(), "gftj-5dx7-lsavv1"));
         cmd.Parameters.AddWithValue("@Role", Session["Role"].ToString());
         cmd.Parameters.Add("@Account_Id", SqlDbType.BigInt);
         cmd.Parameters["@Account_Id"].Direction = ParameterDirection.Output;
         cmd.ExecuteNonQuery();
         int AccountId = Convert.ToInt32(cmd.Parameters["@Account_Id"].Value);
         Session["AccountId"] = AccountId;
         if (AccountId > 1)
         {
             int Role = Convert.ToInt32(Session["Role"]);
             if (Role == 1)
             {
                 Response.Redirect("frmPatientProfile.aspx");
             }
             if (Role == 2)
             {
                 Response.Redirect("frmDoctorProfile.aspx");
             }
             if (Role == 3)
             {
                 Response.Redirect("frmInsuranceProfile.aspx");
             }
         }
         ;
         con.Close();
     }
     catch
     {
         Response.Write("<script>alert('Username not available. Please try with another');</script>");
     }
 }
Exemplo n.º 5
0
 protected void grvRequests_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             e.Row.Attributes.Add("ondblclick", String.Format("window.location='frmViewRequest.aspx?ReqId={0}'", Server.UrlEncode(EHRDataManager.Encrypt(e.Row.Cells[1].Text, "gftj-5dx7-lsavv1"))));
             e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#e0ffff ';this.style.cursor = 'pointer'");
             e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF';");
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 6
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
        }