| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for QuoteProposals.xaml
- /// </summary>
- public partial class QuoteProposals : UserControl, IQuotePage, IPanel<Quote>
- {
- public QuoteProposals()
- {
- InitializeComponent();
- }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent? OnUpdateDataModel;
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public string SectionName => "Quote Proposals";
- public DataModel DataModel(Selection selected)
- {
- var ids = Proposals.ExtractValues(x => x.ID, selected).ToArray();
- return new QuoteProposalDataModel(new Filter<QuoteProposal>(x => x.ID).InList(ids));
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public void Refresh()
- {
- Proposals.Refresh(false,true);
- Details.Refresh(false, true);
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Setup()
- {
- Proposals.Refresh(true, false);
- Details.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public Quote Quote
- {
- get => Proposals.Quote;
- set
- {
- Details.Proposal = null;
- Proposals.Quote = value;
- }
- }
- private void Proposals_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- var row = e.Rows?.FirstOrDefault();
- Details.Proposal = row?.ToObject<QuoteProposal>();
- }
- }
- }
|