示例#1
0
        protected void UpdatePassword(object sender, EventArgs e)
        {
            Customer customer = (Customer)Session["Customer"];

            customer = customerRepo.GetById(customer.ID);
            string CurrentPassword = Security.Encrypt(customer.Key, txtCurrentPassword.Text);

            if (customer.Password.Equals(CurrentPassword))
            {
                customer.Password = Security.Encrypt(ConfigurationManager.AppSettings["KeyCustomer"], txtNewPassword.Text);
                customer.Key      = ConfigurationManager.AppSettings["KeyCustomer"];
                int i = customerRepo.UpdateCustomer(customer);
                Session["Customer"] = customerRepo.GetById(customer.ID);
                CloseChangePasswordForm(null, null);
            }
            else
            {
                lbChangePassword.Text = "Current password is incorrect!";
                ModalPopupChangePassword.Show();
            }
        }
示例#2
0
 protected void CloseChangePasswordForm(object sender, EventArgs e)
 {
     ModalPopupChangePassword.Hide();
 }