diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index b799b28..8ee87dd 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 = DateTime.Now.Date;// (result[0].RenewalDate == null ? DateTime.Now.Date : result[0].RenewalDate.Value); } } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 5f2753c..c364483 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -754,11 +754,23 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //6. reset the isCommingSoonModel to false in local storage so that upcomming module pop up would not show again to the user after firts time localStorage.setItem('isCommingSoonModel', false); + + // for reseller type user first need to update profile + // only instructor ,not student + if (result.UserTypeId == 7 && result.EditionId == 1 && (result.FirstName == "" || result.EmailId == "" || result.LastName == "")) { - $location.path('/'); + $('#updateprofile').html(LoginMessageConstants.USER_UPDATE_PROFILE); + + $("#profileUpdateModal").modal('show'); + + $(".modal-backdrop").css("opacity", ".5"); + + } + else { + $location.path('/'); + } } - else - { + else { if ($('#dvTerms').length > 0) { $('#dvTerms').html(result.TermsAndConditionsText); } @@ -1145,6 +1157,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.userData = userInfo; $rootScope.userModules = userInfo.Modules; // ShowAssignedModulesPopup(userInfo.Modules);; + // for reseller type user first need to update profile + // allow popup for instructor ,not for student. + if (userInfo.UserTypeId == 7 && userInfo.EditionId == 1 && (userInfo.FirstName == "" || userInfo.EmailId == "" || userInfo.LastName == "")) { + + $('#updateprofile').html(LoginMessageConstants.USER_UPDATE_PROFILE); + + $("#profileUpdateModal").modal('show'); + + $(".modal-backdrop").css("opacity", ".5"); + + } + else { + $location.path('/'); + } } } } @@ -6866,7 +6892,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } $rootScope.reDirectURLToAdmin = function () { - window.location.href = "Admin"; + $("#profileUpdateModal").modal('hide'); + $timeout(function () { + window.location.href = "Admin"; + }, 300) + }; $rootScope.SendAdminAccessRequestMail = function (userInfo) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index 04ae6c8..be715a3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -388,6 +388,7 @@ AIA.constant("LoginConstants", { }); AIA.constant("LoginMessageConstants", { + "USER_UPDATE_PROFILE":"Please update your profile first", "USER_OR_PASSWORD_INCORRECT": "UserId or Password is incorrect.", "RESET_PASSWORD": "Please check you email and reset your password.", "USERID_SENT_IN_EMAIL": "We have sent you userId in email.", diff --git a/400-SOURCECODE/AIAHTML5.Web/index.aspx b/400-SOURCECODE/AIAHTML5.Web/index.aspx index a737613..7a13b17 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.aspx +++ b/400-SOURCECODE/AIAHTML5.Web/index.aspx @@ -1081,6 +1081,30 @@ + +
+License saved successfully.
"; - // this.modalRef = this.modalService.show(template); + } } @@ -401,8 +505,7 @@ export class AddLicense implements OnInit { this.alerts = "License update unsuccessfull."; } else { this._confirmService.activate("License updated successfully.", "alertMsg"); - // this.modalAlerts = "License updated successfully.
"; - //this.modalRef = this.modalService.show(template); + } } @@ -471,7 +574,15 @@ export class AddLicense implements OnInit { } } - LicenseTypeChanged(LicenseTypeId: number) { + LicenseTypeChanged(LicenseTypeId: number,startDate: Date) { + + var currentDate = new Date(); + + if(startDate==undefined) + { + this.insertUpdateLicenseFrm.controls['subscriptionStartDate'].setValue(currentDate); + + } this.totalLogins = 0; this.editionLoginsText = ''; this.license.TotalLogins = this.totalLogins; @@ -483,6 +594,7 @@ export class AddLicense implements OnInit { this.insertUpdateLicenseFrm.controls['subscriptionPrice'].setValue(''); this.insertUpdateLicenseFrm.controls['masterSiteUrl'].setValue(''); this.insertUpdateLicenseFrm.controls['accountNumber'].setValue(''); + this.lstEditionLogins = new Array(); this.lstEdition.forEach(element => { this.lstEditionLogins.push({ Id: element.Id, Title: element.Title, Login: 0 }); @@ -542,7 +654,7 @@ export class AddLicense implements OnInit { if (this.insertUpdateLicenseFrm.controls['renew'].value == true){ if (Date.parse(this.insertUpdateLicenseFrm.controls['subscriptionStartDate'].value) < Date.parse(this.license.SubscriptionEndDate.toString())) { - this.alerts += 'The new subscription start date should be greater than the previous subscription end date'; + this.alerts += 'The new subscription start date should be greater than the previous subscription end date('+this.datePipe.transform(this.license.SubscriptionEndDate, 'MM/dd/yyyy')+')'; } } this.editionLoginsText = ''; @@ -552,8 +664,7 @@ export class AddLicense implements OnInit { this.editionLoginsText += element.Id.toString() + '-' + element.Login + '|'; } }); - } - + } else { this.insertUpdateLicenseFrm.controls['editionLoginArr'].value.forEach(element => { if (element.Login > 0) { @@ -612,16 +723,16 @@ export class AddLicense implements OnInit { if (this.lstCountry.find(C => C.Id == this.license.CountryId).CountryName != "United States") { this.license.StateId = this.lstState.find(C => C.StateName == "Other").Id; this.insertUpdateLicenseFrm.controls['stateId'].setValue(this.license.StateId); - this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); - this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required]); + // this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); + // this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required,this.noWhitespaceValidator]); } else { this.license.StateId = 0; this.insertUpdateLicenseFrm.controls['stateId'].setValue(this.license.StateId); - this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); - this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]); + // this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); + // this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]); } - this.insertUpdateLicenseFrm.controls['phone'].updateValueAndValidity(); + //this.insertUpdateLicenseFrm.controls['phone'].updateValueAndValidity(); } OnStateChange(element: any) { @@ -629,16 +740,16 @@ export class AddLicense implements OnInit { if (this.lstState.find(C => C.Id == this.license.StateId).StateName != "Other") { this.license.CountryId = this.lstCountry.find(C => C.CountryName == "United States").Id; this.insertUpdateLicenseFrm.controls['countryId'].setValue(this.license.CountryId); - this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); - this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]); + // this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); + // this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]); } else { this.license.CountryId = 0; this.insertUpdateLicenseFrm.controls['countryId'].setValue(this.license.CountryId); - this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); - this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required]); + // this.insertUpdateLicenseFrm.controls['phone'].clearValidators(); + // this.insertUpdateLicenseFrm.controls['phone'].setValidators([Validators.required,this.noWhitespaceValidator]); } - this.insertUpdateLicenseFrm.controls['phone'].updateValueAndValidity(); + // this.insertUpdateLicenseFrm.controls['phone'].updateValueAndValidity(); } SubscriptionPriceBlur() { diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html index 4ff43c6..2cede89 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html @@ -97,9 +97,9 @@