| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | using System;using System.Collections.Generic;using System.Data;using System.Diagnostics;using System.IO;using System.Linq;using System.Windows;using System.Windows.Media.Imaging;using Comal.Classes;using InABox.Core;using InABox.DynamicGrid;using InABox.Integration.Logikal;using InABox.Wpf;using InABox.WPF;using jdk.nashorn.tools;using Microsoft.Win32;using PRSDesktop.Integrations.Logikal;namespace PRSDesktop;public class LogikalElevationGrid : LogikalGrid<LogikalElevationSummary>{    public Guid ProjectID { get; set; }    public string Phase { get; set; }    protected override void Init()    {        base.Init();                HiddenColumns.Add(x => x.ID);        //ActionColumns.Add(new DynamicMenuColumn(BuildMenu) {  Position = DynamicActionColumnPosition.Start });    }    protected override void DoReconfigure(DynamicGridOptions options)    {        base.DoReconfigure(options);        options.MultiSelect = true;    }    //private void BuildMenu(DynamicMenuColumn column, CoreRow? row)    //{    //    column.AddItem("Download Parts List", PRSDesktop.Resources.doc_xls, GetBOM);    //}    //private void GetBOM(CoreRow? r)    //{    //    if (r != null && Client != null)    //    {    //        var id = r.Get<LogikalElevation, Guid>(x => x.ID);    //        Client.GetBillOfMaterials(ProjectID, id, true)    //            .Error(e =>    //            {    //                Dispatcher.BeginInvoke(() =>    //                {    //                    MessageWindow.ShowError("Unable to retrieve parts", e.Message, e.Status.ToString());    //                });    //            })    //            .Success<LogikalBOMResponse<LogikalProfile,LogikalComponent,LogikalGlass,LogikalLabour>>(p =>    //            {    //                var sfd = new SaveFileDialog();    //                sfd.Filter = "Excel Files (*.xlsx)|*.xlsx";    //                sfd.FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ElevationPartsList.xlsx");    //                if (sfd.ShowDialog() == true)    //                {    //                    File.WriteAllBytes(sfd.FileName, p.ExcelData);    //                    var pInfo = new ProcessStartInfo(sfd.FileName) { UseShellExecute = true };    //                    Process.Start(pInfo);    //                }    //            });    //    }    //}    protected override void DoGet(LogikalClient client, IProgress<string> progress)    {        Items = new List<LogikalElevationSummary>();        if (ProjectID != Guid.Empty)        {            client.GetElevationSummaries(ProjectID, Phase)            .Always(NotifyResponseReceived)            .Success<LogikalElevationSummaryResponse<LogikalElevationSummary>>(p =>            {                Items = p.Elevations.ToList();            });        }    }}
 |