Commit 10b2f6289d8f78c19ac61f0f75182a39a21a203f

Authored by Nikita Kulshreshtha
1 parent 29975015

updated code

400-SOURCECODE/.vs/config/applicationhost.config
... ... @@ -162,7 +162,7 @@
162 162 </site>
163 163 <site name="AIAHTML5.API" id="2">
164 164 <application path="/" applicationPool="Clr4IntegratedAppPool">
165   - <virtualDirectory path="/" physicalPath="D:\100-PROJECTS\003-AIAHTML5\400-SOURCECODE\AIAHTML5.API" />
  165 + <virtualDirectory path="/" physicalPath="D:\100-PROJECTS\003-AIAHTML5\AIAHTML5\400-SOURCECODE\AIAHTML5.API" />
166 166 </application>
167 167 <bindings>
168 168 <binding protocol="http" bindingInformation="*:63874:localhost" />
... ... @@ -170,7 +170,7 @@
170 170 </site>
171 171 <site name="AIAHTML5.Web" id="3">
172 172 <application path="/" applicationPool="Clr4IntegratedAppPool">
173   - <virtualDirectory path="/" physicalPath="D:\100-PROJECTS\003-AIAHTML5\400-SOURCECODE\AIAHTML5.Web" />
  173 + <virtualDirectory path="/" physicalPath="D:\100-PROJECTS\003-AIAHTML5\AIAHTML5\400-SOURCECODE\AIAHTML5.Web" />
174 174 </application>
175 175 <bindings>
176 176 <binding protocol="http" bindingInformation="*:55837:localhost" />
... ...
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... ... @@ -11,9 +11,10 @@ namespace AIAHTML5.API.Constants
11 11 public const string USER_NOT_FOUND = "User not found.";
12 12 public const string MAIL_NOT_SENT = "Mail not sent.";
13 13 public const string MAIL_SENT = "Mail sent.";
14   - public const string EXCEPTION_IN_AIAHTML5 = "We are facing some issue. Please try to login after sometime.";
15   - public const string EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT = "Exception Occured in AIAHTML5";
16   - public const string SQL_CONNECTION_ERROR = "We are unable to connect with database. Kindly, contact customer support";
  14 + public const string EXCEPTION_OCCURED = "We are facing some issue. Please try to login after sometime.";
  15 + public const string EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT = "Exception Occuredin AIAHTML5.";
  16 + public const string SQL_CONNECTION_ERROR = "We are unable to connect with database. Please contact customer support.";
  17 + public const string SQL_CONNECTION_ERROR_MAIL_SUBJECT = "SQL Connection error in AIAHTML5.";
17 18 public const string KEY_ID = "id";
18 19 public const string KEY_TITLE = "title";
19 20 public const string KEY_NAME = "name";
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... ... @@ -158,7 +158,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
158 158 logger.Fatal("SqlException occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
159 159  
160 160 ArrayList supportMailList = UserUtility.GetSupportMailList();
161   - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR;
  161 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
162 162 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
163 163 UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
164 164  
... ... @@ -174,7 +174,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
174 174 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
175 175 UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
176 176  
177   - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_IN_AIAHTML5) };
  177 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
178 178  
179 179 }
180 180  
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/ForgotUserController.cs
... ... @@ -82,7 +82,7 @@ namespace AIAHTML5.API.Controllers
82 82 logger.Fatal("SqlException occured for emailId =" + userInfo["emailId"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
83 83  
84 84 ArrayList supportMailList = UserUtility.GetSupportMailList();
85   - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR;
  85 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
86 86 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
87 87 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
88 88  
... ... @@ -96,7 +96,7 @@ namespace AIAHTML5.API.Controllers
96 96 string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
97 97 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
98 98 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
99   - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_IN_AIAHTML5) };
  99 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
100 100  
101 101 }
102 102 }
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs
... ... @@ -65,7 +65,7 @@ namespace AIAHTML5.API.Controllers
65 65 logger.Fatal("SqlException occured for licenseeAccountNumber =" + userLicenseInfo["licenseeAccountNumber"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
66 66  
67 67 ArrayList supportMailList = UserUtility.GetSupportMailList();
68   - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR;
  68 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
69 69 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
70 70 UserUtility.SendEmail(userLicenseInfo, supportMailList, "", mailSubject, mailBody);
71 71  
... ... @@ -79,7 +79,7 @@ namespace AIAHTML5.API.Controllers
79 79 string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
80 80 string mailBody = "MESSAGE: " + ex.Message + ", STACKTRACE: " + ex.StackTrace;
81 81 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
82   - response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.EXCEPTION_IN_AIAHTML5) };
  82 + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
83 83 return response;
84 84 }
85 85  
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs
... ... @@ -66,7 +66,7 @@ namespace AIAHTML5.API.Controllers
66 66 logger.Fatal("SqlException occured for loginId =" + userInfo["emailId"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
67 67  
68 68 ArrayList supportMailList = UserUtility.GetSupportMailList();
69   - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR;
  69 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
70 70 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
71 71 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
72 72  
... ... @@ -80,7 +80,7 @@ namespace AIAHTML5.API.Controllers
80 80 string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
81 81 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
82 82 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
83   - response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_IN_AIAHTML5) };
  83 + response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
84 84 return response;
85 85 }
86 86  
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/UnblockUserController.cs
... ... @@ -62,7 +62,7 @@ namespace AIAHTML5.API.Controllers
62 62 logger.Fatal("SqlException occured for emailId =" + emailId + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
63 63  
64 64 ArrayList supportMailList = UserUtility.GetSupportMailList();
65   - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR;
  65 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
66 66 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
67 67 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
68 68  
... ... @@ -77,7 +77,7 @@ namespace AIAHTML5.API.Controllers
77 77 string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
78 78 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
79 79 UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody);
80   - response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_IN_AIAHTML5) };
  80 + response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
81 81 return response;
82 82 }
83 83  
... ...
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... ... @@ -198,7 +198,7 @@ namespace AIAHTML5.API.Models
198 198 adapter.Fill(ds);
199 199  
200 200  
201   - if (ds.Tables.Count > 0)
  201 + if (ds!=null && ds.Tables.Count > 0)
202 202 {
203 203 DataTable dt = ds.Tables[0];
204 204  
... ... @@ -749,7 +749,7 @@ namespace AIAHTML5.API.Models
749 749 {
750 750 logger.Debug(" inside GetUserBlockedStatusByUserId for UserId= " + userId);
751 751  
752   - BlockedUser blockedUser = new BlockedUser();
  752 + BlockedUser blockedUser = null;
753 753 DataTable dt = null;
754 754  
755 755 conn = new SqlConnection(dbConnectionString);
... ... @@ -765,6 +765,7 @@ namespace AIAHTML5.API.Models
765 765  
766 766 if (dt!= null && dt.Rows.Count > 0)
767 767 {
  768 + blockedUser = new BlockedUser();
768 769 foreach (DataRow dr in dt.Rows)
769 770 {
770 771 blockedUser.Id = Convert.ToInt32(dr["Id"]);
... ...
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... ... @@ -199,7 +199,7 @@ namespace AIAHTML5.API.Models
199 199  
200 200  
201 201 DBModel objModel = new DBModel();
202   -
  202 + result = objModel.DeleteIncorrectLoginAttempts(userId);
203 203 return result;
204 204 }
205 205  
... ... @@ -211,7 +211,7 @@ namespace AIAHTML5.API.Models
211 211  
212 212  
213 213 DBModel objModel = new DBModel();
214   -
  214 + incorrectLoginAttemptCount = objModel.GetIncorrectLoginAttempts(userId);
215 215 return incorrectLoginAttemptCount;
216 216 }
217 217  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -134,6 +134,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
134 134 }
135 135  
136 136 $rootScope.AuthenticateUser = function (userInfo) {
  137 + $rootScope.errorMessage = "";
137 138 if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) {
138 139  
139 140 // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING);
... ... @@ -152,17 +153,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
152 153 $rootScope.errorMessage = LoginMessageConstants.INVALID_USER;
153 154 $("#messageModal").modal('show');
154 155 }
155   - else if (result == LoginConstants.EXCEPTION_IN_AIAHTML5) {
156   - //alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
157   - $rootScope.isVisibleLogin = true;
158   - $rootScope.errorMessage = LoginMessageConstants.EXCEPTION_IN_AIAHTML5;
159   - $("#messageModal").modal('show');
160   - }
161   - else if (result == LoginConstants.SQL_CONNECTION_ERROR) {
162   - $rootScope.isVisibleLogin = true;
163   - $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR;
164   - $("#messageModal").modal('show');
165   - }
166 156 else {
167 157 if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) {
168 158  
... ... @@ -222,7 +212,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
222 212 }
223 213 else if (result.LicenseInfo != null && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) {
224 214 $rootScope.isVisibleLogin = true;
225   - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
  215 + $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
226 216 $("#messageModal").modal('show');
227 217 }
228 218 else {
... ... @@ -271,7 +261,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
271 261 console.log(' Error in authentication = ' + error.statusText);
272 262 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
273 263 $rootScope.isVisibleLogin = true;
274   - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS;
  264 + $rootScope.errorMessage = LoginConstant.EXCEPTION_OCCURED;
275 265 $("#messageModal").modal('show');
276 266 }
277 267 }
... ... @@ -311,19 +301,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
311 301 $("#messageModal").css("z-index", 111112);
312 302 localStorage.removeItem("loggedInUserDetails");
313 303 }
314   - else if (result == LoginConstants.SQL_CONNECTION_ERROR) {
315   - console.log(result);
316   - $rootScope.isVisibleLogin = true;
317   - $('#dvTermCondition').fadeIn();
318   - $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE;
319   - $("#messageModal").modal('show');
320   - $("#messageModal").css("z-index", 111112);
321   - localStorage.removeItem("loggedInUserDetails");
322   - }
  304 +
323 305 },
324 306 function (error) {
325 307 console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText
326 308 $rootScope.isVisibleLogin = true;
  309 + $rootScope.isVisibleLogin = true;
  310 + $rootScope.errorMessage = LoginConstant.EXCEPTION_OCCURED;
  311 + $("#messageModal").modal('show');
327 312 $('#dvTermCondition').fadeIn();
328 313 });
329 314 }
... ... @@ -404,16 +389,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
404 389 $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
405 390 $("#messageModal").modal('show');
406 391 }
407   - else if (result == LoginConstants.EXCEPTION_IN_AIAHTML5) {
408   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
409   - $rootScope.errorMessage = LoginMessageConstants.EXCEPTION_IN_AIAHTML5;
410   - $("#messageModal").modal('show');
411   - }
412   - else if (result == LoginConstants.SQL_CONNECTION_ERROR) {
413   - $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR;
414   - $("#messageModal").modal('show');
415   - }
416   - else if (result == LoginConstants.MAIL_NOT_SENT) {
  392 + else if (result == LoginConstants.MAIL_NOT_SENT) {
417 393 // alert(LoginMessageConstants.MAIL_NOT_SENT);
418 394 $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT;
419 395 $("#messageModal").modal('show');
... ... @@ -449,7 +425,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
449 425 function (error) {
450 426 console.log(' Error in authentication = ' + error.statusText);
451 427 // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS);
452   - $rootScope.errorMessage = LoginConstants.EXCEPTION_IN_AIAHTML5;
  428 + $rootScope.errorMessage = LoginConstants.EXCEPTION_OCCURED;
453 429 $("#messageModal").modal('show');
454 430 });
455 431 }
... ... @@ -497,7 +473,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
497 473 $("#messageModal").modal('show');
498 474  
499 475 }
500   - else if (result == LoginConstants.EXCEPTION_IN_AIAHTML5) {
  476 + else if (result == LoginConstants.EXCEPTION_OCCURED) {
501 477 // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
502 478 $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
503 479 $("#messageModal").modal('show');
... ... @@ -573,7 +549,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
573 549 },
574 550 function (error) {
575 551 console.log(' Error in authentication = ' + error.statusText);
576   - $rootScope.errorMessage = LoginMessageConstants.EXCEPTION_IN_AIAHTML5;
  552 + $rootScope.errorMessage = LoginMessageConstants.EXCEPTION_OCCURED;
577 553 $("#messageModal").modal('show');
578 554 }
579 555 );
... ...
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... ... @@ -306,8 +306,8 @@ AIA.constant(&quot;LoginConstants&quot;, {
306 306 "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.",
307 307 "MAIL_NOT_SENT": "Mail not sent.",
308 308 "MAIL_SENT": "Mail sent.",
309   - "SQL_CONNECTION_ERROR ": "We are unable to connect with database. Please contact customer support",
310   - "EXCEPTION_IN_AIAHTML5": "We are facing some issue. Please try to login after sometime.",
  309 + "SQL_CONNECTION_ERROR": "We are unable to connect with database. Please contact customer support",
  310 + "EXCEPTION_OCCURED": "We are facing some issue. Please try to login after sometime.",
311 311 "E_NO_ERROR": "0",
312 312 "E_USER_NOT_EXIST": "1",
313 313 "E_PASSWORD_NOT_MATCH": "2",
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
1   -AIA.factory('AuthenticationService', function ($http, $q) {
  1 +AIA.factory('AuthenticationService', function ($http, $q, $rootScope, LoginConstants) {
2 2 return {
3 3 authenticateUser: function (userInfo) {
4 4 var deferred = $q.defer();
... ... @@ -13,7 +13,11 @@
13 13 deferred.resolve(data);
14 14 }).error(function (data, status, headers, config) {
15 15 console.log('error')
16   - deferred.reject(status);
  16 + deferred.reject(data);
  17 + $rootScope.isVisibleLogin = true;
  18 + $rootScope.errorMessage = data;
  19 + $("#messageModal").modal('show');
  20 +
17 21 });
18 22 return deferred.promise;
19 23 },
... ... @@ -32,6 +36,10 @@
32 36 }).error(function (data, status, headers, config) {
33 37 console.log('error')
34 38 deferred.reject(status);
  39 +
  40 + $rootScope.isVisibleLogin = true;
  41 + $rootScope.errorMessage = data;
  42 + $("#messageModal").modal('show');
35 43 });
36 44 return deferred.promise;
37 45 },
... ... @@ -50,6 +58,10 @@
50 58 }).error(function (data, status, headers, config) {
51 59 console.log('error')
52 60 deferred.reject(status);
  61 +
  62 + $rootScope.isVisibleLogin = true;
  63 + $rootScope.errorMessage = data;
  64 + $("#messageModal").modal('show');
53 65 });
54 66 return deferred.promise;
55 67 },
... ... @@ -68,6 +80,10 @@
68 80 }).error(function (data, status, headers, config) {
69 81 console.log('error')
70 82 deferred.reject(status);
  83 +
  84 + $rootScope.isVisibleLogin = true;
  85 + $rootScope.errorMessage = data;
  86 + $("#messageModal").modal('show');
71 87 });
72 88 return deferred.promise;
73 89 },
... ... @@ -86,6 +102,10 @@
86 102 }).error(function (data, status, headers, config) {
87 103 console.log('error')
88 104 deferred.reject(status);
  105 +
  106 + $rootScope.isVisibleLogin = true;
  107 + $rootScope.errorMessage = data;
  108 + $("#messageModal").modal('show');
89 109 });
90 110 return deferred.promise;
91 111 }
... ...