Esempio n. 1
0
        public async Task LoadSpeakers()
        {
            Speakers.Clear();
            GenericPersistence <string, Speaker> facade = new GenericPersistence <string, Speaker>("http://localhost:52415/api/Speakers");
            List <Speaker> speakerList = await facade.Get();

            foreach (Speaker user in speakerList)
            {
                Speakers.Add(user);
            }
        }
Esempio n. 2
0
        public async Task LoadAdmins()
        {
            Admins.Clear();
            GenericPersistence <string, Admin> facade = new GenericPersistence <string, Admin>("http://localhost:52415/api/Admins");
            List <Admin> adminList = await facade.Get();

            foreach (Admin user in adminList)
            {
                Admins.Add(user);
            }
        }
        public async Task LoadParticipants()
        {
            Participants.Clear();
            GenericPersistence <string, Participant> facade = new GenericPersistence <string, Participant>("http://localhost:52415/api/Participants");
            List <Participant> participantList = await facade.Get();

            foreach (Participant user in participantList)
            {
                Participants.Add(user);
            }
        }
Esempio n. 4
0
        public async Task LoadUsers()
        {
            Users.Clear();
            GenericPersistence <string, User> facade = new GenericPersistence <string, User>("http://localhost:52415/api/BasicUsers");
            List <User> userList = await facade.Get();

            foreach (User user in userList)
            {
                Users.Add(user);
            }
        }
        public async Task Load()
        {
            Registrations = await _registrationPersistence.Get();

            RegistrationDictionary = (from @event in EventSing.EventCatalog.Collection
                                      select new
            {
                @event,
                participants = new ObservableCollection <Participant>(from registration in Registrations
                                                                      join participant in ParticiSing.Participants on registration.UserName equals participant.UserName
                                                                      where registration.EventId == @event.Id select participant)
            }).ToDictionary(x => x.@event, x => x.participants);
        }
Esempio n. 6
0
 public async Task <bool> Load()
 {
     try
     {
         _collection = new ObservableCollection <Event>(await _eventPersistence.Get());
         Collection  = new ReadOnlyObservableCollection <Event>(_collection);
         foreach (Event @event in _collection)
         {
             @event.Room    = RoomCatalogSingleton.Instance.Rooms.Single((x) => x.RoomNo == @event.Room.RoomNo);
             @event.Speaker = SpeakerCatalogSingleton.Instance.Speakers.Single((x) => x.UserName == @event.Speaker.UserName);
         }
         return(true);
     }
     catch (HttpRequestException)
     {
         return(false);
     }
 }
Esempio n. 7
0
        /// <summary>
        /// Denne metode loader lokaler fra databasen men blev ikke nøvendig
        /// på grund af load meyoden i mainViewModel
        /// </summary>
        public async Task LoadRooms()
        {
            Rooms.Clear();
            GenericPersistence <string, Room> roomPersistence =
                new GenericPersistence <string, Room>("http://localhost:52415/api/Room/");

            try
            {
                List <Room> rooms = await roomPersistence.Get();

                foreach (Room room in rooms)
                {
                    Rooms.Add(room);
                }
            }
            catch (HttpRequestException)
            {
            }
        }