PurchaseOrderItemAllocationGrid.cs 759 B

123456789101112131415161718192021222324
  1. using Comal.Classes;
  2. using InABox.Core;
  3. using InABox.DynamicGrid;
  4. using InABox.WPF;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Media.Imaging;
  11. namespace PRSDesktop.Panels.PurchaseOrders;
  12. public class PurchaseOrderItemAllocationGrid : DynamicOneToManyGrid<PurchaseOrderItem, PurchaseOrderItemAllocation>
  13. {
  14. protected override void DoValidate(PurchaseOrderItemAllocation[] items, List<string> errors)
  15. {
  16. base.DoValidate(items, errors);
  17. if(items.Any(x => x.Job.ID == Item.Job.ID && x.JobRequisitionItem.ID == Guid.Empty))
  18. {
  19. errors.Add("[Job] may not be equivalent to the Job on the PurchaseOrderItem.");
  20. }
  21. }
  22. }