Ejemplo n.º 1
0
        private void ReadWeatherAPIAndBindToDataGrid()
        {
            //
            // read data file
            //
            IDataService dataService = new APIDataService();

            _cities = dataService.ReadAll();

            //
            // bind list to DataGridView control
            //
            var bindingList = new BindingList <City>(_cities);
            var source      = new BindingSource(bindingList, null);

            dataGridViewCities.DataSource = source;

            //
            // configure DataGridView control
            //
            this.dataGridViewCities.Columns["Pressure"].Visible = false;
            this.dataGridViewCities.Columns["Humidity"].Visible = false;
            this.dataGridViewCities.Columns["Deg"].Visible      = false;
            this.dataGridViewCities.Columns["Icon"].Visible     = false;
        }
Ejemplo n.º 2
0
        public ActionResult UserProfile(string friend)
        {
            StreamLineDataEntities context = new StreamLineDataEntities();

            var user = context.AspNetUsers.Single(u => u.Email == friend);

            APIDataService api = new APIDataService();

            DataModels model = new DataModels();

            model.DataModel = api.GetAllInfo(user.TwitterConnect, user.InstagramConnect);
            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult ProfilePageView()
        {
            StreamLineDataEntities context = new StreamLineDataEntities();

            var user = context.AspNetUsers.Single(u => u.Email == User.Identity.Name);


            APIDataService api = new APIDataService();

            DataModels      model    = new DataModels();
            SpotifyPlaylist playlist = new SpotifyPlaylist();

            playlist.SpotifyPlaylistURL = user.SpotifyPlaylistUri;
            model.DataModel             = api.GetAllInfo(user.TwitterConnect, user.InstagramConnect);
            model.WebPlayer             = playlist;


            return(View(model));
        }
        private void ReadWeatherAPIAndBindToDataGrid()
        {
            //
            // read data file
            //
            IDataService dataService = new APIDataService();

            _cities = dataService.ReadAll();

            //
            // bind list to DataGridView control
            //
            var bindingList = new BindingList <City>(_cities);

            dataGridViewCities.ItemsSource = bindingList;

            dataGridViewCities.Columns["Pressure"].Width      = 0;
            this.dataGridViewCities.Columns["Humidity"].Width = 0;
            this.dataGridViewCities.Columns["Deg"].Width      = 0;
            this.dataGridViewCities.Columns["Icon"].Width     = 0;

            lbl_results.Content = $"Records Returned({bindingList.Count})";
        }