diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index 8ee87dd..b033d7b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -43,6 +43,7 @@ namespace AIAHTML5.ADMIN.API.Models public DateTime RenewDate { get; set; } public DateTime ModifyDate { get; set; } public bool IsActive { get; set; } + public string LicStatus { get; set; } public int? TotalLogins { get; set; } public string EditionLogins { get; set; } public decimal Price { get; set; } @@ -99,6 +100,7 @@ namespace AIAHTML5.ADMIN.API.Models LicenseObj.RenewDate = DateTime.ParseExact((item.RenewDate == "" ? "01/01/0001" : item.RenewDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false); + LicenseObj.LicStatus = item.LicenseStatus; LicenseList.Add(LicenseObj); } recordCount = (int)spRecordCount.Value; diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/ErrorHelper.cs b/400-SOURCECODE/AIAHTML5.API/Constants/ErrorHelper.cs index ef97db0..35ef565 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/ErrorHelper.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/ErrorHelper.cs @@ -71,6 +71,8 @@ namespace AIAHTML5.API.Constants public const int EDITION_NOT_EXIST = 3; public const int MASTER_SITEIP_NOT_EXIST = 2; public const int LICENSE_INACTIVE = 6; + public const int LICENSE_EXPIRED = 7; + public const int LICENSE_NOTSTARTED = 8; /// diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index eca2c65..d05b7f2 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -307,15 +307,26 @@ namespace AIAHTML5.API.Controllers string expirationDate = null; bool isLicenseExpired = false; + // validate license start date + string startDate = null; + bool isSubscriptionNotStart = false; + if (userInfo.LicenseSubscriptions != null) { + isSubscriptionNotStart = AIAHTML5.API.Models.Users.checkIfLicenseNotStarted(userInfo.LicenseSubscriptions, out startDate); + isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate); } if (isLicenseExpired) { userInfo.IsSubscriptionExpired = isLicenseExpired; - userInfo.SubscriptionExpirationDate = expirationDate; + userInfo.SubscriptionExpirationDate = expirationDate; + } + else if (isSubscriptionNotStart) + { + userInfo.IsSubscriptionNotStart = isSubscriptionNotStart; + userInfo.SubscriptionStartDate = startDate; } else { @@ -323,7 +334,6 @@ namespace AIAHTML5.API.Controllers userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId, Convert.ToInt16(userInfo.EditionId)); - } } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index 8b934c9..a404612 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -47,7 +47,9 @@ namespace AIAHTML5.API.Models public License LicenseInfo { get; set; } public LicenseSubscriptionDetails LicenseSubscriptions { get; set; } public LicenseUserExportedImageDetail UserExportImageDetail { get; set; } - + + public bool IsSubscriptionNotStart { get; set; } + public string SubscriptionStartDate { get; set; } public bool IsSubscriptionExpired { get; set; } public string SubscriptionExpirationDate { get; set; } public string TermsAndConditionsTitle { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 2a71239..0e69933 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -159,6 +159,27 @@ namespace AIAHTML5.API.Models return false; } + internal static bool checkIfLicenseNotStarted(LicenseSubscriptionDetails subscriptionDetail, out string startDate) + { + startDate = string.Empty; + bool IsSubscriptionNotStart = false; + + // validate stat date for new license + if (subscriptionDetail != null && subscriptionDetail.RenewalDate==null) + { + DateTime? SubscriptionValidFrom = subscriptionDetail.SubscriptionValidFrom; + if (SubscriptionValidFrom != null && SubscriptionValidFrom.Value.Date <= DateTime.Now.Date) + { + IsSubscriptionNotStart = false; + } + else + { + IsSubscriptionNotStart = true; + startDate = subscriptionDetail.SubscriptionValidFrom.Value.Date.ToString("MM/dd/yyyy").ToString(); + } + } + return IsSubscriptionNotStart; + } internal static bool checkIfLicenseExpired(LicenseSubscriptionDetails subscriptionDetail, out string expirationDate) { expirationDate = string.Empty; @@ -507,9 +528,15 @@ namespace AIAHTML5.API.Models public static User ValidateSiteLogin(String strSiteIP, String strAcccountNumber, String strUrlReferer, string strEdition, int intSiteId) { - bool isExpired = false; User userInfo = null; - + + string expirationDate = null; + bool isLicenseExpired = false; + + // validate license start date + string startDate = null; + bool isSubscriptionNotStart = false; + int intLicenseId = 0; int intEditionId = Convert.ToInt16(strEdition); @@ -541,26 +568,32 @@ namespace AIAHTML5.API.Models //05.3 get licenseSubscription details userInfo.LicenseSubscriptions = AIAHTML5.API.Models.Users.getLicenseSubscriptionDetails( userInfo.LicenseInfo.Id); - //05.4 check the License expiration irespective of either user is active or not because on AIA - //we shows the License expiration message for inactive users too - + //05.4 check the License expiration irespective of either user is active or not because on AIA + //we shows the License expiration message for inactive users too if (userInfo.LicenseSubscriptions != null) { - DateTime? subscriptionValidThrough = userInfo.LicenseSubscriptions.SubscriptionValidThrough; - if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date >= DateTime.Now.Date) - { - isExpired = false; - } - else - { - isExpired = true; - } - } + isSubscriptionNotStart = AIAHTML5.API.Models.Users.checkIfLicenseNotStarted(userInfo.LicenseSubscriptions, out startDate); + isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate); + } + if (Convert.ToBoolean(licRow["IsActive"]) != true) + { + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_INACTIVE; + } + else if(isLicenseExpired) + { + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_EXPIRED; + userInfo.SubscriptionExpirationDate = expirationDate; + } + else if (isSubscriptionNotStart) + { + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_NOTSTARTED; + userInfo.SubscriptionStartDate = startDate; - if (!isExpired && Convert.ToBoolean(licRow["IsActive"]) == true) + } + else { //User objUserContext = new User(); userInfo.Id = 0; @@ -601,25 +634,19 @@ namespace AIAHTML5.API.Models // get edition features details userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId); - - if (intLicenseId > 0) userInfo.Modules = getModuleListByLicenseId(intLicenseId); else userInfo.Modules = getAllModulesList(); - // get exported image detail userInfo.UserExportImageDetail = getExportedImageDetail(userInfo.LicenseId); - // insert login details - objDBModel.InsertSiteLoginDetails(strAcccountNumber, strSiteIP, strEdition); - - } - else - { - userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_INACTIVE; + // insert login details + objDBModel.InsertSiteLoginDetails(strAcccountNumber, strSiteIP, strEdition); } + + } else { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 05f20a4..4eacf2c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -17,7 +17,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location 'width': 0, 'height': 0, 'minimised': false, - 'maximised': false, + 'maximised': true, 'minmaxAutoEvent':true, }; @@ -356,9 +356,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.Set3DwindowStoreData(windowviewid, 'currentViewTitle', ThreeDTitle); localStorage.setItem("currentViewTitle", ThreeDTitle); - var isMaximize = $scope.ThreeDOpenInOtherModules.maximised; - var isMinimize = $scope.ThreeDOpenInOtherModules.minimised; - + var isMaximize = $scope.ThreeDOpenInOtherModules.maximised!=undefined?$scope.ThreeDOpenInOtherModules.maximised:false; + var isMinimize = $scope.ThreeDOpenInOtherModules.minimised!=undefined?$scope.ThreeDOpenInOtherModules.minimised:false; + $scope.Set3DwindowStoreData(windowviewid, 'maximised', isMaximize); $scope.Set3DwindowStoreData(windowviewid, 'minimised', isMinimize); if($location.url()== "/curriculum-builder-detail") { @@ -421,7 +421,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } else { $scope.jsPanelWidth = $(window).outerWidth() - 20; - $scope.jsPanelHeight = $(window).outerHeight() - 105; + $scope.jsPanelHeight = $(window).outerHeight() - 90; $scope.jsPanelLeft = 1; $scope.jsPanelTop = 70; } @@ -435,7 +435,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location theme: 'success', currentController: '3dAController', parentSlug: $scope.Get3DwindowStoreData(windowviewid, 'parentSlugName'), - content: '
' + + content: '
' + '' + '
', title: tittle, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index 98b7b11..ca65a6b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -16,8 +16,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }; - $scope.numPerImage = 100; - $scope.maxSize = 5; + $scope.numPerImage = 108; + $scope.maxSize = 10; $scope.totalimage =0; $scope.numPages = function () { @@ -77,7 +77,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'width': 0, 'height': 0, 'minimised': false, - 'maximised': false, + 'maximised': true, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, }; @@ -223,11 +223,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (windowviewid == undefined) windowviewid = $rootScope.MULTI_VIEW_ID; $scope.DisableUI(); - $scope.activeTab = tabToSet; + + if(tabToSet=="" ||tabToSet==undefined) + { + $scope.activeTab=1; + } + else + { + $scope.activeTab = tabToSet; + } var pretab = $rootScope.getLocalStorageValue("currentAITabView"); - if (pretab != tabToSet) { + if (pretab != $scope.activeTab) { $scope.currentPage = 1; localStorage.setItem("currentpage", $scope.currentPage); } @@ -240,7 +248,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var searchText = $rootScope.getLocalStorageValue("SearchText"); var SearchByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); $scope.hiderow = false; - if (tabToSet == 2) { + if ($scope.activeTab == 2) { var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected"); @@ -494,9 +502,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout .select().slice(0, $scope.numPerImage); $('#grid-view').empty(); - var $e1 = $('
@@ -1181,12 +1181,12 @@ -