コード例 #1
0
        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();
            //}
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        private void OnSaveSetting(object sender, ExecutedRoutedEventArgs e)
        {
            BindingGroup.CommitEdit();
            var saveSettingCommand = (ICommand)(DataContext as dynamic).SaveSettingCommand;

            saveSettingCommand.Execute(e.Parameter);
        }
コード例 #4
0
 private void Izmeni(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     MessageBox.Show("USPESNO STE IZMENILI KONTAKT!");
     MainWindow.izmenio = true;
     this.Close();
 }
コード例 #5
0
ファイル: Unos.xaml.cs プロジェクト: nasriKurs/WpfKontakt2
 private void Dodaj(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     MessageBox.Show("USPESNO STE DODALI NOVI KONTAKT!");
     MainWindow.dodao = true;
     this.Close();
 }
コード例 #6
0
ファイル: Editor.xaml.cs プロジェクト: vanedvinson/To-do
 private void EditorUnos(object sender, RoutedEventArgs e)
 {
     if (BindingGroup.CommitEdit())
     {
         DialogResult = true;
         this.Close();
     }
 }
コード例 #7
0
 private void btnOk(object sender, RoutedEventArgs e)
 {
     if (BindingGroup.CommitEdit())
     {
         DialogResult = true;
         Close();
     }
 }
コード例 #8
0
        private void Klik(object sender, RoutedEventArgs e)
        {
            //BindingOperations.GetBindingExpression(unosTeksta, TextBox.TextProperty).UpdateSource();

            if (!BindingGroup.CommitEdit())
            {
                MessageBox.Show("Los unos!");
            }
        }
コード例 #9
0
        private void OnAddButtonClick(object sender, RoutedEventArgs e)
        {
            BindingGroup.CommitEdit();
            if (BindingGroup.HasValidationError)
            {
                return;
            }
            var addJourneyCommand = (ICommand)(DataContext as dynamic).AddJourneyCommand;

            addJourneyCommand.Execute(null);
        }
コード例 #10
0
 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();
 }
コード例 #11
0
 private void Unos(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     if (DataContext is Osoba o)
     {
         if (!Osobe.Contains(o))
         {
             Osobe.Add(o);
         }
         DataContext = new Osoba();
     }
 }
コード例 #12
0
 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();
 }
コード例 #13
0
 /// <summary>
 /// Сохранить измененные значения в BindingGroup
 /// </summary>
 public void SaveValidation(object parameter = null)
 {
     if (parameter is BindingGroup)
     {
         BindingGroup bindGroup = parameter as BindingGroup;
         if (bindGroup.CommitEdit())
         {
             bindGroup.BeginEdit();
             ReloadInfo();
         }
     }
 }
コード例 #14
0
 private void OK(object sender, RoutedEventArgs e)
 {
     if (BindingGroup.CommitEdit() == true)
     {
         DialogResult = true;
         Close();
     }
     else
     {
         MessageBox.Show("Doslo je do greske :(");
     }
 }
コード例 #15
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (BindingGroup.CommitEdit())
     {
         DialogResult = true;
         Close();
     }
     else
     {
         Close();
     }
 }
コード例 #16
0
 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!!!");
     }
 }
コード例 #17
0
        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();
        }
コード例 #18
0
        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);
            }
        }
コード例 #19
0
        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;
        }
コード例 #20
0
 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!");
     }
 }
コード例 #21
0
 private void IzgubioFokus(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
 }
コード例 #22
0
 private void Unos(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     MessageBox.Show(BitConverter.ToString(s.Hash));
 }
コード例 #23
0
        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;
                }
            }
        }
コード例 #24
0
 private void CloseSettings_Click(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     ((AccountListViewModel)DataContext).saveAsync();
     Close();
 }
コード例 #25
0
 private void Izmena(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     Baza.SaveChanges();
 }
コード例 #26
0
 private void buttonCommit_Click(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     IsEditing = false;
 }
コード例 #27
0
 private void OkButton_Click(object sender, RoutedEventArgs e)
 {
     BindingGroup.CommitEdit();
     DialogResult = true;
 }
コード例 #28
0
 private void OK(object sender, RoutedEventArgs e)
 {
     DialogResult = true;
     BindingGroup.CommitEdit();
     Close();
 }