# Conflicts: # BeWo/View/Detail/Report/ServicesReportViewAlt.xaml # BeWo/View/Detail/Report/ServicesReportViewAlt.xaml.cs # Service/Plugins/PluginLoader.cs
299 lines
9.9 KiB
C#
299 lines
9.9 KiB
C#
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using DevExpress.Charts.Native;
|
|
using DevExpress.XtraEditors.Controls;
|
|
using DevExpress.XtraScheduler.Commands;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Sockets;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices.WindowsRuntime;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class QuittierungsbelegsstatusVM : AbstractDCMapperVM<QuittierungsbelegsstatusDC>
|
|
{
|
|
private string _QuittierungsbelegsstatusNotice;
|
|
|
|
private CompactCustomerDC _Customer;
|
|
private DateTime _Startdatum;
|
|
private DateTime _Enddatum;
|
|
private CompactOrganisationDC _Organisation;
|
|
private CompactEmployeeDC _Employee;
|
|
private ServiceCategoryDC _ServiceCategory;
|
|
private bool _Erstellt;
|
|
private string _ErstelltVon;
|
|
private DateTime? _ErstelltAm;
|
|
private string _Zeitraum;
|
|
private bool _Unterschrieben;
|
|
private string _UnterschriebenVon;
|
|
private DateTime? _UnterschriebenAm;
|
|
|
|
public QuittierungsbelegsstatusVM(QuittierungsbelegsstatusDC qbsDC) : base(qbsDC, qbsDC.QuittierungsbelegsstatusOid == null) { }
|
|
|
|
|
|
public string QuittierungsbelegsstatusNotice
|
|
{
|
|
get { return _QuittierungsbelegsstatusNotice; }
|
|
set
|
|
{
|
|
if(AreDifferent(_QuittierungsbelegsstatusNotice, value))
|
|
{
|
|
_QuittierungsbelegsstatusNotice = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.QuittierungsbelegsstatusNotice, value), nameof(_QuittierungsbelegsstatusNotice));
|
|
FirePropertyChanged(nameof(_QuittierungsbelegsstatusNotice));
|
|
}
|
|
}
|
|
}
|
|
public CompactCustomerDC Customer
|
|
{
|
|
get { return _Customer; }
|
|
set
|
|
{
|
|
_Customer = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Customer, value), nameof(_Customer));
|
|
FirePropertyChanged(nameof(_Customer));
|
|
}
|
|
}
|
|
public String Klientenname
|
|
{
|
|
get
|
|
{
|
|
if (Customer != null)
|
|
return Customer.LastNameFirstName;
|
|
return "";
|
|
}
|
|
}
|
|
|
|
public DateTime Startdatum
|
|
{
|
|
get { return _Startdatum; }
|
|
set
|
|
{
|
|
_Startdatum = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Startdatum, value), nameof(_Startdatum));
|
|
FirePropertyChanged(nameof(_Startdatum));
|
|
}
|
|
}
|
|
public DateTime Enddatum
|
|
{
|
|
get { return _Enddatum; }
|
|
set
|
|
{
|
|
_Enddatum = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Enddatum, value), nameof(_Enddatum));
|
|
FirePropertyChanged(nameof(_Enddatum));
|
|
}
|
|
}
|
|
public CompactOrganisationDC Organisation
|
|
{
|
|
get { return _Organisation; }
|
|
set
|
|
{
|
|
_Organisation = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Organisation, value), nameof(_Organisation));
|
|
FirePropertyChanged(nameof(_Organisation));
|
|
}
|
|
}
|
|
public string OrganisationOid
|
|
{
|
|
get
|
|
{
|
|
if (Organisation != null)
|
|
return Organisation.Name;
|
|
else
|
|
return "";
|
|
}
|
|
}
|
|
public CompactEmployeeDC Employee
|
|
{
|
|
get { return _Employee; }
|
|
set
|
|
{
|
|
_Employee = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Employee, value), nameof(_Employee));
|
|
FirePropertyChanged(nameof(_Employee));
|
|
}
|
|
}
|
|
public string EmployeeOid
|
|
{
|
|
get
|
|
{
|
|
if (Employee != null)
|
|
return Employee.ToString();
|
|
else
|
|
return "";
|
|
}
|
|
}
|
|
public ServiceCategoryDC ServiceCategory
|
|
{
|
|
get { return _ServiceCategory; }
|
|
set
|
|
{
|
|
_ServiceCategory = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.ServiceCategory, value), nameof(_ServiceCategory));
|
|
FirePropertyChanged(nameof(_ServiceCategory));
|
|
}
|
|
}
|
|
public string ServiceCategoryOid
|
|
{
|
|
get
|
|
{
|
|
if (ServiceCategory != null)
|
|
return ServiceCategory.Name;
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
public bool Erstellt
|
|
{
|
|
get { return _Erstellt; }
|
|
set
|
|
{
|
|
_Erstellt = value;
|
|
|
|
if (_Erstellt)
|
|
{
|
|
ErstelltAm = DateTime.Now;
|
|
ErstelltVon = BeWoApp.LoggedOnEmployee.LastNameFirstName;
|
|
}
|
|
else
|
|
{
|
|
ErstelltAm = null;
|
|
ErstelltVon = null;
|
|
}
|
|
StoreDirtyInformation(AreDifferent(DataContract.Erstellt, value), nameof(_Erstellt));
|
|
FirePropertyChanged(nameof(_Erstellt));
|
|
}
|
|
}
|
|
public string ErstelltVon
|
|
{
|
|
get { return _ErstelltVon; }
|
|
set
|
|
{
|
|
_ErstelltVon = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.ErstelltVon, value), nameof(_ErstelltVon));
|
|
FirePropertyChanged(nameof(_ErstelltVon));
|
|
}
|
|
}
|
|
public DateTime? ErstelltAm
|
|
{
|
|
get { return _ErstelltAm; }
|
|
set
|
|
{
|
|
_ErstelltAm = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.ErstelltAm, value), nameof(_ErstelltAm));
|
|
FirePropertyChanged(nameof(_ErstelltAm));
|
|
}
|
|
}
|
|
public string Zeitraum
|
|
{
|
|
get
|
|
{
|
|
if (Erstellt)
|
|
{
|
|
return String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}", Startdatum, Enddatum);
|
|
}
|
|
else
|
|
return "";
|
|
}
|
|
set
|
|
{
|
|
if (Erstellt)
|
|
{
|
|
_Zeitraum = Startdatum.ToString() + " bis " + Enddatum.ToString();
|
|
}
|
|
}
|
|
}
|
|
public bool Unterschrieben
|
|
{
|
|
get { return _Unterschrieben; }
|
|
set
|
|
{
|
|
_Unterschrieben = value;
|
|
if (_Unterschrieben)
|
|
{
|
|
UnterschriebenAm = DateTime.Now;
|
|
UnterschriebenVon = BeWoApp.LoggedOnEmployee.LastNameFirstName;
|
|
}
|
|
else
|
|
{
|
|
UnterschriebenAm = null;
|
|
UnterschriebenVon = null;
|
|
}
|
|
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.Unterschrieben, value), nameof(_Unterschrieben));
|
|
FirePropertyChanged(nameof(_Unterschrieben));
|
|
}
|
|
}
|
|
public string UnterschriebenVon
|
|
{
|
|
get
|
|
{
|
|
return _UnterschriebenVon;
|
|
}
|
|
set
|
|
{
|
|
_UnterschriebenVon = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.UnterschriebenVon, _UnterschriebenVon), nameof(_UnterschriebenVon));
|
|
FirePropertyChanged(nameof(_UnterschriebenVon));
|
|
}
|
|
}
|
|
public DateTime? UnterschriebenAm
|
|
{
|
|
get
|
|
{
|
|
return _UnterschriebenAm;
|
|
}
|
|
set
|
|
{
|
|
_UnterschriebenAm = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.UnterschriebenAm, _UnterschriebenAm), nameof(_UnterschriebenAm));
|
|
FirePropertyChanged(nameof(_UnterschriebenAm));
|
|
}
|
|
}
|
|
|
|
protected override void InitByDataContract(QuittierungsbelegsstatusDC qDataContract)
|
|
{
|
|
QuittierungsbelegsstatusNotice = qDataContract.QuittierungsbelegsstatusNotice;
|
|
Customer = qDataContract.Customer;
|
|
Startdatum = qDataContract.Startdatum;
|
|
Enddatum = qDataContract.Enddatum;
|
|
Organisation = qDataContract.Organisation;
|
|
Employee = qDataContract.Employee;
|
|
ServiceCategory = qDataContract.ServiceCategory;
|
|
Erstellt = qDataContract.Erstellt;
|
|
ErstelltVon = qDataContract.ErstelltVon;
|
|
ErstelltAm = qDataContract.ErstelltAm;
|
|
Unterschrieben = qDataContract.Unterschrieben;
|
|
UnterschriebenVon = qDataContract.UnterschriebenVon;
|
|
UnterschriebenAm = qDataContract.UnterschriebenAm;
|
|
}
|
|
|
|
protected override QuittierungsbelegsstatusDC MapToDataContract(QuittierungsbelegsstatusDC qDataContract, bool doCommit)
|
|
{
|
|
qDataContract.Customer = _Customer;
|
|
qDataContract.Startdatum = _Startdatum;
|
|
qDataContract.Enddatum = _Enddatum;
|
|
qDataContract.Organisation = _Organisation;
|
|
qDataContract.Employee = _Employee;
|
|
qDataContract.ServiceCategory = _ServiceCategory;
|
|
qDataContract.Erstellt = _Erstellt;
|
|
qDataContract.ErstelltVon = _ErstelltVon;
|
|
qDataContract.ErstelltAm = _ErstelltAm;
|
|
qDataContract.Unterschrieben = _Unterschrieben;
|
|
qDataContract.UnterschriebenVon = _UnterschriebenVon;
|
|
qDataContract.UnterschriebenAm = _UnterschriebenAm;
|
|
|
|
return qDataContract;
|
|
}
|
|
}
|
|
}
|