Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

contactbinding.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Transact;
  6. (function (Transact) {
  7. let Controls;
  8. (function (Controls) {
  9. let Offers;
  10. (function (Offers) {
  11. class ContactBinding extends Unibase.Platform.Core.BaseComponent {
  12. constructor() {
  13. super();
  14. }
  15. cssFiles() {
  16. return [];
  17. }
  18. jsFiles() {
  19. return [];
  20. }
  21. html(id, containerid) {
  22. var html = "";
  23. return html;
  24. }
  25. load(id, containerid, callback) {
  26. }
  27. bindContact(containerid, textcontainerid, redeemcontainerid) {
  28. var instance = this;
  29. var isCustomer = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().isRestrictedUser;
  30. var UserId = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().userId;
  31. if (isCustomer) {
  32. instance.fileCacheHelper.loadJsFile("apps/crm/contacts/managers/contactmanager.js", function () {
  33. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getContactByUserId(UserId).then(function (response) {
  34. var contactId = response.result.ContactId;
  35. var orgContactName = response.result.OrgContactName;
  36. var organizationName = response.result.OrganizationName;
  37. var contactName = organizationName + ' - ' + orgContactName;
  38. $(containerid).attr("disabled", 1);
  39. instance.fileCacheHelper.loadJsFile('apps/transact/managers/offers/offermanager.js', function () {
  40. Bizgaze.Apps.Transact.Managers.OfferManager.Instance().getwalletamount(contactId).then(function (response) {
  41. var data = response.result;
  42. if (data != null) {
  43. var walletid = data.WalletId;
  44. var walletvalue = data.WalletValue;
  45. $(textcontainerid).val(walletvalue);
  46. $(redeemcontainerid).val(walletvalue);
  47. var contact = new Option(contactName, walletid.toString(), true);
  48. $(containerid).append(contact);
  49. }
  50. $(textcontainerid).attr("disabled", 1);
  51. });
  52. });
  53. });
  54. });
  55. }
  56. }
  57. static Instance() {
  58. if (this.instance === undefined) {
  59. this.instance = new ContactBinding();
  60. }
  61. return this.instance;
  62. }
  63. }
  64. Offers.ContactBinding = ContactBinding;
  65. })(Offers = Controls.Offers || (Controls.Offers = {}));
  66. })(Controls = Transact.Controls || (Transact.Controls = {}));
  67. })(Transact = Apps.Transact || (Apps.Transact = {}));
  68. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  69. })(Bizgaze || (Bizgaze = {}));