EmployeeQualificationModel.cs 751 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Linq;
  3. using System.Linq.Expressions;
  4. using InABox.Mobile;
  5. using Comal.Classes;
  6. using InABox.Core;
  7. namespace PRS.Mobile
  8. {
  9. public class EmployeeQualificationModel : CoreRepository<EmployeeQualificationModel, EmployeeQualificationShell,
  10. EmployeeQualification>
  11. {
  12. public EmployeeQualificationModel(IModelHost host, Func<Filter<EmployeeQualification>> filter): base(host, filter)
  13. {
  14. }
  15. protected override Expression<Func<EmployeeQualification, object>> ImageColumn => x => x.FrontPhoto.ID;
  16. public int NeedsAttention => Items.Count(x =>
  17. x.Qualified.IsEmpty()
  18. || x.Expiry < DateTime.Today
  19. || x.FrontPhotoID == Guid.Empty
  20. );
  21. }
  22. }