protected void findWeather(object sender, EventArgs e)
        {
            string zip   = "";
            string State = "";

            DiyaloReference1.Service1Client prox = new DiyaloReference1.Service1Client();
            if (Request.Cookies["State"] != null && Request.Cookies["City"] != null)
            {
                State = Request.Cookies["State"].Value;
                zip   = Request.Cookies["City"].Value;
            }
            string[] res = prox.getWeather(zip);
            for (int i = 0; i < res.Length; i++)
            {
                if (i == 0)
                {
                    string a = res[i];
                    a = "Date and Time:     " + a;
                    rr.Items.Add(a);
                }
                else if (i == 1)
                {
                    string b = res[i];
                    b = "Temperature(f):    " + b;
                    rr.Items.Add(b);
                }
                else if (i == 2)
                {
                    string c = res[i];
                    c = "Condition:      " + c;
                    rr.Items.Add(c);
                }
            }
        }
Пример #2
0
        protected void findSolar(object sender, EventArgs e)
        {
            DiyaloReference1.Service1Client prox  = new DiyaloReference1.Service1Client();
            MarcusReference1.ServiceClient  prox2 = new MarcusReference1.ServiceClient();
            string zip   = "";
            string State = "";

            if (Request.Cookies["State"] != null && Request.Cookies["City"] != null)
            {
                State = Request.Cookies["State"].Value;
                zip   = Request.Cookies["City"].Value;
            }
            string res = prox2.getCoordinates(zip);

            string[] rem            = { "<lat>", "</lng>" };
            string[] Split1         = res.Split(rem, StringSplitOptions.RemoveEmptyEntries);
            string[] sep            = { "</lat><lng>" };
            string[] Split2         = Split1[0].Split(sep, StringSplitOptions.RemoveEmptyEntries);
            string   solarIntensity = prox.avgSolarIntensity(Split2[0], Split2[1]);

            Label1.Text = ("Average Solar Intensity (ASI):\t" + solarIntensity);
        }