示例#1
0
        public iTabbedPage()
        {
            InitializeComponent();

            DummyDB _context = new DummyDB();

            List <string> allContinents = new List <string>();

            // Retrieve and insert all continents from our list
            //foreach (var continent in _context.Animals)
            //    allContinents.Add(continent.ContinentOrigin);

            // Distinct to remove duplicates
            //allContinents = allContinents.Distinct().ToList();

            // Create dinamically tabs for continents that we have
            //foreach (var continent in allContinents)
            //    Children.Add(new iTabPage(continent));


            //New

            Repository repository = new Repository();
            //  List<Property> propertyList = repository.GetPropertyByUserSync(int.Parse(App.Current.Properties["UsersId"].ToString()));

            List <Property> propertyList = repository.GetPropertyByUserSync(7);

            propertyList = propertyList.Distinct().ToList();

            foreach (var type in propertyList)
            {
                Children.Add(new iTabPage(int.Parse(type.ToString())));
            }
        }
示例#2
0
        public AnimalViewModel()
        {
            Animals = new ObservableCollection <Animal>();

            DummyDB _context = new DummyDB();

            foreach (var animal in _context.Animals)
            {
                Animals.Add(animal);
            }
        }
示例#3
0
        public IEnumerable <Movie> GetMoviesRecomended(Client client)
        {
            var moviesRecommended = new List <Movie>();

            foreach (var favorite in client.Favorites)
            {
                moviesRecommended.AddRange(DummyDB.GetMovieRecommendedByDirector(favorite.Director));
            }
            // moviesRecommended = moviesRecommended.Where(x => !client.Favorites.Contains(x)).ToList();
            return(moviesRecommended);
        }
示例#4
0
        public AnimalSecondViewModel(string continent)
        {
            Animals = new ObservableCollection <Animal>();

            DummyDB _context = new DummyDB();

            // Get only animals from that continent
            var animals = _context.Animals.Where(a => a.ContinentOrigin == continent).ToList();

            foreach (var animal in animals)
            {
                Animals.Add(animal);
            }
        }
示例#5
0
        public AnimalTabbedPage()
        {
            InitializeComponent();

            DummyDB _context = new DummyDB();

            List <string> allContinents = new List <string>();

            // Retrieve and insert all continents from our list
            foreach (var continent in _context.Animals)
            {
                allContinents.Add(continent.ContinentOrigin);
            }

            // Distinct to remove duplicates
            allContinents = allContinents.Distinct().ToList();

            // Create dinamically tabs for continents that we have
            foreach (var continent in allContinents)
            {
                Children.Add(new AnimalTabPage(continent));
            }
        }
示例#6
0
 public void EnclosureCleanUp()
 {
     DummyDB.CleanDb();
 }
 public void UserCleanUp()
 {
     DummyDB.CleanDb();
 }