|
@@ -4,15 +4,23 @@ using System.ComponentModel;
|
|
|
using System.Linq;
|
|
|
using System.Windows.Controls;
|
|
|
using Comal.Classes;
|
|
|
+using InABox.Configuration;
|
|
|
using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
using InABox.WPF;
|
|
|
|
|
|
namespace PRSDesktop;
|
|
|
|
|
|
+
|
|
|
+public class ReceiptGridSettings : IUserConfigurationSettings
|
|
|
+{
|
|
|
+ public CoreFilterDefinition CurrentFilter { get; set; }
|
|
|
+}
|
|
|
+
|
|
|
public class CustomerReceipts : DynamicDataGrid<Receipt>, IPanel<Receipt>
|
|
|
{
|
|
|
//private bool Outstanding = true;
|
|
|
+ private ReceiptGridSettings _settings;
|
|
|
|
|
|
public CustomerReceipts()
|
|
|
{
|
|
@@ -26,6 +34,13 @@ public class CustomerReceipts : DynamicDataGrid<Receipt>, IPanel<Receipt>
|
|
|
options.AddRange(DynamicGridOption.RecordCount, DynamicGridOption.FilterRows, DynamicGridOption.SelectColumns, DynamicGridOption.MultiSelect);
|
|
|
}
|
|
|
|
|
|
+ protected override void Init()
|
|
|
+ {
|
|
|
+ base.Init();
|
|
|
+ _settings = new UserConfiguration<ReceiptGridSettings>().Load();
|
|
|
+ SelectFilter(_settings.CurrentFilter, false);
|
|
|
+ }
|
|
|
+
|
|
|
public bool IsReady { get; set; }
|
|
|
|
|
|
public event DataModelUpdateEvent OnUpdateDataModel;
|
|
@@ -83,19 +98,11 @@ public class CustomerReceipts : DynamicDataGrid<Receipt>, IPanel<Receipt>
|
|
|
receipt.Notes = string.Format("Invoice{0} {1}", numbers.Length > 1 ? "s" : "", string.Join(", ", numbers));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // private bool ToggleView(Button sender, CoreRow[] rows)
|
|
|
- // {
|
|
|
- // Outstanding = !Outstanding;
|
|
|
- // UpdateButton(sender, PRSDesktop.Resources.view.AsBitmapImage(), Outstanding ? "Show All" : "Outstanding");
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- //
|
|
|
- // protected override void Reload(Filters<Receipt> criteria, Columns<Receipt> columns, ref SortOrder<Receipt> sort,
|
|
|
- // Action<CoreTable, Exception> action)
|
|
|
- // {
|
|
|
- // if (Outstanding)
|
|
|
- // criteria.Add(new Filter<Receipt>(x => x.Reconciled).IsEqualTo(DateTime.MinValue));
|
|
|
- // base.Reload(criteria, columns, ref sort, action);
|
|
|
- // }
|
|
|
+
|
|
|
+ protected override void FilterSelected(CoreFilterDefinition filter)
|
|
|
+ {
|
|
|
+ base.FilterSelected(filter);
|
|
|
+ _settings.CurrentFilter = filter;
|
|
|
+ new UserConfiguration<ReceiptGridSettings>().Save(_settings);
|
|
|
+ }
|
|
|
}
|