2024-02-08 11:38:25 +05:00
using System ;
2021-11-16 13:14:31 +05:00
namespace AsbCloudApp.Data
{
2022-06-02 12:35:51 +05:00
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
/// </summary>
2022-01-05 17:50:45 +05:00
public class SimpleTimezoneDto
2021-11-16 13:14:31 +05:00
{
2022-06-02 12:35:51 +05:00
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> UTC
/// </summary>
2021-11-16 13:14:31 +05:00
public double Hours { get ; set ; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
/// </summary>
2023-02-17 15:30:17 +05:00
public string? TimezoneId { get ; set ; }
2022-06-02 12:35:51 +05:00
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/// </summary>
2021-11-16 13:14:31 +05:00
public bool IsOverride { get ; set ; }
2021-11-22 11:30:08 +05:00
2024-02-08 11:38:25 +05:00
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
/// </summary>
public TimeSpan Offset { get = > TimeSpan . FromHours ( Hours ) ; }
2022-06-02 12:35:51 +05:00
/// <inheritdoc/>
2023-02-17 15:30:17 +05:00
public override bool Equals ( object? obj )
2021-11-22 11:30:08 +05:00
{
2022-04-11 18:00:34 +05:00
if ( obj is SimpleTimezoneDto tTimeZone
& & tTimeZone . Hours = = Hours
& & tTimeZone . TimezoneId = = TimezoneId
2021-11-22 11:30:08 +05:00
& & tTimeZone . IsOverride = = IsOverride )
return true ;
return false ;
}
2022-06-02 12:35:51 +05:00
/// <inheritdoc/>
2021-11-22 11:30:08 +05:00
public override int GetHashCode ( )
= > Hours . GetHashCode ( )
2023-02-17 15:30:17 +05:00
| TimezoneId ? . GetHashCode ( ) ? ? - 1
2021-11-22 11:30:08 +05:00
| IsOverride . GetHashCode ( ) ;
2022-06-07 12:29:11 +05:00
/// <inheritdoc/>
public override string ToString ( )
= > $"{TimezoneId} (UTC+{Hours:00.##})" ;
2021-11-16 13:14:31 +05:00
}
}