diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
index b799b28..034fd12 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
@@ -168,7 +168,7 @@ namespace AIAHTML5.ADMIN.API.Models
LicenseObj.TotalRenewals = result[0].TotalRenewals;
LicenseObj.SubscriptionStartDate = (result[0].SubscriptionStartDate == null ? DateTime.MinValue : result[0].SubscriptionStartDate.Value);
LicenseObj.SubscriptionEndDate = (result[0].SubscriptionEndDate == null ? DateTime.MinValue : result[0].SubscriptionEndDate.Value);
- LicenseObj.RenewDate = (result[0].RenewalDate == null ? DateTime.MinValue : result[0].RenewalDate.Value);
+ LicenseObj.RenewDate = (result[0].RenewalDate == null ? DateTime.Now.Date : result[0].RenewalDate.Value);
}
}
catch (Exception ex) { }
diff --git a/400-SOURCECODE/Admin/src/app/app.component.html b/400-SOURCECODE/Admin/src/app/app.component.html
index ec5e7e3..5c51d35 100644
--- a/400-SOURCECODE/Admin/src/app/app.component.html
+++ b/400-SOURCECODE/Admin/src/app/app.component.html
@@ -33,7 +33,7 @@
{{item.HeaderMenuName}}
diff --git a/400-SOURCECODE/Admin/src/app/app.routing.module.ts b/400-SOURCECODE/Admin/src/app/app.routing.module.ts
index 35be9fd..6f65634 100644
--- a/400-SOURCECODE/Admin/src/app/app.routing.module.ts
+++ b/400-SOURCECODE/Admin/src/app/app.routing.module.ts
@@ -33,6 +33,7 @@ const appRoutes: Routes = [
{ path: 'managediscountcode', component: ManageDiscountCode },
{ path: 'subscriptionprice', component: SubscriptionPrice },
{ path: 'adduser', component: AddUser },
+ { path: 'addgeneral', component: AddUser },
{ path: 'unblockuser', component: UnblockUser },
{ path: 'searchlicense', component: SearchLicense },
{ path: 'addlicense', component: AddLicense },
diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html
index b7e1c7f..12b6adf 100644
--- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html
+++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html
@@ -104,7 +104,7 @@
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
index 53d69d6..59ddd38 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
@@ -60,29 +60,65 @@ export class AddUser implements OnInit, AfterViewInit {
//this.userservice.GetUserById(this.UserId);
this.adduserFrm = this.fb.group({
id: [''],
- UserName: ['', [Validators.required, Validators.minLength(8)]],
- Password: ['', [Validators.required, Validators.minLength(8)]],
- ConfirmPassword: ['', Validators.required],
- FirstName: ['', Validators.required],
- LastName: ['', Validators.required],
- EmailId: ['', Validators.required],
+ UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]],
+ FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
+ LastName: ['', [Validators.required,this.noWhitespaceValidator]],
+ EmailId: ['', [Validators.required,this.noWhitespaceValidator]],
AccountNumberId: ['', Validators.required],
UserTypeId: ['', Validators.required],
ProductEditionId: ['', Validators.required]
});
this._loadingService.ShowLoading("global-loading");
- this.bindUsers();
- this.GetAccountNumber();
- //this.GetUserTypeByLicenseId();
-
+ this.bindUsers(0);
+ if(this.router.url === '/adduser')
+ {
+ this.GetAccountNumber();
+ }
+ else{
+ this._loadingService.HideLoading("global-loading");
+ }
+
}
ngAfterViewInit() {
- this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ if(this.router.url === '/adduser')
+ {
+ this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ }
+
}
redirect() {
this.router.navigate(['/']);
}
+ public noWhitespaceValidator(control: FormControl) {
+ // new validation for intial whaite space
+ //****Birendra *****/
+ var isValid=false;
+ if(control.value!=null)
+ {
+ var controlLen=control.value.length;
+ if(controlLen==undefined)//undefined for integer value
+ {
+ isValid=true;
+ }
+ else if(controlLen!=0)
+ {
+ const isWhitespace = (control.value || '').trim().length === 0;
+ isValid = !isWhitespace;
+ if(!isValid)
+ {
+ control.setValue('');
+
+ }
+ }
+ }
+ // can use also on page of input control
+ //
+ return isValid ? null: { 'whitespace': true };
+
+ }
GetUserTypeByLicenseId() {
var Accountnumber = this.adduserFrm.controls['AccountNumberId'].value;
if (Accountnumber == "") { Accountnumber = 0 }
@@ -222,16 +258,19 @@ export class AddUser implements OnInit, AfterViewInit {
this.alerts += 'Last Name is required.';
}
-
- if (this.adduserFrm.value.AccountNumberId == '0') {
- this.alerts += 'Please select account number';
- }
- if (this.adduserFrm.value.UserTypeId == '0') {
- this.alerts += 'Please select user type';
- }
- if (this.adduserFrm.value.ProductEditionId == '0') {
- this.alerts += 'Please select product edition';
- }
+ if(this.router.url === '/adduser')
+ {
+ if (this.adduserFrm.value.AccountNumberId == '0') {
+ this.alerts += 'Please select account number';
+ }
+ if (this.adduserFrm.value.UserTypeId == '0') {
+ this.alerts += 'Please select user type';
+ }
+ if (this.adduserFrm.value.ProductEditionId == '0') {
+ this.alerts += 'Please select product edition';
+ }
+ }
+
if (this.alerts == '') {
var AddUserEntity = this.adduserFrm.value;
return this.userservice.InsertUser(AddUserEntity)
@@ -253,22 +292,23 @@ export class AddUser implements OnInit, AfterViewInit {
}
ResetForm() {
- this._buildForm();
+ var lcid= this.adduserFrm.controls['AccountNumberId'].value;
+ this._buildForm(lcid);
}
- _buildForm() {
+ _buildForm(lcid) {
this.adduserFrm = this.fb.group({
id: [''],
- UserName: [""],
- Password: [""],
- ConfirmPassword: [""],
- FirstName: [""],
- LastName: [""],
- EmailId: [""],
- AccountNumberId: ["0"],
- UserTypeId: ["0"],
- ProductEditionId: ["0"]
-
+ UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]],
+ FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
+ LastName: ['', [Validators.required,this.noWhitespaceValidator]],
+ EmailId: ['', [Validators.required,this.noWhitespaceValidator]],
+ AccountNumberId: ['', Validators.required],
+ UserTypeId: ['', Validators.required],
+ ProductEditionId: ['', Validators.required]
});
+ this.bindUsers(lcid);
}
CheckDropDownOrUp(elm: any) {
var dropDownTop = elm.children[0].offsetTop;
@@ -283,23 +323,31 @@ export class AddUser implements OnInit, AfterViewInit {
}
@HostListener('window:scroll', ['$event'])
onWindowScroll(event) {
- // console.debug("Scroll Event", document.body.scrollTop);
- // see Andr�s Szepesh�zi's comment below
- //console.debug("Scroll Event", window.pageYOffset );
- this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ if(this.router.url === '/adduser')
+ {
+ this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ }
}
@HostListener('window:resize', ['$event'])
onWindowResize(event) {
- this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ if(this.router.url === '/adduser')
+ {
+ this.CheckDropDownOrUp(this.accountNodiv.nativeElement);
+ }
}
- bindUsers() {
-
- //console.log(data);
- //alert(JSON.stringify(data));
- //this.user = data[0];
-
-
+ bindUsers(lcid) {
+ this.alerts = '';
+ if (this.commonService.UserTypeName == "Client Admin" || this.commonService.UserTypeName == "District Admin" )
+ {
+ this.adduserFrm.controls['AccountNumberId'].setValue(lcid)
+ }
+ else
+ {
+ this.accountDropDownText = 'Select';
+ this.adduserFrm.controls['AccountNumberId'].setValue(0)
+ }
+
this.adduserFrm.controls['id'].setValue(0)
this.adduserFrm.controls['FirstName'].setValue('')
this.adduserFrm.controls['LastName'].setValue('')
@@ -307,8 +355,17 @@ export class AddUser implements OnInit, AfterViewInit {
this.adduserFrm.controls['UserName'].setValue('')
this.adduserFrm.controls['Password'].setValue('')
this.adduserFrm.controls['ConfirmPassword'].setValue('')
- this.adduserFrm.controls['AccountNumberId'].setValue(0)
- this.adduserFrm.controls['UserTypeId'].setValue(0)
+
+ if(this.router.url === '/adduser')
+ {
+ this.adduserFrm.controls['UserTypeId'].setValue(0)
+ }
+ else
+ {
+ // for genral admin
+ this.adduserFrm.controls['UserTypeId'].setValue(2)
+ }
+
this.adduserFrm.controls['ProductEditionId'].setValue(0)
}
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts
index 3e573bd..b90c10f 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts
@@ -64,7 +64,7 @@ export class License {
ProductKey: string;
SubscriptionStartDate: Date;
SubscriptionEndDate: Date;
- Renewdate: Date;
+ RenewDate: Date;
EditionLogins: string;
Price: DoubleRange;
NoOfImages: number;
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts
index 0d86130..4478f1a 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts
@@ -66,7 +66,11 @@ export class UpdateUserProfile implements OnInit {
if(control.value!=null)
{
var controlLen=control.value.length;
- if(controlLen!=0)
+ if(controlLen==undefined)//undefined for integer value
+ {
+ isValid=true;
+ }
+ else if(controlLen!=0)
{
const isWhitespace = (control.value || '').trim().length === 0;
isValid = !isWhitespace;
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
index 25250dd..0ba5096 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
@@ -168,7 +168,7 @@
-
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
index 9606625..b83958a 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
@@ -88,12 +88,12 @@ export class UsersList implements OnInit, AfterViewChecked {
});
this.adduserFrm = this.fb.group({
id: [''],
- UserName: ['', [Validators.required, Validators.minLength(8)]],
- Password: ['', [Validators.required, Validators.minLength(8)]],
- ConfirmPassword: ['', Validators.required],
- FirstName: ['', Validators.required],
- LastName: ['', Validators.required],
- EmailId: ['', Validators.required],
+ UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
+ ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]],
+ FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
+ LastName: ['', [Validators.required,this.noWhitespaceValidator]],
+ EmailId: ['', [Validators.required,this.noWhitespaceValidator]],
AccountNumber: [''],
UserTypeTitle: [''],
AccountTypeTitle: [''],
@@ -172,6 +172,33 @@ export class UsersList implements OnInit, AfterViewChecked {
//this.GetUserList();
}
+ public noWhitespaceValidator(control: FormControl) {
+ // new validation for intial whaite space
+ //****Birendra *****/
+ var isValid=false;
+ if(control.value!=null)
+ {
+ var controlLen=control.value.length;
+ if(controlLen==undefined)//undefined for integer value
+ {
+ isValid=true;
+ }
+ else if(controlLen!=0)
+ {
+ const isWhitespace = (control.value || '').trim().length === 0;
+ isValid = !isWhitespace;
+ if(!isValid)
+ {
+ control.setValue('');
+
+ }
+ }
+ }
+ // can use also on page of input control
+ //
+ return isValid ? null: { 'whitespace': true };
+
+ }
handleChange(evt) {
var target = evt.target;
if (target.value == 'true') {
diff --git a/400-SOURCECODE/Admin/src/assets/data/Menu.json b/400-SOURCECODE/Admin/src/assets/data/Menu.json
index 26197de..298d8ac 100644
--- a/400-SOURCECODE/Admin/src/assets/data/Menu.json
+++ b/400-SOURCECODE/Admin/src/assets/data/Menu.json
@@ -87,6 +87,12 @@
"SubMenuStatus": "True"
},
{
+ "SubMenuId": "224",
+ "SubMenuName": "Add General Admin",
+ "SubMenuUrl": "addgeneral",
+ "SubMenuStatus": "True"
+ },
+ {
"SubMenuId": "209",
"SubMenuName": "Unblock User",
"SubMenuUrl": "unblockuser",
@@ -294,6 +300,12 @@
"SubMenuStatus": "True"
},
{
+ "SubMenuId": "224",
+ "SubMenuName": "Add General Admin",
+ "SubMenuUrl": "addgeneral",
+ "SubMenuStatus": "True"
+ },
+ {
"SubMenuId": "209",
"SubMenuName": "Unblock User",
"SubMenuUrl": "unblockuser",