1136 lines
32 KiB
C#
1136 lines
32 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using BeWo.Core;
|
|
using BeWo.Validation;
|
|
using BeWo.View;
|
|
using BeWo.ViewModel.ListViewModel;
|
|
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.GkvAbrechnung;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class OrganisationVM : AbstractDCMapperVM<OrganisationDC>, IArbeitszeitenVM
|
|
{
|
|
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_ContactPerson = "ContactPerson";
|
|
public static string PropertyName_CostRatePeriods = "CostRatePeriods";
|
|
public static string PropertyName_EMail = "EMail";
|
|
public static string PropertyName_Fax = "Fax";
|
|
public static string PropertyName_IBAN = "IBAN";
|
|
public static string PropertyName_InvoiceAddressPOBox = "InvoiceAddressPOBox";
|
|
public static string PropertyName_InvoiceAddressPostalCode = "InvoiceAddressPostalCode";
|
|
public static string PropertyName_InvoiceAddressStreet = "InvoiceAddressStreet";
|
|
public static string PropertyName_InvoiceAddressTown = "InvoiceAddressTown";
|
|
public static string PropertyName_InvoiceAddressLine1 = "InvoiceAddressLine1";
|
|
public static string PropertyName_IsCalculatingWithFactor = "IsCalculatingWithFactor";
|
|
public static string PropertyName_IsSingleInvoicePerCustomer = "IsSingleInvoicePerCustomer";
|
|
public static string PropertyName_Name = "Name";
|
|
public static string PropertyName_Name2 = "Name2";
|
|
public static string PropertyName_Notice = "Notice";
|
|
public static string PropertyName_POBox = "POBox";
|
|
public static string PropertyName_Phone = "Phone";
|
|
public static string PropertyName_PossibleQualifications = "PossibleQualifications";
|
|
public static string PropertyName_PersonRelations = "PersonRelations";
|
|
public static string PropertyName_PostalCode = "PostalCode";
|
|
public static string PropertyName_Street = "Street";
|
|
public static string PropertyName_Town = "Town";
|
|
public static string PropertyName_AddressLine1 = "AddressLine1";
|
|
public static string PropertyName_Website = "Website";
|
|
public static string PropertyName_DebitorNumber = "DebitorNumber";
|
|
public static string PropertyName_IsArchived = "IsArchived";
|
|
public static string PropertyName_VarFields = "VarFields";
|
|
public static string PropertyName_Function = "OrganisationsFunction";
|
|
public static string PropertyName_Arbeitszeiten = "Arbeitszeiten";
|
|
public static string PropertyName_Feiertage = "Feiertage";
|
|
|
|
private readonly List<ValueListEntryDC> _AllQualifications;
|
|
|
|
private string _AccountNumber;
|
|
private string _BankCode;
|
|
private string _BankName;
|
|
private string _Bic;
|
|
private string _ContactPerson;
|
|
private CostRatePeriodListVM _CostRatePeriods;
|
|
private string _EMail;
|
|
private string _Fax;
|
|
private string _IBAN;
|
|
private string _InvoiceAddressPOBox;
|
|
private string _InvoiceAddressPostalCode;
|
|
private string _InvoiceAddressStreet;
|
|
private string _InvoiceAddressTown;
|
|
private string _InvoiceAddressLine1;
|
|
private bool _IsCalculatingWithFactor;
|
|
private bool _IsSingleInvoicePerCustomer;
|
|
private string _Name;
|
|
private string _Name2;
|
|
private string _Notice;
|
|
private string _POBox;
|
|
private string _Phone;
|
|
private OrganisationPersonRelationListVM _PersonRelations;
|
|
private string _PostalCode;
|
|
private string _Street;
|
|
private string _Town;
|
|
private string _AddressLine1;
|
|
private string _Website;
|
|
private string _DebitorNumber;
|
|
private bool _IsArchived;
|
|
private VarFieldListVM _VarFields;
|
|
private ObservableSortCollection<ValueListEntryDC> _Functions;
|
|
private ObservableSortCollection<ValueListEntryDC> _RoleInOrganisations;
|
|
private ValueListEntryDC _Function;
|
|
private ArbeitszeitListVM _ArbeitszeitListe;
|
|
private FeiertagListVM _Feiertage;
|
|
private string _IKKrankenkasse;
|
|
private string _IKKostentrager;
|
|
private string _IKDatenannahmestelle;
|
|
private string _BezDatenannahmestelle;
|
|
private string _Leistungserbringergruppe;
|
|
private string _BusinessPartnerId;
|
|
private GkvVerfahrensstufe? _Verfahrensstufe;
|
|
private bool _GkvAusblenden;
|
|
|
|
private AddressVM _HausanschriftDatenannahmestelle;
|
|
private AddressVM _PostfachanschriftDatenannahmestelle;
|
|
private AddressVM _GroßkundenanschriftDatenannahmestelle;
|
|
|
|
public OrganisationVM()
|
|
{
|
|
if (!BeWoApp.IsInDesignMode)
|
|
throw new NotImplementedException();
|
|
|
|
Name = "Designername";
|
|
}
|
|
public OrganisationVM(OrganisationDC pDataContract, List<ValueListEntryDC> pAllQualifications, List<ValueListEntryDC> pPossibleFunctions, List<ValueListEntryDC> pPossibleRoleInOrganisations)
|
|
: base(pDataContract, pDataContract.OrganisationOid == null)
|
|
{
|
|
this._AllQualifications = pAllQualifications;
|
|
|
|
this._Functions = new ObservableSortCollection<ValueListEntryDC>(pPossibleFunctions, Comparer.ValueListEntryDCComparer);
|
|
|
|
_RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>(pPossibleRoleInOrganisations, Comparer.ValueListEntryDCComparer);
|
|
|
|
Arbeitszeiten = new ArbeitszeitListVM(DataContract.Arbeitszeiten);
|
|
|
|
Feiertage = new FeiertagListVM(DataContract.Feiertage);
|
|
}
|
|
|
|
public ArbeitszeitListVM Arbeitszeiten
|
|
{
|
|
get { return _ArbeitszeitListe; }
|
|
|
|
set
|
|
{
|
|
_ArbeitszeitListe = value;
|
|
FirePropertyChanged(PropertyName_Arbeitszeiten);
|
|
}
|
|
}
|
|
|
|
public FeiertagListVM Feiertage
|
|
{
|
|
get { return _Feiertage; }
|
|
|
|
set
|
|
{
|
|
_Feiertage = value;
|
|
FirePropertyChanged(PropertyName_Feiertage);
|
|
}
|
|
}
|
|
|
|
public string AccountNumber
|
|
{
|
|
get { return this._AccountNumber; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._AccountNumber, value))
|
|
{
|
|
this._AccountNumber = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AccountNumber, value), PropertyName_AccountNumber);
|
|
|
|
this.FirePropertyChanged(PropertyName_AccountNumber);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string BankCode
|
|
{
|
|
get { return this._BankCode; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._BankCode, value))
|
|
{
|
|
this._BankCode = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.BankCode, value), PropertyName_BankCode);
|
|
|
|
this.FirePropertyChanged(PropertyName_BankCode);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string BankName
|
|
{
|
|
get { return this._BankName; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._BankName, value))
|
|
{
|
|
this._BankName = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.BankName, value), PropertyName_BankName);
|
|
|
|
this.FirePropertyChanged(PropertyName_BankName);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Bic
|
|
{
|
|
get { return this._Bic; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Bic, value))
|
|
{
|
|
this._Bic = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Bic, value), PropertyName_Bic);
|
|
this.FirePropertyChanged(PropertyName_Bic);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string ContactPerson
|
|
{
|
|
get { return this._ContactPerson; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._ContactPerson, value))
|
|
{
|
|
this._ContactPerson = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.ContactPerson && con.ContactValue == value).SingleOrDefault() == null,
|
|
PropertyName_ContactPerson);
|
|
|
|
this.FirePropertyChanged(PropertyName_ContactPerson);
|
|
}
|
|
}
|
|
}
|
|
|
|
public CostRatePeriodListVM CostRatePeriods
|
|
{
|
|
get { return this._CostRatePeriods; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._CostRatePeriods, value))
|
|
{
|
|
this._CostRatePeriods = value;
|
|
this.FirePropertyChanged(PropertyName_CostRatePeriods);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string EMail
|
|
{
|
|
get { return this._EMail; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._EMail, value))
|
|
{
|
|
this._EMail = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.business_Mail && con.ContactValue == value).SingleOrDefault() == null, PropertyName_EMail);
|
|
|
|
this.FirePropertyChanged(PropertyName_EMail);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Fax
|
|
{
|
|
get { return this._Fax; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Fax, value))
|
|
{
|
|
this._Fax = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.business_Fax && con.ContactValue == value).SingleOrDefault() == null, PropertyName_Fax);
|
|
|
|
this.FirePropertyChanged(PropertyName_Fax);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string IBAN
|
|
{
|
|
get { return this._IBAN; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._IBAN, value))
|
|
{
|
|
this._IBAN = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.IBAN, value), PropertyName_IBAN);
|
|
|
|
this.FirePropertyChanged(PropertyName_IBAN);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string InvoiceAddressPOBox
|
|
{
|
|
get { return this._InvoiceAddressPOBox; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._InvoiceAddressPOBox, value))
|
|
{
|
|
this._InvoiceAddressPOBox = value;
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.private_POBox && con.ContactValue == value).SingleOrDefault() == null,
|
|
PropertyName_InvoiceAddressPOBox);
|
|
this.FirePropertyChanged(PropertyName_InvoiceAddressPOBox);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string InvoiceAddressPostalCode
|
|
{
|
|
get { return this._InvoiceAddressPostalCode; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._InvoiceAddressPostalCode, value))
|
|
{
|
|
this._InvoiceAddressPostalCode = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.InvoiceAddressPostalCode, value), PropertyName_InvoiceAddressPostalCode);
|
|
this.FirePropertyChanged(PropertyName_InvoiceAddressPostalCode);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string InvoiceAddressStreet
|
|
{
|
|
get { return this._InvoiceAddressStreet; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._InvoiceAddressStreet, value))
|
|
{
|
|
this._InvoiceAddressStreet = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.InvoiceAddressStreet, value), PropertyName_InvoiceAddressStreet);
|
|
this.FirePropertyChanged(PropertyName_InvoiceAddressStreet);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string InvoiceAddressTown
|
|
{
|
|
get { return this._InvoiceAddressTown; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._InvoiceAddressTown, value))
|
|
{
|
|
this._InvoiceAddressTown = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.InvoiceAddressTown, value), PropertyName_InvoiceAddressTown);
|
|
this.FirePropertyChanged(PropertyName_InvoiceAddressTown);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string InvoiceAddressLine1
|
|
{
|
|
get { return this._InvoiceAddressLine1; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._InvoiceAddressLine1, value))
|
|
{
|
|
this._InvoiceAddressLine1 = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.InvoiceAddressLine1, value), PropertyName_InvoiceAddressLine1);
|
|
this.FirePropertyChanged(PropertyName_InvoiceAddressLine1);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IsCalculatingWithFactor
|
|
{
|
|
get { return this._IsCalculatingWithFactor; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._IsCalculatingWithFactor, value))
|
|
{
|
|
this._IsCalculatingWithFactor = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.IsCalculatingWithFactor, value), PropertyName_IsCalculatingWithFactor);
|
|
|
|
this.FirePropertyChanged(PropertyName_IsCalculatingWithFactor);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IsArchived
|
|
{
|
|
get { return this._IsArchived; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._IsArchived, value))
|
|
{
|
|
this._IsArchived = value;
|
|
this.StoreDirtyInformation(
|
|
(value && this.DataContract.ActivationType == ActivationTypeId.Active) || (!value && this.DataContract.ActivationType == ActivationTypeId.Archived), PropertyName_IsArchived);
|
|
this.FirePropertyChanged(PropertyName_IsArchived);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool IsDirty
|
|
{
|
|
get
|
|
{
|
|
if (Utils.IsAnyNull(this._CostRatePeriods, _VarFields))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return base.IsDirty
|
|
|| this._CostRatePeriods.IsDirty
|
|
|| this._VarFields.IsDirty
|
|
|| (_ArbeitszeitListe != null && _ArbeitszeitListe.IsDirty)
|
|
|| (_Feiertage != null && _Feiertage.IsDirty)
|
|
|| (HausanschriftDatenannahmestelle?.IsDirty ?? false)
|
|
|| (PostfachanschriftDatenannahmestelle?.IsDirty ?? false)
|
|
|| (GroßkundenanschriftDatenannahmestelle?.IsDirty ?? false);
|
|
}
|
|
}
|
|
|
|
public bool IsSingleInvoicePerCustomer
|
|
{
|
|
get { return this._IsSingleInvoicePerCustomer; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._IsSingleInvoicePerCustomer, value))
|
|
{
|
|
this._IsSingleInvoicePerCustomer = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.IsSingleInvoicePerCustomer, value), PropertyName_IsSingleInvoicePerCustomer);
|
|
this.FirePropertyChanged(PropertyName_IsSingleInvoicePerCustomer);
|
|
}
|
|
}
|
|
}
|
|
|
|
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
public string Name
|
|
{
|
|
get { return this._Name; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Name, value))
|
|
{
|
|
this._Name = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Name, value), PropertyName_Name);
|
|
|
|
this.FirePropertyChanged(PropertyName_Name);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Name2
|
|
{
|
|
get { return this._Name2; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Name2, value))
|
|
{
|
|
this._Name2 = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Name2, value), PropertyName_Name2);
|
|
|
|
this.FirePropertyChanged(PropertyName_Name2);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Notice
|
|
{
|
|
get { return this._Notice; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Notice, value))
|
|
{
|
|
this._Notice = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.OrganisationNotice, value), PropertyName_Notice);
|
|
|
|
this.FirePropertyChanged(PropertyName_Notice);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string POBox
|
|
{
|
|
get { return this._POBox; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._POBox, value))
|
|
{
|
|
this._POBox = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.business_POBox && con.ContactValue == value).SingleOrDefault() == null, PropertyName_POBox);
|
|
|
|
this.FirePropertyChanged(PropertyName_POBox);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Phone
|
|
{
|
|
get { return this._Phone; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Phone, value))
|
|
{
|
|
this._Phone = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.business_Phone && con.ContactValue == value).SingleOrDefault() == null, PropertyName_Phone);
|
|
|
|
this.FirePropertyChanged(PropertyName_Phone);
|
|
}
|
|
}
|
|
}
|
|
|
|
public List<ValueListEntryDC> PossibleQualifications
|
|
{
|
|
get
|
|
{
|
|
var existing = this._CostRatePeriods.VMList.Where(i => i.ValueListEntry != null).Select(i => i.ValueListEntry.ValueListEntryOid).Distinct().ToList();
|
|
|
|
return this._AllQualifications.Where(i => !existing.Contains(i.ValueListEntryOid)).ToList();
|
|
}
|
|
}
|
|
|
|
public OrganisationPersonRelationListVM PersonRelations
|
|
{
|
|
get { return _PersonRelations; }
|
|
|
|
set
|
|
{
|
|
_PersonRelations = value;
|
|
FirePropertyChanged(PropertyName_PersonRelations);
|
|
}
|
|
}
|
|
|
|
public string PostalCode
|
|
{
|
|
get { return this._PostalCode; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._PostalCode, value))
|
|
{
|
|
this._PostalCode = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.PostalCode, value), PropertyName_PostalCode);
|
|
|
|
this.FirePropertyChanged(PropertyName_PostalCode);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Street
|
|
{
|
|
get { return this._Street; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Street, value))
|
|
{
|
|
this._Street = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Street, value), PropertyName_Street);
|
|
|
|
this.FirePropertyChanged(PropertyName_Street);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Town
|
|
{
|
|
get { return this._Town; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Town, value))
|
|
{
|
|
this._Town = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Town, value), PropertyName_Town);
|
|
|
|
this.FirePropertyChanged(PropertyName_Town);
|
|
}
|
|
}
|
|
}
|
|
|
|
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 Website
|
|
{
|
|
get { return this._Website; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Website, value))
|
|
{
|
|
this._Website = value;
|
|
|
|
this.StoreDirtyInformation(
|
|
this.DataContract.ContactInformations.Where(con => con.ContactType == ContactType.business_Homepage && con.ContactValue == value).SingleOrDefault() == null,
|
|
PropertyName_Website);
|
|
|
|
this.FirePropertyChanged(PropertyName_Website);
|
|
}
|
|
}
|
|
}
|
|
|
|
public string DebitorNumber
|
|
{
|
|
get { return this._DebitorNumber; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._DebitorNumber, value))
|
|
{
|
|
this._DebitorNumber = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.DebitorNumber, value), PropertyName_DebitorNumber);
|
|
|
|
this.FirePropertyChanged(PropertyName_DebitorNumber);
|
|
}
|
|
}
|
|
}
|
|
|
|
public VarFieldListVM VarFields
|
|
{
|
|
get { return this._VarFields; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._VarFields, value))
|
|
{
|
|
this._VarFields = value;
|
|
this.FirePropertyChanged(PropertyName_VarFields);
|
|
}
|
|
}
|
|
}
|
|
|
|
public ObservableSortCollection<ValueListEntryDC> Functions
|
|
{
|
|
get
|
|
{
|
|
if (this._Functions == null)
|
|
{
|
|
this._Functions = new ObservableSortCollection<ValueListEntryDC>();
|
|
}
|
|
|
|
return this._Functions;
|
|
}
|
|
}
|
|
|
|
public ObservableSortCollection<ValueListEntryDC> RoleInOrganisations
|
|
{
|
|
get
|
|
{
|
|
if (this._RoleInOrganisations == null)
|
|
{
|
|
this._RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>();
|
|
}
|
|
|
|
return this._RoleInOrganisations;
|
|
}
|
|
}
|
|
|
|
public ValueListEntryDC Function
|
|
{
|
|
get { return this._Function; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Function, value))
|
|
{
|
|
this._Function = value;
|
|
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Function, value), PropertyName_Function);
|
|
|
|
this.FirePropertyChanged(PropertyName_Function);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IsIKNumberValid
|
|
=> Validator.IsIKNumberValid(IKKrankenkasse)
|
|
&& Validator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
|
|
|
|
public string IKKrankenkasse
|
|
{
|
|
get { return this._IKKrankenkasse; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_IKKrankenkasse, value))
|
|
return;
|
|
|
|
_IKKrankenkasse = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.IKKrankenkasse, value), nameof(IKKrankenkasse));
|
|
FirePropertyChanged(nameof(IKKrankenkasse));
|
|
FirePropertyChanged(nameof(IsIKNumberValid));
|
|
}
|
|
}
|
|
|
|
public string IKKostentrager
|
|
{
|
|
get { return this._IKKostentrager; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_IKKostentrager, value))
|
|
return;
|
|
|
|
_IKKostentrager = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.IKKostentrager, value), nameof(IKKostentrager));
|
|
FirePropertyChanged(nameof(IKKostentrager));
|
|
}
|
|
}
|
|
|
|
public string IKDatenannahmestelle
|
|
{
|
|
get { return this._IKDatenannahmestelle; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_IKDatenannahmestelle, value))
|
|
return;
|
|
|
|
_IKDatenannahmestelle = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.IKDatenannahmestelle, value), nameof(IKDatenannahmestelle));
|
|
FirePropertyChanged(nameof(IKDatenannahmestelle));
|
|
}
|
|
}
|
|
|
|
public string BezDatenannahmestelle
|
|
{
|
|
get { return this._BezDatenannahmestelle; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_BezDatenannahmestelle, value))
|
|
return;
|
|
|
|
_BezDatenannahmestelle = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.BezDatenannahmestelle, value), nameof(BezDatenannahmestelle));
|
|
FirePropertyChanged(nameof(BezDatenannahmestelle));
|
|
}
|
|
}
|
|
|
|
public string Leistungserbringergruppe
|
|
{
|
|
get { return _Leistungserbringergruppe; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_Leistungserbringergruppe, value))
|
|
return;
|
|
|
|
_Leistungserbringergruppe = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Leistungserbringergruppe, value), nameof(Leistungserbringergruppe));
|
|
FirePropertyChanged(nameof(Leistungserbringergruppe));
|
|
FirePropertyChanged(nameof(IsIKNumberValid));
|
|
}
|
|
}
|
|
|
|
public string BusinessPartnerId
|
|
{
|
|
get { return this._BusinessPartnerId; }
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._BusinessPartnerId, value))
|
|
{
|
|
this._BusinessPartnerId = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.BusinessPartnerId, value), nameof(BusinessPartnerId));
|
|
this.FirePropertyChanged(nameof(BusinessPartnerId));
|
|
}
|
|
}
|
|
}
|
|
|
|
public GkvVerfahrensstufe Verfahrensstufe
|
|
{
|
|
get { return _Verfahrensstufe ?? GkvVerfahrensstufe.Test; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(_Verfahrensstufe, value))
|
|
return;
|
|
|
|
_Verfahrensstufe = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Verfahrensstufe, value), nameof(Verfahrensstufe));
|
|
FirePropertyChanged(nameof(Verfahrensstufe));
|
|
FirePropertyChanged(nameof(VerfahrensstufeInt));
|
|
}
|
|
}
|
|
|
|
public int VerfahrensstufeInt
|
|
{
|
|
get { return (int)Verfahrensstufe; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(VerfahrensstufeInt, value))
|
|
return;
|
|
|
|
Verfahrensstufe = (GkvVerfahrensstufe)value;
|
|
}
|
|
}
|
|
|
|
public bool GkvAusblenden
|
|
{
|
|
get { return _GkvAusblenden; }
|
|
|
|
set
|
|
{
|
|
if (!AreDifferent(GkvAusblenden, value))
|
|
return;
|
|
|
|
_GkvAusblenden = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.GkvAusblenden, value), nameof(GkvAusblenden));
|
|
FirePropertyChanged(nameof(GkvAusblenden));
|
|
}
|
|
}
|
|
|
|
public AddressVM HausanschriftDatenannahmestelle
|
|
{
|
|
get => _HausanschriftDatenannahmestelle;
|
|
set
|
|
{
|
|
_HausanschriftDatenannahmestelle = value;
|
|
FirePropertyChanged(nameof(HausanschriftDatenannahmestelle));
|
|
}
|
|
}
|
|
public AddressVM PostfachanschriftDatenannahmestelle
|
|
{
|
|
get => _PostfachanschriftDatenannahmestelle;
|
|
set
|
|
{
|
|
_PostfachanschriftDatenannahmestelle = value;
|
|
FirePropertyChanged(nameof(PostfachanschriftDatenannahmestelle));
|
|
}
|
|
}
|
|
public AddressVM GroßkundenanschriftDatenannahmestelle
|
|
{
|
|
get => _GroßkundenanschriftDatenannahmestelle;
|
|
set
|
|
{
|
|
_GroßkundenanschriftDatenannahmestelle = value;
|
|
FirePropertyChanged(nameof(GroßkundenanschriftDatenannahmestelle));
|
|
}
|
|
}
|
|
|
|
protected void CommitContact(string pValue, ContactType pContactType)
|
|
{
|
|
List<ContactDC> lOldContactDCs;
|
|
if (this.DataContract.ContactInformations != null)
|
|
{
|
|
lOldContactDCs = this.DataContract.ContactInformations.ToList();
|
|
}
|
|
else
|
|
{
|
|
lOldContactDCs = new List<ContactDC>();
|
|
}
|
|
|
|
ContactDC lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType);
|
|
|
|
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;
|
|
}
|
|
|
|
this.DataContract.ContactInformations = lOldContactDCs;
|
|
}
|
|
|
|
protected override void InitByDataContract(OrganisationDC pDataContract)
|
|
{
|
|
this._VarFields = new VarFieldListVM(pDataContract.VarFields);
|
|
|
|
if (!IsNew)
|
|
{
|
|
_AccountNumber = pDataContract.AccountNumber;
|
|
_BankCode = pDataContract.BankCode;
|
|
_BankName = pDataContract.BankName;
|
|
_Bic = pDataContract.Bic;
|
|
_IBAN = pDataContract.IBAN;
|
|
_Name = pDataContract.Name;
|
|
_Name2 = pDataContract.Name2;
|
|
_Notice = pDataContract.OrganisationNotice;
|
|
_PostalCode = pDataContract.PostalCode;
|
|
_Street = pDataContract.Street;
|
|
_Town = pDataContract.Town;
|
|
_AddressLine1 = pDataContract.AddressLine1;
|
|
_InvoiceAddressPostalCode = pDataContract.InvoiceAddressPostalCode;
|
|
_InvoiceAddressStreet = pDataContract.InvoiceAddressStreet;
|
|
_InvoiceAddressTown = pDataContract.InvoiceAddressTown;
|
|
_InvoiceAddressLine1 = pDataContract.InvoiceAddressLine1;
|
|
_IsCalculatingWithFactor = pDataContract.IsCalculatingWithFactor;
|
|
_IsSingleInvoicePerCustomer = pDataContract.IsSingleInvoicePerCustomer;
|
|
_DebitorNumber = pDataContract.DebitorNumber;
|
|
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
|
|
_IKKrankenkasse = pDataContract.IKKrankenkasse;
|
|
_IKKostentrager = pDataContract.IKKostentrager;
|
|
_IKDatenannahmestelle = pDataContract.IKDatenannahmestelle;
|
|
_BezDatenannahmestelle = pDataContract.BezDatenannahmestelle;
|
|
_Leistungserbringergruppe = pDataContract.Leistungserbringergruppe;
|
|
_BusinessPartnerId = pDataContract.BusinessPartnerId;
|
|
_Verfahrensstufe = pDataContract.Verfahrensstufe;
|
|
_GkvAusblenden = pDataContract.GkvAusblenden;
|
|
|
|
_Function = pDataContract.Function;
|
|
|
|
foreach (ContactDC iContactDC in pDataContract.ContactInformations)
|
|
{
|
|
if (iContactDC.ContactType == ContactType.business_Mail)
|
|
{
|
|
this._EMail = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.business_Homepage)
|
|
{
|
|
this._Website = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.business_Fax)
|
|
{
|
|
this._Fax = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.business_Phone)
|
|
{
|
|
this._Phone = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.ContactPerson)
|
|
{
|
|
this._ContactPerson = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.ContactPerson)
|
|
{
|
|
this._ContactPerson = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.business_POBox)
|
|
{
|
|
this._POBox = iContactDC.ContactValue;
|
|
}
|
|
|
|
if (iContactDC.ContactType == ContactType.private_POBox)
|
|
{
|
|
this._InvoiceAddressPOBox = iContactDC.ContactValue;
|
|
}
|
|
}
|
|
}
|
|
|
|
HausanschriftDatenannahmestelle = pDataContract.HausanschriftDatenannahmestelle is AddressDC dc
|
|
? new AddressVM(dc)
|
|
: new AddressVM();
|
|
|
|
PostfachanschriftDatenannahmestelle = pDataContract.PostfachanschriftDatenannahmestelle is AddressDC dc2
|
|
? new AddressVM(dc2)
|
|
: new AddressVM();
|
|
|
|
GroßkundenanschriftDatenannahmestelle = pDataContract.GrosskundenanschriftDatenannahmestelle is AddressDC dc3
|
|
? new AddressVM(dc3)
|
|
: new AddressVM();
|
|
|
|
VMFactory.CreateOrganisationPersonRelationListVMAsync(
|
|
pDataContract.RelatedPersons ?? (pDataContract.RelatedPersons = new List<OrganisationPersonRelationDC>()), cb => PersonRelations = cb);
|
|
|
|
if (pDataContract.CostRatePeriods == null)
|
|
{
|
|
pDataContract.CostRatePeriods = new List<CostRatePeriodDC>();
|
|
}
|
|
|
|
Utils.GetAllEnumValues<CostRatePeriodType>().ToList().ForEach(
|
|
t =>
|
|
{
|
|
if (t != CostRatePeriodType.Unknown && !pDataContract.CostRatePeriods.Exists(i => i.CostRateType == t))
|
|
{
|
|
pDataContract.CostRatePeriods.Add(
|
|
new CostRatePeriodDC
|
|
{
|
|
CostRateType = t
|
|
});
|
|
}
|
|
});
|
|
|
|
this._CostRatePeriods = new CostRatePeriodListVM(pDataContract.CostRatePeriods);
|
|
|
|
this._CostRatePeriods.VMList.ListChanged += (s, e) =>
|
|
{
|
|
if (e.ListChangedType != ListChangedType.ItemChanged)
|
|
{
|
|
this.FirePropertyChanged(PropertyName_PossibleQualifications);
|
|
}
|
|
};
|
|
}
|
|
|
|
protected override OrganisationDC MapToDataContract(OrganisationDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.AccountNumber = _AccountNumber;
|
|
pDataContract.BankCode = _BankCode;
|
|
pDataContract.BankName = _BankName;
|
|
pDataContract.Bic = _Bic;
|
|
pDataContract.IBAN = _IBAN;
|
|
pDataContract.Name = _Name;
|
|
pDataContract.Name2 = _Name2;
|
|
pDataContract.OrganisationNotice = _Notice;
|
|
pDataContract.PostalCode = _PostalCode;
|
|
pDataContract.RelatedPersons = _PersonRelations.CopyToDCList(doCommit);
|
|
pDataContract.Street = _Street;
|
|
pDataContract.Town = _Town;
|
|
pDataContract.AddressLine1 = _AddressLine1;
|
|
pDataContract.InvoiceAddressStreet = _InvoiceAddressStreet;
|
|
pDataContract.InvoiceAddressTown = _InvoiceAddressTown;
|
|
pDataContract.InvoiceAddressPostalCode = _InvoiceAddressPostalCode;
|
|
pDataContract.InvoiceAddressLine1 = _InvoiceAddressLine1;
|
|
pDataContract.IsCalculatingWithFactor = _IsCalculatingWithFactor;
|
|
pDataContract.IsSingleInvoicePerCustomer = _IsSingleInvoicePerCustomer;
|
|
pDataContract.DebitorNumber = _DebitorNumber;
|
|
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
|
|
pDataContract.Function = _Function;
|
|
pDataContract.IKDatenannahmestelle = _IKDatenannahmestelle?.Trim();
|
|
pDataContract.BezDatenannahmestelle = _BezDatenannahmestelle?.Trim();
|
|
pDataContract.IKKostentrager = _IKKostentrager?.Trim();
|
|
pDataContract.IKKrankenkasse = _IKKrankenkasse?.Trim();
|
|
pDataContract.Leistungserbringergruppe = _Leistungserbringergruppe?.Trim();
|
|
pDataContract.BusinessPartnerId = _BusinessPartnerId;
|
|
pDataContract.Verfahrensstufe = Verfahrensstufe;
|
|
pDataContract.GkvAusblenden = GkvAusblenden;
|
|
|
|
CommitContact(_Phone, ContactType.business_Phone);
|
|
CommitContact(_Website, ContactType.business_Homepage);
|
|
CommitContact(_Fax, ContactType.business_Fax);
|
|
CommitContact(_EMail, ContactType.business_Mail);
|
|
CommitContact(_ContactPerson, ContactType.ContactPerson);
|
|
CommitContact(_POBox, ContactType.business_POBox);
|
|
CommitContact(_InvoiceAddressPOBox, ContactType.private_POBox);
|
|
|
|
pDataContract.CostRatePeriods = this._CostRatePeriods.CopyToDCList(doCommit);
|
|
|
|
if (this._VarFields != null)
|
|
{
|
|
pDataContract.VarFields = this._VarFields.CopyToDCList(doCommit);
|
|
}
|
|
|
|
if (_ArbeitszeitListe != null)
|
|
{
|
|
pDataContract.Arbeitszeiten = _ArbeitszeitListe.CopyToDCList(doCommit);
|
|
}
|
|
|
|
if (_Feiertage != null)
|
|
{
|
|
pDataContract.Feiertage = _Feiertage.CopyToDCList(doCommit);
|
|
}
|
|
|
|
if (HausanschriftDatenannahmestelle is object)
|
|
pDataContract.HausanschriftDatenannahmestelle = HausanschriftDatenannahmestelle.CommitToDataContract();
|
|
else
|
|
pDataContract.HausanschriftDatenannahmestelle = null;
|
|
|
|
if (PostfachanschriftDatenannahmestelle is object)
|
|
pDataContract.PostfachanschriftDatenannahmestelle = PostfachanschriftDatenannahmestelle.CommitToDataContract();
|
|
else
|
|
pDataContract.PostfachanschriftDatenannahmestelle = null;
|
|
|
|
if (GroßkundenanschriftDatenannahmestelle is object)
|
|
pDataContract.GrosskundenanschriftDatenannahmestelle = GroßkundenanschriftDatenannahmestelle.CommitToDataContract();
|
|
else
|
|
pDataContract.GrosskundenanschriftDatenannahmestelle = null;
|
|
|
|
return pDataContract;
|
|
}
|
|
|
|
public override void UpdateByDataContract(OrganisationDC pDataContract)
|
|
{
|
|
base.UpdateByDataContract(pDataContract);
|
|
}
|
|
|
|
public void UpdateByGetIKResponse(GkvAbrechnungGetIKResponseDC response)
|
|
{
|
|
BezDatenannahmestelle = response.BezDatenannahmestelle;
|
|
IKKostentrager = response.IKKostentrager;
|
|
IKDatenannahmestelle = response.IKDatenannahmestelle;
|
|
|
|
HausanschriftDatenannahmestelle.UpdateByDataContract(response.Hausanschrift);
|
|
FirePropertyChanged(nameof(HausanschriftDatenannahmestelle));
|
|
PostfachanschriftDatenannahmestelle.UpdateByDataContract(response.Postfachanschrift);
|
|
GroßkundenanschriftDatenannahmestelle.UpdateByDataContract(response.Großkundenanschrift);
|
|
}
|
|
}
|
|
} |