private void buttonAdd_Click(object sender, RoutedEventArgs e) { UserWraper newUser = new UserWraper(); String password = textBoxPass.Password; String passwordConfirm = textBoxPassConfirm.Password; if (!Validator.ValidPassword(password, passwordConfirm)) { return; } newUser.Login = textBoxLogin.Text; newUser.Password = password; newUser.Firstname = textBoxFirstname.Text; newUser.Surname = textBoxSurname.Text; newUser.Type = (UserType)ComboBoxType.SelectedItem; UsersServiceClient client = new UsersServiceClient(); String sessionId = (String)App.Current.Properties[App.sessionPropertyName]; int savedQuantity = client.Save(sessionId, newUser); if (savedQuantity > 0) { StaffDataGrid.ItemsSource = client.FindAll(sessionId); } }
public void TestDeleteUserLocations() { var usersServiceClient = new UsersServiceClient(); UserLocationsCollection collection = usersServiceClient.GetUserLocations("victor"); int i = 1; }
public void TestSetFavoriteUserLocations() { var usersServiceClient = new UsersServiceClient(); UserLocationsCollection userLocationsCollection = usersServiceClient.GetUserLocations("victor"); usersServiceClient.SetUserLocationAsDefault(userLocationsCollection.Items[0]); int i = 1; }
public Staff() { InitializeComponent(); ComboBoxType.ItemsSource = Enum.GetValues(typeof(UserType)).Cast <UserType>(); UsersServiceClient client = new UsersServiceClient(); String sessionId = (String)App.Current.Properties[App.sessionPropertyName]; StaffDataGrid.ItemsSource = client.FindAll(sessionId); }
public void TestAddUserLocation() { var usersServiceClient = new UsersServiceClient(); var userLocation = new UserLocation { Alt = 0, IsFavorite = true, Lat = 0, Long = 0, Username = "******" }; usersServiceClient.AddUserLocation(userLocation); var userLocation2 = new UserLocation { Alt = 1, IsFavorite = false, Lat = 1, Long = 1, Username = "******" }; usersServiceClient.AddUserLocation(userLocation2); }
public MainWindow() { InitializeComponent(); bindRoomsComboBox(); bindCusstomerComboBox(); datePickerFrom.SelectedDate = DateTime.Today; datePickerTo.SelectedDate = DateTime.Today; ReserversionsServiceClient client = new ReserversionsServiceClient(); String sessionId = (String)App.Current.Properties[App.sessionPropertyName]; ReserverionsDataGrid.ItemsSource = client.FindAll(sessionId); UsersServiceClient usersClient = new UsersServiceClient(); String login = (String)App.Current.Properties[App.loginPropertyName]; if (usersClient.isAdmin(sessionId, login)) { MenuStaff.Visibility = Visibility.Visible; } }
private void buttonUpdate_Click(object sender, RoutedEventArgs e) { UserWraper selectedUser = (UserWraper)StaffDataGrid.SelectedItem; String password = textBoxPass.Password; String passwordConfirm = textBoxPassConfirm.Password; if (!Validator.ValidPassword(password, passwordConfirm)) { return; } selectedUser.Login = textBoxLogin.Text; selectedUser.Password = password; selectedUser.Firstname = textBoxFirstname.Text; selectedUser.Surname = textBoxSurname.Text; selectedUser.Type = (UserType)ComboBoxType.SelectedItem; UsersServiceClient client = new UsersServiceClient(); String sessionId = (String)App.Current.Properties[App.sessionPropertyName]; client.Save(sessionId, selectedUser); }