private ContactTimezoneInfo GetProfileTimezone() { Select select = GetProfileTimezoneSelect(); ContactTimezoneInfo info = ReadTimezoneFromSelectResult(select, _profileTimezoneColumnsName); string timezone = info.TimezoneCode; _isSysAdminUnitContact = !string.IsNullOrEmpty(timezone); return(info); }
/// <summary> /// Returns contact current time information. /// </summary> /// <param name="contactId">Contact id</param> /// <returns>Contact current time information</returns> public string GetContactCurrentTime(Guid contactId) { string result = string.Empty; ContactTimezoneInfo info = ContactTimezone.GetTimezone(contactId); if (info == null) { return(result); } CurrentTimeInfo currentTimeInfo = GetCurrentTimeInfo(info.TimezoneCode); if (currentTimeInfo == null) { return(result); } currentTimeInfo.Location = info.Location; return(currentTimeInfo.ToString()); }
/// <summary> /// Returns contact GMT timezone. /// </summary> /// <param name="contactId">Contact id.</param> /// <returns>Contact GMT timezone.</returns> public ContactTimezoneInfo GetTimezone(Guid contactId) { ContactId = contactId; ContactTimezoneInfo info = GetProfileTimezone(); if (string.IsNullOrEmpty(info.TimezoneCode) && _isSysAdminUnitContact) { info = GetSysSettingTimezone(); } if (string.IsNullOrEmpty(info.TimezoneCode)) { info = GetContactAddressTimezone(); } if (string.IsNullOrEmpty(info.TimezoneCode)) { info = GetContactAccountAddressTimezone(); } return(info); }