using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Comal.Classes; using InABox.Core; using InABox.DynamicGrid; using InABox.Integration.Logikal; using PRSDesktop.Integrations.Logikal; namespace PRSDesktop; public class LogikalPhasesGrid : LogikalGrid { public Guid ProjectID { get; set; } protected override void Init() { base.Init(); HiddenColumns.Add(x => x.ID); } protected override DynamicGridColumns LoadColumns() { var result = new DynamicGridColumns(); result.Add(x => x.Title, 0, "Phases", "", Alignment.MiddleLeft); return result; } protected override void DoReconfigure(DynamicGridOptions options) { base.DoReconfigure(options); options.FilterRows = true; options.HideDatabaseFilters = true; } protected override void DoGet(LogikalClient client, IProgress progress) { Items = new List(); if (ProjectID != Guid.Empty) { client.GetPhases(ProjectID) .Always(NotifyResponseReceived) .Success>(p => { Items = p.Phases.ToList(); }); } } }