Пример #1
0
        private void Vlozit_Click(object sender, RoutedEventArgs e)
        {
            Model.IdUlice = IdUlice;
            var result = Model.Insert();

            FormularGenerator.GenerujSpravu(result, Model.ErrorMessage);
            if (result)
            {
                DataContext = null;
                DataContext = new SStlp();
            }
        }
Пример #2
0
        private void Vlozit_Click(object sender, RoutedEventArgs e)
        {
            Model.Cislo = CisloStlpu;
            var result = Model.Insert();

            FormularGenerator.GenerujSpravu(result, Model.ErrorMessage);
            if (result)
            {
                DataContext    = null;
                DataContext    = new SInfo();
                Obrazok.Source = null;
            }
        }
Пример #3
0
        private void Upravit_Click(object sender, RoutedEventArgs e)
        {
            if (!HlavnyStackPanel.IsEnabled)
            {
                HlavnyStackPanel.IsEnabled = true;
                return;
            }
            Model.Cislo = CisloStlpu;
            var result = Model.Update();

            FormularGenerator.GenerujSpravu(result, Model.ErrorMessage);
            if (result)
            {
                HlavnyStackPanel.IsEnabled = false;
            }
        }
Пример #4
0
        private void Zmazat_Click(object sender, RoutedEventArgs e)
        {
            var odpoved = MessageBox.Show(SpravaZaznamovWindow.AktualneOkno, "Ste si istý že chcete zmazať túto položku?",
                                          "Upozornenie", MessageBoxButton.OKCancel, MessageBoxImage.Warning);

            if (odpoved == MessageBoxResult.OK)
            {
                var result = Model.Drop();
                FormularGenerator.GenerujSpravu(result, Model.ErrorMessage);
                if (result)
                {
                    Vlozit.Visibility           = Visibility.Collapsed;
                    Zmazat.Visibility           = Visibility.Collapsed;
                    Upravit.Visibility          = Visibility.Collapsed;
                    Prehladavat.Visibility      = Visibility.Collapsed;
                    HlavnyStackPanel.Background = new SolidColorBrush(Colors.LightSalmon);
                }
            }
        }