MYOBGlobalPosterSettings.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 { get; set; }
  13. [EditorSequence(2)]
  14. [TextBoxEditor]
  15. public string CompanyFileUserID { get; set; }
  16. [EditorSequence(3)]
  17. [PasswordEditor(ViewButtonVisible = true)]
  18. public string CompanyFilePassword { get; set; }
  19. [EditorSequence(4)]
  20. [CheckBoxEditor]
  21. public bool NoCredentials { get; set; }
  22. [TextBoxEditor(ToolTip = "The MYOB tax code which should be used for global supplier tax codes, customer tax codes, freight tax codes, etc.")]
  23. public string DefaultTaxCode { get; set; }
  24. protected override void DoPropertyChanged(string name, object? before, object? after)
  25. {
  26. base.DoPropertyChanged(name, before, after);
  27. if(name == nameof(NoCredentials) && NoCredentials)
  28. {
  29. CompanyFileUserID = "";
  30. CompanyFilePassword = "";
  31. }
  32. }
  33. }