| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Comal.Classes;
- using InABox.Mobile;
- namespace PRS.Mobile
- {
- public abstract class BaseKanbanShell<TModel> : Shell<TModel, Kanban>, IKanbanShell
- where TModel : IKanbanModel
- {
- protected override void ConfigureColumns(ShellColumns<TModel, Kanban> columns)
- {
- columns
- .Map(nameof(Number), x => x.Number)
- .Map(nameof(Title), x => x.Title)
- .Map(nameof(TypeID), x => x.Type.ID)
- .Map(nameof(TypeName), x => x.Type.Description)
- .Map(nameof(Status), x => x.Status)
- .Map(nameof(DueDate), x => x.DueDate)
- .Map(nameof(Completed), x => x.Completed)
- .Map(nameof(Description), x => x.Description)
- .Map(nameof(Summary), x => x.Summary)
- .Map(nameof(Notes), x=>x.Notes)
- .Map(nameof(EmployeeID), x => x.EmployeeLink.ID)
- .Map(nameof(EmployeeName), x => x.EmployeeLink.Name)
- .Map(nameof(ManagerID), x => x.ManagerLink.ID)
- .Map(nameof(ManagerName), x => x.ManagerLink.Name)
- .Map(nameof(Attachments), x => x.Attachments)
- .Map(nameof(Locked), x => x.Locked)
- .Map(nameof(JobID), x => x.JobLink.ID)
- .Map(nameof(JobNumber), x => x.JobLink.JobNumber)
- .Map(nameof(JobName), x => x.JobLink.Name)
- .Map(nameof(EquipmentID), x => x.Equipment.ID)
- .Map(nameof(EquipmentDescription), x => x.Equipment.Description);
- }
-
- public int Number => Get<int>();
- public string Title
- {
- get => Get<string>();
- set => Set(value);
- }
- public Guid TypeID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String TypeName
- {
- get => Get<string>();
- set => Set(value);
- }
- public KanbanStatus Status {
- get => Get<KanbanStatus>();
- set => Set(value);
- }
- public DateTime Completed
- {
- get => Get<DateTime>();
- set => Set(value);
- }
- public DateTime DueDate
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- public String Description
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public String Summary
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public IList<String> Notes
- {
- get => Get<String[]>();
- set => Set(value);
- }
- public Guid EmployeeID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String EmployeeName
- {
- get => Get<String>();
- set => Set(value);
- }
- public Guid ManagerID
- {
- get => Get<Guid>();
- set => Set(value);
- }
- public String ManagerName
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public int Attachments => Get<int>();
- public bool Locked => Get<bool>();
-
- 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 Guid EquipmentID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String EquipmentDescription
- {
- get => Get<String>();
- set => Set(value);
- }
-
- public String LookupCode => Number.ToString();
- public String LookupDescription => Title;
- public bool LookupSelected { get; set; }
-
- public override void Save(string auditmessage)
- {
- base.Save(auditmessage);
- var subscribers = new ClientKanbanSubscriberSet(new Guid[] { ID });
- subscribers.EnsureAssignee(ID, EmployeeID);
- subscribers.EnsureManager(ID,ManagerID);
- subscribers.Save(false);
- }
- }
- }
|