123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class EmployeeRosterItem : Entity, IRemotable, IPersistent, IImportable, IExportable, IEmployeeRosterItem, ILicense<CoreLicense>, IOneToMany<Employee>
- {
- private static readonly Dictionary<string, Func<EmployeeRosterItem, TimeSpan>> times = new Dictionary<string, Func<EmployeeRosterItem, TimeSpan>>()
- {
- { "Start", x => x.Start },
- { "Finish", x => x.Finish },
- { "Break", x => x.Break },
- { "Start2", x => x.Start2 },
- { "Finish2", x => x.Finish2 },
- { "Break2", x => x.Break2 }
- };
- public EmployeeLink Employee { get; set; }
-
- [IntegerEditor(Alignment = Alignment.MiddleCenter, Editable = Editable.Hidden, Visible = Visible.Hidden)]
- [EditorSequence(1)]
- [Caption("Day")]
- public int Day { get; set; }
-
- [TextBoxEditor(Alignment = Alignment.MiddleCenter, Editable = Editable.Disabled)]
- [EditorSequence(2)]
- public string Description { get; set; }
- [CheckBoxEditor]
- [EditorSequence(3)]
- [Caption("Rostered On?")]
- public bool Enabled { get; set; }
- [TimeOfDayEditor(Format = "hh:mm", Width = 70)]
- [EditorSequence(4)]
- public TimeSpan Start { get; set; }
- [TimeOfDayEditor(Format = "hh:mm", Width = 70)]
- [EditorSequence(5)]
- public TimeSpan Finish { get; set; }
- [DurationEditor(Format = "hh:mm", Visible = Visible.Default, Editable = Editable.Enabled, Width = 70)]
- [EditorSequence(6)]
- public TimeSpan Break { get; set; }
- [CheckBoxEditor]
- [EditorSequence(7)]
- [Caption("Split")]
- public bool SplitShift { get; set; }
- [TimeOfDayEditor(Format = "hh:mm", Width = 70)]
- [EditorSequence(8)]
- [Caption("Start 2")]
- public TimeSpan Start2 { get; set; }
- [TimeOfDayEditor(Format = "hh:mm", Width = 70)]
- [EditorSequence(9)]
- [Caption("Finish 2")]
- public TimeSpan Finish2 { get; set; }
- [DurationEditor(Format = "hh:mm", Visible = Visible.Default, Editable = Editable.Enabled, Width = 70)]
- [EditorSequence(10)]
- [Caption("Break 2")]
- public TimeSpan Break2 { get; set; }
-
- [DoubleEditor(Format = "F2", Visible = Visible.Default, Editable = Editable.Disabled, Summary = Summary.Sum, Width = 70,
- Alignment = Alignment.MiddleCenter)]
- [EditorSequence(12)]
- [Caption("Total")]
- public double Duration { get; set; }
- public OvertimeLink Overtime { get; set; }
- protected override void DoPropertyChanged(string name, object? before, object? after)
- {
- if (String.Equals(name, nameof(Day)))
- Description = $"Day {after}";
- base.DoPropertyChanged(name, before, after);
- (this as IEmployeeRosterItem).DoPropertyChanged(name, before, after);
- }
- }
- }
|