Esempio n. 1
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);
        }