diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index b84e0ba..cd6b850 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", -function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants) { +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants","LoginMessageConstants", +function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, LoginMessageConstants) { //$scope.pageToOpen = { // name: 'MainMenu' @@ -98,7 +98,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.AuthenticateUser = function (userInfo) { if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) { - alert("Username or Password is missing."); + alert(LoginMessageConstants.USER_CREDENTIALS_MISSING); $rootScope.isVisibleLogin = true; } else { @@ -190,10 +190,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic alert(LoginConstants.USER_NOT_FOUND); } else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { - alert("An error occured."); + alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); } else if (result == LoginConstants.MAIL_NOT_SENT) { - alert("Due to some issue, email not sent."); + alert(LoginMessageConstants.MAIL_NOT_SENT); } else { if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { @@ -207,9 +207,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $('.forgot-sm1').modal('hide'); } if (isMailForPassword) - message = "Please check you email and reset your password."; + message = LoginMessageConstants.RESET_PASSWORD; else - message = "Please check you email, sent UserId in your email."; + message = LoginMessageConstants.USERID_SENT_IN_EMAIL alert(message); @@ -223,11 +223,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }); } else { - alert("Please enter correct email id"); + alert(LoginMessageConstants.INCORRECT_EMAIL_ID); } } else { - alert("Please enter your email id"); + alert(LoginMessageConstants.BLANK_EMAIL_ID); } }; @@ -259,14 +259,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic .then( function (result) { if (result == LoginConstants.USER_NOT_FOUND) { - alert(LoginConstants.USER_NOT_FOUND); + alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); } else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { - alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); + alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); } else { if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { - alert('Your password has been reset.'); + alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); $rootScope.isVisibleLogin = true; $rootScope.isVisibleResetPass = false; $location.url("/") ; @@ -275,11 +275,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }, function (error) { console.log(' Error in authentication = ' + error.statusText); - alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); + alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); }); } else { - $rootScope.errorMesaage = "Your new password and confirm password not matched!"; + $rootScope.errorMesaage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index 60f4391..467be8a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -281,12 +281,25 @@ AIA.constant('ImageTypes', ['Illustration', 'Cadaver Photograph', 'Radiograph']) //login constant. AIA.constant("LoginConstants", { - "USER_NOT_FOUND": "UserId or Password is incorrect.", + "USER_NOT_FOUND": "User not found.", "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", - "MAIL_NOT_SENT": "We are facing some issue in sending email. Please try after sometime." + "MAIL_NOT_SENT": "Mail not sent." }) +AIA.constant("LoginMessageConstants", { + "USER_OR_PASSWORD_INCORRECT": "UserId or Password is incorrect.", + "RESET_PASSWORD": "Please check you email and reset your password.", + "USERID_SENT_IN_EMAIL": "Please check you email, sent UserId in your email.", + "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", + "MAIL_NOT_SENT": "We are facing some issue in sending email. Please try after sometime.", + "INCORRECT_EMAIL_ID": "Please enter correct email id", + "BLANK_EMAIL_ID": "Please enter your email id", + "PASSWORD_RESET_MESSAGE": "Your password has been reset.", + "NEW_AND_OLD_PASSWORD_DONOT_MATCH": "Your new password and confirm password not matched!", + "USER_CREDENTIALS_MISSING":"Please Enter your credentials" + +}) AIA.config(function ($routeProvider, pages, $locationProvider) {