Esempio n. 1
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            Dentist d = cbDentist.SelectedItem as Dentist;

            if (d == null)
            {
                MessageBox.Show("Please select a Dentist first.");
                return;
            }


            if (txtPasswd.Text.Equals(string.Empty))
            {
                MessageBox.Show("Type your password to updated.");
                return;
            }
            if (!txtPasswd.Text.Equals(txtConfirm.Text))
            {
                MessageBox.Show("Password didn't match. Please try again.");
                return;
            }

            DB.SetPassword(DB.CalculateMD5Hash(txtConfirm.Text), d.UserId);
            MessageBox.Show("Password updated successfully.");
        }