Beispiel #1
0
		TimeZoneInfo GetTimeZone( Tenant tenant)
		{
			return tenant.TimeZone ?? TimeZoneInfo.Local;
		}
Beispiel #2
0
		Tenant ToTenant(Record r)
		{
			var tenant = new Tenant();
			tenant.Name = r.GetString("name");
			tenant.DisplayName = r.GetString("displayName");
			var cultureName = r.GetString("culture");
			tenant.Culture = cultureName != null ? new CultureInfo(cultureName) : CultureInfo.CurrentCulture;
			var timeZone = r.GetString("timeZone");
			tenant.TimeZone = timeZone != null ? TimeZoneInfo.FindSystemTimeZoneById(timeZone) : TimeZoneInfo.Local;
			var items = r.GetString("items");
			tenant.Items = !string.IsNullOrEmpty(items) ? Json.Deserialize<Map>(items) : new Map();
			return tenant;
		}
Beispiel #3
0
		CultureInfo GetCulture(string cultureName, Tenant tenant)
		{
			if(cultureName != null)
			{
				return new CultureInfo(cultureName);
			}
			return tenant.Culture ?? CultureInfo.CurrentCulture;
		}
Beispiel #4
0
		public Tenant LoadTenant(string name)
		{
			if(foo == null)
			{ 
				foo = new Tenant() {
					Culture = new System.Globalization.CultureInfo("es-ES"),
					TimeZone = TimeZoneInfo.Local
				};
			}
			return foo;
		}