SHARE
TWEET

Untitled

a guest May 31st, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void btnChange_Click(object sender, EventArgs e)
  2.         {
  3.             string sUsername = txtUsername.Text;
  4.             string sOPassword = txtOriginalPassword.Text;
  5.             string sNPasswprd = txtNewPassword.Text;
  6.             string sCPassword = txtConfirmPassword.Text;
  7.  
  8.             DataClasses1DataContext dc = new DataClasses1DataContext();
  9.  
  10.             var loginCheck =
  11.                 dc.GetTable<User>().SingleOrDefault(credentials => credentials.Username == sUsername && credentials.Password == sOPassword);
  12.  
  13.             if (sNPasswprd == sCPassword)
  14.             {
  15.                 Table<User> tUser = dc.GetTable<User>();
  16.                 User nUser = new User();
  17.  
  18.                 nUser.Password = sCPassword;
  19.                 nUser.Username = sUsername;
  20.                 //tUser.InsertOnSubmit(nUser);
  21.                 dc.SubmitChanges();
  22.                 this.Close();
  23.             }
  24.             else
  25.             {
  26.                 MessageBox.Show("Unfortunately the Password for that User Account does not exist, or you have incorrectly typed your new passwords!", "Password Change Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  27.  
  28.                 this.Close();
  29.             }
  30.                
  31.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top