Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
2
Indexable
Never
checkValidity() {
        console.log(this.initParamForm);
        if (this.recordName == "WebServices") {
            //Enable is empty
            if (this.initParamForm.value["webservices.enable"] === this.webservicesEnable) {
                this.toastr.error(this.translateService.instant("webservicesEnableEmpty"));
                return false;
            }
            else if (
                this.initParamForm.value["webservices.enable"] !== "Y" && this.initParamForm.value["webservices.enable"] !== "N" &&
                this.initParamForm.value["webservices.enable"] !== "y" &&
                 this.initParamForm.value["webservices.enable"] !== "n"
            ) {
                console.log(this.initParamForm.value["webservices.enable"]);
                this.toastr.error(this.translateService.instant("webservicesEnableIncorrectValue"));
                return false;
            };
            const PORT = parseInt(this.initParamForm.value["webservices.port"]);

            if (isNaN(PORT)) {
                console.log(this.initParamForm.value["webservices.port"]);
                this.toastr.error(this.translateService.instant("webservicesPortIncorrectValue"));
                return false;
            }
            else if (this.initParamForm.value["webservices.port"] === this.webservicesPort) {
                this.toastr.error(this.translateService.instant("webservicesPortEmpty"));
                return false;
            };
        }
    }