| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System;
- using System.Linq;
- using System.Linq.Expressions;
- using Comal.Classes;
- using InABox.Core;
- using System.Diagnostics.CodeAnalysis;
- namespace comal.timesheets
- {
- public class EquipmentModel : ListModel<EquipmentModel, EquipmentShell, Equipment>
- {
- public EquipmentModel(IModelHost host, Func<Filter<Equipment>> filter, bool transient = false) : base(host, filter, transient)
- {
- //new EquipmentDocumentShell();
- //new EquipmentKanbanShell();
- //Reset();
- }
- public EquipmentModel(IModelHost host, Func<Filter<Equipment>> filter, [NotNull] String filename) : base(host, filter, filename)
- {
- //new EquipmentDocumentShell();
- //new EquipmentKanbanShell();
- //Reset();
- }
- // private void Reset()
- // {
- // Kanbans = new EquipmentKanbanShell[] { };
- // Documents = new EquipmentDocumentShell[] { };
- // }
-
- // public override Columns<Equipment> Columns => EquipmentShell.Columns.
- protected override Expression<Func<Equipment, object>> ImageColumn => x => x.GroupLink.Thumbnail.ID;
-
- //public EquipmentKanbanShell[] Kanbans { get; private set; }
-
- //public EquipmentDocumentShell[] Documents { get; private set; }
-
- public String[] GroupNames => Items.Select(x => x.GroupName).Distinct().OrderBy(x => x).Prepend("All").ToArray();
-
- // public override void BeforeLoad(MultiQuery query)
- // {
- // base.BeforeLoad(query);
- //
- // query.Add(
- // new Filter<Kanban>(x => x.Equipment.ID).InQuery(Filter(), x => x.ID),
- // EquipmentKanbanShell.Columns.Columns
- // );
- //
- // query.Add(
- // new Filter<EquipmentDocument>(x => x.EntityLink.ID).InQuery(Filter(), x => x.ID),
- // EquipmentDocumentShell.Columns.Columns
- // );
- // }
-
- // public override void AfterLoad(MultiQuery query)
- // {
- // base.AfterLoad(query);
- // Kanbans = query.Get<Kanban>()
- // .Rows
- // .Select(x => new EquipmentKanbanShell() { Row = x, Parent = this })
- // .ToArray();
- // Documents = query.Get<EquipmentDocument>()
- // .Rows
- // .Select(x => new EquipmentDocumentShell() { Row = x, Parent = this })
- // .ToArray();
- // }
- // protected override void DoUnload()
- // {
- // base.DoUnload();
- // Reset();
- // }
- }
- }
|