Mini Kabibi Habibi

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

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Partial Public Class Widgets_Weather
	Inherits System.Web.UI.UserControl
	Private privateOwnerZoneID As String
	Public Property OwnerZoneID() As String
		Get
			Return privateOwnerZoneID
		End Get
		Set(ByVal value As String)
			privateOwnerZoneID = value
		End Set
	End Property

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
		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
	End Sub

	Protected Shared Function GetTemperatureString(ByVal value As Integer) As String
		If value >= 0 Then
			Return String.Format("{0}{1}°","+", value)
		Else
			Return String.Format("{0}{1}°","", value)
		End If
	End Function
	Protected Shared Function GetWeatherTypeImageUrl(ByVal type As WeatherType) As String
		Return String.Format("~/Widgets/Images/Weather/type_{0}.png", type.ToString())
	End Function
End Class