|
@@ -78,19 +78,18 @@ internal class JobRequisitionItemGrid : DynamicDataGrid<JobRequisitionItem>, IMa
|
|
|
|
|
|
#region CreatePurchaseOrder
|
|
|
|
|
|
- private bool DoCreatePurchaseOrder(Button button, CoreRow[]? rows)
|
|
|
+ private bool DoCreatePurchaseOrder(Button button, CoreRow[] rows)
|
|
|
{
|
|
|
- if (rows?.Any() != true)
|
|
|
+ if (rows.Length == 0)
|
|
|
return false;
|
|
|
|
|
|
- MultiSelectDialog<Supplier> dlg = new MultiSelectDialog<Supplier>(
|
|
|
+ var dlg = new MultiSelectDialog<Supplier>(
|
|
|
LookupFactory.DefineFilter<Supplier>(),
|
|
|
Columns.None<Supplier>()
|
|
|
.Add(x => x.ID)
|
|
|
.Add(x => x.Code)
|
|
|
.Add(x => x.Name),
|
|
|
- false
|
|
|
- );
|
|
|
+ false);
|
|
|
|
|
|
var _po = new PurchaseOrder();
|
|
|
if (dlg.ShowDialog())
|
|
@@ -104,11 +103,11 @@ internal class JobRequisitionItemGrid : DynamicDataGrid<JobRequisitionItem>, IMa
|
|
|
Client.Save(_po, "Created From Requisition Screen");
|
|
|
|
|
|
progress.Report("Creating Order Items");
|
|
|
- Dictionary<JobRequisitionItem,PurchaseOrderItem> _pois = new Dictionary<JobRequisitionItem,PurchaseOrderItem>();
|
|
|
+ var _pois = new Dictionary<JobRequisitionItem,PurchaseOrderItem>();
|
|
|
foreach (CoreRow row in SelectedRows)
|
|
|
{
|
|
|
- JobRequisitionItem _jri = row.ToObject<JobRequisitionItem>();
|
|
|
- PurchaseOrderItem _poi = new PurchaseOrderItem();
|
|
|
+ var _jri = row.ToObject<JobRequisitionItem>();
|
|
|
+ var _poi = new PurchaseOrderItem();
|
|
|
_poi.PurchaseOrderLink.ID = _po.ID;
|
|
|
_poi.Product.ID = _jri.Product.ID;
|
|
|
_poi.Product.Code = _jri.Product.Code;
|
|
@@ -136,9 +135,7 @@ internal class JobRequisitionItemGrid : DynamicDataGrid<JobRequisitionItem>, IMa
|
|
|
poia.Item.ID = _pois[_jri].ID;
|
|
|
}
|
|
|
Client.Save(poias,"Created From Requisition Screen");
|
|
|
-
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
new SupplierPurchaseOrders().EditItems(new[] { _po });
|
|
|
return true;
|