123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- var Bizgaze;
- (function (Bizgaze) {
- let Apps;
- (function (Apps) {
- let CRM;
- (function (CRM) {
- let Companies;
- (function (Companies) {
- let Managers;
- (function (Managers) {
- class CompanyManager extends Unibase.Platform.Core.BaseManager {
- getAssignedCompanies(Ids) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/assignedcompanies/selectedcompanyids/' + Ids;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getAssignedBranches(BranchIds, UserId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/getbranchesbyids/selectedbranchids/' + BranchIds + '/userid/' + UserId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getWarehousesbyCompanyid(CompanyId, BranchId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/companies/getwarehousesbycompanyid/companyid/' + CompanyId + '/branchid/' + BranchId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- refreshBranchTypes() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/refreshbranchtypes/np';
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- return response.message;
- });
- });
- }
- getBankBranchDetails(id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/getbankbranches/bankbranchid/' + id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getUserBranches(id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/getuserbranches/contactid/' + id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- changeBranch(branchid, partitionid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/changebranch/branchid/' + branchid + '/partitionid/' + partitionid;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- var identity = JSON.parse(response.result);
- identity = Object.keys(identity).reduce((c, k) => (c[k.charAt(0).toLowerCase() + k.slice(1)] = identity[k], c), {});
- for (var s = 0; s < identity.settings.length; s++) {
- identity.settings[s] = Object.keys(identity.settings[s]).reduce((c, k) => (c[k.charAt(0).toLowerCase() + k.slice(1)] = identity.settings[s][k], c), {});
- }
- Unibase.Platform.Membership.Infos.Identity.setCurrentUser(identity);
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getBranch(branchid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/getbranchbybranchid/branchid/' + branchid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getBranches(CompanyId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/companies/getallbranchesbycompanyid/companyid/' + CompanyId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- static Instance() {
- if (this._instance === undefined)
- this._instance = new CompanyManager();
- return this._instance;
- }
- }
- Managers.CompanyManager = CompanyManager;
- })(Managers = Companies.Managers || (Companies.Managers = {}));
- })(Companies = CRM.Companies || (CRM.Companies = {}));
- })(CRM = Apps.CRM || (Apps.CRM = {}));
- })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
- })(Bizgaze || (Bizgaze = {}));
|