private void ZapiszDokumentBTN_Click(object sender, RoutedEventArgs e)
        {
            var nazwa = UsuwanyNazwa.Text;
            var tresc = UsuwanyTresc.Text;


            var dto = new DocumentDTO()
            {
                Name = nazwa, Content = tresc
            };

            try
            {
                manager.DeleteDocument(dto);
            }
            catch (DocumentExceptions.DocumentNotFoundException exception)
            {
                MessageBox.Show(exception.Message);
            }
            finally
            {
                UsuwanyNazwa.Text = string.Empty;
                UsuwanyTresc.Text = string.Empty;
            }
        }
Example #2
0
        private static void UsunDokument()
        {
            Console.WriteLine("Podaj nzwę dokumentu do usninięcia:");
            string nazwa = Console.ReadLine();

            Console.WriteLine("Podaj treść dokumentu do usninięcia:");
            string tresc = Console.ReadLine();

            DocumentDTO dto = new DocumentDTO();

            dto.Name    = nazwa;
            dto.Content = tresc;

            try
            {
                manager.DeleteDocument(dto);
            }
            catch (DocumentExceptions.DocumentNotFoundException exception)
            {
                Console.WriteLine(exception);
            }
        }