Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conflicts.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. var Unibase;
  2. (function (Unibase) {
  3. let Utilities;
  4. (function (Utilities) {
  5. let Components;
  6. (function (Components) {
  7. class Conflicts extends Unibase.Platform.Core.BaseComponent {
  8. init() {
  9. return null;
  10. }
  11. loadControl(containerid, prop) {
  12. return null;
  13. }
  14. loadControlSettings(controlsettingjson, formpropertyid) {
  15. return null;
  16. }
  17. loadPropertySettings(propertysettings, formpropertyid) {
  18. return null;
  19. }
  20. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  21. return null;
  22. }
  23. Refresh() {
  24. let ConflictId = 0, IsExecuteInAllDistributors = false, IsComparisonConflict = false;
  25. let instance = this;
  26. let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  27. let Conflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_conflictid");
  28. let ExecuteInAllDistributors = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_isexecuteinalldistributors");
  29. let ComparisonConflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_iscomparisonconflict");
  30. if (Conflict != undefined)
  31. ConflictId = Number(Conflict.Value);
  32. if (ExecuteInAllDistributors != undefined) {
  33. IsExecuteInAllDistributors = ExecuteInAllDistributors.Value;
  34. }
  35. if (ComparisonConflict != undefined) {
  36. IsComparisonConflict = ComparisonConflict.Value;
  37. }
  38. if (IsExecuteInAllDistributors == true || IsComparisonConflict == true) {
  39. $("#DetailSetting_" + InstalledAppId + "_RefreshConflict").addClass("hidden");
  40. $("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").removeClass("hidden");
  41. $("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").unbind().click(function () {
  42. instance.RefreshConflictInAllDistributors(ConflictId);
  43. });
  44. }
  45. else {
  46. $("#DetailSetting_" + InstalledAppId + "_RefreshConflict").removeClass("hidden");
  47. $("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").addClass("hidden");
  48. $("#DetailSetting_" + InstalledAppId + "_RefreshConflict").unbind().click(function () {
  49. instance.RefreshConflict(ConflictId);
  50. });
  51. }
  52. }
  53. RefreshAllConflicts() {
  54. let instance = this;
  55. let PostData = {
  56. ConflictId: 0,
  57. Page: 0,
  58. PageSize: 1,
  59. };
  60. instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
  61. Unibase.Utilities.Managers.ConflictManager.Instance().RefreshAllConflicts(PostData).then(function (response) {
  62. if (response.errors != null && response.errors.length > 0) {
  63. MessageHelper.Instance().showError(response.message, "div_message");
  64. }
  65. else {
  66. MessageHelper.Instance().showSuccess(response.message, "div_message");
  67. }
  68. });
  69. });
  70. }
  71. RefreshConflict(ConflictId) {
  72. let instance = this;
  73. let PostData = {
  74. ConflictId: ConflictId,
  75. Page: 0,
  76. PageSize: 1,
  77. };
  78. instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
  79. Unibase.Utilities.Managers.ConflictManager.Instance().RefreshConflict(PostData).then(function (response) {
  80. if (response.errors != null && response.errors.length > 0) {
  81. MessageHelper.Instance().showError(response.message, "div_message");
  82. }
  83. else {
  84. MessageHelper.Instance().showSuccess(response.message, "div_message");
  85. }
  86. });
  87. });
  88. }
  89. RefreshConflictInAllDistributors(ConflictId) {
  90. let instance = this;
  91. let PostData = {
  92. ConflictId: ConflictId,
  93. Page: 0,
  94. PageSize: 1,
  95. };
  96. instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
  97. Unibase.Utilities.Managers.ConflictManager.Instance().RefreshConflictInAllDistributors(PostData).then(function (response) {
  98. if (response.errors != null && response.errors.length > 0) {
  99. MessageHelper.Instance().showError(response.message, "div_message");
  100. }
  101. else {
  102. MessageHelper.Instance().showSuccess(response.message, "div_message");
  103. }
  104. });
  105. });
  106. }
  107. DeleteConflict() {
  108. let instance = this;
  109. let ConflictId = 0;
  110. let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  111. let Conflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_conflictid");
  112. let ExecuteInAllDistributors = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_isexecuteinalldistributors");
  113. if (Conflict != undefined)
  114. ConflictId = Number(Conflict.Value);
  115. instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
  116. Unibase.Utilities.Managers.ConflictManager.Instance().DeleteConflict(ConflictId).then(function (response) {
  117. if (response.errors != null && response.errors.length > 0) {
  118. MessageHelper.Instance().showError(response.message, "div_message");
  119. }
  120. else {
  121. MessageHelper.Instance().showSuccess(response.message, "div_message");
  122. Unibase.Themes.Compact.Components.Nav.Instance().loadList(InstalledAppId);
  123. }
  124. });
  125. });
  126. }
  127. ConflictEvents() {
  128. let instance = this;
  129. $(".divCustomProperties_distributorquery, .divCustomProperties_currentdbquery, .divCustomProperties_query").addClass("mb-20");
  130. var ConflictId = $(".hdn_conflictid").val();
  131. $(".divCustomProperties_countreportid, .divCustomProperties_datareportid").addClass("hidden");
  132. $(".divCustomProperties_iscomparison").addClass("hidden");
  133. $(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").addClass("hidden");
  134. $("#chk_iscomparisonconflict").change(function () {
  135. instance.ChangedIsCompConflict_chbx();
  136. });
  137. $("#chk_isexecuteinalldistributors").change(function () {
  138. instance.ChangedIsExecInAllDistributors_chbx();
  139. });
  140. if (ConflictId != 0) {
  141. instance.ChangedIsExecInAllDistributors_chbx();
  142. instance.ChangedIsCompConflict_chbx();
  143. }
  144. }
  145. ChangedIsExecInAllDistributors_chbx() {
  146. if ($("#chk_isexecuteinalldistributors").prop("checked") == true) {
  147. $(".divCustomProperties_countreportid, .divCustomProperties_datareportid").removeClass("hidden");
  148. $("#chk_iscomparisonconflict").prop("checked", false);
  149. }
  150. else {
  151. $(".divCustomProperties_countreportid, .divCustomProperties_datareportid").addClass("hidden");
  152. $(".txtAutoComplete_countreportid, .txtAutoComplete_datareportid").val("").trigger("change");
  153. }
  154. }
  155. ChangedIsCompConflict_chbx() {
  156. if ($("#chk_iscomparisonconflict").prop("checked") == true) {
  157. $(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").removeClass("hidden");
  158. $("#chk_isexecuteinalldistributors").prop("checked", false);
  159. }
  160. else {
  161. $(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").addClass("hidden");
  162. $(".divCustomProperties_currentdbquery textarea").val("");
  163. $(".divCustomProperties_distributorquery textarea").val("");
  164. }
  165. }
  166. static Instance() {
  167. if (this.instance === undefined) {
  168. this.instance = new Conflicts();
  169. }
  170. return this.instance;
  171. }
  172. }
  173. Components.Conflicts = Conflicts;
  174. })(Components = Utilities.Components || (Utilities.Components = {}));
  175. })(Utilities = Unibase.Utilities || (Unibase.Utilities = {}));
  176. })(Unibase || (Unibase = {}));