Ejemplo n.º 1
0
        protected void BtnChangePasswordClick(object sender, EventArgs e)
        {
            SecurePage objSecurePage = new SecurePage();

            try
            {
                int i = ChangePassword(objSecurePage.LoggedInUserId, txtOldPassword.Text, txtNewPassword.Text);

                if (i > 0)
                {
                    var mail = new MailMessage
                    {
                        From    = new MailAddress(ApplicationSettings.Instance.Email),
                        Subject = "AdmissionJankari: Password reset "
                    };
                    var body = _objMailTemplete.MailBodyForGetPassword(objSecurePage.LoggedInUserEmailId, txtNewPassword.Text, objSecurePage.LoggedInUserName);
                    mail.Body = body;
                    mail.To.Add(txtEmailId.Text);
                    mail.IsBodyHtml = true;
                    Utils.SendMailMessageAsync(mail);
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.InnerException.Message;
                }
                const string addInfo = "Error while executing BtnChangePasswordClick in UcChangePassword.ascx  :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }