Esempio n. 1
0
        public static void Login()
        {
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Hi kanban's user ! please enter your Email and password");
            Console.ResetColor();
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("NOTE : In order to return to the menu, press '-1' ");
            Console.ResetColor();
            Console.Write("Email : ");
            string email = Console.ReadLine();

            Console.Write("Password :"******"-1" & password != "-1")
            {
                if (kanban.LogIn(email, password))//password and email are in the system;
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("Logeedin successfully! ");
                    Console.ResetColor();
                    isLogged = true;

                    PrintBoard();
                    // מה קורה כשמתחברים??
                    UserOption();
                }
                else // if the email and password are incorrect
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Login failed!! your email or password is incorrect!");
                    Console.ResetColor();
                    Login();
                }
            }
            else // the user wants to go back to menu
            {
                Start();
            }
        } // צריך לאתחל את השדות יוזר ובורד בקנבןבורד
Esempio n. 2
0
        public static void Login()
        {
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.WriteLine("Hello Kanban user! Please enter your email and password.");
            Console.ResetColor();
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("NOTE : In order to go back to the menu, press '-1'\n");
            Console.ResetColor();
            Console.Write("Email : ");
            string email = Console.ReadLine();

            if (email != "-1")
            {
                if (kanban.IsValidEmail(email))
                {
                    if (!(kanban.IsUniqueEmail(email)))
                    {
                        Console.Write("Password : "******"-1")
                        {
                            if (kanban.LogIn(email, password))//password and email are in the system;
                            {
                                Console.WriteLine("");
                                Console.ForegroundColor = ConsoleColor.DarkGreen;
                                Console.WriteLine("Logeed in successfully!\n");
                                Log.Info("User with email " + email + "logged in.");
                                Console.ResetColor();
                                PrintBoard();
                                UserOption();
                            }
                            else
                            {
                                Console.ForegroundColor = ConsoleColor.Red;
                                Log.Error("Password do not match to user.");
                                Console.WriteLine("Login failed! Your password is incorrect.\n");
                                Console.ResetColor();
                                Login();
                            }
                        }
                        else //if the user wants to go back to menu
                        {
                            Start();
                        }
                    }
                    else //if the email isnt in the system
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Log.Warn("Email address does not exist in the system.");
                        Console.WriteLine("Please enter a valid email!\n");
                        Console.ResetColor();
                        Login();
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Log.Warn("Invalid input: Email address isnt legit.");
                    Console.WriteLine("Please enter a valid email adress.\n");
                    Console.ResetColor();
                    Login();
                }
            }
            else // the user wants to go back to menu
            {
                Start();
            }
        }