public E.BookingEvent UpdateBookingEvent(E.BookingEvent eEvent)
        {
            Contract.Requires(eEvent != null);
            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository <E.BookingEvent> repo = uow.GetRepository <E.BookingEvent>();
                repo.Merge(eEvent);
                var merged = repo.Get(eEvent.Id);
                repo.Put(merged);
                uow.Commit();
            }

            return(eEvent);
        }
        public bool DeleteBookingEvent(E.BookingEvent deleteEvent)
        {
            Contract.Requires(deleteEvent != null);
            Contract.Requires(deleteEvent.Id >= 0);

            using (ScheduleManager sManager = new ScheduleManager())
            {
                bool deleteSchedules = sManager.RemoveAllSchedulesByEvent(deleteEvent.Id);

                if (deleteSchedules)
                {
                    using (IUnitOfWork uow = this.GetUnitOfWork())
                    {
                        IRepository <E.BookingEvent> repo = uow.GetRepository <E.BookingEvent>();
                        deleteEvent = repo.Reload(deleteEvent);
                        repo.Delete(deleteEvent);
                        uow.Commit();
                    }
                }
            }

            return(true);
        }