using System; using System.Collections.Generic; using BS.Shared; using BS.Shared.Core; namespace BeWo.Data.Entities { public class ConfirmationReceiptSignature : BeWoEntityBase { private long? _CustomerOid; private Employee _Employee; private IList _ServiceRecords; private string _SignatureImage; private string _TimeSpanString; public virtual Employee Employee { get => _Employee; set { if(AreDifferent(_Employee, value)) { _Employee = value; } } } public virtual long? CustomerOid { get => _CustomerOid; set { if(AreDifferent(_CustomerOid, value)) { _CustomerOid = value; } } } public virtual IList ServiceRecords { get => _ServiceRecords; set { if(AreDifferent(_ServiceRecords, value)) { _ServiceRecords = value; } } } public virtual string SignatureImage { get => _SignatureImage; set { if(AreDifferent(_SignatureImage, value)) { _SignatureImage = value; } } } public ConfirmationReceiptSignature() { _Tid = TableID.ConfirmationReceiptSignature; } private SignatureType _SignatureType; public virtual SignatureType SignatureType { get => _SignatureType; set { if(AreDifferent(_SignatureType, value)) { _SignatureType = value; } } } public virtual string TimeSpanString { get => _TimeSpanString; set { if(AreDifferent(_TimeSpanString, value)) { _TimeSpanString = value; } } } public virtual DateTimeSpan GetSignatureTimeSpan() { //Z.B. "01.01. bis 31.01.2025" var year = int.Parse(TimeSpanString.Substring(17)); var month = int.Parse(TimeSpanString.Substring(3, 2)); var startDay = int.Parse(TimeSpanString.Substring(0, 2)); var endDay = int.Parse(TimeSpanString.Substring(11, 2)); return new DateTimeSpan(new DateTime(year, month, startDay), new DateTime(year, month, endDay)); } } }