private void Unesi(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit()) { foreach (clsSirovina os in sirovine) { if (os.sifra == sifra) { MessageBox.Show("Sirovina sa tom sifrom VEĆ postoji!"); return; } if (os.naziv == naziv) { MessageBox.Show("Sirovina sa tim nazivom VEĆ postoji!"); return; } } //MessageBox.Show("Sirovina sa tim imenom ili sifrom NE postoji!"); //na ovaj način kažemo da je unos urađen i da je sve ok DialogResult = true; Close(); } else { MessageBox.Show("Došlo je do greške prilikom unosa podataka u edit poljima!"); } //if (BindingGroup.CommitEdit()) //{ // DialogResult = true; // Close(); //} }
private void OkButton_Click(object sender, RoutedEventArgs e) { if (!BindingGroup.CommitEdit()) { return; } Timeline.Filters.Clear(); Timeline.Tag = ""; if (listRadio.IsChecked ?? false) { Timeline.Type = TimelineType.List; Timeline.Tag = (string)lists.SelectedValue; } if (searchRadio.IsChecked ?? false) { Timeline.Type = TimelineType.Search; Timeline.Tag = search.Text; } if (filterRadio.IsChecked ?? false) { Timeline.Type = TimelineType.User; Timeline.Filters.AddRange(filters); } DialogResult = true; }
private void OnSaveSetting(object sender, ExecutedRoutedEventArgs e) { BindingGroup.CommitEdit(); var saveSettingCommand = (ICommand)(DataContext as dynamic).SaveSettingCommand; saveSettingCommand.Execute(e.Parameter); }
private void Izmeni(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); MessageBox.Show("USPESNO STE IZMENILI KONTAKT!"); MainWindow.izmenio = true; this.Close(); }
private void Dodaj(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); MessageBox.Show("USPESNO STE DODALI NOVI KONTAKT!"); MainWindow.dodao = true; this.Close(); }
private void EditorUnos(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit()) { DialogResult = true; this.Close(); } }
private void btnOk(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit()) { DialogResult = true; Close(); } }
private void Klik(object sender, RoutedEventArgs e) { //BindingOperations.GetBindingExpression(unosTeksta, TextBox.TextProperty).UpdateSource(); if (!BindingGroup.CommitEdit()) { MessageBox.Show("Los unos!"); } }
private void OnAddButtonClick(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); if (BindingGroup.HasValidationError) { return; } var addJourneyCommand = (ICommand)(DataContext as dynamic).AddJourneyCommand; addJourneyCommand.Execute(null); }
private void Unos(object sender, RoutedEventArgs e) { //BindingOperations.GetBindingExpression(txtIme, TextBox.TextProperty).UpdateSource(); //BindingOperations.GetBindingExpression(txtPrezime, TextBox.TextProperty).UpdateSource(); BindingGroup.CommitEdit(); //if (DataContext is Osoba o) if (!listaOsoba.Contains(DataContext)) { listaOsoba.Add((Osoba)DataContext); } DataContext = new Osoba(); }
private void Unos(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); if (DataContext is Osoba o) { if (!Osobe.Contains(o)) { Osobe.Add(o); } DataContext = new Osoba(); } }
private void Unos(object sender, RoutedEventArgs e) { if (Baza.Clans.ToList().Contains(DataContext as Clan)) { return; } BindingGroup.CommitEdit(); (DataContext as Clan).PostaoClan = DateTime.Now; Baza.Clans.Add(DataContext as Clan); Baza.SaveChanges(); DataContext = new Clan(); }
/// <summary> /// Сохранить измененные значения в BindingGroup /// </summary> public void SaveValidation(object parameter = null) { if (parameter is BindingGroup) { BindingGroup bindGroup = parameter as BindingGroup; if (bindGroup.CommitEdit()) { bindGroup.BeginEdit(); ReloadInfo(); } } }
private void OK(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit() == true) { DialogResult = true; Close(); } else { MessageBox.Show("Doslo je do greske :("); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit()) { DialogResult = true; Close(); } else { Close(); } }
private void Dodaj_sirovinu(object sender, RoutedEventArgs e) { //binding commitedit vraća true i false if (BindingGroup.CommitEdit()) { DialogResult = true; Close(); } else { MessageBox.Show("NeŠto sa unosom nije uredu!!!"); } }
private void UnosAdr(object sender, RoutedEventArgs e) { if (dgOsobe.SelectedItem == null) { MessageBox.Show("Izaberite osobu!"); return; } Baza db = new Baza(); BindingGroup.CommitEdit(); db.Adresas.Add(a); a.Osobe.Add(db.Osobas.Where(oDB => oDB.ID == o.ID).First()); db.SaveChanges(); o = new Osoba(); a = new Adresa(); }
private void Unos(object sender, RoutedEventArgs e) { Baza db = new Baza(); BindingGroup.CommitEdit(); try { db.Osobas.Add(o); o = new Osoba(); db.SaveChanges(); dgOsobe.ItemsSource = db.Osobas.ToList(); } catch (Exception ee) { MessageBox.Show("Proverite podatke!"); MessageBox.Show(ee.Message); } }
private void OkButton_Click(object sender, RoutedEventArgs e) { // 変更をコミットする BindingGroup.CommitEdit(); // 見やすくするために変数名を短縮する Settings settings = Settings.Default; // パスワードを保存 settings.Password = PasswordBox.Password; settings.ProxyPassword = ProxyPasswordBox.Password; // キーボードショートカットを保存 if (KeyMappingComboBox.SelectedValue != null) { settings.KeyMapping = ((KeyMapping)KeyMappingComboBox.SelectedValue).Name; } settings.KeyBindings.Clear(); foreach (var item in keyBindings.Where(p => p.Key != Key.None)) { settings.KeyBindings.Add(item); } // サウンド設定を保存 settings.SoundBindings.Clear(); foreach (var item in soundBindings) { settings.SoundBindings.Add(item); } // キーワード設定を保存 settings.KeywordBindings.Clear(); foreach (var item in keywordBindings) { settings.KeywordBindings.Add(item); } // メッセージフッタの履歴を保存 if (!settings.TweetFooter.IsNullOrEmpty() && !settings.TweetFooterHistory.Contains(settings.TweetFooter)) { settings.TweetFooterHistory.Add(settings.TweetFooter); } DialogResult = true; }
private void UnosArt(object sender, RoutedEventArgs e) { if (BindingGroup.CommitEdit()) { foreach (Artikal art in SviArtikli) { if (art.Sifra == Sifra) { if (!TrenutniRacun.Artikli.ContainsKey(art)) { TrenutniRacun.Artikli.Add(art, 1); //za domaci kolicina i provera stanja :P } else { TrenutniRacun.Artikli[art] += 1; } dgArtikli.ItemsSource = null; dgArtikli.ItemsSource = TrenutniRacun.Artikli; return; } } MessageBox.Show("Ne postoji artikal sa tom sifrom!"); } }
private void IzgubioFokus(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); }
private void Unos(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); MessageBox.Show(BitConverter.ToString(s.Hash)); }
private void SaveAccount_Click(object sender, RoutedEventArgs e) { // wieder die Standard Farbe nehmen falls man beim zweiten Mal was anderes falsch hat, // damit das erste nicht mehr rot ist. shownameTextBox.ClearValue(TextBox.BorderBrushProperty); shownameTextBox.ClearValue(TextBox.BorderBrushProperty); userTextBox.ClearValue(TextBox.BorderBrushProperty); emailTextBox.ClearValue(TextBox.BorderBrushProperty); passwordBox.ClearValue(TextBox.BorderBrushProperty); imapPop3ServerTextBox.ClearValue(TextBox.BorderBrushProperty); imapPop3PortTextBox.ClearValue(TextBox.BorderBrushProperty); smtpServerTextBox.ClearValue(TextBox.BorderBrushProperty); smtpPortTextBox.ClearValue(TextBox.BorderBrushProperty); ErrorLabel.Content = ""; if (accountListViewModel != null) { //Account hinzufügen try { BindingGroup.CommitEdit(); if (!BindingGroup.HasValidationError) { //settingsViewModel.addAccount((AccountViewModel)DataContext); accountListViewModel.addAccount(shownameTextBox.Text, userTextBox.Text, emailTextBox.Text, passwordBox.Password, (bool)imapRadioButton.IsChecked, imapPop3ServerTextBox.Text, imapPop3PortTextBox.Text, smtpServerTextBox.Text, smtpPortTextBox.Text, signatureTextBox.Text); DialogResult = true; } } catch (ShownameEmptyException) { shownameTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der Anzeigename ist leer!"; } catch (UserEmptyException) { userTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der User ist leer!"; } catch (EmailEmptyException) { emailTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Die E-Mail ist leer!"; } catch (PasswordEmptyException) { passwordBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Das Passwort ist leer!"; } catch (IMAPPOP3ServerEmptyException) { imapPop3ServerTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der IMAP/POP3-Server ist leer!"; } catch (IMAPPOP3PortEmptyException) { imapPop3PortTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der IMAP/POP3-Port ist leer!"; } catch (IMAPPOP3PortFormatException) { imapPop3PortTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der IMAP/POP3-Port ist keine Zahl!"; } catch (SMTPServerEmptyException) { smtpServerTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der SMTP-Server ist leer!"; } catch (SMTPPortEmtpyException) { smtpPortTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der SMTP-Port ist leer!"; } catch (SMTPPortFormatException) { smtpPortTextBox.BorderBrush = Brushes.Red; ErrorLabel.Content = "Der SMTP-Port ist keine Zahl!"; } } else { BindingGroup.CommitEdit(); if (!BindingGroup.HasValidationError) { DialogResult = true; } } }
private void CloseSettings_Click(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); ((AccountListViewModel)DataContext).saveAsync(); Close(); }
private void Izmena(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); Baza.SaveChanges(); }
private void buttonCommit_Click(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); IsEditing = false; }
private void OkButton_Click(object sender, RoutedEventArgs e) { BindingGroup.CommitEdit(); DialogResult = true; }
private void OK(object sender, RoutedEventArgs e) { DialogResult = true; BindingGroup.CommitEdit(); Close(); }