Commit 5cbcbb224c3228b209dee390790f7895c9f8a2b1
1 parent
90d6be64
update phone validation in admin
Showing
1 changed file
with
1 additions
and
30 deletions
400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
... | ... | @@ -205,22 +205,7 @@ export class EditLicenseBasicSettings implements OnInit { |
205 | 205 | this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(this.license.CountryId); |
206 | 206 | this.updateLicenseBasicSettingsFrm.controls['zip'].setValue(this.license.Zip); |
207 | 207 | this.updateLicenseBasicSettingsFrm.controls['emailId'].setValue(this.license.EmailId); |
208 | - //this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone); | |
209 | - var str = this.license.Phone; | |
210 | - var origPh = this.license.Phone; | |
211 | - str = str.replace(" ", ""); | |
212 | - str = str.replace("-", "").replace("-", ""); | |
213 | - if (str.length >= 10) { | |
214 | - origPh = str.substr(0, 3) + "-" + str.substr(3, 3) + "-" + str.substr(5, 4) | |
215 | - } | |
216 | - else { | |
217 | - this.MinusCharater = 10 - str.length; | |
218 | - this.AddZeroInPhoneNo(this.MinusCharater, str); | |
219 | - origPh = this.ConvertedPhoneno.substr(0, 2) + "-" + this.ConvertedPhoneno.substr(2, 5) + "-" + this.ConvertedPhoneno.substr(5, 9) | |
220 | - | |
221 | - | |
222 | - } | |
223 | - this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(origPh); | |
208 | + this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone); | |
224 | 209 | this._loadingService.HideLoading("global-loading"); |
225 | 210 | }, |
226 | 211 | error => this.error = <any>error); |
... | ... | @@ -263,19 +248,5 @@ export class EditLicenseBasicSettings implements OnInit { |
263 | 248 | } |
264 | 249 | |
265 | 250 | } |
266 | - AddZeroInPhoneNo(num: number, phone: string) { | |
267 | - if (num = 1) { this.ConvertedPhoneno = phone + "0"; } | |
268 | - if (num = 2) { this.ConvertedPhoneno = phone + "00"; } | |
269 | - if (num = 3) { this.ConvertedPhoneno = phone + "000"; } | |
270 | - if (num = 4) { this.ConvertedPhoneno = phone + "0000"; } | |
271 | - if (num = 5) { this.ConvertedPhoneno = phone + "00000"; } | |
272 | - if (num = 6) { this.ConvertedPhoneno = phone + "000000"; } | |
273 | - if (num = 7) { this.ConvertedPhoneno = phone + "0000000"; } | |
274 | - if (num = 8) { this.ConvertedPhoneno = phone + "00000000"; } | |
275 | - if (num = 9) { this.ConvertedPhoneno = phone + "000000000"; } | |
276 | - if (num = 10) { this.ConvertedPhoneno = phone + "0000000000"; } | |
277 | - | |
278 | - | |
279 | - } | |
280 | 251 | |
281 | 252 | } | ... | ... |