Files
BeWoPlaner/Shared/DataContracts/Compact/ClientPartials/CompactOrganisationDC.cs

137 lines
3.8 KiB
C#
Raw Normal View History

2024-12-30 16:12:47 +01:00
using System.Diagnostics;
using System.Windows.Media;
using BS.Shared.DataContracts.ClientPartials;
2016-06-27 01:45:38 +02:00
using BS.Shared.Extensions;
namespace BS.Shared.DataContracts.Compact
{
2024-12-30 16:12:47 +01:00
[DebuggerDisplay("{SimpleDescription}")]
public partial class CompactOrganisationDC : IFilterableDC, IMoKSearchableDC
2016-06-27 01:45:38 +02:00
{
public long EntityOid => OrganisationOid;
2016-06-27 01:45:38 +02:00
public bool IsArchived => ActivationType == ActivationTypeId.Archived;
2016-06-27 01:45:38 +02:00
public bool IsDeleted => ActivationType == ActivationTypeId.Deleted;
2016-06-27 01:45:38 +02:00
public string AddressString
{
get
{
var address = Street;
if(!string.IsNullOrEmpty(address))
2016-06-27 01:45:38 +02:00
{
address += ", ";
}
return address + PostalCode + " " + Town;
2016-06-27 01:45:38 +02:00
}
}
public SolidColorBrush FilterableBrush => new SolidColorBrush(Colors.Transparent);
2016-06-27 01:45:38 +02:00
public string AddressSummaryInfo
{
get
{
var address = Street;
if(!string.IsNullOrEmpty(address))
2016-06-27 01:45:38 +02:00
{
address += "\n";
}
if(address is null)
2016-06-27 01:45:38 +02:00
{
address = string.Empty;
}
address += PostalCode + " " + Town;
2016-06-27 01:45:38 +02:00
return address;
}
2016-06-27 01:45:38 +02:00
set { }
}
public string ContactSummaryInfo
{
get
{
var info = string.Empty;
if(!string.IsNullOrEmpty(Communication1))
{
info = "Tel.: " + Communication1;
}
2016-06-27 01:45:38 +02:00
if(!string.IsNullOrEmpty(Communication2))
2016-06-27 01:45:38 +02:00
{
if (info.Length > 0)
info += "\n";
info += "Fax: " + Communication2;
2016-06-27 01:45:38 +02:00
}
if(!string.IsNullOrEmpty(Communication3))
2016-06-27 01:45:38 +02:00
{
if (info.Length > 0)
info += "\n";
info += "E-Mail: " + Communication3;
2016-06-27 01:45:38 +02:00
}
if(!string.IsNullOrEmpty(Communication4))
2016-06-27 01:45:38 +02:00
{
if(info.Length > 0)
{
2016-06-27 01:45:38 +02:00
info += "\n";
}
info += "Internet: " + Communication4;
2016-06-27 01:45:38 +02:00
}
2016-06-27 01:45:38 +02:00
return info;
}
set { }
2016-06-27 01:45:38 +02:00
}
public string DetailDescription => Name;
2016-06-27 01:45:38 +02:00
public string FilterRelevants => $"{Name} {Function} {AddressSummaryInfo} {IKKrankenkasse} {IKKostentrager} {IKDatenannahmestelle}";
2016-06-27 01:45:38 +02:00
public string IconPath => @"..\..\Ressources\Icons\OfficeBulidingBlackDisabled.png";
2016-06-27 01:45:38 +02:00
public string ServiceUnitName => CostRatePeriods != null ? CostRatePeriods.GetCurrentlyValidRate(CostRatePeriodType.MinutesPerServiceUnit).UnitName : "Stunden";
2016-06-27 01:45:38 +02:00
public string SimpleDescription => Name;
2016-06-27 01:45:38 +02:00
public bool SupportsActivationType => false;
2016-06-27 01:45:38 +02:00
public long Version
{
get => OrganisationVersion;
2016-06-27 01:45:38 +02:00
set => OrganisationVersion = value;
2016-06-27 01:45:38 +02:00
}
public override bool Equals(object obj)
{
if(obj is CompactOrganisationDC compactOrganisation)
2016-06-27 01:45:38 +02:00
{
return OrganisationOid == compactOrganisation.OrganisationOid;
2016-06-27 01:45:38 +02:00
}
return false;
}
public override int GetHashCode()
{
return GetType().Name.GetHashCode() ^ OrganisationOid.GetHashCode();
2016-06-27 01:45:38 +02:00
}
public override string ToString()
{
return Name;
2016-06-27 01:45:38 +02:00
}
}
}