private void add_note(object sender, RoutedEventArgs e) { string title = note_sub.Text; string body = note_body.Text; Baza.AddNote(title, body); note_sub.Text = String.Empty; note_body.Text = String.Empty; note.Content = "Dodano notatkę"; List <Note> note2 = new List <Note>(); note2 = Baza.NoteList2(); dataGrid4.ItemsSource = note2; }
public static void addNoteInterface(string notatka) { Console.ForegroundColor = ConsoleColor.Magenta; Functions.createFrame(42, 3, 74, 19); Console.ForegroundColor = ConsoleColor.Magenta; Console.SetCursorPosition(48, 6); Console.Write(" Dodaj Nową Notatke"); Console.SetCursorPosition(49, 9); Console.WriteLine(" Nazwa notatki:"); Console.SetCursorPosition(51, 10); string temat = Console.ReadLine(); Console.SetCursorPosition(49, 14); Console.WriteLine("[Enter] - Potwierdź"); Console.SetCursorPosition(49, 16); Console.WriteLine(" [Esc] - Odrzuć "); Console.ResetColor(); ConsoleKeyInfo key; key = Console.ReadKey(); if (key.Key == ConsoleKey.Enter) { Baza.AddNote(temat, notatka); Functions.createNoteInterface(); } if (key.Key == ConsoleKey.Escape) { Functions.createNoteInterface(); } }