var Unibase; (function (Unibase) { let Platform; (function (Platform) { let InviteUsers; (function (InviteUsers) { let Components; (function (Components) { class UserLockUnLockStatus extends Platform.Core.BaseComponent { cssFiles() { return []; } jsFiles() { return ['platform/membership/managers/accountmanager.js']; } html(id, containerid) { let html = ``; return html; } load(id, containerid, callback) { } init(containerid) { var instance = this; instance.fileCacheHelper.loadJsFile("platform/membership/managers/accountmanager.js", function () { Unibase.Platform.Membership.Managers.AccountManager.Instance(); instance.render(containerid); }); } render(containerid) { var instance = this; let html = `
Lock & UnLock
Lock & UnLock
`; $("." + containerid).append(html); instance.loadDetails(); } loadDetails() { $("#UserUnLockStatusDiv").hide(); let instance = this; $("#btnChangeLockStatus").click(function () { var status = "Lock"; let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId; bootbox.confirm("User gets " + status + " Are you sure?", function (result) { if (result) { Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) { MessageHelper.Instance().showSuccess(response.message, ''); $("#UserLockStatusDiv").hide(); $("#UserUnLockStatusDiv").show(); }); } }); }); $("#btnChangeUnLockStatus").click(function () { var status = "UnLock"; let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId; bootbox.confirm("User gets " + status + " Are you sure?", function (result) { if (result) { Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) { MessageHelper.Instance().showSuccess(response.message, ''); $("#UserUnLockStatusDiv").hide(); $("#UserLockStatusDiv").show(); }); } }); }); instance.LockDetails(); } LockDetails() { let instance = this; let status = ""; let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId; Unibase.Platform.Membership.Managers.AccountManager.Instance().ValidateUsersLockStatus(tenantid).then(function (response) { if (response != undefined && response.toString() == "Lock") { instance.lockstatus = 'Lock'; $("#UserLockStatusDiv").hide(); $("#UserUnLockStatusDiv").show(); } else if (response != undefined && response.toString() == "UnLock") { instance.lockstatus = 'Un-Lock'; $("#UserUnLockStatusDiv").hide(); $("#UserLockStatusDiv").show(); } }); } static Instance() { if (this.instance === undefined) { this.instance = new UserLockUnLockStatus(); } return this.instance; } } Components.UserLockUnLockStatus = UserLockUnLockStatus; })(Components = InviteUsers.Components || (InviteUsers.Components = {})); })(InviteUsers = Platform.InviteUsers || (Platform.InviteUsers = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));