Example #1
0
        private void GetSharingGroupsFromSpreadSheet(int row, ExcelWorksheet sheet, int EventId)
        {
            SharingGroup sg = new SharingGroup();

            sg.Capacity = Convert.ToInt32(sheet.Cells[TYPE_SG_CAPACITY + Convert.ToString(row)].Value);
            sg.EventId  = EventId;
            try
            {
                sg.Type = Convertors.GetSharingGroupCategory((string)sheet.Cells[TYPE_SG + Convert.ToString(row)].Value);
            }
            catch (Exception)
            {
                sg.Type = SharingGroupCategoryEnum.ADULTE;
            }
            sg.Persist();
        }
Example #2
0
        private void EnsureLoaded()
        {
            if (this.IsAllDataLoaded)
            {
                return; //data already loaded
            }

            //Get list of attendees
            this.attendees = EventAttendee.GetAttendeeList(this.CurrentEvent.Id);
            if (this.attendees == null)
            {
                throw new System.NullReferenceException(string.Format("No Attendee registered yet for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }

            //Get attendees information
            this.attendeesInfo = User.GetRegisteredUsersPerEventId(this.CurrentEvent.Id);
            if (this.attendeesInfo == null)
            {
                throw new System.NullReferenceException(string.Format("Infos not available for registered users for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }
            this.IsAttendeeInfoLoaded = true;

            //Get list of seats
            this.seatsInHall = Hall.GetHallSections(this.CurrentEvent.Id);
            if (this.seatsInHall == null)
            {
                throw new System.NullReferenceException(string.Format("Seats not availaible for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }
            this.IsSeatsDataLoaded = true;

            //Get list of beds
            this.bedsInDorms = Dormitory.GetDormitoryList(this.CurrentEvent.Id);
            if (this.bedsInDorms == null)
            {
                throw new System.NullReferenceException(string.Format("Beds not availaible for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }
            this.IsBedsDataLoaded = true;

            //Get list of refectories
            this.refectories = Refectory.GetRefectoryList(this.CurrentEvent.Id);
            if (this.refectories == null)
            {
                throw new System.NullReferenceException(string.Format("Tables not availaible for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }

            //Get list of tables
            this.tablesInRefs = Table.GetTableList(this.CurrentEvent.Id);
            if (this.tablesInRefs == null)
            {
                throw new System.NullReferenceException(string.Format("Tables not availaible for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }
            this.IsTablesDataLoaded = true;

            //sharing groups
            this.sharingGroups = SharingGroup.GetSharingGroups(this.CurrentEvent.Id);
            if (this.sharingGroups == null)
            {
                throw new System.NullReferenceException(string.Format("Sharing groups not availaible for the event at {0}, starting on {1}"
                                                                      , this.CurrentEvent.Place
                                                                      , this.CurrentEvent.StartDate.ToString()));
            }
            this.IsSharingGroupLoaded = true;
        }