Ejemplo n.º 1
0
        private static ContactMethod GetUserContactMethod(Invitee invitee)
        {
            List <ContactMethod> newContactMethods = new List <ContactMethod> {
                ContactMethod.Email, ContactMethod.Mail, ContactMethod.Phone, ContactMethod.WhatsApp
            };
            ContactMethod methods = new ContactMethod();

            do
            {
                int i = 1;
                Console.WriteLine("kies een contact methode");
                foreach (var item in newContactMethods)
                {
                    Console.WriteLine($"{i}) {item}");
                    i++;
                }
                int result;
                if (int.TryParse(Console.ReadLine(), out result) && result > 0 && result <= newContactMethods.Count)
                {
                    methods |= newContactMethods[result - 1];
                    newContactMethods.RemoveAt(result - 1);
                }
                else
                {
                    Console.WriteLine($"geef een numer tussen 1 en {newContactMethods.Count} op");
                }
            } while (GetUserInput("wilt u meer toevoegen? druk \"y\" en ENTER", false) == "y" || newContactMethods.Count == 4);
            GetRelevantContactMethods(invitee, methods);
            return(methods);
        }
Ejemplo n.º 2
0
 private static void GetRelevantContactMethods(Invitee invitee, ContactMethod contactMethod)
 {
     if (contactMethod.HasFlag(ContactMethod.Email))
     {
         invitee.Email = GetUserInput("een emailadres");
     }
     if (contactMethod.HasFlag(ContactMethod.Mail))
     {
         invitee.Adress = GetUserInput("een postadress");
     }
     if (contactMethod.HasFlag(ContactMethod.Phone) || contactMethod.HasFlag(ContactMethod.WhatsApp))
     {
         invitee.phoneNumber = GetUserInput("je Telefoonnummer");
     }
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            // verkrijg de organisator informatie
            Organizer organizer = new Organizer(GetUserInput("de naam van de organisator"), GetUserInput("eventuele tussenvoegsels", false), GetUserInput("de achternaam van de organisator"));

            organizer.Email       = GetUserInput("Emailadres van de organisator");
            organizer.phoneNumber = GetUserInput("telefoon nummer van de organisator");
            organizer.Gender      = GetUserGender("het geslacht van de organisator");

            // verkijg event informatie
            Activity activity = new Activity(GetUserInput("de naam van het evenement"), GetActivityDate("de datum (dd-mm-yyyy) van het evenement", true), GetUserInput("een omschrijving van het evenement", false));

            // collectie van genodigden
            List <Invitee> Invitees = new List <Invitee>();

            do
            {
                Invitee newInvitee = new Invitee(GetUserInput("de voornaam van de genodigde"), GetUserInput("eventuele tussenvoegsels", false), GetUserInput("de achternaam van de genodigde"));
                newInvitee.Gender           = GetUserGender("het geslacht van de deelnemer");
                newInvitee.MyContactMethods = GetUserContactMethod(newInvitee);
                Invitees.Add(newInvitee);
                Console.Clear();
            } while (GetUserInput("Wilt u meer gasten toevoegen?\n)Y\n)N") == "Y");

            Console.WriteLine($"de activiteit {activity.Name} wordt georganiseerd door: {organizer.FullName} op {activity.Date}\nDe Bevestigingen worden verstuurd naar: {organizer.Email}\n{activity.Description}");
            foreach (var item in Invitees)
            {
                if (item.MyContactMethods.HasFlag(ContactMethod.Email))
                {
                    Console.WriteLine($"\nTHIS IS AN EMAIL\nDear{(item.Gender == Gender.Female? " Madame " : item.Gender == Gender.Male? " sir ": string.Empty) }{item.FullName},\n\n you are invited to {activity.Name} organised by {organizer.FullName}.\n the event will be held on {activity.Date.ToShortDateString()} please reply to {organizer.Email} to let them know wether you are willing to attend.\nThis message will be send to your {item.MyContactMethods}"); item.Email = GetUserInput("een emailadres");
                }
                if (item.MyContactMethods.HasFlag(ContactMethod.Mail))
                {
                    Console.WriteLine($"\nTHIS IS A LETTER \nDear{(item.Gender == Gender.Female? " Madame " : item.Gender == Gender.Male? " sir ": string.Empty) }{item.FullName},\n\n you are invited to {activity.Name} organised by {organizer.FullName}.\n the event will be held on {activity.Date.ToShortDateString()} please reply to {organizer.Email} to let them know wether you are willing to attend.\nThis message will be send to your {item.MyContactMethods}");
                }
                if (item.MyContactMethods.HasFlag(ContactMethod.WhatsApp))
                {
                    Console.WriteLine($"\nTHIS IS A WHATSAPP \nDear{(item.Gender == Gender.Female? " Madame " : item.Gender == Gender.Male? " sir ": string.Empty) }{item.FullName},\n\n you are invited to {activity.Name} organised by {organizer.FullName}.\n the event will be held on {activity.Date.ToShortDateString()} please reply to {organizer.Email} to let them know wether you are willing to attend.\nThis message will be send to your {item.MyContactMethods}");
                }
                if (item.MyContactMethods.HasFlag(ContactMethod.Phone))
                {
                    Console.WriteLine("ringgggg ringggggg");
                }
            }

            Console.WriteLine("Press <ENTER> to exit...");
            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void MainV3(string[] args)
        {
            // verkrijg de organisator informatie
            Organizer organizer = new Organizer();

            organizer.FirstName = GetUserInput("de naam van de organisator");
            organizer.SurName   = GetUserInput("de achternaam van de organisator");
            organizer.Email     = GetUserInput("Emailadres van de organisator");

            // verkijg event informatie
            string ActivityTitle = GetUserInput("de naam van het evenement");

            DateTime activityDate;

            DateTime.TryParse(GetUserInput("de datum (dd-mm-yyyy) van het evenement"), out activityDate);

            string activityDescription = GetUserInput("een omschrijving van het evenement", false);

            // collectie van genodigden
            List <Invitee> Invitees = new List <Invitee>();

            do
            {
                Invitee newInvitee = new Invitee(GetUserInput($"de voornaam van de genodigde"), GetUserInput($"de achternaam van de genodigde"));
                newInvitee.Email       = GetUserInput($"Emailadres van de genodigde");
                newInvitee.phoneNumber = int.Parse(GetUserInput($"Telefoonnummer van de genodigde"));
                //newInvitee.Preferences = GetUserInput($"Emailadres van de genodigde ({i+1}/{amountOfInvitees})");
                Invitees.Add(newInvitee);
                Console.Clear();
            } while (GetUserInput("Wilt u meer gasten toevoegen?\n)Y\n)N") == "Y");

            foreach (var item in Invitees)
            {
                Console.WriteLine($"de activiteit {ActivityTitle} wordt georganiseerd door: {organizer.FullName} op {activityDate}\nDe Bevestigingen worden verstuurd naar: {organizer.Email}\n{activityDescription}");

                Console.WriteLine($"Deelnmer: {item.FullName}   Email: {item.Email}");
            }

            Console.WriteLine("Press <ENTER> to exit...");
            Console.ReadLine();
        }