Iniit
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Utilities;
|
||||
(function (Utilities) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Conflicts extends Unibase.Platform.Core.BaseComponent {
|
||||
init() {
|
||||
return null;
|
||||
}
|
||||
loadControl(containerid, prop) {
|
||||
return null;
|
||||
}
|
||||
loadControlSettings(controlsettingjson, formpropertyid) {
|
||||
return null;
|
||||
}
|
||||
loadPropertySettings(propertysettings, formpropertyid) {
|
||||
return null;
|
||||
}
|
||||
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
|
||||
return null;
|
||||
}
|
||||
Refresh() {
|
||||
let ConflictId = 0, IsExecuteInAllDistributors = false, IsComparisonConflict = false;
|
||||
let instance = this;
|
||||
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
let Conflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_conflictid");
|
||||
let ExecuteInAllDistributors = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_isexecuteinalldistributors");
|
||||
let ComparisonConflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_iscomparisonconflict");
|
||||
if (Conflict != undefined)
|
||||
ConflictId = Number(Conflict.Value);
|
||||
if (ExecuteInAllDistributors != undefined) {
|
||||
IsExecuteInAllDistributors = ExecuteInAllDistributors.Value;
|
||||
}
|
||||
if (ComparisonConflict != undefined) {
|
||||
IsComparisonConflict = ComparisonConflict.Value;
|
||||
}
|
||||
if (IsExecuteInAllDistributors == true || IsComparisonConflict == true) {
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflict").addClass("hidden");
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").removeClass("hidden");
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").unbind().click(function () {
|
||||
instance.RefreshConflictInAllDistributors(ConflictId);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflict").removeClass("hidden");
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflictInAllDistributors").addClass("hidden");
|
||||
$("#DetailSetting_" + InstalledAppId + "_RefreshConflict").unbind().click(function () {
|
||||
instance.RefreshConflict(ConflictId);
|
||||
});
|
||||
}
|
||||
}
|
||||
RefreshAllConflicts() {
|
||||
let instance = this;
|
||||
let PostData = {
|
||||
ConflictId: 0,
|
||||
Page: 0,
|
||||
PageSize: 1,
|
||||
};
|
||||
instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
|
||||
Unibase.Utilities.Managers.ConflictManager.Instance().RefreshAllConflicts(PostData).then(function (response) {
|
||||
if (response.errors != null && response.errors.length > 0) {
|
||||
MessageHelper.Instance().showError(response.message, "div_message");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_message");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
RefreshConflict(ConflictId) {
|
||||
let instance = this;
|
||||
let PostData = {
|
||||
ConflictId: ConflictId,
|
||||
Page: 0,
|
||||
PageSize: 1,
|
||||
};
|
||||
instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
|
||||
Unibase.Utilities.Managers.ConflictManager.Instance().RefreshConflict(PostData).then(function (response) {
|
||||
if (response.errors != null && response.errors.length > 0) {
|
||||
MessageHelper.Instance().showError(response.message, "div_message");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_message");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
RefreshConflictInAllDistributors(ConflictId) {
|
||||
let instance = this;
|
||||
let PostData = {
|
||||
ConflictId: ConflictId,
|
||||
Page: 0,
|
||||
PageSize: 1,
|
||||
};
|
||||
instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
|
||||
Unibase.Utilities.Managers.ConflictManager.Instance().RefreshConflictInAllDistributors(PostData).then(function (response) {
|
||||
if (response.errors != null && response.errors.length > 0) {
|
||||
MessageHelper.Instance().showError(response.message, "div_message");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_message");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
DeleteConflict() {
|
||||
let instance = this;
|
||||
let ConflictId = 0;
|
||||
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
let Conflict = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_conflictid");
|
||||
let ExecuteInAllDistributors = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_isexecuteinalldistributors");
|
||||
if (Conflict != undefined)
|
||||
ConflictId = Number(Conflict.Value);
|
||||
instance.fileCacheHelper.loadJsFile("platform/utilities/managers/conflictmanager.js", function () {
|
||||
Unibase.Utilities.Managers.ConflictManager.Instance().DeleteConflict(ConflictId).then(function (response) {
|
||||
if (response.errors != null && response.errors.length > 0) {
|
||||
MessageHelper.Instance().showError(response.message, "div_message");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_message");
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().loadList(InstalledAppId);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
ConflictEvents() {
|
||||
let instance = this;
|
||||
$(".divCustomProperties_distributorquery, .divCustomProperties_currentdbquery, .divCustomProperties_query").addClass("mb-20");
|
||||
var ConflictId = $(".hdn_conflictid").val();
|
||||
$(".divCustomProperties_countreportid, .divCustomProperties_datareportid").addClass("hidden");
|
||||
$(".divCustomProperties_iscomparison").addClass("hidden");
|
||||
$(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").addClass("hidden");
|
||||
$("#chk_iscomparisonconflict").change(function () {
|
||||
instance.ChangedIsCompConflict_chbx();
|
||||
});
|
||||
$("#chk_isexecuteinalldistributors").change(function () {
|
||||
instance.ChangedIsExecInAllDistributors_chbx();
|
||||
});
|
||||
if (ConflictId != 0) {
|
||||
instance.ChangedIsExecInAllDistributors_chbx();
|
||||
instance.ChangedIsCompConflict_chbx();
|
||||
}
|
||||
}
|
||||
ChangedIsExecInAllDistributors_chbx() {
|
||||
if ($("#chk_isexecuteinalldistributors").prop("checked") == true) {
|
||||
$(".divCustomProperties_countreportid, .divCustomProperties_datareportid").removeClass("hidden");
|
||||
$("#chk_iscomparisonconflict").prop("checked", false);
|
||||
}
|
||||
else {
|
||||
$(".divCustomProperties_countreportid, .divCustomProperties_datareportid").addClass("hidden");
|
||||
$(".txtAutoComplete_countreportid, .txtAutoComplete_datareportid").val("").trigger("change");
|
||||
}
|
||||
}
|
||||
ChangedIsCompConflict_chbx() {
|
||||
if ($("#chk_iscomparisonconflict").prop("checked") == true) {
|
||||
$(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").removeClass("hidden");
|
||||
$("#chk_isexecuteinalldistributors").prop("checked", false);
|
||||
}
|
||||
else {
|
||||
$(".divCustomProperties_currentdbquery, .divCustomProperties_distributorquery").addClass("hidden");
|
||||
$(".divCustomProperties_currentdbquery textarea").val("");
|
||||
$(".divCustomProperties_distributorquery textarea").val("");
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new Conflicts();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.Conflicts = Conflicts;
|
||||
})(Components = Utilities.Components || (Utilities.Components = {}));
|
||||
})(Utilities = Unibase.Utilities || (Unibase.Utilities = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user