Esempio n. 1
0
        protected void reset_Click(object sender, EventArgs e)
        {
            error.Visible = false;
            success.Visible = false;
            int id = int.Parse(userDrop.SelectedItem.Value);
            string password = pas.Value.ToString();
            string conf = confirm.Value.ToString();
            encrypt en = new encrypt();
            if (password == conf && password != string.Empty)
            {
                string enpassword = en.Encrypt(password);
                try
                {
                    SQL sql = new SQL();
                    sql.resetPassword(id, enpassword);
                    successmsg.InnerText = "Password Reset";
                    success.Visible = true;
                }
                catch (Exception ex)
                {
                    errmsg.InnerText = "Error occoured changing password " + ex.Message.ToString();
                    error.Visible = true;
                }

            }
            else
            {
                errmsg.InnerText = "The passwords do not match..";
                error.Visible = true;
            }
        }