123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Comal.Classes;
- using Xamarin.Forms;
- namespace comal.timesheets
- {
- public class KanbanShell : Shell<KanbanModel, KanbanSubscriber>
- {
- static KanbanShell()
- {
- Columns
- .Map(nameof(ID), x => x.Kanban.ID)
- .Map(nameof(Number), x => x.Kanban.Number)
- .Map(nameof(Title), x => x.Kanban.Title)
- .Map(nameof(Type), x => x.Kanban.Type.Code)
- .Map(nameof(Category), x => x.Kanban.Category)
- .Map(nameof(DueDate), x => x.Kanban.DueDate)
- .Map(nameof(Completed), x => x.Kanban.Completed)
- .Map(nameof(Summary), x => x.Kanban.Summary)
- .Map(nameof(ManagerName), x => x.Kanban.ManagerLink.Name)
- .Map(nameof(Attachments), x => x.Kanban.Attachments)
- .Map(nameof(Locked), x => x.Kanban.Locked)
- .Map(nameof(IsManager), x => x.Manager)
- .Map(nameof(IsEmployee), x => x.Assignee);
- }
-
- public Guid ID => Get<Guid>();
- public int Number => Get<int>();
- public string Title => Get<string>();
- public String Type => Get<string>();
- public string Category => Get<string>();
- public DateTime Completed => Get<DateTime>();
- public DateTime DueDate => Get<DateTime>();
- public String Summary => Get<String>();
- public String ManagerName => Get<String>();
- public int Attachments => Get<int>();
- public String ImagePath =>
- Attachments > 0 ? Device.RuntimePlatform.Equals(Device.iOS) ? "attachments.png" : "paperclip.png" : "";
- public bool Locked => Get<bool>();
- public bool IsManager => Get<bool>();
- public bool IsEmployee => Get<bool>();
- public bool IsObserver => !IsManager && !IsEmployee;
- public Color Color => IsEmployee
- ? DueDate > DateTime.Today.AddDays(7)
- ? Color.FromHex("#77dd77") //green / pastel green
- : DueDate > DateTime.Today
- ? Color.FromHex("#fff8dc") //cornsilk / light yellow
- : Color.FromHex("#f08080") //light coral / red
- : IsManager
- ? Color.LightGray
- : Color.FromHex("#cb99c9"); //purple / pastel violet
-
- }
- }
|