Files
BeWoPlaner/Data/Entities/Address.cs
2025-05-16 11:57:21 +02:00

61 lines
1.6 KiB
C#

using BS.Shared;
using BS.Shared.Interface;
using System.Diagnostics;
namespace BeWo.Data.Entities
{
[DebuggerDisplay("{Oid}: {Street}, {Town}")]
public class Address : BeWoEntityBase
{
public static string PropertyName_AddressLine1 = "AddressLine1";
public static string PropertyName_Country = "Country";
public static string PropertyName_PostalCode = "PostalCode";
public static string PropertyName_State = "State";
public static string PropertyName_Street = "Street";
public static string PropertyName_Town = "Town";
public Address()
{
_Tid = TableID.Address;
}
public virtual string AddressLine1 { get; set; }
public virtual string AddressLine2 { get; set; }
public virtual string Country { get; set; }
public virtual string PostalCode { get; set; }
public virtual string State { get; set; }
public virtual string Street { get; set; }
public virtual string Town { get; set; }
public virtual decimal? Latitude { get; set; }
public virtual decimal? Longitude { get; set; }
public virtual long? L_Version { get; set; }
public override int GetHashCode()
{
if (this is null)
return 0;
return Oid.Value.GetHashCode();
}
public virtual Address CopyToNew()
{
return new Address
{
AddressLine1 = AddressLine1,
AddressLine2 = this.AddressLine2,
Country = this.Country,
PostalCode = this.PostalCode,
Notice = this.Notice,
State = this.State,
Street = this.Street,
Town = this.Town
};
}
public virtual bool IsEmpty()
{
return string.IsNullOrWhiteSpace(Street + Town + PostalCode);
}
}
}