Пример #1
0
        public void chartCity(string City)
        {
            bali = new BL.MyBL();
            try
            {
                var output = bali.dali.GetForecast(City);

                double tmp_1  = Math.Round(output.tmp_day_1, 1);
                string day_1_ = getDate(output.day_1);
                double tmp_2  = Math.Round(output.tmp_day_2, 1);
                string day_2_ = getDate(output.day_2);
                double tmp_3  = Math.Round(output.tmp_day_3, 1);
                string day_3_ = getDate(output.day_3);
                double tmp_4  = Math.Round(output.tmp_day_4, 1);
                string day_4_ = getDate(output.day_4);
                double tmp_5  = Math.Round(output.tmp_day_5, 1);
                string day_5_ = getDate(output.day_5);
                double tmp_6  = Math.Round(output.tmp_day_6, 1);
                string day_6_ = getDate(output.day_6);

                SeriesCollection = new SeriesCollection
                {
                };
                Labels     = new[] { day_1_, day_2_, day_3_, day_4_, day_5_, day_6_ };
                YFormatter = value => value.ToString() + "°С";

                //modifying the series collection will animate and update the chart
                SeriesCollection.Add(new LineSeries
                {
                    Title  = "",
                    Values = new ChartValues <double> {
                        tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp_6
                    },
                    LineSmoothness    = 0, //0: straight lines, 1: really smooth lines
                    PointGeometry     = DefaultGeometries.Square,
                    PointGeometrySize = 15,
                    PointForeground   = Brushes.Red
                });

                //modifying any series values will also animate and update the chart
                //SeriesCollection[0].Values.Add();

                //DataContext = this;


                Chart.DataContext = this;
            }
            catch (Exception)
            {
            }
        }
Пример #2
0
        public void TableWeather(string City)
        {
            try
            {
                bali = new BL.MyBL();
                var output = bali.dali.GetForecast(City);


                day1(output);


                day2(output);

                day3(output);


                day4(output);

                day5(output);
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
        public void WeatherDay(string City)
        {
            try
            {
                bali = new BL.MyBL();
                var output = bali.dali.GetForecast(City);
                TodayWeather.ans_Hum.Text       = string.Format("{0}", output.humidity + "%");
                TodayWeather.ans_Condition.Text = string.Format("{0}", output.description1);
                TodayWeather.ans_Speed.Text     = string.Format("{0}", output.speed + "m/s");
                TodayWeather.ans_Temp.Text      = string.Format("{0}°С", Math.Round(output.tmp_day_1, 1));

                string icon1     = "../icons/" + string.Format("{0}", output.icon1) + ".png";
                Uri    imageUri1 = new Uri(icon1, UriKind.Relative);
                System.Windows.Media.Imaging.BitmapImage imageBitmap1 = new System.Windows.Media.Imaging.BitmapImage(imageUri1);
                TodayWeather.image_1.Source     = imageBitmap1;
                TodayWeather.image_1.Visibility = Visibility.Visible;
                TodayWeather.cityBlock.Text     = output.city + "," + output.country;
            }
            catch (Exception)
            {
                Search.search.Text = "";
                MessageBox.Show("Invalid city!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            listBox.Items.Clear();
            BL.MyBL       bl      = new BL.MyBL();
            string        myInput = input.Text;
            List <Flower> list    = bl.getFlowersWithTheWord(myInput);

            foreach (Flower f in list)
            {
                listBox.Items.Add("Location: " + f.Area);
                listBox.Items.Add("Color: " + f.Color);
                listBox.Items.Add("Description: " + f.Description);



                Image im = new Image();
                im.Width  = 150;
                im.Height = 150;

                im.Source = new BitmapImage(new Uri(f.Image));
                listBox.Items.Add(im);
                listBox.Items.Add("------------");
            }
        }
Пример #5
0
 public RSSview()
 {
     this.InitializeComponent();
     bl           = new BL.MyBL();
     LinkBox.Text = "http://www.inn.co.il/Rss.aspx";
 }
Пример #6
0
 public CurrentDetailes()
 {
     bali = new BL.MyBL();
 }