Esempio n. 1
0
        private void CargarCiudad()
        {
            WSMeteorologicoClient ws = new WSMeteorologicoClient("WSMeteorologico");
            int id = (Form1.lugar as PRONOSTICO_REGIONALREGIONCIUDAD)?.id ?? 5;

            try
            {
                PRONOSTICO_REGIONALREGIONCIUDAD reg = ws.pronosticoPorCiudadxID(id).ParseXML <PRONOSTICO_REGIONALREGIONCIUDAD>();
                panel1.Hide();
                panel2.Hide();
                panel3.Hide();

                if (id != -1)
                {
                    if (reg.ESTADOMANANA != null)
                    {
                        pbxCM.ImageLocation = String.Format("https://www.imn.ac.cr{0}", reg.ESTADOMANANA.imgPath);
                        lblCCM.Text         = reg.COMENTARIOMANANA;
                        lblCTM.Text         = reg.ESTADOMANANA.Value;
                        panel1.Show();
                    }

                    if (reg.ESTADOTARDE != null)
                    {
                        pbxCT.ImageLocation = String.Format("https://www.imn.ac.cr{0}", reg.ESTADOTARDE.imgPath);
                        lblCCT.Text         = reg.COMENTARIOTARDE;
                        lblCTT.Text         = reg.ESTADOTARDE.Value;
                        panel2.Show();
                    }

                    if (reg.ESTADONOCHE != null)
                    {
                        pbxCN.ImageLocation = String.Format("https://www.imn.ac.cr{0}", reg.ESTADONOCHE.imgPath);
                        lblCCN.Text         = reg.COMENTARIONOCHE;
                        lblCTN.Text         = reg.ESTADONOCHE.Value;
                        panel3.Show();
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(id.ToString());
            }
        }
Esempio n. 2
0
        public void ComboClick(ComboBox comboBox1, Panel panel1, Panel panel2, Panel panel3, GMapControl gMapControl1, PictureBox pbxCM, TextBox lblCCM, Label lblCTM,
                               PictureBox pbxCT, TextBox lblCCT, Label lblCTT, PictureBox pbxCN, TextBox lblCCN, Label lblCTN)
        {
            PRONOSTICO_REGIONALREGIONCIUDAD ciudad = comboBox1.SelectedItem as PRONOSTICO_REGIONALREGIONCIUDAD;

            panel1.Hide();
            panel2.Hide();
            panel3.Hide();
            try
            {
                Getting_Methods.GeoCode(comboBox1);
                string newla = Getting_Methods.Latitude.Replace(".", ",");
                string newlo = Getting_Methods.Longitude.Replace(".", ",");
                gMapControl1.Overlays.Clear();
                Capa_Negocios.Getting_Methods.cargarMapa(Convert.ToDouble(newla), Convert.ToDouble(newlo), gMapControl1);
            }
            catch (Exception err)
            {
                return;
            }

            if (ciudad.ESTADOMANANA != null)
            {
                pbxCM.ImageLocation = String.Format("https://www.imn.ac.cr{0}", ciudad.ESTADOMANANA.imgPath);
                lblCCM.Text         = ciudad.COMENTARIOMANANA;
                lblCTM.Text         = ciudad.ESTADOMANANA.Value;
                panel1.Show();
            }
            if (ciudad.ESTADOTARDE != null)
            {
                pbxCT.ImageLocation = String.Format("https://www.imn.ac.cr{0}", ciudad.ESTADOTARDE.imgPath);
                lblCCT.Text         = ciudad.COMENTARIOTARDE;
                lblCTT.Text         = ciudad.ESTADOTARDE.Value;
                panel2.Show();
            }

            if (ciudad.ESTADONOCHE != null)
            {
                pbxCN.ImageLocation = String.Format("https://www.imn.ac.cr{0}", ciudad.ESTADONOCHE.imgPath);
                lblCCN.Text         = ciudad.COMENTARIONOCHE;
                lblCTN.Text         = ciudad.ESTADONOCHE.Value;
                panel3.Show();
            }
        }