private void RefreshTextBoxes() { CustomerIdTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ContactInfoTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NicTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); }
private void Save_Click_Button(object sender, RoutedEventArgs e) { if (NameTextBox.Text == String.Empty || SurnameTextBox.Text == String.Empty || LoginTextBox.Text == String.Empty || PasswordTextBox.Text == String.Empty) { MessageBox.Show("Uzupełnij puste pola!"); return; } Courier us = null; try { us = DB.CouriersList.Where(u => u.Login == LoginTextBox.Text).Single(); } catch (Exception) { } if (us != null && css.Login != LoginTextBox.Text) { MessageBox.Show("Podany login jest zajety!"); return; } BindingExpression binding = NameTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); binding = SurnameTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); binding = PasswordTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); binding = LoginTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); MessageBox.Show("Aktualizacja danych powiodła się!"); }
private void DiscardButton_Click(object sender, RoutedEventArgs e) { // revert to original employee information NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); EmployeeIdTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ContactInfoTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); }
private void UpdateButton_OnClick(object sender, RoutedEventArgs e) { if (SelectedCustomer == null) { MessageBox.Show("Please select a customer", "GOLDLINE", MessageBoxButton.OK); } else if (NameTextBox.Text == "" || ContactInfoTextBox.Text == "" || NicTextBox.Text == "") { MessageBox.Show("Please enter valid inputs", "GOLDLINE", MessageBoxButton.OK); } else { if (ValidateValues()) { _customerHandler.UpdateCustomer((Customer)CustomerDataGrid.SelectedItem, NameTextBox.Text, NicTextBox.Text, ContactInfoTextBox.Text); MessageBox.Show("Changes updated successfully", "GOLDLINE", MessageBoxButton.OK); CustomerDataGrid.Items.Refresh(); NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NicTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ContactInfoTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); } else { MessageBox.Show("Please enter valid inputs", "GOLDLINE", MessageBoxButton.OK); } } }
private void refreshTextBoxes() { EmployeeIdTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ContactInfoTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); JoinedOnTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ActiveCheckBox.GetBindingExpression(ToggleButton.IsCheckedProperty)?.UpdateTarget(); }
private void OKHandler(ContentDialog sender, ContentDialogButtonClickEventArgs args) { BindingExpression bindingExpressionName = NameTextBox.GetBindingExpression(TextBox.TextProperty); bindingExpressionName.UpdateSource(); BindingExpression bindingExpressionComment = CommentTextBox.GetBindingExpression(TextBox.TextProperty); bindingExpressionComment.UpdateSource(); }
private void OKButton_Click(object sender, RoutedEventArgs e) { BindingExpression binding = NameTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); binding = MaxLevelTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); binding = MaxScoreTextBox.GetBindingExpression(TextBox.TextProperty); binding.UpdateSource(); DialogResult = true; Close(); }
private void displayValidation() { DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ImageTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TypesComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); EraComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TouristicComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IncomeTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DateTextBox.GetBindingExpression(Xceed.Wpf.Toolkit.MaskedTextBox.TextProperty).UpdateSource(); DateComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); }
private void EditTypeButton_Click(object sender, RoutedEventArgs e) { newType.Description = DescriptionTextBox.Text; newType.Name = NameTextBox.Text; newType.Icon = IconTextBox.Text; IdTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); bool validation = ValidateForm(); if (validation == false) { return; } EditTypeCallback(newType); //this.DialogResult = true; this.Close(); }
private void RefreshTextBoxes() { EmployeeIdTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); LastPaymentDateTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); }
private void ForceValidation() { NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); SerialNoTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); StockLevelTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); }
public bool Validate() { NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); return(false); }
private void DiscardButton_Click(object sender, RoutedEventArgs e) { NameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); NicTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); ContactInfoTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget(); }