private static string CheckEmail(string email) { if (email == "-1") { return(email); } else { bool temp = kanban.IsValidEmail(email) && kanban.IsUniqueEmail(email); if (temp) { return(email); } else { Console.ForegroundColor = ConsoleColor.Red; Log.Warn("Invalid input: email isnt a valid email or already been used in the system"); Console.WriteLine("please enter a valid email address and make sure it hasn't been used in this system before."); Console.ResetColor(); Console.Write("EmailAddress : "); email = Console.ReadLine(); return(CheckEmail(email)); } } }
private static string CheckEmail(string email) { if (email == "-1") { return(email); } else { bool temp = kanban.IsValidEmail(email) && kanban.IsUniqueEmail(email); if (temp) { return(email); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Invalid Email - please enter a valid email address and make sure that it hasn't been used in this system."); Console.ResetColor(); // Log.Instance.warn("Invalid input - Invalid Email");//log Console.ForegroundColor = ConsoleColor.DarkCyan; Console.Write("EmailAddress :"); email = Console.ReadLine(); return(CheckEmail(email)); } } }