StagingSetoutStore.cs 847 B

1234567891011121314151617181920212223242526
  1. using Comal.Classes;
  2. using Comal.Stores;
  3. using NPOI.HSSF.Record;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using InABox.Core;
  8. namespace PRSStores
  9. {
  10. public class StagingSetoutStore : BaseStore<StagingSetout>
  11. {
  12. protected override void BeforeSave(StagingSetout entity)
  13. {
  14. if ((entity.Setout.ID != Guid.Empty || entity.Task.ID != Guid.Empty) && entity.Archived == DateTime.MinValue)
  15. entity.Archived = DateTime.Now;
  16. if (!string.IsNullOrWhiteSpace(entity.SavePath) && entity.Locked == DateTime.MinValue)
  17. entity.Locked = DateTime.Now;
  18. else if (string.IsNullOrWhiteSpace(entity.SavePath) && entity.Locked != DateTime.MinValue)
  19. entity.Locked = DateTime.MinValue;
  20. base.BeforeSave(entity);
  21. }
  22. }
  23. }