public void updateFavoriteNotes() { totalNotes = DB_Data.GetTotalFavoriteNotes(Properties.Settings.Default.UserID); notesPerPage = 100; // This is because we will show only 100 notes for page. actualPage = 1; // If we get less notes than the max notes. if (totalNotes < notesPerPage) { // Max pages set to 1. maxPages = 1; // Blocking those buttons so the user cannot go forward/back. buttonPAGE_BACK.Enabled = false; buttonPAGE_NEXT.Enabled = false; } else { // Max pages set to the value + 1, just to avoid problems with the data showed. maxPages = (totalNotes / notesPerPage) + 1; } // Showing the notes. showFavoriteNotesByPage(1); }
public void updateData() { int id = Properties.Settings.Default.UserID; labelNOTES_TOTALCREATED.Text = Convert.ToString(DB_Data.GetTotalNotes(id)); labelNOTES_FAVORITES.Text = Convert.ToString(DB_Data.GetTotalFavoriteNotes(id)); labelNOTES_DELETED.Text = Convert.ToString(DB_Data.GetTotalDeletedNotes(id)); labelNOTES_USERSCREATED.Text = Convert.ToString(DB_Data.GetTotalUsersCreated()); }