MYOBGlobalPosterSettingsGrid.cs 815 B

12345678910111213141516171819202122232425
  1. using InABox.Core;
  2. using InABox.DynamicGrid;
  3. using InABox.Poster.MYOB;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PRS.Shared.Posters.MYOB;
  10. public class MYOBGlobalPosterSettingsGrid : DynamicItemsListGrid<MYOBGlobalPosterSettings>
  11. {
  12. protected override void DoAfterSave(IDynamicEditorForm editor, MYOBGlobalPosterSettings[] items)
  13. {
  14. base.DoAfterSave(editor, items);
  15. if(items.Any(x => x.HasOriginalValue(x => x.CompanyFileID) || x.HasOriginalValue(x => x.CompanyFilePassword) || x.HasOriginalValue(x => x.CompanyFileUserID)))
  16. {
  17. var data = MYOBPosterEngine.GetConnectionData();
  18. // Reset authentication if it's changed.
  19. data.CompanyFile = null;
  20. }
  21. }
  22. }