|
@@ -1,6 +1,9 @@
|
|
|
using Comal.Classes;
|
|
|
+using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
+using System;
|
|
|
+using System.Linq;
|
|
|
|
|
|
namespace PRSDesktop;
|
|
|
|
|
@@ -13,6 +16,16 @@ public class SupplierGrid : DynamicDataGrid<Supplier>
|
|
|
PostUtils.AddPostColumn(this);
|
|
|
}
|
|
|
|
|
|
+ public override Supplier CreateItem()
|
|
|
+ {
|
|
|
+ var item = base.CreateItem();
|
|
|
+ item.SupplierStatus.ID = Client.Query(
|
|
|
+ new Filter<SupplierStatus>(x => x.Default).IsEqualTo(true),
|
|
|
+ Columns.None<SupplierStatus>().Add(x => x.ID))
|
|
|
+ .ToObjects<SupplierStatus>().FirstOrDefault()?.ID ?? Guid.Empty;
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
protected override void DoReconfigure(DynamicGridOptions options)
|
|
|
{
|
|
|
base.DoReconfigure(options);
|