private void SaveButton_Click(object sender, RoutedEventArgs e) { string login = LoginTextBox.Text, pass = PasswordTextBox.Text, notebooktext = NotebookTextBox.Text; allRegisteredUsersList.AddingTextToUserFile(login, pass, notebooktext + "\n"); MessageBox.Show("Your data is saved successful to your notebook!!!"); }
public void SignIn() { string login, pass; EnterLoginInfo(out login, out pass); Authorization auth = new Authorization(allRegisteredUsersList); if (auth.ValidateRegisteredUser(login, pass)) { Console.WriteLine("\nYour authorization is successful !!!\n"); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Please enter your today's notes to your 'Electronic Notebook' row by row\n" + "Press 'quit' when you finish your writting\n" + "Press 'data' to see the content of your notebook\n"); Console.ForegroundColor = ConsoleColor.White; string notebooktext = "\n" + DateTime.UtcNow; Console.WriteLine(notebooktext); while (true) { notebooktext += "\n" + Console.ReadLine(); if (notebooktext.Contains("quit")) { allRegisteredUsersList.AddingTextToUserFile(login, pass, notebooktext + "\n"); break; } if (notebooktext.Contains("data")) { allRegisteredUsersList.AddingTextToUserFile(login, pass, notebooktext + "\n"); Console.WriteLine("\nData from your notebook:"); Console.WriteLine(GetTextFromUserNotebook(login, pass) + "\n"); break; } } } else { Console.WriteLine("\nYour authorization isn't successful !!! Please try to Log in again or create a new account."); } }