static bool UserAddControl(string _UserName) { bool control = false; for (int i = 0; i < Database.Count; i++) { CustomerY temp = (CustomerY)Database[i]; if (temp.UserName == _UserName) { control = true; break; } } return(control); }
public static void UserEmail(CustomerY M) { if (M != null && !string.IsNullOrEmpty(M.UserName) && !string.IsNullOrEmpty(M.email)) { bool emailControl = EmailControl(M.email); if (emailControl) { Console.WriteLine("the email adress you want to add is already suscribed"); } else { Database.Add(M); Console.WriteLine("New suscribtion process is successfull"); } } }