Ejemplo n.º 1
0
 public ManageParticipantsViewModel()
 {
     using (AppContext context = new AppContext()) {
         context.Participants.Load();
         ConvertCollection convert = new ConvertCollection();
         Participants = convert.GetParticipantModelFrom(context.Participants.Local);
     }
 }
Ejemplo n.º 2
0
 public ManageItemsViewModel()
 {
     using (AppContext context = new AppContext()) {
         context.Items.Load();
         ConvertCollection convert = new ConvertCollection();
         Items = convert.GetItemModelFrom(context.Items.Local);
     }
 }
Ejemplo n.º 3
0
        public RaffleWinnersViewModel(IUnitOfWork uow)
        {
            this.uow = uow;

            var raffles = uow.Raffles.GetAll()
                             .Include(r => r.RaffleItems)
                             .Include(r => r.RaffleParticipants)
                             .Include(r => r.Winners)
                             .ToObservableCollection();
            var convert = new ConvertCollection();
            Raffles = convert.GetRaffleModelFrom(raffles);
        }
Ejemplo n.º 4
0
        public ManageRafflesViewModel(IUnitOfWork uow)
        {
            this.uow = uow;

            var raffles = uow.Raffles.GetAll()
                             .Include(r => r.RaffleItems)
                             .Include(r => r.RaffleParticipants)
                             .Include(r => r.Winners)
                             .ToObservableCollection();
            var items = uow.Items.GetAll().ToObservableCollection();
            var participants = uow.Participants.GetAll()
                                  .ToObservableCollection();

            var convert = new ConvertCollection();
            Raffles = convert.GetRaffleModelFrom(raffles);
            Items = convert.GetItemModelFrom(items);
            Participants = convert.GetParticipantModelFrom(participants);
        }