| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using System;
- using Comal.Classes;
- using InABox.Core;
- using InABox.Mobile;
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace PRS.Mobile
- {
- public class TimeSheetShell : Shell<TimeSheetModel,TimeSheet>
- {
- public static Filter<TimeSheet> UnprocessedTimeSheets => new Filter<TimeSheet>(x => x.EmployeeLink.ID)
- .IsEqualTo(App.Data.Me.ID)
- .And(x => x.Processed).IsEqualTo(DateTime.MinValue);
- protected override void ConfigureColumns(ShellColumns<TimeSheetModel, TimeSheet> columns)
- {
- columns
- .Map(nameof(Date), x => x.Date)
- .Map(nameof(_actualstart), x => x.Start)
- .Map(nameof(_actualfinish), x => x.Finish)
- .Map(nameof(_approvedstart), x => x.ApprovedStart)
- .Map(nameof(_approvedfinish), x => x.ApprovedFinish)
- .Map(nameof(_approved), x => x.Approved)
- .Map(nameof(StartLongitude), x => x.StartLocation.Longitude)
- .Map(nameof(StartLatitude), x => x.StartLocation.Latitude)
- .Map(nameof(StartAddress), x => x.StartLocation.Address)
- .Map(nameof(StartTimeStamp), x => x.StartLocation.Timestamp)
- .Map(nameof(FinishLongitude), x => x.FinishLocation.Longitude)
- .Map(nameof(FinishLatitude), x => x.FinishLocation.Latitude)
- .Map(nameof(FinishAddress), x => x.FinishLocation.Address)
- .Map(nameof(FinishTimeStamp), x => x.FinishLocation.Timestamp)
- .Map(nameof(JobID), x => x.JobLink.ID)
- .Map(nameof(JobNumber), x => x.JobLink.JobNumber)
- .Map(nameof(JobName), x => x.JobLink.Name)
- .Map(nameof(Notes), x => x.Notes);
- }
- public DateTime Date
- {
- get => Get<DateTime>();
- set => Set(value);
- }
- private TimeSpan _actualstart
- {
- get => Get<TimeSpan>();
- set => Set(value);
- }
-
- private TimeSpan _actualfinish
- {
- get => Get<TimeSpan>();
- set => Set(value);
- }
-
- private TimeSpan _approvedstart
- {
- get => Get<TimeSpan>();
- set => Set(value);
- }
- private TimeSpan _approvedfinish
- {
- get => Get<TimeSpan>();
- set => Set(value);
- }
- private DateTime _approved
- {
- get => Get<DateTime>();
- set => Set(value);
- }
- public TimeSpan Start => _approved.IsEmpty()
- ? _actualstart
- : _approvedstart;
-
- public TimeSpan Finish => _approved.IsEmpty()
- ? _actualfinish
- : _approvedfinish;
-
- public ImageSource? Approved => _approved.IsEmpty()
- ? null
- : ImageSource.FromFile("tick");
-
- public double StartLongitude
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double StartLatitude
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public string StartAddress
- {
- get => Get<string>();
- set => Set(value);
- }
-
- public DateTime StartTimeStamp
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- public double FinishLongitude
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double FinishLatitude
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public string FinishAddress
- {
- get => Get<string>();
- set => Set(value);
- }
-
- public DateTime FinishTimeStamp
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- public Guid JobID
- {
- get => Get<Guid>();
- set => Set(value);
- }
- public string JobNumber
- {
- get => Get<string>();
- set => Set(value);
- }
-
- public string JobName
- {
- get => Get<string>();
- set => Set(value);
- }
-
- public string Notes
- {
- get => Get<string>();
- set => Set(value);
- }
- }
- }
|