Example #1
0
        public static List <Event> CreateOffers()
        {
            List <Event> offers = new List <Event>();

            EventBuildOrganizer eventBuildOrganizer = EventBuildOrganizer.Instance;

            Event eveniment, clone, clone1;

            eventBuildOrganizer.Construct(300, 100, EPackageType.Standard, ELocation.Belvedere, EEventDay.WeekTime, EEventType.Wedding);//3

            eveniment = eventBuildOrganizer.GetResult();
            offers.Add(eveniment);
            clone            = eveniment.Clone();
            clone.StartPrice = 200;
            clone.EventType  = EEventType.Banquet;
            offers.Add(clone);
            clone1            = eveniment.Clone();
            clone1.StartPrice = 100;
            clone1.EventType  = EEventType.Party;
            offers.Add(clone1);

            return(offers);
        }
Example #2
0
        public static Event DecoratedVersion()
        {
            EEventType   EType;
            EEventDay    DType;
            ELocation    LType;
            EPackageType PType;

            //event option
            Console.WriteLine("Every Offer is for 100 guests!");
            Console.WriteLine("Choose your event type:");
            Console.WriteLine("1.Wedding 2.Banquet 3.Party");
            string etype = Console.ReadLine();

            //location option
            Console.WriteLine("Choose your preferred location:");
            Console.WriteLine("1.Belvedere 2.Yaz 3.LuxDivina 4.QEvents");
            string ltype = Console.ReadLine();

            //Weekend/Weektime
            Console.WriteLine("Choose what time of the week you would like (Keep in mind that in weekend there is an extra fee");
            Console.WriteLine("1.Weekend 2.WeekTime");
            string dtype = Console.ReadLine();

            //package option
            Console.WriteLine("Choose what type of event package you would like:");
            Console.WriteLine("1.Standard 2.StandardPlus 3.Premium 4.VIP");
            string ptype = Console.ReadLine();

            //from string to enum
            EType = (EEventType)(Enum.Parse(typeof(EEventType), etype));
            DType = (EEventDay)(Enum.Parse(typeof(EEventDay), dtype));
            LType = (ELocation)(Enum.Parse(typeof(ELocation), ltype));
            PType = (EPackageType)(Enum.Parse(typeof(EPackageType), ptype));
            StandardPackage standard;
            float           money = 0;

            switch (PType)
            {
            case EPackageType.Standard:
            {
                if ((EType == EEventType.Wedding || EType == EEventType.Banquet || EType == EEventType.Party) &&
                    (LType == ELocation.Belvedere || LType == ELocation.Yaz || LType == ELocation.LuxDivina ||
                     LType == ELocation.QEvents))
                {
                    if (DType == EEventDay.Weekend)
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    else
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    Console.WriteLine(standard);
                    money = standard.Price;
                }

                break;
            }

            case EPackageType.StandardPlus:
            {
                if ((EType == EEventType.Wedding || EType == EEventType.Banquet || EType == EEventType.Party) &&
                    (LType == ELocation.Belvedere || LType == ELocation.Yaz || LType == ELocation.LuxDivina ||
                     LType == ELocation.QEvents))
                {
                    if (DType == EEventDay.Weekend)
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    else
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    Console.WriteLine(new StandardPlusPackage(standard));
                    money = standard.Price;
                }

                break;
            }

            case EPackageType.Premium:
            {
                if ((EType == EEventType.Wedding || EType == EEventType.Banquet || EType == EEventType.Party) &&
                    (LType == ELocation.Belvedere || LType == ELocation.Yaz || LType == ELocation.LuxDivina ||
                     LType == ELocation.QEvents))
                {
                    if (DType == EEventDay.Weekend)
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    else
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    Console.WriteLine(new PremiumPackage(standard));
                    money = standard.Price;
                }

                break;
            }

            case EPackageType.VIP:
            {
                if ((EType == EEventType.Wedding || EType == EEventType.Banquet || EType == EEventType.Party) &&
                    (LType == ELocation.Belvedere || LType == ELocation.Yaz || LType == ELocation.LuxDivina ||
                     LType == ELocation.QEvents))
                {
                    if (DType == EEventDay.Weekend)
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    else
                    {
                        standard = new StandardPackage(EType, DType, LType, 100);
                    }
                    Console.WriteLine(new VIPPackage(standard));
                    money = standard.Price;
                }

                break;
            }
            }
            ShowFinalPrice(money);
            EventBuildOrganizer eventBuildOrganizer = EventBuildOrganizer.Instance;
            Event eveniment;

            eventBuildOrganizer.Construct((int)money, 100, PType, LType, DType, EType);
            eveniment = eventBuildOrganizer.GetResult();
            return(eveniment);
        }