Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/ASP.NET/CS/TouchBoard/Widgets/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/ASP.NET/CS/TouchBoard/Widgets/Weather.ascx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Widgets_Weather : System.Web.UI.UserControl {
    public string OwnerZoneID { get; set; }

    protected void Page_Load(object sender, EventArgs e) {
        WeatherPanel.OwnerZoneUID = OwnerZoneID;

        lblLocation.Text = WeatherWidget.Location;
        lblDate.Text = WeatherWidget.TodayWeather.WeatherDate.ToString("D");

        lblTemperature.Text = GetTemperatureString(WeatherWidget.TodayWeather.Temperature);

        WeatherPanel.Styles.Content.CssClass += " pnlWeatherWidget_" + WeatherWidget.TodayWeather.Type;
    }

    protected static string GetTemperatureString(int value) {
        return string.Format("{0}{1}°", value >= 0 ? "+" : "", value);
    }
    protected static string GetWeatherTypeImageUrl(WeatherType type) {
        return string.Format("~/Widgets/Images/Weather/type_{0}.png", type.ToString());
    }
}