Esempio n. 1
0
        public static IOccassion GetOccassionInputs(Occasion occasion, ILog logger)
        {
            IOccassion newOccassion = null;
            string     name1 = string.Empty, name2 = string.Empty;

            switch (occasion)
            {
            case Occasion.Birthday:
                Console.WriteLine("Get birthyguy name");
                name1        = Console.ReadLine();
                newOccassion = new Birthday(name1);
                break;

            case Occasion.HouseWarming:
                Console.WriteLine("Get houseonwers name");
                name1        = Console.ReadLine();
                newOccassion = new HouseWarming(name1);
                break;

            case Occasion.Marriage:
                Console.WriteLine("Get bride and grooms name");
                name1        = Console.ReadLine();
                name2        = Console.ReadLine();
                newOccassion = new Marriage(name1, name2);
                break;
            }
            return(newOccassion);
        }
Esempio n. 2
0
        public ActionResult <string> CreateEvent(Event event1)
        {
            customerController.SetCustomer(loggedInCustomer);
            logger.Info("Came here");
            var format = "yyyy-MM-dd HH:mm";
            var giftE  = selectionController.GetGiftsForGiftIds(event1.giftIds);
            var giftR  = new GiftCollection();
            var date   = DateTime.ParseExact(event1.date + " " + event1.time, format, CultureInfo.InvariantCulture);

            logger.Info("date is formateed to " + date.ToString());
            IOccassion occassionInQ = selectionController.GetOccassion(event1.occassionType, event1.person1, event1.person2);

            customerController.CreateOccassion(occassionInQ);
            var result = customerController.CreateEvent(occassionInQ, event1.place, date, giftE, giftR);

            customerController.AddToExpectedGifts(giftE, result);
            return(result);
        }
        public IOccassion GetOccassion(Occasion occassion, string person1, string person2)
        {
            IOccassion occassionInQ = null;

            switch (occassion)
            {
            case Occasion.Marriage:
                occassionInQ = new Marriage(person1, person2);
                break;

            case Occasion.Birthday:
                occassionInQ = new Birthday(person2);
                break;

            case Occasion.HouseWarming:
                occassionInQ = new HouseWarming(person2);
                break;
            }
            return(occassionInQ);
        }
Esempio n. 4
0
 public abstract bool modifyOccasion(IOccassion occassion);