diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/UnblockUserController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/UnblockUserController.cs index 0129a50..92b8ba1 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/UnblockUserController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/UnblockUserController.cs @@ -39,9 +39,9 @@ namespace AIAHTML5.API.Controllers try { - dynamic user = AIAHTML5.API.Models.DBModel.GetUserDetailsByEmailId(emailId); + User user = AIAHTML5.API.Models.DBModel.GetUserDetailsByEmailId(emailId); - if (user!=null && user.Count > 0) + if (user!=null) { int result = 0; diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 2ef57e3..4ff8923 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -430,11 +430,12 @@ namespace AIAHTML5.API.Models if (ds!= null && ds.Tables.Count > 0) { - license = new License(); - + DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { + license = new License(); + foreach (DataRow dr in dt.Rows) { DateTime date; @@ -820,10 +821,7 @@ namespace AIAHTML5.API.Models blockedUsersList.Add(blockedUser); } } - else - { - blockedUser = new BlockedUser(); - } + return blockedUsersList; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 4cac29a..3580450 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -102,11 +102,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic document.getElementById("forgetPwdForm").reset() $("#forgotPwdModal").modal("show"); $(".modal-backdrop").css("opacity", ".5"); + $("body.modal-open").css("padding-right", "0px"); } $rootScope.forgotUserModalShow = function () { document.getElementById("forgetUSerIdForm").reset(); $("#forgotUserModal").modal("show"); $(".modal-backdrop").css("opacity", ".5"); + $("body.modal-open").css("padding-right", "0px"); } $rootScope.initializeAIA = function () { @@ -170,26 +172,26 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.errorMessage = LoginMessageConstants.USER_BLOCKED; $("#messageModal").modal('show'); } - else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) + else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; $("#messageModal").modal('show'); } - else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { + else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; $("#messageModal").modal('show'); } - else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { + else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; $("#messageModal").modal('show'); } - else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { + else if ((result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; $("#messageModal").modal('show'); @@ -199,18 +201,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; $("#messageModal").modal('show'); } - else if (result.LicenseInfo!=null && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { + else if ( (result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; $("#messageModal").modal('show'); } - else if (result.LicenseInfo != null && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { + else if ((result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; $("#messageModal").modal('show'); } - else if (result.LicenseInfo != null && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { + else if ((result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { $rootScope.isVisibleLogin = true; $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; $("#messageModal").modal('show'); @@ -261,7 +263,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic console.log(' Error in authentication = ' + error.statusText); // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.isVisibleLogin = true; - $rootScope.errorMessage = LoginConstant.EXCEPTION_OCCURED; + $rootScope.errorMessage = error; $("#messageModal").modal('show'); } } @@ -307,7 +309,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText $rootScope.isVisibleLogin = true; $rootScope.isVisibleLogin = true; - $rootScope.errorMessage = LoginConstant.EXCEPTION_OCCURED; + $rootScope.errorMessage = error; $("#messageModal").modal('show'); $('#dvTermCondition').fadeIn(); }); @@ -385,11 +387,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic AuthenticationService.SendMailToUser(userInfo) .then(function (result) { if (result == LoginConstants.USER_NOT_FOUND) { + removeEmailPopUp(); // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } - else if (result == LoginConstants.MAIL_NOT_SENT) { + else if (result == LoginConstants.MAIL_NOT_SENT) { + removeEmailPopUp(); // alert(LoginMessageConstants.MAIL_NOT_SENT); $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT; $("#messageModal").modal('show'); @@ -397,14 +401,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic else { if (result == LoginMessageConstants.MAIL_SENT) { var message; - if ($('.forgot-sm').length > 0) { - $('.forgot-sm').fadeOut(); - $('.forgot-sm').modal('hide'); - } - if ($('.forgot-sm1').length > 0) { - $('.forgot-sm1').fadeOut(); - $('.forgot-sm1').modal('hide'); - } + removeEmailPopUp(); + if (isMailForForgotPassword) { if (userInfo.unblockUser) message = LoginMessageConstants.USER_UNBLOCK_LINK_IN_EMAIL; @@ -424,26 +422,39 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }, function (error) { console.log(' Error in authentication = ' + error.statusText); + removeEmailPopUp(); // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginConstants.EXCEPTION_OCCURED; + $rootScope.errorMessage = error; $("#messageModal").modal('show'); }); } else { - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); + // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); + removeEmailPopUp(); $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } } else { //alert(LoginMessageConstants.BLANK_EMAIL_ID); + removeEmailPopUp(); $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID; $("#messageModal").modal('show'); } }; - + function removeEmailPopUp() + { + if ($('#forgotUserModal').length > 0) { + $('#forgotUserModal').fadeOut(); + $('#forgotUserModal').modal('hide'); + } + if ($('#forgotPwdModal').length > 0) { + $('#forgotPwdModal').fadeOut(); + $('#forgotPwdModal').modal('hide'); + } + } function validateEmail(email) { @@ -505,7 +516,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic function (error) { console.log(' Error in authentication = ' + error.statusText); // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = error; $("#messageModal").modal('show'); }); @@ -549,7 +560,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }, function (error) { console.log(' Error in authentication = ' + error.statusText); - $rootScope.errorMessage = LoginMessageConstants.EXCEPTION_OCCURED; + $rootScope.errorMessage = error; $("#messageModal").modal('show'); } ); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 21530dd..ab82845 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -35,7 +35,7 @@ deferred.resolve(data); }).error(function (data, status, headers, config) { console.log('error') - deferred.reject(status); + deferred.reject(data); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = data; @@ -57,7 +57,7 @@ deferred.resolve(data); }).error(function (data, status, headers, config) { console.log('error') - deferred.reject(status); + deferred.reject(data); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = data; @@ -79,7 +79,7 @@ deferred.resolve(data); }).error(function (data, status, headers, config) { console.log('error') - deferred.reject(status); + deferred.reject(data); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = data; @@ -101,7 +101,7 @@ deferred.resolve(data); }).error(function (data, status, headers, config) { console.log('error') - deferred.reject(status); + deferred.reject(data); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = data;