Ejemplo n.º 1
0
        protected override void InitFromBundle(IMvxBundle parameters)
        {
            base.InitFromBundle(parameters);

            var jsonString = parameters.Data["JsonString"];
            var mainPojo   = _serializationService.Deserialize <MainPojo>(jsonString);

            Location    = "Weather in " + mainPojo.Name + ", " + mainPojo.Sys.Country;
            Temperature = mainPojo.Main.Temp.Convert(ConversionType.Degrees);
            Date        = "get at " + mainPojo.Dt.Convert(ConversionType.Date);

            foreach (var weather in mainPojo.Weather)
            {
                PicUrl      = "http://openweathermap.org/img/w/" + weather.Icon + ".png";
                Description = weather.Description;
            }

            ListOfData.Add(new WeatherData(Strings.Temperature, Temperature));
            ListOfData.Add(new WeatherData(Strings.Humidity, mainPojo.Main.Humidity.Convert(ConversionType.Percentage)));
            ListOfData.Add(new WeatherData(Strings.Pressure, mainPojo.Main.Pressure.Convert(ConversionType.Degrees)));
            ListOfData.Add(new WeatherData(Strings.Clouds, mainPojo.Clouds.All));
            ListOfData.Add(new WeatherData(Strings.Sunrise, mainPojo.Sys.Sunrise.Convert(ConversionType.TimeOfDay)));
            ListOfData.Add(new WeatherData(Strings.Sunset, mainPojo.Sys.Sunset.Convert(ConversionType.TimeOfDay)));
            ListOfData.Add(new WeatherData(Strings.Coords, "[" + mainPojo.Coord.Lon + ", " + mainPojo.Coord.Lat + "]"));
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            inpu = new List <Input>();
            Users users = new Users();

            inpu = users.selected();
            int currentX = 20, currentY = 5;

            // MessageBox.Show(inpu.Count()+"");
            for (int i = 0; i <= inpu.Count() - 1; i++)
            {
                ListOfData lsd = new ListOfData();
                lsd.namee         = inpu[i].Name;
                lsd.family        = inpu[i].Family;
                lsd.code          = inpu[i].NumberStudent.ToString();
                lsd.number        = inpu[i].Mobile;
                lsd.btnTagDelete  = inpu[i].NumberStudent.ToString();
                lsd.btnTagDetails = i;
                if (i % 2 == 0)
                {
                    lsd.colour = "#EDF0FC";
                }
                else
                {
                    lsd.colour = "#ffffff";
                }
                lsd.Location = new Point(currentX, currentY);
                this.panel2.Controls.Add(lsd);
                currentY = currentY + 50;
            }
        }
Ejemplo n.º 3
0
 public List <int> MakeData()
 {
     while (ListOfData.Count < 10)
     {
         int randomNumber = Random.Next(1, 10);
         ListOfData.Add(randomNumber);
     }
     ;
     return(ListOfData);
 }
        private void ListBook_Load(object sender, EventArgs e)
        {
            inpu = new List <Input>();
            Books books = new Books();

            inpu = books.selected();
            int currentX = 20, currentY = 5;

            // MessageBox.Show(inpu.Count()+"");
            for (int i = 0; i <= inpu.Count() - 1; i++)
            {
                ListOfData lsd = new ListOfData();
                lsd.namee = inpu[i].Title;
                Authors authors = new Authors();
                // MessageBox.Show(inpu[i].Isbn + "");
                authorsId = authors.selectedAuthorId(inpu[i].Isbn);
                if (authorsId.Count() != 0)
                {
                    for (int c = 0; c <= authorsId.Count() - 1; c++)
                    {
                        authorsName.Add(authors.selectedAuthorName(authorsId[c]));
                        //MessageBox.Show("m " + authorsId[c] + "   authorsId[c]  " + authorsName[c]+"  authorsName[c]");
                        inpu[i].Name = inpu[i].Name + "|" + authorsName[c];
                    }
                    lsd.family = "..." + authorsName[0];
                }


                // MessageBox.Show(inpu[i].Name + "");
                Publications publications = new Publications();
                publicId          = publications.selectedpublicationsId(inpu[i].Isbn);
                inpu[i].Family    = publications.selectedpublicationName(publicId);
                lsd.code          = inpu[i].Family;
                lsd.number        = inpu[i].Isbn;
                lsd.btnTagDelete  = inpu[i].Isbn + "*";
                lsd.btnTagDetails = i;
                authorsName.Clear();
                if (i % 2 == 0)
                {
                    lsd.colour = "#EDF0FC";
                }
                else
                {
                    lsd.colour = "#ffffff";
                }
                lsd.Location = new Point(currentX, currentY);
                this.panel5.Controls.Add(lsd);
                currentY = currentY + 50;
            }
        }