Commit 670747d99ca24e1f4470c2d8ed381515e5e52bba
1 parent
fb06cc4e
admin user update fixed
Showing
4 changed files
with
20 additions
and
15 deletions
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts
... | ... | @@ -35,9 +35,9 @@ export class AddLicense implements OnInit { |
35 | 35 | divClass: string = ''; |
36 | 36 | topPos: string = '2000px'; |
37 | 37 | datePipe: DatePipe = new DatePipe('en-US'); |
38 | - bsValue1: Date = new Date(); | |
39 | - bsValue2: Date = new Date(); | |
40 | - bsValue3: Date = new Date(); | |
38 | + bsValue1: Date = null;//new Date(); | |
39 | + bsValue2: Date = null;//new Date(); | |
40 | + bsValue3: Date = null;//new Date(); | |
41 | 41 | modalRef: BsModalRef; |
42 | 42 | editionLoginsText: string; |
43 | 43 | rowIndex: number = 0; | ... | ... |
400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts
... | ... | @@ -36,8 +36,8 @@ export class SearchLicense implements OnInit, AfterViewChecked { |
36 | 36 | topPos: string = '2000px'; |
37 | 37 | selectedRow: number = 0; |
38 | 38 | datePipe: DatePipe = new DatePipe('en-US'); |
39 | - bsValue1: Date = new Date(); | |
40 | - bsValue2: Date = new Date(); | |
39 | + bsValue1: Date = null;//new Date(); | |
40 | + bsValue2: Date = null;//new Date(); | |
41 | 41 | selectedId: number = 0; |
42 | 42 | modalRef: BsModalRef; |
43 | 43 | checkedRecords: Array<number>; | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... | ... | @@ -204,7 +204,10 @@ |
204 | 204 | <label for="inputPassword3" class="col-sm-5 control-label">Confirm Password <span class="red">*</span> :</label> |
205 | 205 | <div class="col-sm-7"> |
206 | 206 | <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword"> |
207 | - <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div> | |
207 | + <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && !adduserFrm.controls.ConfirmPassword.value && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div> | |
208 | + <div *ngIf="adduserFrm.controls.ConfirmPassword.value!=adduserFrm.controls.Password.value && adduserFrm.controls.ConfirmPassword.valid" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;"> | |
209 | + Password not match. | |
210 | + </div> | |
208 | 211 | </div> |
209 | 212 | </div> |
210 | 213 | <div class="form-group"> | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... | ... | @@ -347,29 +347,31 @@ export class UsersList implements OnInit, AfterViewChecked { |
347 | 347 | } |
348 | 348 | |
349 | 349 | public UpdateUser() { |
350 | - this.alerts = ''; | |
351 | - if (this.adduserFrm.value.UserName == '') { | |
352 | - this.alerts += '<span>User Name minimum 8 characters is required.</span>'; | |
350 | + this.alerts = ''; | |
351 | + if (this.adduserFrm.value.UserName == '' ||(!this.adduserFrm.controls.UserName.valid)) | |
352 | + { | |
353 | + this.alerts += '<span>User Name of minimum 8 characters is required.</span>'; | |
353 | 354 | } |
354 | - if (this.adduserFrm.value.Password == '') { | |
355 | + if (this.adduserFrm.value.Password == '' ||(!this.adduserFrm.controls.Password.valid )) { | |
355 | 356 | this.alerts += '</br><span>Password of minimum 8 characters is required.</span>'; |
356 | 357 | } |
357 | 358 | if (this.adduserFrm.value.ConfirmPassword == '') { |
358 | 359 | this.alerts += '</br><span>Confirm Password is required.</span>'; |
359 | 360 | } |
360 | - if (this.adduserFrm.value.EmailId == '') { | |
361 | + if (this.adduserFrm.value.Password != this.adduserFrm.value.ConfirmPassword) { | |
362 | + this.alerts += '</br><span>Password and confirm password must be same</span>'; | |
363 | + } | |
364 | + if (this.adduserFrm.value.EmailId == '' ||(!this.adduserFrm.controls.EmailId.valid)) { | |
361 | 365 | this.alerts += '</br><span>Email Id is required.</span>'; |
362 | 366 | } |
367 | + | |
363 | 368 | if (this.adduserFrm.value.FirstName == '') { |
364 | 369 | this.alerts += '</br><span>First Name is required.</span>'; |
365 | 370 | } |
366 | 371 | if (this.adduserFrm.value.LastName == '') { |
367 | 372 | this.alerts += '</br><span>Last Name is required.</span>'; |
368 | 373 | } |
369 | - if (this.adduserFrm.value.Password != this.adduserFrm.value.ConfirmPassword) { | |
370 | - this.alerts += '</br><span>Password and confirm password must be same</span>'; | |
371 | - } | |
372 | - | |
374 | + | |
373 | 375 | if (this.adduserFrm.valid && this.alerts == '') { |
374 | 376 | this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) |
375 | 377 | ... | ... |