protected string GetWeatherInfo(object obj, int idex, string columnName) { MyService.City city = obj as MyService.City; MyService.WeatherInfo[] infos = city.Weathers; switch (columnName) { case "Temp": return(infos[idex].Temp); case "Condition": return(infos[idex].Condition); case "Image": return(infos[idex].Image); default: return(String.Empty); } }
protected string ShowWeather(object obj, string columnName) { MyService.City city = obj as MyService.City; MyService.WeatherInfo info = city.Weather; switch (columnName) { case "Temp": return(info.Temp); case "Condition": return(info.Condition); case "Image": return(info.Image); default: return(String.Empty); } }