Esempio n. 1
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string userid = "";

            try
            {
                if (Session["userid"] != null)
                {
                    userid = Session["userid"].ToString();
                }
                else if (Session["forgetpwduser"] != null)
                {
                    userid = Session["forgetpwduser"].ToString();
                }
                ADUserDetails adObj = new ADUserDetails();
                adObj.sendSMSDetails(userid);
                //getuserMobileNo
                Response.Redirect("ValidateOTP.aspx");
            }
            catch (Exception er)
            {
                Response.Redirect("ValidateOTP.aspx");
            }
        }
Esempio n. 2
0
        protected void validateUserQAs()
        {
            string userid = null;

            try
            {
                if (Session["userid"] != null)
                {
                    userid = Session["userid"].ToString();
                    //  displayuser.Text = "User: "******"username"].ToString();
                }
                else if (Session["forgetpwduser"] != null)
                {
                    userid = Session["forgetpwduser"].ToString();
                }
                displayuser.Text = "User: "******"";
                String str2 = "";

                //if (QASecurity.Decryptdata(Label1.Attributes["answer1"].ToString()).Equals(answer1.Text, StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                //    if (QASecurity.Decryptdata(Label2.Attributes["answer1"].ToString()).Equals(answer2.Text,StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                //    if (QASecurity.Decryptdata(Label3.Attributes["answer1"].ToString()).Equals(answer3.Text, StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                if (QASecurity.Decryptdata(Session["answer1"].ToString()).Equals(answer1.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }

                if (QASecurity.Decryptdata(Session["answer2"].ToString()).Equals(answer2.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }

                if (QASecurity.Decryptdata(Session["answer3"].ToString()).Equals(answer3.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }



                if (j >= 2)
                {
                    //this is where SMS need to be send

                    ADUserDetails adObj = new ADUserDetails();
                    if (adObj.sendSMSDetails(userid))
                    {
                        Response.Redirect("ValidateOTP.aspx");
                    }
                    else
                    {
                        resultlable.Text      = "Mobile number not available/configured, Please contact Administrator";
                        resultlable.ForeColor = System.Drawing.Color.Red;
                    }
                    //getuserMobileNo
                }
                else
                {
                    // resultlable.Text = "Atleast 2 answers should match, Please verify again";
                    // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Atleast 2 answers should match, Please verify again')", true);
                    //this.Page.EnableViewState = true;
                    Session.Add("answermismatch", "true");
                    Response.Redirect("RestPasswordQA.aspx", false);
                    //return;
                }

                /*
                 * if (answer1.Text.Equals(q1hash[3].ToString()) && answer2.Text.Equals(q2hash[3].ToString()) && answer3.Text.Equals(q3hash[3].ToString()) && answer4.Text.Equals(q4hash[3].ToString()) && answer5.Text.Equals(q5hash[2].ToString()) && answer6.Text.Equals(q5hash[4].ToString()))
                 * {
                 *  Response.Redirect("wer.aspx");
                 * }
                 * else
                 * {
                 *  resultlable.Text = "Answers are not matching, Please verify again";
                 *  return;
                 * }
                 *
                 */
            }
            catch (Exception er)
            {
            }
        }