Built files from Bizgaze WebServer
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

tenantpopup.js 4.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Tenants;
  6. (function (Tenants) {
  7. let SecondarySwitch;
  8. (function (SecondarySwitch) {
  9. class TenantPopup extends Platform.Core.BaseComponent {
  10. constructor() {
  11. super();
  12. }
  13. jsFiles() {
  14. return ["platform/membership/requests/registeruser.js", "platform/membership/managers/accountmanager.js"];
  15. }
  16. cssFiles() {
  17. return [];
  18. }
  19. html(id, containerid) {
  20. var html = ``;
  21. return html;
  22. }
  23. load(id, containerid, callback) {
  24. this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
  25. var instance = this;
  26. $("#cmbBizgaze_Tenants").change(function () {
  27. bootbox.confirm("Do you want to change the tenant you want to login to?", function (result) {
  28. if (result) {
  29. var PresentTenantID = $("#hfBizgaze_TenantId").val();
  30. var NewTenantID = $("#cmbBizgaze_Tenants").val();
  31. }
  32. });
  33. });
  34. $('input[type=radio][name=radio_PrimaryData]').change(function () {
  35. instance.switchSecData(0);
  36. });
  37. $('input[type=radio][name=radio_SecondaryData]').change(function () {
  38. instance.switchSecData(1);
  39. });
  40. if ($('#hfBizgaze_SecDataEnabled').val() == "1") {
  41. $("#btnSecondaryData").addClass('active');
  42. }
  43. else {
  44. $("#btnPrimaryData").addClass('active');
  45. }
  46. }
  47. Disable() {
  48. this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
  49. var instance = this;
  50. instance._accountManager.getconnectedtenant(1, 1).then(function (response) {
  51. let data;
  52. data = response;
  53. if (data.result.parentTenantId != data.result.childTenantId) {
  54. $("#btnPrimaryData").hide();
  55. $("#btnSecondaryData").hide();
  56. }
  57. else {
  58. if ($('#hfBizgaze_IsEmployee').val() == "1") {
  59. $("#btnPrimaryData").show();
  60. $("#btnSecondaryData").show();
  61. }
  62. }
  63. });
  64. }
  65. switchSecData(id) {
  66. this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
  67. var instance = this;
  68. var message = "Primary";
  69. if (id == 1) {
  70. message = "Secondary";
  71. }
  72. bootbox.confirm("You are about to change to " + message + " data.Are you sure?", function (result) {
  73. if (result) {
  74. instance._accountManager.switchtosecondary(id).then(function (response) {
  75. instance.navigationHelper.hideLoading();
  76. window.location.reload();
  77. }, function (response) {
  78. instance.navigationHelper.hideLoading();
  79. MessageHelper.Instance().showError(response.errors[0], "got error while switching.");
  80. });
  81. }
  82. });
  83. }
  84. static Instance() {
  85. if (this._instance === undefined)
  86. this._instance = new TenantPopup();
  87. return this._instance;
  88. }
  89. }
  90. SecondarySwitch.TenantPopup = TenantPopup;
  91. })(SecondarySwitch = Tenants.SecondarySwitch || (Tenants.SecondarySwitch = {}));
  92. })(Tenants = Platform.Tenants || (Platform.Tenants = {}));
  93. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  94. })(Unibase || (Unibase = {}));