123456789101112131415161718192021222324252627282930 |
- using InABox.Core;
- using InABox.DynamicGrid;
- using InABox.Poster.MYOB;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PRS.Shared.Posters.MYOB;
- public class MYOBGlobalPosterSettingsGrid : DynamicItemsListGrid<MYOBGlobalPosterSettings>
- {
- protected override void DoAfterSave(IDynamicEditorForm editor, MYOBGlobalPosterSettings[] items)
- {
- base.DoAfterSave(editor, items);
- if(items.Any(x => x.CompanyFile.HasOriginalValue(x => x.ID)
- || x.HasOriginalValue(x => x.CompanyFilePassword)
- || x.HasOriginalValue(x => x.CompanyFileUserID)))
- {
- var data = MYOBPosterEngine.GetConnectionDataOrNull();
- if(data is not null)
- {
- // Reset authentication if it's changed.
- data.CompanyFile = null;
- }
- }
- }
- }
|