-
diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
index 14a140e..50ae43b 100644
--- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
@@ -32,6 +32,7 @@ export class EditLicenseBasicSettings implements OnInit {
MinusCharater: number;
LicenseId:number=0;
AccountNumber:string='';
+ IsUniteState:Boolean=false;
constructor(private _loadingService: LoadingService,private licenseService: LicenseService,
public globalService: GlobalService, private router: Router,
@@ -53,11 +54,12 @@ export class EditLicenseBasicSettings implements OnInit {
address1: ['', [Validators.required,this.noWhitespaceValidator]],
address2: [''],
city: ['', [Validators.required,this.noWhitespaceValidator]],
- stateId: [0],
+ stateId: [0, [Validators.min(1)]],
countryId: [0],
zip: ['', [Validators.required]],
emailId: ['', [Validators.required]],
- phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
+ //phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
+ phone: ['', [Validators.required]]
});
this.GetCountry();
this.GetState();
@@ -114,57 +116,100 @@ export class EditLicenseBasicSettings implements OnInit {
return isValid ? null: { 'whitespace': true };
}
+
onKeyUp(event: any) {
var mobno = event.target.value;
- var newnum=mobno;
- if(mobno!="" && event.key!="Backspace")
+ var countryName =$("#Country option:selected").text().trim();
+ if(mobno!="" && event.key!="Backspace")
+ {
+ if(countryName=="United States")
+ {
+ this.USFormatPhoneNumber(mobno);
+ }
+ else
{
- var tempArr = mobno.split('-');
-
- if(tempArr.length==1)
- {
- var countdigit=tempArr[0].length;
- newnum=tempArr[0];
- if(countdigit==3)
- {
- newnum=tempArr[0]+"-";
- }
- else if(countdigit>3)
- {
- newnum=tempArr[0].substr(0,3)+"-"+tempArr[0].substr(3,1);
- }
-
- }
- else if(tempArr.length==2)
- {
- newnum=tempArr[0]+"-"+tempArr[1];
- var countdigit=tempArr[1].length;
- if(countdigit==3)
- {
- newnum=tempArr[0]+"-"+tempArr[1]+"-";
- }
- else if(countdigit>3)
- {
- newnum= tempArr[0]+"-"+tempArr[1].substr(0,3)+"-"+tempArr[1].substr(3,1);
- }
- }
- else
- {
- newnum=tempArr[0]+"-"+tempArr[1]+"-"+tempArr[2];
- }
+ this.OtherFormatPhoneNumber(mobno);
+ }
+}
+
+};
- }
- this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(newnum);
-
+OtherFormatPhoneNumber(mobno:any)
+{
+ //var regex = /\d+/g;
+ //var matches = mobno.match(regex); //extract digit only
+ //var currentNum= matches==null?"" :matches.join('');
+ this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(mobno);
+}
+
+USFormatPhoneNumber(mobno:any)
+{
+ var newformat="";
+ if(mobno!="" && mobno!=null)
+ {
+ var regex = /\d+/g;
+ var matches = mobno.match(regex); //extract digit only
+ var currentNum= matches==null?"" :matches.join('');
+
+ for(var ind=0;ind
) {
this.modalRef = this.modalService.show(template);
}
GetCountry() {
this.licenseService.GetCountry()
- .subscribe(y => { this.lstCountry = y; }, error => this.error = error);
+ .subscribe(y => {
+ this.lstCountry = y;
+ }, error => this.error = error);
}
GetState() {
@@ -207,6 +252,8 @@ export class EditLicenseBasicSettings implements OnInit {
this.updateLicenseBasicSettingsFrm.controls['emailId'].setValue(this.license.EmailId);
this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone);
this._loadingService.HideLoading("global-loading");
+
+ this.UpdatePhoneValidation();
},
error => this.error = error);
}
diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts
index 822cd14..7642c4b 100644
--- a/400-SOURCECODE/Admin/src/app/shared/global.ts
+++ b/400-SOURCECODE/Admin/src/app/shared/global.ts
@@ -30,6 +30,7 @@ export class GlobalService {
SessionId:number=0;
isSiteUser:boolean=false;
isAdmin:boolean=false;
+ LicenseTypeId:number=0;
RemoveColumns: Array = ["Serial_No", "LicenseId","RowNum"]
error;
public href: string = "";
@@ -58,7 +59,11 @@ export class GlobalService {
this.aiaPingInterval=this.loggedInUser.aiaPingInterval;
this.SessionId=this.loggedInUser.SessionId;
this.isSiteUser=this.loggedInUser.isSiteUser;
- this.isAdmin=this.loggedInUser.LicenseId==0?true:false;;
+ this.isAdmin=this.loggedInUser.LicenseId==0?true:false;
+
+ if (this.loggedInUser.LicenseInfo != null) {
+ this.LicenseTypeId=this.loggedInUser.LicenseInfo.LicenseTypeId;
+ }
}
diff --git a/400-SOURCECODE/Admin/src/assets/data/Menu.json b/400-SOURCECODE/Admin/src/assets/data/Menu.json
index b05d23c..5584eda 100644
--- a/400-SOURCECODE/Admin/src/assets/data/Menu.json
+++ b/400-SOURCECODE/Admin/src/assets/data/Menu.json
@@ -578,6 +578,7 @@
"SubMenuId": "218",
"SubMenuName": "Site License Usage Report",
"SubMenuUrl": "sitelicenseusagereport",
+ "LicenseTypeId": 1,
"SubMenuStatus": "True"
},
{