diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts index fee0ebc..96a41fb 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts @@ -95,7 +95,8 @@ export class AddLicense implements OnInit { testLicenseEditionId: [1], creatorId: [this.globalService.loggedInUser.Id], renew: [false], - renewDate: ['', Validators.required], + renewDate: [''], + //renewDate: ['', Validators.required], totalRenewals: [0], isActive: ['false'] }); @@ -231,6 +232,18 @@ export class AddLicense implements OnInit { { this.alerts = ''; this.NumberOfRows=0; + //renew date + if(isChecked) + { + this.insertUpdateLicenseFrm.controls['renewDate'].clearValidators(); + this.insertUpdateLicenseFrm.controls['renewDate'].setValidators(Validators.required); + } + else + { + this.insertUpdateLicenseFrm.controls['renewDate'].clearValidators(); + } + this.insertUpdateLicenseFrm.controls['renewDate'].updateValueAndValidity(); + if (this.insertUpdateLicenseFrm.controls['licenseTypeId'].value == 2) { this.insertUpdateLicenseFrm.controls['editionLoginArr'].value.forEach(element => { if(this.NumberOfRows >1) diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts index a9d2a44..f436e13 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts @@ -177,7 +177,7 @@ export class SearchLicense implements OnInit, AfterViewChecked { this.license = this.licenses[0]; this.searchLicenseFrm.setControl('licenses', this.fb.array(this.licenses)); if(this.selectedId > -1){ - this.license = this.searchLicenseFrm.controls['licenses'].value.find(C => C.LicenseId = this.selectedId); + this.license = this.searchLicenseFrm.controls['licenses'].value.find(C => C.LicenseId == this.selectedId); } if (this.licenses.length > 0) { this.NoRecord = '';