public ManageParticipantsViewModel()
 {
     using (AppContext context = new AppContext()) {
         context.Participants.Load();
         ConvertCollection convert = new ConvertCollection();
         Participants = convert.GetParticipantModelFrom(context.Participants.Local);
     }
 }
示例#2
0
 public ManageItemsViewModel()
 {
     using (AppContext context = new AppContext()) {
         context.Items.Load();
         ConvertCollection convert = new ConvertCollection();
         Items = convert.GetItemModelFrom(context.Items.Local);
     }
 }
示例#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);
        }
示例#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);
        }