// Zapisywanie wpisu private void SaveEntryBtn_Click(object sender, RoutedEventArgs e) { try { DbConnections.CheckEntry(DbConnections.user, date); if (DbConnections.count > 0) { EditPopup.IsOpen = true; } else { MainBox.Document.GetText(TextGetOptions.None, out string entryText); DbConnections.entry = entryText; DbConnections.author = DbConnections.user; DbConnections.SaveEntry(DbConnections.user, date, entryText); SetText(entryText); SuccessInfo(Messages.SaveSuccess()); } } catch (MySqlException) { EditPopup.IsOpen = false; ErrorInfo(Messages.ConnectionError()); } }
// Usuwanie wpisu private void DeleteEntryBtn_Click(object sender, RoutedEventArgs e) { try { DbConnections.CheckEntry(DbConnections.user, date); if (DbConnections.count > 0) { DeletePopup.IsOpen = true; } else { SetText(""); ErrorInfo(Messages.EntryNotFound()); } } catch (MySqlException) { ErrorInfo(Messages.ConnectionError()); } }