JobZoneGrid.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace PRSDesktop
  2. {
  3. }
  4. //public class JobZoneGrid : DynamicDataGrid<JobZone>, IJobGrid, IDataModelSource
  5. //{
  6. // public Guid JobID { get; set; }
  7. // public JobZoneGrid() : base()
  8. // {
  9. // Options = new DynamicGridOptions[] { DynamicGridOptions.RecordCount, DynamicGridOptions.SelectColumns, DynamicGridOptions.AddRows, DynamicGridOptions.ExportData, DynamicGridOptions.FilterRows, DynamicGridOptions.MultiSelect, DynamicGridOptions.EditRows, DynamicGridOptions.SortRows, DynamicGridOptions.DeleteRows };
  10. // }
  11. // public event DataModelUpdateEvent OnUpdateDataModel;
  12. // protected override void DoAdd(bool OpenEditorOnDirectEdit = false)
  13. // {
  14. // if (JobID.Equals(Guid.Empty) || JobID.Equals(CoreUtils.FullGuid))
  15. // System.Windows.MessageBox.Show("Please select a Job first!");
  16. // else
  17. // base.DoAdd();
  18. // }
  19. // protected override JobZone CreateItem()
  20. // {
  21. // var result = base.CreateItem();
  22. // result.Job.ID = JobID;
  23. // return result;
  24. // }
  25. // protected override void Reload(Filters<JobZone> criteria, Columns<JobZone> columns, ref SortOrder<JobZone> sort, Action<CoreTable,Exception> action)
  26. // {
  27. // criteria.Add(new Filter<JobZone>(x => x.Job.ID).IsEqualTo(JobID));
  28. // base.Reload(criteria, columns, ref sort, action);
  29. // }
  30. // public DataModel DataModel(Selection selection)
  31. // {
  32. // Guid[] ids = ExtractValues<Guid>(x => x.ID, selection).ToArray();
  33. // return new JobZoneDataModel(new Filter<JobZone>(x => x.ID).InList(ids));
  34. // }
  35. //}