private void ChangePass(object sender, RoutedEventArgs e) { try { if (!Validator.ValidTextBoxes(this.OldPassword.Password, this.NewPass.Password, this.RepNewPass.Password)) { MessageBox.Show("Passwords not input"); } else if (!Validator.CheckPassword(this.NewPass.Password, this.RepNewPass.Password)) { MessageBox.Show("New passwords non Equal"); } else if (!Validator.CheckPassword(thisUser.Password, Crypt.CryptPassword(this.OldPassword.Password))) { MessageBox.Show("Old passwords non Equal"); } else { try { thisUser.ChangePass(this.NewPass.Password); ServerObject.SendMessage("13", thisUser.ToString()); MessageBox.Show("Password is changed"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//constructor public User(string pName, string pSurName, string pNickName, string pGender, string pBirthday, string pCountry, string pCity, string pPassword) { this.Name = pName; this.SurName = pSurName; this.NickName = pNickName; this.Gender = pGender; this.Birthday = pBirthday; this.Country = pCountry; this.City = pCity; this.Password = Crypt.CryptPassword(pPassword); }
public void ChangePass(string pass) { this.Password = Crypt.CryptPassword(pass); }
public User(string name, string password) { this.NickName = name; this.Password = Crypt.CryptPassword(password); }