Example #1
0
    private void FillTimeZone(int locationId)
    {
        ITimeZoneService service = null;

        try
        {
            // Get time zone id.
            Location selectedLocation = this.mLocation.Where(item => item.Id == locationId).FirstOrDefault();
            if (selectedLocation == null)
            {
                this.hdnTimeZoneId.Value   = "0";
                this.spnTimeZone.InnerHtml = "";
                return;
            }

            // Create the service.
            service            = AppService.Create <ITimeZoneService>();
            service.AppManager = this.AppManager;
            Tks.Entities.TimeZone timeZone = service.Retrieve(selectedLocation.TimeZoneId);

            // Bind.
            this.hdnTimeZoneId.Value   = timeZone.Id.ToString();
            this.spnTimeZone.InnerHtml = timeZone.Name;
        }
        catch { throw; }
    }