2016-06-27 01:45:38 +02:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using BeWo.Validation;
|
|
|
|
|
|
|
|
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
|
|
using BS.Shared.DataContracts.Compact;
|
|
|
|
|
|
using BS.Shared.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.ViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public class SupportConceptApprovalPeriodEmployeeRelVM : AbstractDCMapperVM<SupportConceptApprovalPeriodEmployeeRelDC>
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string PropertyName_Employee = "Employee";
|
|
|
|
|
|
public static string PropertyName_Betreuungsschluessel = "Betreuungsschluessel";
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public static string PropertyName_IsAbsolut = "IsAbsolut";
|
2016-06-27 01:45:38 +02:00
|
|
|
|
public static string PropertyName_EmployeeString = "EmployeeString";
|
|
|
|
|
|
|
|
|
|
|
|
private CompactEmployeeDC _Employee;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
private bool _IsAbsolut;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
private decimal _Betreuungsschluessel;
|
|
|
|
|
|
|
|
|
|
|
|
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
|
|
|
|
public CompactEmployeeDC Employee
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _Employee; }
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_Employee, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_Employee = value;
|
|
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.Employee, value), PropertyName_Employee);
|
|
|
|
|
|
FirePropertyChanged(PropertyName_Employee);
|
|
|
|
|
|
FirePropertyChanged(PropertyName_EmployeeString);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ValidationAttribute(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
|
|
|
|
public string EmployeeString
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _Employee.ToStringNullCheck(); } // Validation Workaround
|
|
|
|
|
|
set { }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Betreuungsschluessel
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _Betreuungsschluessel; }
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_Betreuungsschluessel, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_Betreuungsschluessel = value;
|
|
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.Betreuungsschluessel, value), PropertyName_Betreuungsschluessel);
|
|
|
|
|
|
FirePropertyChanged(PropertyName_Betreuungsschluessel);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public bool IsProzentual
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return !IsAbsolut; }
|
|
|
|
|
|
|
|
|
|
|
|
set { IsAbsolut = !value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsAbsolut
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _IsAbsolut; }
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_IsAbsolut, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_IsAbsolut = value;
|
|
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.IsAbsolut, value), PropertyName_IsAbsolut);
|
|
|
|
|
|
FirePropertyChanged(PropertyName_IsAbsolut);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
public SupportConceptApprovalPeriodEmployeeRelVM(SupportConceptApprovalPeriodEmployeeRelDC pDataContract) : base(pDataContract, pDataContract.SupportConceptApprovalPeriod2EmployeeOid == null) { }
|
|
|
|
|
|
|
|
|
|
|
|
protected override void InitByDataContract(SupportConceptApprovalPeriodEmployeeRelDC pDataContract)
|
|
|
|
|
|
{
|
2023-03-14 18:12:07 +01:00
|
|
|
|
//if (!IsNew)
|
|
|
|
|
|
//{
|
2016-06-27 01:45:38 +02:00
|
|
|
|
_Employee = pDataContract.Employee;
|
|
|
|
|
|
_Betreuungsschluessel = pDataContract.Betreuungsschluessel;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
_IsAbsolut = pDataContract.IsAbsolut;
|
2023-03-14 18:12:07 +01:00
|
|
|
|
//}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override SupportConceptApprovalPeriodEmployeeRelDC MapToDataContract(SupportConceptApprovalPeriodEmployeeRelDC pDataContract, bool doCommit)
|
|
|
|
|
|
{
|
|
|
|
|
|
pDataContract.Employee = _Employee;
|
|
|
|
|
|
pDataContract.Betreuungsschluessel = _Betreuungsschluessel;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
pDataContract.IsAbsolut = _IsAbsolut;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
return pDataContract;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|