private void SaveExecute(object parameter) { try { var passwordBox = parameter as PasswordBox; var password = passwordBox.Password; string encryptedString = EncryptionHelper.Encrypt(password); User.Passwd = encryptedString; User = service.AddUser(User); Manager.HotelFloor = Floor; Manager.QualificationsLevel = Level; Manager.UserId = User.ID; service.AddManager(Manager); view.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void SaveExecute(object parameter) { try { var passwordBox = parameter as PasswordBox; var password = passwordBox.Password; string encryptedString = EncryptionHelper.Encrypt(password); User.Passwd = encryptedString; User = service.AddUser(User); Employee.HotelFloor = Floor; Employee.UserId = User.ID; if (Gender.Equals("male")) { Employee.Gender = "m"; } else { Employee.Gender = "f"; } service.AddEmployee(Employee); view.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }