Files
BeWoPlaner/Shared/DataContracts/ClientPartials/FlatSupportConceptTreeNodeDC.cs
Rene Evertz 6f0c28a7c7 Not Finished
Translation into SharedLauncher.csproj
Uninstall
2024-06-03 11:58:46 +02:00

196 lines
5.5 KiB
C#

using BS.SharedLauncher.Translation;
using System;
using System.ComponentModel;
using System.Windows.Media;
namespace BS.Shared.DataContracts
{
public class FlatSupportConceptTreeNodeDC : INotifyPropertyChanged
{
private string _CustomerWarning;
private string _EmployeeWarning;
private bool _IsCustomerWarningActive;
private bool _IsEmployeeWarningActive;
public event PropertyChangedEventHandler PropertyChanged;
public string CostBearerName
{
get
{
if (this.SupportConceptTreeNodeDC == null)
{
return string.Empty;
}
if (this.SupportConceptTreeNodeDC.CostBearer != null)
{
return this.SupportConceptTreeNodeDC.CostBearer.ToString();
}
return string.Empty;
}
}
public string CustomerName
{
get
{
if (this.SupportConceptTreeNodeDC == null)
{
return Translator.Translate("<Kein Hilfeplan ausgewählt>");
}
if (this.SupportConceptTreeNodeDC.Customer != null)
{
return this.SupportConceptTreeNodeDC.Customer.ToString();
}
return string.Empty;
}
}
public string CustomerWarning
{
get
{
return this._CustomerWarning;
}
set
{
this._CustomerWarning = value;
this.RaisePropertyChanged("CustomerWarning");
}
}
public string EmployeeWarning
{
get
{
return this._EmployeeWarning;
}
set
{
this._EmployeeWarning = value;
this.RaisePropertyChanged("EmployeeWarning");
}
}
public bool ExpiresIn3MonthOrLess
{
get
{
if (this.SupportConceptTreeNodeDC != null)
{
return this.SupportConceptTreeNodeDC.ExpiresIn3MonthOrLess;
}
return false;
}
}
public bool IsAboutToExpire
{
get
{
if (this.SupportConceptTreeNodeDC != null)
{
return this.SupportConceptTreeNodeDC.IsAboutToExpire;
}
return false;
}
}
public bool IsCustomerWarningActive
{
get
{
return this._IsCustomerWarningActive;
}
set
{
this._IsCustomerWarningActive = value;
this.RaisePropertyChanged("IsCustomerWarningActive");
}
}
public bool IsEmployeeWarningActive
{
get
{
return this._IsEmployeeWarningActive;
}
set
{
this._IsEmployeeWarningActive = value;
this.RaisePropertyChanged("IsEmployeeWarningActive");
}
}
public Brush NodeForegroundBrush
{
get
{
if (this.IsAboutToExpire)
{
return Brushes.Red;
}
else if (this.ExpiresIn3MonthOrLess)
{
return Brushes.Yellow;
}
else
{
return new SolidColorBrush(Color.FromRgb(160, 160, 160));
}
}
}
public string SupportConceptName
{
get
{
if (this.SupportConceptTreeNodeDC == null)
{
return string.Empty;
}
// if (this.SupportConceptTreeNodeDC.SupportConcept != null)
// return "Plan vom " + this.SupportConceptTreeNodeDC.SupportConcept.ToString();
if (this.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
{
if (
!string.IsNullOrEmpty(
this.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.AuswahlBezeichnung))
{
return String.Format("{0} {1}",
this.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.AuswahlBezeichnung,
this.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.DateRangeString);
}
return this.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.DateRangeString;
}
return string.Empty;
}
}
public SupportConceptTreeNodeDC SupportConceptTreeNodeDC { get; set; }
protected void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if (propertyChanged != null)
{
propertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}