MYOBGlobalPosterSettings.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using InABox.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace InABox.Poster.MYOB;
  8. public class MYOBGlobalPosterSettings : GlobalPosterSettings
  9. {
  10. [EditorSequence(1)]
  11. [MYOBCompanyFileEditor]
  12. public MYOBCompanyFile CompanyFile => InitializeField(ref _companyFile, nameof(CompanyFile));
  13. private MYOBCompanyFile? _companyFile;
  14. [EditorSequence(2)]
  15. [TextBoxEditor]
  16. public string CompanyFileUserID { get; set; }
  17. [EditorSequence(3)]
  18. [PasswordEditor(ViewButtonVisible = true)]
  19. public string CompanyFilePassword { get; set; }
  20. [EditorSequence(4)]
  21. [CheckBoxEditor]
  22. public bool NoCredentials { get; set; }
  23. [TextBoxEditor(ToolTip = "The MYOB tax code which should be used for global supplier tax codes, customer tax codes, freight tax codes, etc.")]
  24. public string DefaultTaxCode { get; set; }
  25. protected override void DoPropertyChanged(string name, object? before, object? after)
  26. {
  27. base.DoPropertyChanged(name, before, after);
  28. if(name == nameof(NoCredentials) && NoCredentials)
  29. {
  30. CompanyFileUserID = "";
  31. CompanyFilePassword = "";
  32. }
  33. }
  34. }