protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WeatherPredictionEntities entity = new WeatherPredictionEntities(); if (Session["MinTemp"] != null && Session["MaxTemp"] != null) { var minTemp = Session["MinTemp"].ToString(); var maxTemp = Session["MaxTemp"].ToString(); int min = Convert.ToInt16(minTemp); int max = Convert.ToInt16(maxTemp); var crops = (from ob in entity.Crops select new { Name = ob.Crop_Name_Eng, Description = ob.Description, ImageUrl = ob.ImageURL, MinTemp = ob.MinTemp, MaxTemp = ob.MaxTemp }).ToList(); var ResultedCrops = (from ob in crops where (min >= ob.MinTemp && max <= ob.MaxTemp) select new { ob.Name, ob.Description, ImageUrl = ob.ImageUrl.Replace("~", "..") }).ToList(); Rep_Crops.DataSource = ResultedCrops; Rep_Crops.DataBind(); } else { Response.Write("nothing found"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WeatherPredictionEntities entity = new WeatherPredictionEntities(); if (Session["MinTemp"] != null && Session["MaxTemp"] != null) { var minTemp = Session["MinTemp"].ToString(); var maxTemp = Session["MaxTemp"].ToString(); int min = Convert.ToInt16(minTemp); int max = Convert.ToInt16(maxTemp); int Selected_SeasonID = (from obj in entity.Clothes where (min >= obj.MinTemp && max <= obj.MaxTemp) select obj.SeasonID).FirstOrDefault(); var clothes = (from ob in entity.ClothesImages where (Selected_SeasonID == ob.SeasonID) select new { ImageUrl = ob.ImageURL }).ToList(); var ClothesResults = (from ob in clothes select new { ImageUrl = ob.ImageUrl.Replace("~", "..") }).ToList(); Repeater_Clothes.DataSource = ClothesResults; Repeater_Clothes.DataBind(); } else { Response.Write("Nothing Found!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WeatherPredictionEntities entity = new WeatherPredictionEntities(); if (Session["MinTemp"] != null && Session["MaxTemp"] != null && Session["Humidity"] != null && Session["Wind"] != null) { var Min_Temp = Session["MinTemp"]; var Max_Temp = Session["MaxTemp"]; var Humidity = Session["Humidity"]; var Wind = Session["Wind"]; lbl_minTemp.Text = Min_Temp.ToString(); lbl_maxTemp.Text = Max_Temp.ToString(); lbl_humidity.Text = Humidity.ToString(); lbl_wind.Text = Wind.ToString(); var cityName = Session["CityName"]; lbl_1_city.Text = cityName.ToString(); lbl_2_city.Text = cityName.ToString(); lbl_3_city.Text = cityName.ToString(); lbl_4_city.Text = cityName.ToString(); } else { Response.Write("nothing found"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WeatherPredictionEntities entity = new WeatherPredictionEntities(); var crops = (from ob in entity.Crops select new { Name = ob.Crop_Name_Eng, Description = ob.Description, ImageUrl = ob.ImageURL }).ToList(); var gallery = (from ob in crops select new { ob.Name, ob.Description, ImageUrl = ob.ImageUrl.Replace("~", "..") }).ToList(); Repeater_Gallery.DataSource = gallery; Repeater_Gallery.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["CityName"] != null && Session["CityIndex"] != null) { WeatherPredictionEntities entity = new WeatherPredictionEntities(); var CityInd = Session["CityIndex"]; int City_In = Convert.ToInt32(CityInd) + 1; var items = (from tab in entity.Places where (tab.City_ID == City_In) select new { tab.City_Name, tab.Description_Eng }).ToList(); var places = (from obj in entity.PlacesImages where (obj.CityID == City_In) select new { ImageUrl = obj.ImageURL, Name = obj.PlaceName }).ToList(); var ClothesResults = (from ob in places select new { ImageUrl = ob.ImageUrl.Replace("~", ".."), Name = ob.Name }).ToList(); for (int i = 0; i < items.Count; i++) { string CityName = items[i].City_Name.ToString(); string CityDes = items[i].Description_Eng.ToString(); lbl_cityname.Text = CityName; p_citydesc.InnerText = CityDes; } Repeater_Places.DataSource = ClothesResults; Repeater_Places.DataBind(); } else { Response.Write("Nothing Found!"); } }