예제 #1
0
        protected void ChangePasswordUser_click(object sender, EventArgs e)
        {
            try
            {
                canvBiz = new CanvasBizProcess();

                if (Request.QueryString["fp"] != null && !string.IsNullOrEmpty(Request["id"]))
                {
                    if (Request.QueryString["fp"].Contains("1") && Request.QueryString["id"] != null)
                    {
                        string cid = Request["id"].ToString();
                        id = HttpUtility.UrlDecode(CommonUtility.Decrypt(Request["id"].ToString()));
                        int status = canvBiz.ChangePasswordUser(id, txtpasswordnew.Text.TrimStart(' ').TrimEnd(' '));
                        string script = string.Empty;
                        if (status != 0)
                        {
                            canvBiz.UpdatefpStatus(id, 0);
                            script = "alert('Password Changed Successfully ... ');" + "location.href='Home.aspx?rp=1';";
                            this.ClientScript.RegisterStartupScript(typeof(Page), "RedirectArticle", script, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CommonUtility objCommon = new CommonUtility();
                objCommon.SendErrorMail(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), SessionData.Customer.CustomerID);
            }
        }
예제 #2
0
        protected void submibmail_Click(object sender, EventArgs e)
        {
            canvBiz = new CanvasBizProcess();
            AppCustomer oAppCustomer = new AppCustomer();

            string uid = canvBiz.GetCustId(txtmailid.Text.TrimStart(' ').TrimEnd(' '));
            try
            {
                if (txtmailid.Text.Contains(">") || txtmailid.Text.Contains("<") || txtmailid.Text.Contains("'") || txtmailid.Text.Contains("--") || txtmailid.Text.Contains("%"))
                {
                    txtmailid.Text = "";
                }
                else
                {
                    if (flag)
                    {
                        string NewTempPass = GenerateNewPassword(8);
                        string temppass = _oEncryptionUtilities.getEncryptedCode(NewTempPass);
                        int chkavalible = canvBiz.VerifyEmailInsertNewPassword(txtmailid.Text.TrimStart(' ').TrimEnd(' '), temppass);

                        if (chkavalible == 1)
                        {
                            int mailstatus = MailTrigger(txtmailid.Text);
                            if (mailstatus == 1)
                            {
                                string script = "alert('Password Sent To Email.');" + "location.href='Home.aspx?';";
                                this.ClientScript.RegisterStartupScript(typeof(Page), "Redirect", script, true);
                                CanvasBizProcess canvasBiz = new CanvasBizProcess();
                                //UPdate fpStatus to 1 as user has requested reset password
                                canvasBiz.UpdatefpStatus(uid, 1);
                                //canvBiz.UpdateTempPwd(txtmailid.Text, temppass);

                            }
                        }
                        else
                        {
                            maillbl.Visible = true;
                            maillbl.Text = " Invalid Email Id /Please Check Email Id Again.";
                            CodeNumberTextBox.Text = "";
                            this.Session["CaptchaImageText"] = GenerateRandomCode();
                            errorlblsecurity.Text = string.Empty;
                        }
                    }
                    else
                    {
                        errorlblsecurity.Style.Add("display", "block");
                        errorlblsecurity.Text = "The Characters Doesn't Match. Please Try Again.";
                        CodeNumberTextBox.Text = "";
                        errorlblsecurity.Focus();
                    }

                }
            }

            catch (Exception ex)
            {
                DigiMa.Common.CommonUtility objCommon = new CommonUtility();
                objCommon.SendErrorMail(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), "");
            }
        }