Files

1701 lines
48 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Media;
using BeWo.Core;
using BeWo.Core.Service;
using BeWo.Validation;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using Color = System.Drawing.Color;
namespace BeWo.ViewModel
{
public class EmployeeVM : AbstractDCMapperVM<EmployeeDC>
{
#region Property Names
2019-07-10 10:11:10 +02:00
public static string PropertyName_Abbreviation = "Abbreviation";
public static string PropertyName_AbsenceTimes = "AbsenceTimes";
public static string PropertyName_AccountNumber = "AccountNumber";
public static string PropertyName_BankCode = "BankCode";
public static string PropertyName_BankName = "BankName";
public static string PropertyName_Bic = "Bic";
public static string PropertyName_CancellationPeriod = "CancellationPeriod";
public static string PropertyName_ChildCount = "ChildCount";
2019-07-10 10:11:10 +02:00
public static string PropertyName_Contracts = "Contracts";
public static string PropertyName_CustomerRelations = "CustomerRelations";
public static string PropertyName_DateOfBirth = "DateOfBirth";
public static string PropertyName_EMail = "EMail";
public static string PropertyName_EmploymentType = "EmploymentType";
public static string PropertyName_EntryDate = "EntryDate";
public static string PropertyName_FamilyStatus = "FamilyStatus";
public static string PropertyName_Fax = "Fax";
public static string PropertyName_Female = "IsFemale";
2019-09-17 17:44:57 +02:00
public static string PropertyName_IsDivers = "IsDivers";
public static string PropertyName_FirstName = "FirstName";
2019-07-10 10:11:10 +02:00
public static string PropertyName_Focuses = "Focuses";
public static string PropertyName_Gender = "Gender";
public static string PropertyName_HealthInsurance = "HealthInsurance";
public static string PropertyName_HourlyRate = "HourlyRate";
public static string PropertyName_IBAN = "IBAN";
public static string PropertyName_InsuranceNumber = "InsuranceNumber";
public static string PropertyName_IsArchived = "IsArchived";
public static string PropertyName_IsMarried = "IsMarried";
public static string PropertyName_IsQualified = "IsQualified";
public static string PropertyName_IsSingle = "IsSingle";
public static string PropertyName_LastName = "LastName";
public static string PropertyName_LeaveDays = "LeaveDays";
public static string PropertyName_Male = "IsMale";
public static string PropertyName_MobilePhone = "MobilePhone";
public static string PropertyName_Nationalitaet = "Nationalitaet";
public static string PropertyName_Notice2 = "Notice2";
public static string PropertyName_Overtimes = "Overtimes";
public static string PropertyName_PersonnelNumber = "PersonnelNumber";
public static string PropertyName_Phone = "Phone";
2016-06-27 01:45:38 +02:00
public static string PropertyName_PossibleEmploymentTypes = "PossibleEmploymentTypes";
2019-07-10 10:11:10 +02:00
public static string PropertyName_PostalCode = "PostalCode";
public static string PropertyName_PrivateEMail = "PrivateEMail";
public static string PropertyName_ProbationPeriod = "ProbationPeriod";
public static string PropertyName_WeeklyDays = "WeeklyDays";
public static string PropertyName_Profession = "Profession";
public static string PropertyName_Qualifications = "Qualifications";
public static string PropertyName_AddressLine1 = "AddressLine1";
public static string PropertyName_AddressLine2 = "AddressLine2";
2019-07-10 10:11:10 +02:00
public static string PropertyName_Street = "Street";
public static string PropertyName_TaxClass = "TaxClass";
2019-07-10 10:11:10 +02:00
public static string PropertyName_TaxNumber = "TaxNumber";
public static string PropertyName_Text1 = "Text1";
public static string PropertyName_Text2 = "Text2";
public static string PropertyName_Text3 = "Text3";
public static string PropertyName_Text4 = "Text4";
public static string PropertyName_Text5 = "Text5";
public static string PropertyName_Town = "Town";
public static string PropertyName_WeeklyFLS = "WeeklyFLS";
public static string PropertyName_WeeklyTotalHours = "WeeklyTotalHours";
public static string PropertyName_MonthlyTotalHours = "MonthlyTotalHours";
public static String PropertyName_EmployeeColor = "EmployeeColor";
public static String PropertyName_EmployeeBrush = "EmployeeBrush";
public static string PropertyName_EmployeeImage = "EmployeeImage";
public static string PropertyName_Arbeitszeiten = "Arbeitszeiten";
public static string PropertyName_Pflege = "Pflege";
public static string PropertyName_Toilettengang = "Toilettengang";
public static string PropertyName_Aggressiv = "Aggressiv";
public static string PropertyName_Schutzstufe = "Schutzstufe";
public static string PropertyName_Hygienebelehrung = "Hygienebelehrung";
2023-05-02 14:24:26 +02:00
public static string PropertyName_BemerkungenSbd = "BemerkungenSbd";
2019-07-10 10:11:10 +02:00
public static string PropertyName_VarFields = "VarFields";
#endregion
private readonly ObservableSortCollection<ValueListEntryDC> _PossibleFocuses;
private readonly ObservableSortCollection<ValueListEntryDC> _PossibleQualifications;
private string _Abbreviation;
private AbsenceTimeListVM _AbsenceTimes;
private string _AccountNumber;
private string _BankCode;
private string _BankName;
private string _Bic;
private string _ChildCount;
2019-07-10 10:11:10 +02:00
private ContractListVM _Contracts;
private CustomerEmployeeRelationListVM _CustomerRelations;
private DateTime? _DateOfBirth;
private string _EMail;
private FamilyStatus? _FamilyStatus;
private string _Fax;
private string _FirstName;
2016-06-27 01:45:38 +02:00
private ObservableSortCollection<ValueListEntryDC> _Focuses;
2019-07-10 10:11:10 +02:00
private string _HealthInsurance;
private string _IBAN;
private string _InsuranceNumber;
private bool _IsArchived;
private bool _IsFemale;
private bool _IsMale;
2019-09-17 17:44:57 +02:00
private bool _IsDivers;
private bool _IsQualified = true;
2019-07-10 10:11:10 +02:00
private string _LastName;
private string _MobilePhone;
private string _Notice2;
private OvertimeListVM _Overtimes;
private string _PersonnelNumber;
private string _Phone;
private IList<AuszahlungsartDC> _PossibleAuszahlungsarten;
private IList<EmploymentTypeDC> _PossibleEmploymentTypes;
private string _PostalCode;
private string _PrivateEMail;
private string _Profession;
2016-06-27 01:45:38 +02:00
private ObservableSortCollection<ValueListEntryDC> _Qualifications;
2019-07-10 10:11:10 +02:00
private Sex? _Sex;
private string _AddressLine1;
private string _AddressLine2;
2019-07-10 10:11:10 +02:00
private string _Street;
private string _TaxClass;
2019-07-10 10:11:10 +02:00
private string _TaxNumber;
private string _Text1;
private string _Text2;
private string _Text3;
private string _Text4;
private string _Text5;
private string _Town;
private String _EmployeeColor;
private SolidColorBrush _EmployeeBrush;
private byte[] _EmployeeImage;
private bool _Pflege;
private bool _Toilettengang;
private bool _Aggressiv;
private bool _Hygienebelehrung;
private String _Schutzstufe;
2023-05-02 14:24:26 +02:00
private String _BemerkungenSbd;
private DateTime? _AusweisGueltigVon;
private DateTime? _AusweisGueltigBis;
private string _GradDerBehinderung;
private string _AusweisBemerkung;
2019-07-10 10:11:10 +02:00
private ArbeitszeitListVM _ArbeitszeitListe;
private VarFieldListVM _VarFields;
private IList<UrlaubskontoDarstellungDC> _UrlaubskontoDarstellungDCs;
2019-07-10 10:11:10 +02:00
private ValueListEntryDC _Nationalitaet;
private ObservableSortCollection<ValueListEntryDC> _Nationalitaeten;
private ObservableSortCollection<ValueListEntryDC> _EintragKategorien;
2019-07-10 10:11:10 +02:00
private bool _SpinEditEnabled;
public EmployeeVM(
2019-07-10 10:11:10 +02:00
EmployeeDC pEmployeeDC, IList<EmploymentTypeDC> pPossibleTypes, IEnumerable<ValueListEntryDC> pValueList, IEnumerable<ValueListEntryDC> pPossibleQualifications,
IEnumerable<ValueListEntryDC> pPossibleFocusTypes, IEnumerable<AuszahlungsartDC> pPossibleAuszahlungsarten, List<ValueListEntryDC> allContractTypes, List<CostRatePeriodDC> allHourlyRateCostRatePeriods, List<ValueListEntryDC> eintragKategorien)
2016-06-27 01:45:38 +02:00
: base(pEmployeeDC, pEmployeeDC.EmployeeOid == null)
{
_PossibleEmploymentTypes = pPossibleTypes;
2019-07-10 10:11:10 +02:00
var possibleNationalitaeten = pValueList.Where(vle => vle.Type == ValueListEntryType.Nationality);
_Nationalitaeten = new ObservableSortCollection<ValueListEntryDC>(possibleNationalitaeten, Comparer.ValueListEntryDCComparer);
2018-10-08 11:57:16 +02:00
Contracts = new ContractListVM(_PossibleEmploymentTypes, allContractTypes, allHourlyRateCostRatePeriods, DataContract.Contracts ?? (DataContract.Contracts = new List<ContractDC>()));
2019-07-10 10:11:10 +02:00
Arbeitszeiten = new ArbeitszeitListVM(DataContract.Arbeitszeiten);
2016-06-27 01:45:38 +02:00
_PossibleQualifications = DataContract.Qualifications != null
? new ObservableSortCollection<ValueListEntryDC>(pPossibleQualifications.Except(DataContract.Qualifications), Comparer.ValueListEntryDCComparer)
: new ObservableSortCollection<ValueListEntryDC>(pPossibleQualifications, Comparer.ValueListEntryDCComparer);
_PossibleFocuses = DataContract.Focuses != null
? new ObservableSortCollection<ValueListEntryDC>(pPossibleFocusTypes.Except(DataContract.Focuses), Comparer.ValueListEntryDCComparer)
: new ObservableSortCollection<ValueListEntryDC>(pPossibleFocusTypes, Comparer.ValueListEntryDCComparer);
_PossibleAuszahlungsarten = new List<AuszahlungsartDC>(pPossibleAuszahlungsarten);
2019-07-10 10:11:10 +02:00
if (EmployeeBrush != null)
{
EmployeeBrush.Freeze();
}
_EintragKategorien = new ObservableSortCollection<ValueListEntryDC>(eintragKategorien);
}
2016-06-27 01:45:38 +02:00
public bool SpinEditEnabled
{
get { return _SpinEditEnabled; }
set
{
_SpinEditEnabled = value;
}
}
2019-07-10 10:11:10 +02:00
public List<SolidColorBrush> AllBrushes
{
get
{
var lTemp = typeof(Color).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Static).Select(pi => (Color)pi.GetGetMethod().Invoke(null, null)).ToList();
2016-06-27 01:45:38 +02:00
2019-07-10 10:11:10 +02:00
lTemp.Sort((x, y) => x.GetBrightness().CompareTo(y.GetBrightness()));
2016-06-27 01:45:38 +02:00
2019-07-10 10:11:10 +02:00
return lTemp.Where(w => (w.R * 0.299 + w.G * 0.587 + w.B * .114) > 75).Select(c => new SolidColorBrush(System.Windows.Media.Color.FromArgb(c.A, c.R, c.G, c.B))).ToList();
}
}
2016-06-27 01:45:38 +02:00
public bool IsArchived
{
get { return _IsArchived; }
set
{
if (AreDifferent(_IsArchived, value))
{
_IsArchived = value;
StoreDirtyInformation(
(value && DataContract.ActivationType == ActivationTypeId.Active) ||
(!value && DataContract.ActivationType == ActivationTypeId.Archived), PropertyName_IsArchived);
FirePropertyChanged(PropertyName_IsArchived);
}
}
}
public string Abbreviation
{
get { return _Abbreviation; }
set
{
if (AreDifferent(_Abbreviation, value))
{
_Abbreviation = value;
StoreDirtyInformation(AreDifferent(DataContract.Abbreviation, value), PropertyName_Abbreviation);
FirePropertyChanged(PropertyName_Abbreviation);
}
}
}
2019-07-10 10:11:10 +02:00
public SolidColorBrush EmployeeBrush
{
get { return _EmployeeBrush; }
set
{
if (AreDifferent(_EmployeeBrush, value))
{
_EmployeeBrush = value;
_EmployeeColor = value.ToString();
StoreDirtyInformation(AreDifferent(DataContract.EmployeeColor, value.ToString()), PropertyName_EmployeeBrush);
FirePropertyChanged(PropertyName_EmployeeBrush);
}
}
}
2016-06-27 01:45:38 +02:00
public AbsenceTimeListVM AbsenceTimes
{
get { return _AbsenceTimes; }
set
{
_AbsenceTimes = value;
FirePropertyChanged(PropertyName_AbsenceTimes);
}
}
public OvertimeListVM Overtimes
{
get { return _Overtimes; }
set
{
_Overtimes = value;
FirePropertyChanged(PropertyName_Overtimes);
}
}
public List<AuszahlungsartDC> PossibleAuszahlungsarten
{
get { return _PossibleAuszahlungsarten.ToList(); }
set
{
if (AreDifferent(_PossibleAuszahlungsarten.ToList(), value))
{
_PossibleAuszahlungsarten = value;
}
}
}
public ContractListVM Contracts
{
get { return _Contracts; }
set
{
_Contracts = value;
FirePropertyChanged(PropertyName_Contracts);
}
}
2019-07-10 10:11:10 +02:00
public ArbeitszeitListVM Arbeitszeiten
{
get { return _ArbeitszeitListe; }
2019-07-10 10:11:10 +02:00
set
{
_ArbeitszeitListe = value;
FirePropertyChanged(PropertyName_Arbeitszeiten);
}
}
2016-06-27 01:45:38 +02:00
public ContractVM LastContract
{
get
{
DateTime maxDate = DateTime.MinValue;
ContractVM contractWithMaxDate = null;
if (Contracts != null)
{
foreach (ContractVM item in Contracts.VMList)
{
if (!item.ContractEndDate.HasValue)
{
contractWithMaxDate = item;
maxDate = DateTime.MaxValue;
}
else if (item.ContractEndDate.Value > maxDate)
{
maxDate = item.ContractEndDate.Value;
contractWithMaxDate = item;
}
}
}
return contractWithMaxDate;
}
}
public string AccountNumber
{
get { return _AccountNumber; }
set
{
if (AreDifferent(_AccountNumber, value))
{
_AccountNumber = value;
StoreDirtyInformation(AreDifferent(DataContract.AccountNumber, value), PropertyName_AccountNumber);
FirePropertyChanged(PropertyName_AccountNumber);
}
}
}
public string BankCode
{
get { return _BankCode; }
set
{
if (AreDifferent(_BankCode, value))
{
_BankCode = value;
StoreDirtyInformation(AreDifferent(DataContract.BankCode, value), PropertyName_BankCode);
FirePropertyChanged(PropertyName_BankCode);
}
}
}
public string BankName
{
get { return _BankName; }
set
{
if (AreDifferent(_BankName, value))
{
_BankName = value;
StoreDirtyInformation(AreDifferent(DataContract.BankName, value), PropertyName_BankName);
FirePropertyChanged(PropertyName_BankName);
}
}
}
public string Bic
{
get { return _Bic; }
set
{
if (AreDifferent(_Bic, value))
{
_Bic = value;
StoreDirtyInformation(AreDifferent(DataContract.Bic, value), PropertyName_Bic);
FirePropertyChanged(PropertyName_Bic);
}
}
}
//public int CancellationPeriod
//{
// get { return this._CancellationPeriod; }
// set
// {
// if (this.AreDifferent(this._CancellationPeriod, value))
// {
// this._CancellationPeriod = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.CancellationPeriod, value), PropertyName_CancellationPeriod);
// this.FirePropertyChanged(PropertyName_CancellationPeriod);
// }
// }
//}
public string ChildCount
{
get { return _ChildCount; }
set
{
if (AreDifferent(_ChildCount, value))
{
_ChildCount = value;
StoreDirtyInformation(AreDifferent(DataContract.ChildCount, value), PropertyName_ChildCount);
FirePropertyChanged(PropertyName_ChildCount);
}
}
}
2016-06-27 01:45:38 +02:00
public CustomerEmployeeRelationListVM CustomerRelations
{
get { return _CustomerRelations; }
set
{
_CustomerRelations = value;
FirePropertyChanged(PropertyName_CustomerRelations);
}
}
public DateTime? AusweisGueltigVon
{
get { return _AusweisGueltigVon; }
set
{
if (AreDifferent(_AusweisGueltigVon, value))
{
_AusweisGueltigVon = value;
StoreDirtyInformation(AreDifferent(DataContract.AusweisGueltigVon, value), nameof(AusweisGueltigVon));
FirePropertyChanged(nameof(AusweisGueltigVon));
}
}
}
public DateTime? AusweisGueltigBis
{
get { return _AusweisGueltigBis; }
set
{
if (AreDifferent(_AusweisGueltigBis, value))
{
_AusweisGueltigBis = value;
StoreDirtyInformation(AreDifferent(DataContract.AusweisGueltigBis, value), nameof(AusweisGueltigBis));
FirePropertyChanged(nameof(AusweisGueltigBis));
}
}
}
public string GradDerBehinderung
{
get { return _GradDerBehinderung; }
set
{
if (AreDifferent(_GradDerBehinderung, value))
{
_GradDerBehinderung = value;
StoreDirtyInformation(AreDifferent(DataContract.GradDerBehinderung, value), nameof(GradDerBehinderung));
FirePropertyChanged(nameof(GradDerBehinderung));
}
}
}
public string AusweisBemerkung
{
get { return _AusweisBemerkung; }
set
{
if (AreDifferent(_AusweisBemerkung, value))
{
_AusweisBemerkung = value;
StoreDirtyInformation(AreDifferent(DataContract.AusweisBemerkung, value), nameof(AusweisBemerkung));
FirePropertyChanged(nameof(AusweisBemerkung));
}
}
}
2016-06-27 01:45:38 +02:00
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public DateTime? DateOfBirth
{
get { return _DateOfBirth; }
set
{
if (AreDifferent(_DateOfBirth, value))
{
_DateOfBirth = value;
StoreDirtyInformation(AreDifferent(DataContract.DateOfBirth, value), PropertyName_DateOfBirth);
FirePropertyChanged(PropertyName_DateOfBirth);
}
}
}
public string EMail
{
get { return _EMail; }
set
{
if (AreDifferent(_EMail, value))
{
_EMail = value;
StoreDirtyInformation(
DataContract.ContactInformations.SingleOrDefault(
con => con.ContactType == ContactType.business_Mail && con.ContactValue == value) == null,
PropertyName_EMail);
FirePropertyChanged(PropertyName_EMail);
}
}
}
//public string EmploymentType
//{
// get { return this._EmploymentType; }
// set
// {
// if (this.AreDifferent(this._EmploymentType, value))
// {
// this._EmploymentType = value;
// bool lDirty = true;
// if (this.DataContract.EmploymentType != null)
// {
// lDirty = this.DataContract.EmploymentType.TypeDescription != value;
// }
// this.StoreDirtyInformation(lDirty, PropertyName_EmploymentType);
// this.FirePropertyChanged(PropertyName_EmploymentType);
// }
// }
//}
//public DateTime? EntryDate
//{
// get { return this._EntryDate; }
// set
// {
// if (this.AreDifferent(this._EntryDate, value))
// {
// this._EntryDate = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.EntryDate, value), PropertyName_EntryDate);
// this.FirePropertyChanged(PropertyName_EntryDate);
// }
// }
//}
public FamilyStatus? FamilyStatus
{
get { return _FamilyStatus; }
set
{
if (AreDifferent(_FamilyStatus, value))
{
_FamilyStatus = value;
StoreDirtyInformation(AreDifferent(DataContract.FamilyStatus, value), PropertyName_FamilyStatus);
FirePropertyChanged(PropertyName_FamilyStatus);
}
}
}
public string Fax
{
get { return _Fax; }
set
{
if (AreDifferent(_Fax, value))
{
_Fax = value;
StoreDirtyInformation(
DataContract.ContactInformations.Where(
con => con.ContactType == ContactType.business_Fax && con.ContactValue == value).SingleOrDefault() == null,
PropertyName_Fax);
FirePropertyChanged(PropertyName_Fax);
}
}
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string FirstName
{
get { return _FirstName; }
set
{
if (AreDifferent(_FirstName, value))
{
_FirstName = value;
StoreDirtyInformation(AreDifferent(DataContract.FirstName, value), PropertyName_FirstName);
FirePropertyChanged(PropertyName_FirstName);
}
}
}
public ObservableSortCollection<ValueListEntryDC> Focuses
{
get
{
return _Focuses ?? (_Focuses = new ObservableSortCollection<ValueListEntryDC>(Comparer.ValueListEntryDCComparer));
}
}
public string HealthInsurance
{
get { return _HealthInsurance; }
set
{
if (AreDifferent(_HealthInsurance, value))
{
_HealthInsurance = value;
StoreDirtyInformation(AreDifferent(DataContract.HealthInsurance, value), PropertyName_HealthInsurance);
FirePropertyChanged(PropertyName_HealthInsurance);
}
}
}
//public decimal? HourlyRate
//{
// get { return this._HourlyRate; }
// set
// {
// if (this.AreDifferent(this._HourlyRate, value))
// {
// this._HourlyRate = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.HourlyRate, value), PropertyName_HourlyRate);
// this.FirePropertyChanged(PropertyName_HourlyRate);
// }
// }
//}
public string IBAN
{
get { return _IBAN; }
set
{
if (AreDifferent(_IBAN, value))
{
_IBAN = value;
StoreDirtyInformation(AreDifferent(DataContract.IBAN, value), PropertyName_IBAN);
FirePropertyChanged(PropertyName_IBAN);
}
}
}
public string InsuranceNumber
{
get { return _InsuranceNumber; }
set
{
if (AreDifferent(_InsuranceNumber, value))
{
_InsuranceNumber = value;
StoreDirtyInformation(AreDifferent(DataContract.InsuranceNumber, value), PropertyName_InsuranceNumber);
FirePropertyChanged(PropertyName_InsuranceNumber);
}
}
}
public override bool IsDirty
{
get
{
2019-07-10 10:11:10 +02:00
return base.IsDirty || (CustomerRelations != null && CustomerRelations.IsDirty)
|| (_AbsenceTimes != null && _AbsenceTimes.IsDirty) || (_Contracts != null && _Contracts.IsDirty) || (_Overtimes != null && _Overtimes.IsDirty) || (_ArbeitszeitListe != null && _ArbeitszeitListe.IsDirty) || (_VarFields != null && _VarFields.IsDirty);
2016-06-27 01:45:38 +02:00
}
}
// HACK: Bug bei den RadioButtons, geben false nicht weiter
// TODO nochmal angucken wenn mehr als zwei Optionen, dann in listbox und an selected item binden
// http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2146568&SiteID=1
2019-09-17 17:44:57 +02:00
public bool IsFemale
{
get { return _IsFemale; }
set
{
if (_IsFemale != value)
{
_IsFemale = value;
_IsMale = !value;
_IsDivers = !value;
StoreDirtyInformation((DataContract.Sex == Sex.Female) != value, "sex");
FirePropertyChanged(PropertyName_Female);
FirePropertyChanged(PropertyName_Male);
FirePropertyChanged(PropertyName_IsDivers);
}
}
}
public bool IsMale
{
get { return _IsMale; }
set
{
if (_IsMale != value)
{
_IsMale = value;
_IsFemale = !value;
_IsDivers = !value;
StoreDirtyInformation((DataContract.Sex == Sex.Male) != value, "sex");
FirePropertyChanged(PropertyName_Female);
FirePropertyChanged(PropertyName_Male);
FirePropertyChanged(PropertyName_IsDivers);
}
}
}
public bool IsDivers
{
get { return _IsDivers; }
set
{
if (_IsDivers != value)
{
_IsDivers = value;
_IsMale = !value;
_IsFemale = !value;
StoreDirtyInformation((DataContract.Sex == Sex.Divers) != value, "sex");
FirePropertyChanged(PropertyName_Female);
FirePropertyChanged(PropertyName_Male);
FirePropertyChanged(PropertyName_IsDivers);
}
}
}
public bool IsQualified
2016-06-27 01:45:38 +02:00
{
get { return _IsQualified; }
set
{
if (AreDifferent(_IsQualified, value))
{
_IsQualified = value;
StoreDirtyInformation(AreDifferent(DataContract.IsQualified, value), PropertyName_IsQualified);
FirePropertyChanged(PropertyName_IsQualified);
}
}
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string LastName
{
get { return _LastName; }
set
{
if (AreDifferent(_LastName, value))
{
_LastName = value;
StoreDirtyInformation(AreDifferent(DataContract.LastName, value), PropertyName_LastName);
FirePropertyChanged(PropertyName_LastName);
}
}
}
//public decimal? LeaveDays
//{
// get { return this._LeaveDays; }
// set
// {
// if (this.AreDifferent(this._LeaveDays, value))
// {
// this._LeaveDays = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.LeaveDays, value), PropertyName_LeaveDays);
// this.FirePropertyChanged(PropertyName_LeaveDays);
// }
// }
//}
public string MobilePhone
{
get { return _MobilePhone; }
set
{
if (AreDifferent(_MobilePhone, value))
{
_MobilePhone = value;
StoreDirtyInformation(
DataContract.ContactInformations.Where(
con => con.ContactType == ContactType.business_MobilePhone && con.ContactValue == value).SingleOrDefault() ==
null,
PropertyName_MobilePhone);
FirePropertyChanged(PropertyName_MobilePhone);
}
}
}
2019-07-10 10:11:10 +02:00
public ValueListEntryDC Nationalitaet
{
get { return this._Nationalitaet; }
set
{
if (this.AreDifferent(this._Nationalitaet, value))
{
this._Nationalitaet = value;
this.StoreDirtyInformation(this.AreDifferent(DataContract.Nationalitaet, value), PropertyName_Nationalitaet);
this.FirePropertyChanged(PropertyName_Nationalitaet);
}
}
}
public ObservableSortCollection<ValueListEntryDC> Nationalitaeten
{
get
{
if (_Nationalitaeten == null)
{
this._Nationalitaeten = new ObservableSortCollection<ValueListEntryDC>();
}
return this._Nationalitaeten;
}
}
2016-06-27 01:45:38 +02:00
public string PersonnelNumber
{
get { return _PersonnelNumber; }
set
{
if (AreDifferent(_PersonnelNumber, value))
{
_PersonnelNumber = value;
StoreDirtyInformation(AreDifferent(DataContract.PersonnelNumber, value), PropertyName_PersonnelNumber);
FirePropertyChanged(PropertyName_PersonnelNumber);
}
}
}
public string Phone
{
get { return _Phone; }
set
{
if (AreDifferent(_Phone, value))
{
_Phone = value;
StoreDirtyInformation(
DataContract.ContactInformations.Where(
con => con.ContactType == ContactType.business_Phone && con.ContactValue == value).SingleOrDefault() == null,
PropertyName_Phone);
FirePropertyChanged(PropertyName_Phone);
}
}
}
//public IEnumerable<string> PossibleEmploymentTypeNames
//{
// get { return this._PossibleEmploymentTypesBack.Select(empType => empType.TypeDescription); }
//}
//public IEnumerable<ValueListEntryDC> PossibleEmploymentTypes
//{
// set { this._PossibleEmploymentTypesBack = value; }
//}
public ObservableSortCollection<ValueListEntryDC> PossibleFocuses
{
get { return _PossibleFocuses; }
}
public ObservableSortCollection<ValueListEntryDC> PossibleQualifications
{
get { return _PossibleQualifications; }
}
public string PostalCode
{
get { return _PostalCode; }
set
{
if (AreDifferent(_PostalCode, value))
{
_PostalCode = value;
StoreDirtyInformation(AreDifferent(DataContract.PostalCode, value), PropertyName_PostalCode);
FirePropertyChanged(PropertyName_PostalCode);
}
}
}
public string PrivateEMail
{
get { return _PrivateEMail; }
set
{
if (AreDifferent(_PrivateEMail, value))
{
_PrivateEMail = value;
StoreDirtyInformation(
DataContract.ContactInformations.Where(
con => con.ContactType == ContactType.private_Mail && con.ContactValue == value).SingleOrDefault() == null,
PropertyName_PrivateEMail);
FirePropertyChanged(PropertyName_PrivateEMail);
}
}
}
//public int ProbationPeriod
//{
// get { return this._ProbationPeriod; }
// set
// {
// if (this.AreDifferent(this._ProbationPeriod, value))
// {
// this._ProbationPeriod = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.ProbationPeriod, value), PropertyName_ProbationPeriod);
// this.FirePropertyChanged(PropertyName_ProbationPeriod);
// }
// }
//}
public string Profession
{
get { return _Profession; }
set
{
if (AreDifferent(_Profession, value))
{
_Profession = value;
StoreDirtyInformation(AreDifferent(DataContract.Profession, value), PropertyName_Profession);
FirePropertyChanged(PropertyName_Profession);
}
}
}
public ObservableSortCollection<ValueListEntryDC> Qualifications
{
get
{
return _Qualifications ?? (_Qualifications = new ObservableSortCollection<ValueListEntryDC>(Comparer.ValueListEntryDCComparer));
}
}
public ObservableSortCollection<ValueListEntryDC> EintragKategorien
{
get
{
return _EintragKategorien ?? (_EintragKategorien = new ObservableSortCollection<ValueListEntryDC>(Comparer.ValueListEntryDCComparer));
}
}
public string AddressLine1
{
get { return this._AddressLine1; }
set
{
if (this.AreDifferent(this._AddressLine1, value))
{
this._AddressLine1 = value;
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AddressLine1, value), PropertyName_AddressLine1);
this.FirePropertyChanged(PropertyName_AddressLine1);
}
}
}
public string AddressLine2
{
get { return this._AddressLine2; }
set
{
if (this.AreDifferent(this._AddressLine2, value))
{
this._AddressLine2 = value;
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AddressLine2, value), PropertyName_AddressLine2);
this.FirePropertyChanged(PropertyName_AddressLine2);
}
}
}
public string Street
2016-06-27 01:45:38 +02:00
{
get { return _Street; }
set
{
if (AreDifferent(_Street, value))
{
_Street = value;
StoreDirtyInformation(AreDifferent(DataContract.Street, value), PropertyName_Street);
FirePropertyChanged(PropertyName_Street);
}
}
}
public string TaxClass
{
get { return _TaxClass; }
set
{
if (AreDifferent(_TaxClass, value))
{
_TaxClass = value;
StoreDirtyInformation(AreDifferent(DataContract.TaxClass, value), PropertyName_TaxClass);
FirePropertyChanged(PropertyName_TaxClass);
}
}
}
2016-06-27 01:45:38 +02:00
public string TaxNumber
{
get { return _TaxNumber; }
set
{
if (AreDifferent(_TaxNumber, value))
{
_TaxNumber = value;
StoreDirtyInformation(AreDifferent(DataContract.TaxNumber, value), PropertyName_TaxNumber);
FirePropertyChanged(PropertyName_TaxNumber);
}
}
}
public string Town
{
get { return _Town; }
set
{
if (AreDifferent(_Town, value))
{
_Town = value;
StoreDirtyInformation(AreDifferent(DataContract.Town, value), PropertyName_Town);
FirePropertyChanged(PropertyName_Town);
}
}
}
//public decimal? WeeklyFLS
//{
// get { return this._WeeklyFLS; }
// set
// {
// if (this.AreDifferent(this._WeeklyFLS, value))
// {
// this._WeeklyFLS = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.WeeklyFLS, value), PropertyName_WeeklyFLS);
// this.FirePropertyChanged(PropertyName_WeeklyFLS);
// }
// }
//}
//public decimal? WeeklyTotalHours
//{
// get { return this._WeeklyTotalHours; }
// set
// {
// if (this.AreDifferent(this._WeeklyTotalHours, value))
// {
// this._WeeklyTotalHours = value;
// this.StoreDirtyInformation(this.AreDifferent(this.DataContract.WeeklyTotalHours, value), PropertyName_WeeklyTotalHours);
// this.FirePropertyChanged(PropertyName_WeeklyTotalHours);
// }
// }
//}
public string Text1
{
get { return _Text1; }
set
{
if (base.AreDifferent(_Text1, value))
{
_Text1 = value;
StoreDirtyInformation(AreDifferent(DataContract.Text1, value), PropertyName_Text1);
FirePropertyChanged(PropertyName_Text1);
}
}
}
public string Text2
{
get { return _Text2; }
set
{
if (base.AreDifferent(_Text2, value))
{
_Text2 = value;
StoreDirtyInformation(AreDifferent(DataContract.Text2, value), PropertyName_Text2);
FirePropertyChanged(PropertyName_Text2);
}
}
}
public string Text3
{
get { return _Text3; }
set
{
if (base.AreDifferent(_Text3, value))
{
_Text3 = value;
StoreDirtyInformation(AreDifferent(DataContract.Text3, value), PropertyName_Text3);
FirePropertyChanged(PropertyName_Text3);
}
}
}
public string Text4
{
get { return _Text4; }
set
{
if (base.AreDifferent(_Text4, value))
{
_Text4 = value;
StoreDirtyInformation(AreDifferent(DataContract.Text4, value), PropertyName_Text4);
FirePropertyChanged(PropertyName_Text4);
}
}
}
public string Text5
{
get { return _Text5; }
set
{
if (base.AreDifferent(_Text5, value))
{
_Text5 = value;
StoreDirtyInformation(AreDifferent(DataContract.Text5, value), PropertyName_Text5);
FirePropertyChanged(PropertyName_Text5);
}
}
}
public string Notice2
{
get { return _Notice2; }
set
{
if (base.AreDifferent(_Notice2, value))
{
_Notice2 = value;
StoreDirtyInformation(AreDifferent(DataContract.Notice2, value), PropertyName_Notice2);
FirePropertyChanged(PropertyName_Notice2);
}
}
}
2019-07-10 10:11:10 +02:00
public Byte[] EmployeeImage
{
get { return _EmployeeImage; }
set
{
if (AreDifferent(_EmployeeImage, value))
{
_EmployeeImage = value;
StoreDirtyInformation(AreDifferent(DataContract.Images, value), PropertyName_EmployeeImage);
FirePropertyChanged(PropertyName_EmployeeImage);
}
}
}
public bool Pflege
{
get { return _Pflege; }
set
{
if (AreDifferent(_Pflege, value))
{
_Pflege = value;
StoreDirtyInformation(AreDifferent(DataContract.Pflege, value), PropertyName_Pflege);
FirePropertyChanged(PropertyName_Pflege);
}
}
}
public bool Toilettengang
{
get { return _Toilettengang; }
set
{
if (AreDifferent(_Toilettengang, value))
{
_Toilettengang = value;
StoreDirtyInformation(AreDifferent(DataContract.Toilettengang, value), PropertyName_Toilettengang);
FirePropertyChanged(PropertyName_Toilettengang);
}
}
}
public bool Aggressiv
{
get { return _Aggressiv; }
set
{
if (AreDifferent(_Aggressiv, value))
{
_Aggressiv = value;
StoreDirtyInformation(AreDifferent(DataContract.Aggressiv, value), PropertyName_Aggressiv);
FirePropertyChanged(PropertyName_Aggressiv);
}
}
}
public bool Hygienebelehrung
{
get { return _Hygienebelehrung; }
set
{
if (AreDifferent(_Hygienebelehrung, value))
{
_Hygienebelehrung = value;
StoreDirtyInformation(AreDifferent(DataContract.Hygienebelehrung, value), PropertyName_Hygienebelehrung);
FirePropertyChanged(PropertyName_Hygienebelehrung);
}
}
}
public String Schutzstufe
{
get { return _Schutzstufe; }
set
{
if (AreDifferent(_Schutzstufe, value))
{
_Schutzstufe = value;
StoreDirtyInformation(AreDifferent(DataContract.Schutzstufe, value), PropertyName_Schutzstufe);
FirePropertyChanged(PropertyName_Schutzstufe);
}
}
}
2023-05-02 14:24:26 +02:00
public string BemerkungenSbd
{
get { return _BemerkungenSbd; }
set
{
if (AreDifferent(_BemerkungenSbd, value))
{
_BemerkungenSbd = value;
StoreDirtyInformation(AreDifferent(DataContract.BemerkungenSbd, value), PropertyName_BemerkungenSbd);
FirePropertyChanged(PropertyName_BemerkungenSbd);
}
}
}
2019-07-10 10:11:10 +02:00
public VarFieldListVM VarFields
{
get { return _VarFields; }
set
{
if (AreDifferent(_VarFields, value))
{
_VarFields = value;
FirePropertyChanged(PropertyName_VarFields);
}
}
}
public List<UrlaubskontoDarstellungDC> UrlaubskontoDarstellungDCs
{
get { return _UrlaubskontoDarstellungDCs.ToList(); }
set
{
if (AreDifferent(_UrlaubskontoDarstellungDCs.ToList(), value))
{
_UrlaubskontoDarstellungDCs = value;
}
}
}
2019-07-10 10:11:10 +02:00
protected override void InitByDataContract(EmployeeDC pDataContract)
2016-06-27 01:45:38 +02:00
{
if (!IsNew)
{
_DateOfBirth = pDataContract.DateOfBirth;
_FirstName = pDataContract.FirstName;
_Abbreviation = pDataContract.Abbreviation;
_FamilyStatus = pDataContract.FamilyStatus;
_Sex = pDataContract.Sex;
_HealthInsurance = pDataContract.HealthInsurance;
_InsuranceNumber = pDataContract.InsuranceNumber;
_LastName = pDataContract.LastName;
_PersonnelNumber = pDataContract.PersonnelNumber;
_PostalCode = pDataContract.PostalCode;
_Profession = pDataContract.Profession;
_AddressLine1 = pDataContract.AddressLine1;
_AddressLine2 = pDataContract.AddressLine2;
2016-06-27 01:45:38 +02:00
_Street = pDataContract.Street;
_TaxNumber = pDataContract.TaxNumber;
_TaxClass = pDataContract.TaxClass;
_ChildCount = pDataContract.ChildCount;
2016-06-27 01:45:38 +02:00
_Town = pDataContract.Town;
_BankName = pDataContract.BankName;
_AccountNumber = pDataContract.AccountNumber;
_BankCode = pDataContract.BankCode;
_IBAN = pDataContract.IBAN;
_Bic = pDataContract.Bic;
_FamilyStatus = pDataContract.FamilyStatus;
_IsQualified = pDataContract.IsQualified == null || pDataContract.IsQualified.Value;
_IsMale = pDataContract.Sex == Sex.Male;
_IsFemale = pDataContract.Sex == Sex.Female;
2019-09-17 17:44:57 +02:00
_IsDivers = pDataContract.Sex == Sex.Divers;
_Text1 = pDataContract.Text1;
2016-06-27 01:45:38 +02:00
_Text2 = pDataContract.Text2;
_Text3 = pDataContract.Text3;
_Text4 = pDataContract.Text4;
_Text5 = pDataContract.Text5;
_Notice2 = pDataContract.Notice2;
2019-07-10 10:11:10 +02:00
_EmployeeColor = pDataContract.EmployeeColor;
_Pflege = pDataContract.Pflege;
_Toilettengang = pDataContract.Toilettengang;
_Aggressiv = pDataContract.Aggressiv;
_Schutzstufe = pDataContract.Schutzstufe;
2023-05-02 14:24:26 +02:00
_BemerkungenSbd = pDataContract.BemerkungenSbd;
2019-07-10 10:11:10 +02:00
_Hygienebelehrung = pDataContract.Hygienebelehrung;
_Nationalitaet = pDataContract.Nationalitaet;
_AusweisGueltigVon = pDataContract.AusweisGueltigVon;
_AusweisGueltigBis = pDataContract.AusweisGueltigBis;
_GradDerBehinderung = pDataContract.GradDerBehinderung;
_AusweisBemerkung = pDataContract.AusweisBemerkung;
2019-07-10 10:11:10 +02:00
if (pDataContract.Images != null && pDataContract.Images.Count > 0)
{
_EmployeeImage = pDataContract.Images[0];
}
2017-02-01 13:53:59 +01:00
2019-07-10 10:11:10 +02:00
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
2016-06-27 01:45:38 +02:00
//this._CancellationPeriod = pDataContract.CancellationPeriod;
//this._EntryDate = pDataContract.EntryDate;
//this._ProbationPeriod = pDataContract.ProbationPeriod;
//this._HourlyRate = pDataContract.HourlyRate;
//this._WeeklyFLS = pDataContract.WeeklyFLS.HasValue ? Math.Round(pDataContract.WeeklyFLS.Value, 2) : pDataContract.WeeklyFLS;
//this._WeeklyTotalHours = pDataContract.WeeklyTotalHours.HasValue ? Math.Round(pDataContract.WeeklyTotalHours.Value, 2) : pDataContract.WeeklyTotalHours;
//this._LeaveDays = pDataContract.LeaveDays.HasValue ? Math.Round(pDataContract.LeaveDays.Value, 2) : pDataContract.LeaveDays;
2019-07-10 10:11:10 +02:00
if (!String.IsNullOrEmpty(pDataContract.EmployeeColor))
{
EmployeeBrush = (SolidColorBrush)new BrushConverter().ConvertFrom(_EmployeeColor);
}
2016-06-27 01:45:38 +02:00
2023-10-26 00:06:56 +02:00
VMFactory.CreateAbsenceTimeListVMAsync(pDataContract.AbsenceTimes ?? (pDataContract.AbsenceTimes = new List<AbsenceTimeDC>()), AbsenceReasonVisibilityType.Employee, cb => AbsenceTimes = cb);
2016-06-27 01:45:38 +02:00
VMFactory.CreateOvertimeListVMAsync(pDataContract.Overtimes ?? (pDataContract.Overtimes = new List<OvertimeDC>()), cb => Overtimes = cb);
CustomerRelations = VMFactory.CreateCustomerEmployeeRelationListVM(pDataContract.RelatedCustomers ?? (pDataContract.RelatedCustomers = new List<CustomerEmployeeRelationDC>()));
if (pDataContract.Focuses != null)
{
_Focuses = new ObservableSortCollection<ValueListEntryDC>(pDataContract.Focuses, Comparer.ValueListEntryDCComparer);
}
if (pDataContract.Qualifications != null)
{
_Qualifications = new ObservableSortCollection<ValueListEntryDC>(pDataContract.Qualifications,
Comparer.ValueListEntryDCComparer);
}
foreach (ContactDC iContactDC in pDataContract.ContactInformations)
{
if (iContactDC.ContactType == ContactType.private_Mail)
{
_PrivateEMail = iContactDC.ContactValue;
}
if (iContactDC.ContactType == ContactType.business_Mail)
{
_EMail = iContactDC.ContactValue;
}
if (iContactDC.ContactType == ContactType.business_Fax)
{
_Fax = iContactDC.ContactValue;
}
if (iContactDC.ContactType == ContactType.business_Phone)
{
_Phone = iContactDC.ContactValue;
}
if (iContactDC.ContactType == ContactType.business_MobilePhone)
{
_MobilePhone = iContactDC.ContactValue;
}
}
//if (pDataContract.EmploymentType != null)
//{
// this._EmploymentType = pDataContract.EmploymentType.TypeDescription;
//}
}
2019-07-10 10:11:10 +02:00
_VarFields = new VarFieldListVM(pDataContract.EmployeeVarFields);
_UrlaubskontoDarstellungDCs = new List<UrlaubskontoDarstellungDC>();
2019-07-10 10:11:10 +02:00
Focuses.CollectionChanged += (s, e) => StoreDirtyInformation(!_Focuses.ContainsSameItemsAs(pDataContract.Focuses), PropertyName_Focuses);
2016-06-27 01:45:38 +02:00
Qualifications.CollectionChanged += (s, e) => StoreDirtyInformation(!_Qualifications.ContainsSameItemsAs(pDataContract.Qualifications), PropertyName_Qualifications);
}
protected override EmployeeDC MapToDataContract(EmployeeDC pDataContract, bool doCommit)
{
pDataContract.DateOfBirth = _DateOfBirth;
pDataContract.FirstName = _FirstName;
pDataContract.Abbreviation = _Abbreviation;
pDataContract.FamilyStatus = _FamilyStatus;
pDataContract.HealthInsurance = _HealthInsurance;
pDataContract.InsuranceNumber = _InsuranceNumber;
pDataContract.LastName = _LastName;
pDataContract.PersonnelNumber = _PersonnelNumber;
pDataContract.PostalCode = _PostalCode;
pDataContract.Profession = _Profession;
pDataContract.AddressLine1 = _AddressLine1;
pDataContract.AddressLine2 = _AddressLine2;
2016-06-27 01:45:38 +02:00
pDataContract.Street = _Street;
pDataContract.TaxNumber = _TaxNumber;
pDataContract.TaxClass = _TaxClass;
pDataContract.ChildCount = _ChildCount;
2016-06-27 01:45:38 +02:00
pDataContract.Town = _Town;
pDataContract.BankName = _BankName;
pDataContract.AccountNumber = _AccountNumber;
pDataContract.BankCode = _BankCode;
pDataContract.IBAN = _IBAN;
pDataContract.Bic = _Bic;
pDataContract.FamilyStatus = _FamilyStatus;
pDataContract.IsQualified = _IsQualified;
pDataContract.Text1 = _Text1;
pDataContract.Text2 = _Text2;
pDataContract.Text3 = _Text3;
pDataContract.Text4 = _Text4;
pDataContract.Text5 = _Text5;
pDataContract.Notice2 = _Notice2;
2019-07-10 10:11:10 +02:00
pDataContract.EmployeeColor = _EmployeeColor;
pDataContract.Type = PersonType.Employee;
pDataContract.Pflege = _Pflege;
pDataContract.Toilettengang = _Toilettengang;
pDataContract.Aggressiv = _Aggressiv;
pDataContract.Schutzstufe = _Schutzstufe;
pDataContract.Hygienebelehrung = _Hygienebelehrung;
2023-05-02 14:24:26 +02:00
pDataContract.BemerkungenSbd = _BemerkungenSbd;
2019-07-10 10:11:10 +02:00
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
pDataContract.Nationalitaet = _Nationalitaet;
pDataContract.AusweisGueltigVon = _AusweisGueltigVon;
pDataContract.AusweisGueltigBis = _AusweisGueltigBis;
pDataContract.GradDerBehinderung = _GradDerBehinderung;
pDataContract.AusweisBemerkung = _AusweisBemerkung;
2019-07-10 10:11:10 +02:00
if (pDataContract.Images != null)
{
pDataContract.Images.Clear();
}
if (_EmployeeImage != null)
{
if (pDataContract.Images == null)
{
pDataContract.Images = new List<byte[]>();
}
pDataContract.Images.Add(_EmployeeImage);
}
//pDataContract.CancellationPeriod = this._CancellationPeriod;
//pDataContract.EntryDate = this._EntryDate;
//pDataContract.ProbationPeriod = this._ProbationPeriod;
//pDataContract.HourlyRate = this._HourlyRate;
//pDataContract.LeaveDays = this._LeaveDays;
//pDataContract.WeeklyFLS = this._WeeklyFLS;
//pDataContract.WeeklyTotalHours = this._WeeklyTotalHours;
CommitContact(_MobilePhone, ContactType.business_MobilePhone);
2016-06-27 01:45:38 +02:00
CommitContact(_Phone, ContactType.business_Phone);
CommitContact(_Fax, ContactType.business_Fax);
CommitContact(_EMail, ContactType.business_Mail);
CommitContact(_PrivateEMail, ContactType.private_Mail);
if (this._IsMale)
pDataContract.Sex = Sex.Male;
if (this._IsFemale)
pDataContract.Sex = Sex.Female;
2019-09-17 17:44:57 +02:00
if (_IsDivers)
{
pDataContract.Sex = Sex.Divers;
}
if (_CustomerRelations != null)
2016-06-27 01:45:38 +02:00
{
pDataContract.RelatedCustomers = _CustomerRelations.CopyToDCList(doCommit);
}
pDataContract.Focuses = _Focuses.ToList();
pDataContract.Qualifications = _Qualifications.ToList();
if (_AbsenceTimes != null)
{
pDataContract.AbsenceTimes = _AbsenceTimes.CopyToDCList(doCommit);
}
if (_Contracts != null)
{
pDataContract.Contracts = _Contracts.CopyToDCList(doCommit);
}
2019-07-10 10:11:10 +02:00
if (_ArbeitszeitListe != null)
{
pDataContract.Arbeitszeiten = _ArbeitszeitListe.CopyToDCList(doCommit);
}
2016-06-27 01:45:38 +02:00
if (_Overtimes != null)
{
pDataContract.Overtimes = _Overtimes.CopyToDCList(doCommit);
}
2019-07-10 10:11:10 +02:00
//if (this._PossibleEmploymentTypesBack != null)
//{
// ValueListEntryDC lEmplyomentType = this._PossibleEmploymentTypesBack.SingleOrDefault(empType => empType.TypeDescription == this._EmploymentType);
// if ((pDataContract.EmploymentType == null && lEmplyomentType != null) || pDataContract.EmploymentType != null)
// {
// pDataContract.EmploymentType = lEmplyomentType;
// }
//}
if (_VarFields != null)
{
pDataContract.EmployeeVarFields = _VarFields.CopyToDCList(doCommit);
}
return pDataContract;
2016-06-27 01:45:38 +02:00
}
private void CommitContact(string pValue, ContactType pContactType)
{
List<ContactDC> lOldContactDCs;
if (DataContract.ContactInformations != null)
{
lOldContactDCs = DataContract.ContactInformations.ToList();
}
else
{
lOldContactDCs = new List<ContactDC>();
}
ContactDC lContactDC = null;
try
{
lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType);
}
catch (Exception)
{
// donothing
}
if (string.IsNullOrEmpty(pValue) && lContactDC != null)
{
lOldContactDCs.Remove(lContactDC);
}
else if (!string.IsNullOrEmpty(pValue))
{
if (lContactDC == null)
{
lContactDC = new ContactDC
{
ContactType = pContactType
};
lOldContactDCs.Add(lContactDC);
}
lContactDC.ContactValue = pValue;
}
DataContract.ContactInformations = lOldContactDCs;
}
}
}