Commit 246d84ae7f577d1e1c1e9be645f12cdd38645493
1 parent
3579fceb
Committing sql connection error handling in case of 'updateLicenseTerm'
Showing
10 changed files
with
352 additions
and
203 deletions
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... | ... | @@ -11,6 +11,7 @@ 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 SQL_CONNECTION_ERROR = "SQL Connection Error"; | |
14 | 15 | |
15 | 16 | public const string KEY_ID = "id"; |
16 | 17 | public const string KEY_TITLE = "title"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -41,7 +41,7 @@ namespace AIAHTML5.API.Controllers |
41 | 41 | { |
42 | 42 | |
43 | 43 | dynamic authenticationRepsonse = AIAHTML5.API.Models.Users.GetUserDetailsForAuthenticatedUser(credentials); |
44 | - if (Convert.ToString(authenticationRepsonse) != AIAConstants.USER_NOT_FOUND && Convert.ToString(authenticationRepsonse) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
44 | + if (Convert.ToString(authenticationRepsonse) != AIAConstants.USER_NOT_FOUND && Convert.ToString(authenticationRepsonse) != AIAConstants.ERROR_IN_FECTHING_DETAILS && Convert.ToString(authenticationRepsonse)!= AIAConstants.SQL_CONNECTION_ERROR) | |
45 | 45 | { |
46 | 46 | //string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(authenticationRepsonse); |
47 | 47 | return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) }; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/ForgotUserController.cs
... | ... | @@ -76,7 +76,7 @@ namespace AIAHTML5.API.Controllers |
76 | 76 | logger.Debug("inside POST in ForgotUserController for emailId = " + userInfo["emailId"]); |
77 | 77 | |
78 | 78 | dynamic userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); |
79 | - if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
79 | + if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS && Convert.ToString(userData) != AIAConstants.SQL_CONNECTION_ERROR) | |
80 | 80 | { |
81 | 81 | //logger.Debug("inside if in ForgotUserController userData.loginId= " + userData.LoginId); |
82 | 82 | bool isMailSent = false; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs
... | ... | @@ -32,12 +32,18 @@ namespace AIAHTML5.API.Controllers |
32 | 32 | logger.Debug("inside POST"); |
33 | 33 | HttpResponseMessage response = null; |
34 | 34 | |
35 | - int result = AIAHTML5.API.Models.Users.UpdateLicenseTerm(licenseeAccountNumber); | |
36 | - if (result > 0) | |
37 | - response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) }; | |
35 | + dynamic result = AIAHTML5.API.Models.Users.UpdateLicenseTerm(licenseeAccountNumber); | |
36 | + if (Convert.ToString(result) != AIAConstants.SQL_CONNECTION_ERROR) | |
37 | + { | |
38 | + if (Convert.ToInt32(result) > 0) | |
39 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) }; | |
40 | + else | |
41 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) }; | |
42 | + } | |
38 | 43 | else |
39 | - response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) }; | |
40 | - | |
44 | + { | |
45 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) }; | |
46 | + } | |
41 | 47 | return response; |
42 | 48 | } |
43 | 49 | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs
... | ... | @@ -35,9 +35,9 @@ namespace AIAHTML5.API.Controllers |
35 | 35 | { |
36 | 36 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
37 | 37 | logger.Debug("inside POST"); |
38 | - User userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
38 | + dynamic userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
39 | 39 | HttpResponseMessage response = null; |
40 | - if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
40 | + if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS && Convert.ToString(userData) != AIAConstants.SQL_CONNECTION_ERROR) | |
41 | 41 | { |
42 | 42 | int result = 0; |
43 | 43 | if (!String.IsNullOrEmpty(userInfo["newPassword"].ToString())) |
... | ... | @@ -46,9 +46,13 @@ namespace AIAHTML5.API.Controllers |
46 | 46 | if (result > 0) |
47 | 47 | response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_SUCCESS) }; |
48 | 48 | else |
49 | - response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_FAILED) }; | |
49 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_FAILED) }; | |
50 | 50 | } |
51 | 51 | } |
52 | + else | |
53 | + { | |
54 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData.ToString()) }; | |
55 | + } | |
52 | 56 | |
53 | 57 | return response; |
54 | 58 | } | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -434,94 +434,87 @@ namespace AIAHTML5.API.Models |
434 | 434 | User objUser = new User(); |
435 | 435 | DBModel objModel = new DBModel(); |
436 | 436 | |
437 | - try | |
438 | - { | |
439 | - conn = new SqlConnection(dbConnectionString); | |
440 | - cmd = new SqlCommand(); | |
441 | - SqlDataAdapter adapter; | |
442 | - SqlParameter param; | |
443 | - DataSet ds = new DataSet(); | |
437 | + conn = new SqlConnection(dbConnectionString); | |
438 | + cmd = new SqlCommand(); | |
439 | + SqlDataAdapter adapter; | |
440 | + SqlParameter param; | |
441 | + DataSet ds = new DataSet(); | |
444 | 442 | |
445 | - cmd.Connection = conn; | |
446 | - cmd.CommandText = "GetUserInfoByEmailId"; | |
447 | - cmd.CommandType = CommandType.StoredProcedure; | |
443 | + cmd.Connection = conn; | |
444 | + cmd.CommandText = "GetUserInfoByEmailId"; | |
445 | + cmd.CommandType = CommandType.StoredProcedure; | |
448 | 446 | |
449 | - param = new SqlParameter("@sEmailId", emailId); | |
450 | - param.Direction = ParameterDirection.Input; | |
451 | - param.DbType = DbType.String; | |
452 | - cmd.Parameters.Add(param); | |
447 | + param = new SqlParameter("@sEmailId", emailId); | |
448 | + param.Direction = ParameterDirection.Input; | |
449 | + param.DbType = DbType.String; | |
450 | + cmd.Parameters.Add(param); | |
453 | 451 | |
454 | - adapter = new SqlDataAdapter(cmd); | |
455 | - adapter.Fill(ds); | |
456 | - DataTable dt = ds.Tables[0]; | |
452 | + adapter = new SqlDataAdapter(cmd); | |
453 | + adapter.Fill(ds); | |
454 | + DataTable dt = ds.Tables[0]; | |
457 | 455 | |
458 | - foreach (DataRow dr in dt.Rows) | |
456 | + foreach (DataRow dr in dt.Rows) | |
457 | + { | |
458 | + foreach (DataColumn dc in dt.Columns) | |
459 | 459 | { |
460 | - foreach (DataColumn dc in dt.Columns) | |
460 | + if (dc.ColumnName == "Id") | |
461 | + objUser.Id = Convert.ToInt32(dr[dc]); | |
462 | + if (dc.ColumnName == "FirstName") | |
463 | + objUser.FirstName = dr[dc].ToString(); | |
464 | + if (dc.ColumnName == "LastName") | |
465 | + objUser.LastName = dr[dc].ToString(); | |
466 | + if (dc.ColumnName == "EmailId") | |
467 | + objUser.EmailId = dr[dc].ToString(); | |
468 | + if (dc.ColumnName == "LoginId") | |
469 | + objUser.LoginId = dr[dc].ToString(); | |
470 | + if (dc.ColumnName == "Password") | |
471 | + objUser.Password = dr[dc].ToString(); | |
472 | + if (dc.ColumnName == "SecurityQuestionId") | |
461 | 473 | { |
462 | - if (dc.ColumnName == "Id") | |
463 | - objUser.Id = Convert.ToInt32(dr[dc]); | |
464 | - if (dc.ColumnName == "FirstName") | |
465 | - objUser.FirstName = dr[dc].ToString(); | |
466 | - if (dc.ColumnName == "LastName") | |
467 | - objUser.LastName = dr[dc].ToString(); | |
468 | - if (dc.ColumnName == "EmailId") | |
469 | - objUser.EmailId = dr[dc].ToString(); | |
470 | - if (dc.ColumnName == "LoginId") | |
471 | - objUser.LoginId = dr[dc].ToString(); | |
472 | - if (dc.ColumnName == "Password") | |
473 | - objUser.Password = dr[dc].ToString(); | |
474 | - if (dc.ColumnName == "SecurityQuestionId") | |
475 | - { | |
476 | - int tempVal; | |
477 | - objUser.SecurityQuestionId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
478 | - } | |
479 | - if (dc.ColumnName == "SecurityAnswer") | |
480 | - objUser.SecurityAnswer = dr[dc].ToString(); | |
481 | - if (dc.ColumnName == "CreatorId") | |
482 | - { | |
483 | - int tempVal; | |
484 | - objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
485 | - } | |
486 | - if (dc.ColumnName == "CreationDate") | |
487 | - objUser.CreationDate = Convert.ToDateTime(dr[dc]); | |
488 | - if (dc.ColumnName == "DeactivationDate") | |
489 | - { | |
490 | - DateTime? date; | |
491 | - if (dr[dc] == DBNull.Value) | |
492 | - date = null; | |
493 | - else | |
494 | - date = (DateTime)dr[dc]; | |
495 | - | |
496 | - objUser.DeactivationDate = date; | |
497 | - } | |
498 | - if (dc.ColumnName == "ModifierId") | |
499 | - { | |
500 | - int tempVal; | |
501 | - objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
502 | - } | |
503 | - if (dc.ColumnName == "ModifiedDate") | |
504 | - { | |
505 | - DateTime? date; | |
506 | - if (dr[dc] == DBNull.Value) | |
507 | - date = null; | |
508 | - else | |
509 | - date = (DateTime)dr[dc]; | |
474 | + int tempVal; | |
475 | + objUser.SecurityQuestionId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
476 | + } | |
477 | + if (dc.ColumnName == "SecurityAnswer") | |
478 | + objUser.SecurityAnswer = dr[dc].ToString(); | |
479 | + if (dc.ColumnName == "CreatorId") | |
480 | + { | |
481 | + int tempVal; | |
482 | + objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
483 | + } | |
484 | + if (dc.ColumnName == "CreationDate") | |
485 | + objUser.CreationDate = Convert.ToDateTime(dr[dc]); | |
486 | + if (dc.ColumnName == "DeactivationDate") | |
487 | + { | |
488 | + DateTime? date; | |
489 | + if (dr[dc] == DBNull.Value) | |
490 | + date = null; | |
491 | + else | |
492 | + date = (DateTime)dr[dc]; | |
510 | 493 | |
511 | - objUser.ModifiedDate = date; | |
512 | - } | |
513 | - if (dc.ColumnName == "UserTypeId") | |
514 | - objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | |
515 | - if (dc.ColumnName == "IsActive") | |
516 | - objUser.IsActive = Convert.ToBoolean(dr[dc]); | |
494 | + objUser.DeactivationDate = date; | |
495 | + } | |
496 | + if (dc.ColumnName == "ModifierId") | |
497 | + { | |
498 | + int tempVal; | |
499 | + objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
500 | + } | |
501 | + if (dc.ColumnName == "ModifiedDate") | |
502 | + { | |
503 | + DateTime? date; | |
504 | + if (dr[dc] == DBNull.Value) | |
505 | + date = null; | |
506 | + else | |
507 | + date = (DateTime)dr[dc]; | |
517 | 508 | |
509 | + objUser.ModifiedDate = date; | |
518 | 510 | } |
511 | + if (dc.ColumnName == "UserTypeId") | |
512 | + objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | |
513 | + if (dc.ColumnName == "IsActive") | |
514 | + objUser.IsActive = Convert.ToBoolean(dr[dc]); | |
515 | + | |
519 | 516 | } |
520 | 517 | } |
521 | - catch (Exception ex) | |
522 | - { | |
523 | - logger.Fatal("Exception in GetUserDetailsByEmailId for emailId= " + emailId + ", Exception= " + ex.Message + ", STACKTRACE= " + ex.StackTrace); | |
524 | - } | |
525 | 518 | |
526 | 519 | return objUser; |
527 | 520 | } |
... | ... | @@ -735,23 +728,15 @@ namespace AIAHTML5.API.Models |
735 | 728 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
736 | 729 | logger.Debug(" inside UpdateLicenseTermStatus for AccountNumber = " + accountNumber); |
737 | 730 | int result = 0; |
738 | - try | |
739 | - { | |
740 | - conn = new SqlConnection(dbConnectionString); | |
741 | - cmd = new SqlCommand(); | |
742 | - cmd.Connection = conn; | |
743 | - conn.Open(); | |
744 | - cmd.CommandText = "UpdateLicenseTermAcceptedStatus"; | |
745 | - cmd.CommandType = CommandType.StoredProcedure; | |
746 | - cmd.Parameters.AddWithValue("@sAccountNumber", accountNumber); | |
747 | - result = cmd.ExecuteNonQuery(); | |
748 | - conn.Close(); | |
749 | - } | |
750 | - catch (SqlException ex) | |
751 | - { | |
752 | - conn.Close(); | |
753 | - logger.Fatal("Exception in UpdateLicenseTermStatus for AccountNumber =" + accountNumber + ", Exception= " + ex.Message + ", STACKTRACE=" + ex.StackTrace); | |
754 | - } | |
731 | + conn = new SqlConnection(dbConnectionString); | |
732 | + cmd = new SqlCommand(); | |
733 | + cmd.Connection = conn; | |
734 | + conn.Open(); | |
735 | + cmd.CommandText = "UpdateLicenseTermAcceptedStatus"; | |
736 | + cmd.CommandType = CommandType.StoredProcedure; | |
737 | + cmd.Parameters.AddWithValue("@sAccountNumber", accountNumber); | |
738 | + result = cmd.ExecuteNonQuery(); | |
739 | + conn.Close(); | |
755 | 740 | return result; |
756 | 741 | } |
757 | 742 | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/UserUtility.cs
1 | -๏ปฟusing System; | |
1 | +๏ปฟ๏ปฟusing System; | |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Linq; |
4 | 4 | using System.Web; |
... | ... | @@ -13,6 +13,7 @@ using System.Text; |
13 | 13 | using System.IO; |
14 | 14 | using System.Net.Mime; |
15 | 15 | using System.Configuration; |
16 | +using System.Collections; | |
16 | 17 | |
17 | 18 | namespace AIAHTML5.API.Models |
18 | 19 | { |
... | ... | @@ -223,10 +224,93 @@ namespace AIAHTML5.API.Models |
223 | 224 | } |
224 | 225 | catch (Exception ex) |
225 | 226 | { |
226 | - logger.Fatal("exception in GetMailBodyTextFromTemplate. msg= " + ex.Message + ", stacktrace= " + ex.StackTrace); | |
227 | + logger.Fatal("exception in SendAdminRequestEmail for email =" + userInfo["emailId"] + ". msg= " + ex.Message + ", stacktrace= " + ex.StackTrace); | |
227 | 228 | return false; |
228 | 229 | } |
229 | 230 | } |
230 | 231 | |
232 | + public static bool SendEmail(Newtonsoft.Json.Linq.JObject userInfo, ArrayList mailToList, string sender, string mailSubject = "", string mailBody = "") | |
233 | + { | |
234 | + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); | |
235 | + logger.Debug("Inside SendEmail with UserInfo =" + userInfo); | |
236 | + | |
237 | + try | |
238 | + { | |
239 | + EmailUtility emailUtility = new EmailUtility(); | |
240 | + List<string> lstToAddress = new List<string>(); | |
241 | + List<string> lstBccAddress = new List<string>(); | |
242 | + | |
243 | + string emailMessage = string.Empty; | |
244 | + string senderEmailId = string.Empty; | |
245 | + | |
246 | + foreach (string email in mailToList) | |
247 | + { | |
248 | + lstToAddress.Add(email); | |
249 | + } | |
250 | + | |
251 | + emailMessage = "Unable to process request for "; | |
252 | + | |
253 | + if (UserUtility.CheckIfPropertyExists(userInfo, "username") && !string.IsNullOrEmpty(userInfo["username"].ToString())) | |
254 | + emailMessage += "username: <b>" + userInfo["username"].ToString() + "</b>"; | |
255 | + if (UserUtility.CheckIfPropertyExists(userInfo, "password") && !string.IsNullOrEmpty(userInfo["password"].ToString())) | |
256 | + emailMessage += "& password: <b>" + userInfo["password"].ToString() + "</b><br/><br/>"; | |
257 | + if (UserUtility.CheckIfPropertyExists(userInfo, "emailId") && !string.IsNullOrEmpty(userInfo["emailId"].ToString())) | |
258 | + emailMessage += "emailId: <b>" + userInfo["emailId"].ToString() + "</b><br/><br/>"; | |
259 | + if (UserUtility.CheckIfPropertyExists(userInfo, "accountNumber") && !string.IsNullOrEmpty(userInfo["accountNumber"].ToString())) | |
260 | + emailMessage += "accountNumber: <b>" + userInfo["accountNumber"].ToString() + "</b><br/><br/>"; | |
261 | + | |
262 | + if (string.IsNullOrEmpty(sender)) | |
263 | + senderEmailId = Convert.ToString(ConfigurationManager.AppSettings["SenderEmailAddress"]); | |
264 | + else | |
265 | + senderEmailId = sender; | |
266 | + | |
267 | + emailMessage += mailBody; | |
268 | + | |
269 | + emailMessage = emailMessage.Replace("\n", "<br/>"); | |
270 | + | |
271 | + emailMessage += "<br/><br/>"; | |
272 | + | |
273 | + emailUtility.sHostName = Convert.ToString(ConfigurationManager.AppSettings["HostAddress"]); | |
274 | + emailUtility.sFromAddress = senderEmailId; | |
275 | + emailUtility.bIsBodyHtml = true; | |
276 | + emailUtility.bEnableSsl = false; | |
277 | + emailUtility.sSubject = mailSubject; | |
278 | + emailUtility.sBodyText = emailMessage; | |
279 | + emailUtility.iPort = 25; | |
280 | + emailUtility.sToAddresses = lstToAddress; | |
281 | + emailUtility.sBccAddresses = lstBccAddress; | |
282 | + | |
283 | + emailUtility.SendSmtpEmail(); | |
284 | + return true; | |
285 | + } | |
286 | + catch (Exception ex) | |
287 | + { | |
288 | + logger.Fatal("exception in SendEmail for username: " + userInfo["username"].ToString() + " & password: " + userInfo["password"].ToString() + " email =" + userInfo["emailId"] + ". msg= " + ex.Message + ", stacktrace= " + ex.StackTrace); | |
289 | + return false; | |
290 | + } | |
291 | + } | |
292 | + | |
293 | + public static ArrayList GetSupportMailList() | |
294 | + { | |
295 | + ArrayList supoortMailList = new ArrayList(); | |
296 | + string[] mailToArr = (ConfigurationManager.AppSettings["AdminSupport"]).Split(','); | |
297 | + if (mailToArr.Length > 0) | |
298 | + { | |
299 | + for (int i = 0; i < mailToArr.Length; i++) | |
300 | + { | |
301 | + supoortMailList.Add(mailToArr[i].ToString()); | |
302 | + } | |
303 | + } | |
304 | + return supoortMailList; | |
305 | + } | |
306 | + | |
307 | + protected static bool CheckIfPropertyExists(dynamic dynamicObject, string propertyName) | |
308 | + { | |
309 | + var res = dynamicObject[propertyName]; | |
310 | + if (res != null) | |
311 | + return true; | |
312 | + else | |
313 | + return false; | |
314 | + } | |
231 | 315 | } |
232 | 316 | } |
233 | 317 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -9,6 +9,7 @@ using AIAHTML5.API.Constants; |
9 | 9 | using log4net; |
10 | 10 | using AIAHTML5.API.Models; |
11 | 11 | using Newtonsoft.Json; |
12 | +using System.Collections; | |
12 | 13 | |
13 | 14 | namespace AIAHTML5.API.Models |
14 | 15 | { |
... | ... | @@ -62,8 +63,16 @@ namespace AIAHTML5.API.Models |
62 | 63 | |
63 | 64 | logger.Fatal("Exception in AuthenticateUser for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace); |
64 | 65 | |
65 | - string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
66 | - userDetails = errorMessage; | |
66 | + //string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
67 | + //string error = "Message: " + e.Message + ", STACKTRACE: " + e.StackTrace; | |
68 | + //userDetails = errorMessage; | |
69 | + | |
70 | + ArrayList supportMailList = UserUtility.GetSupportMailList(); | |
71 | + string mailSubject = "SQL Exception intimation mail"; | |
72 | + string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace; | |
73 | + UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody); | |
74 | + | |
75 | + userDetails = AIAConstants.SQL_CONNECTION_ERROR; | |
67 | 76 | } |
68 | 77 | return userDetails; |
69 | 78 | } |
... | ... | @@ -123,8 +132,15 @@ namespace AIAHTML5.API.Models |
123 | 132 | { |
124 | 133 | logger.Fatal("Exception in Gettting UserDetailsByEmailId for EmailId =" + userInfo["emailId"].ToString() + " Exception= " + ex.Message + ", STACKTRACE: " + ex.StackTrace); |
125 | 134 | |
126 | - string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
127 | - return errorMessage; | |
135 | + //string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
136 | + //return errorMessage; | |
137 | + | |
138 | + ArrayList supportMailList = UserUtility.GetSupportMailList(); | |
139 | + string mailSubject = "SQL Exception intimation mail"; | |
140 | + string mailBody = "MESSAGE: " + ex.Message + ", STACKTRACE: " + ex.StackTrace; | |
141 | + UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody); | |
142 | + | |
143 | + return AIAConstants.SQL_CONNECTION_ERROR; | |
128 | 144 | } |
129 | 145 | |
130 | 146 | |
... | ... | @@ -152,14 +168,41 @@ namespace AIAHTML5.API.Models |
152 | 168 | } |
153 | 169 | catch (Exception e) |
154 | 170 | { |
155 | - logger.Fatal("Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace); | |
156 | - return AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
171 | + logger.Fatal("Exception in UdatePassword with user details = " + userInfo + ", LoginId:" + sLoginId + ", EmailId: "+ sEmailId + "<br/>MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace); | |
172 | + //return AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
173 | + | |
174 | + ArrayList supportMailList = UserUtility.GetSupportMailList(); | |
175 | + string mailSubject = "SQL Exception intimation mail"; | |
176 | + string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace; | |
177 | + UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody); | |
178 | + | |
179 | + return AIAConstants.SQL_CONNECTION_ERROR; | |
157 | 180 | } |
158 | 181 | } |
159 | 182 | |
160 | 183 | internal static dynamic UpdateLicenseTerm(string accNumber) |
161 | 184 | { |
162 | - int result = DBModel.UpdateLicenseTermStatus(accNumber); | |
185 | + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); | |
186 | + logger.Debug(" inside UpdateLicenseTerm for AccountNumber = " + accNumber); | |
187 | + Newtonsoft.Json.Linq.JObject userInfo = new Newtonsoft.Json.Linq.JObject(); | |
188 | + userInfo.Add("accountNumber", accNumber); | |
189 | + dynamic result; | |
190 | + try | |
191 | + { | |
192 | + result = DBModel.UpdateLicenseTermStatus(accNumber); | |
193 | + } | |
194 | + catch (Exception ex) | |
195 | + { | |
196 | + logger.Fatal("Exception in UpdateLicenseTerm for AccountNumber =" + accNumber + " Exception= " + ex.Message + ", STACKTRACE: " + ex.StackTrace); | |
197 | + | |
198 | + ArrayList supportMailList = UserUtility.GetSupportMailList(); | |
199 | + string mailSubject = "SQL Exception intimation mail"; | |
200 | + string mailBody = "MESSAGE: " + ex.Message + ", STACKTRACE: " + ex.StackTrace; | |
201 | + UserUtility.SendEmail(userInfo, supportMailList, "", mailSubject, mailBody); | |
202 | + | |
203 | + result = AIAConstants.SQL_CONNECTION_ERROR; | |
204 | + } | |
205 | + | |
163 | 206 | |
164 | 207 | return result; |
165 | 208 | } | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -43,7 +43,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
43 | 43 | // on refersh this variable will also get null that is why we are only checking this variable on initialize that if it is null that means page gets refershed. |
44 | 44 | $rootScope.refreshcheck = null; |
45 | 45 | |
46 | - | |
46 | + | |
47 | 47 | |
48 | 48 | $rootScope.isModestyOn; |
49 | 49 | $rootScope.isModestyOff; |
... | ... | @@ -95,18 +95,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
95 | 95 | $rootScope.licenseeAccountNumber = null; |
96 | 96 | var isfilloptionChecked = ""; |
97 | 97 | var isOutlineOptionChecked = ""; |
98 | - $rootScope.forgotPwdModalShow = function () | |
99 | - { | |
100 | - document.getElementById("forgetPwdForm").reset(); | |
98 | + $rootScope.forgotPwdModalShow = function () { | |
99 | + document.getElementById("forgetPwdForm").reset() | |
101 | 100 | $("#forgotPwdModal").modal("show"); |
102 | - $(".modal-backdrop").css("opacity",".5"); | |
101 | + $(".modal-backdrop").css("opacity", ".5"); | |
103 | 102 | } |
104 | - $rootScope.forgotUserModalShow=function() | |
105 | - { | |
103 | + $rootScope.forgotUserModalShow = function () { | |
106 | 104 | document.getElementById("forgetUSerIdForm").reset(); |
107 | 105 | $("#forgotUserModal").modal("show"); |
108 | 106 | $(".modal-backdrop").css("opacity", ".5"); |
109 | - | |
107 | + | |
110 | 108 | } |
111 | 109 | $rootScope.initializeAIA = function () { |
112 | 110 | |
... | ... | @@ -133,18 +131,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
133 | 131 | |
134 | 132 | function (result) { |
135 | 133 | if (result == 'true') { |
136 | - | |
134 | + | |
137 | 135 | $rootScope.userModules = UserModules; |
138 | 136 | $rootScope.isVisibleLogin = false; |
139 | 137 | $location.path('/'); |
140 | - | |
138 | + | |
141 | 139 | } |
142 | 140 | else { |
143 | 141 | if (result == LoginConstants.USER_NOT_FOUND) { |
144 | 142 | $rootScope.isVisibleLogin = true; |
145 | 143 | // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); |
146 | 144 | $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; |
147 | - $("#messageModal").modal('show'); | |
145 | + $("#messageModal").modal('show'); | |
148 | 146 | } |
149 | 147 | else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { |
150 | 148 | //alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); |
... | ... | @@ -152,10 +150,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
152 | 150 | $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; |
153 | 151 | $("#messageModal").modal('show'); |
154 | 152 | } |
153 | + else if (result == LoginConstants.SQL_CONNECTION_ERROR) { | |
154 | + $rootScope.isVisibleLogin = true; | |
155 | + $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE; | |
156 | + $("#messageModal").modal('show'); | |
157 | + } | |
155 | 158 | else { |
156 | 159 | if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { |
157 | 160 | |
158 | - if ($("#messageModal").length > 0){ | |
161 | + if ($("#messageModal").length > 0) { | |
159 | 162 | $("#messageModal").modal('hide'); |
160 | 163 | } |
161 | 164 | if (result == LoginMessageConstants.INVALID_USER) { |
... | ... | @@ -184,9 +187,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
184 | 187 | localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); |
185 | 188 | $('#dvUserModulesInfo').modal('show'); |
186 | 189 | $location.path('/'); |
187 | - | |
190 | + | |
188 | 191 | } |
189 | - //else if ((!result.IsSubscriptionExpired) && (result.UserType== UserTypeConstants.CLIENT_ADMIN || result.UserType== UserTypeConstants.DISTRICT_ADMIN || result.UserType== UserTypeConstants.SINGLE_USER ||result.UserType== UserTypeConstants.RESELLER) && result.License.IsTermAccepted) {} | |
192 | + //else if ((!result.IsSubscriptionExpired) && (result.UserType== UserTypeConstants.CLIENT_ADMIN || result.UserType== UserTypeConstants.DISTRICT_ADMIN || result.UserType== UserTypeConstants.SINGLE_USER ||result.UserType== UserTypeConstants.RESELLER) && result.License.IsTermAccepted) {} | |
190 | 193 | |
191 | 194 | else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && result.IsActive) { |
192 | 195 | if (result.UserType == UserTypeConstants.CLIENT_ADMIN || result.UserType == UserTypeConstants.DISTRICT_ADMIN || result.UserType == UserTypeConstants.SINGLE_USER || result.UserType == UserTypeConstants.RESELLER) { |
... | ... | @@ -194,12 +197,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
194 | 197 | $rootScope.userData = result; |
195 | 198 | $rootScope.userModules = result.Modules; |
196 | 199 | $rootScope.isVisibleLogin = false; |
197 | - $rootScope.haveRoleAdmin = true; | |
200 | + $rootScope.haveRoleAdmin = true; | |
198 | 201 | $rootScope.licenseeAccountNumber = result.License.AccountNumber; |
199 | 202 | localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); |
200 | 203 | $('#dvUserModulesInfo').modal('show'); |
201 | 204 | $location.path('/'); |
202 | - | |
205 | + | |
203 | 206 | } |
204 | 207 | else { |
205 | 208 | if ($('#dvTerms').length > 0) { |
... | ... | @@ -208,7 +211,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
208 | 211 | $rootScope.isVisibleLogin = true; |
209 | 212 | $('#dvTermCondition').fadeIn(); |
210 | 213 | $rootScope.userData = result; |
211 | - $rootScope.userModules = result.Modules; | |
214 | + $rootScope.userModules = result.Modules; | |
212 | 215 | $rootScope.haveRoleAdmin = true; |
213 | 216 | $rootScope.licenseeAccountNumber = result.License.AccountNumber; |
214 | 217 | localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); |
... | ... | @@ -241,25 +244,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
241 | 244 | $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; |
242 | 245 | $("#messageModal").modal('show'); |
243 | 246 | } |
244 | - else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && result.IsActive) { | |
247 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && result.IsActive) { | |
245 | 248 | $rootScope.isVisibleLogin = true; |
246 | 249 | $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; |
247 | 250 | $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; |
248 | 251 | $("#messageModal").modal('show'); |
249 | 252 | } |
250 | - else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && !result.IsActive) { | |
253 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && !result.IsActive) { | |
251 | 254 | $rootScope.isVisibleLogin = true; |
252 | 255 | $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; |
253 | 256 | $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; |
254 | 257 | $("#messageModal").modal('show'); |
255 | 258 | } |
256 | - else if (result.License == null && !result.IsActive) { | |
259 | + else if (typeof(result.License) != "undefined" && !result.IsActive) { | |
257 | 260 | $rootScope.isVisibleLogin = true; |
258 | 261 | $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; |
259 | 262 | $("#messageModal").modal('show'); |
260 | 263 | } |
261 | 264 | } |
262 | - } | |
265 | + } | |
263 | 266 | } |
264 | 267 | } |
265 | 268 | }, |
... | ... | @@ -275,28 +278,40 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
275 | 278 | } |
276 | 279 | $rootScope.UpdateLicenseTermStatus = function () { |
277 | 280 | $('#dvTermCondition').fadeOut(); |
278 | - if($rootScope.licenseeAccountNumber !=null) { | |
279 | - | |
280 | - AuthenticationService.UpdateLicenseTerm($rootScope.licenseeAccountNumber) | |
281 | - .then(function (result) { | |
282 | - console.log(' Term and Condition acceptance status updated successfully.'); | |
283 | - | |
284 | - }, | |
285 | - function (error) { | |
286 | - console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText | |
287 | - }); | |
288 | - } | |
289 | - var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | |
290 | - if (currentUserDetails) { | |
291 | - var userInfo = JSON.parse(currentUserDetails); | |
292 | - | |
293 | - if (userInfo.loginId != undefined || userInfo.loginId != "" || userInfo.loginId != null) { | |
294 | - $rootScope.isVisibleLogin = false; | |
295 | - $rootScope.userData = userInfo; | |
296 | - $rootScope.userModules = userInfo.Modules; | |
297 | - $('#dvUserModulesInfo').modal('show'); | |
298 | - } | |
299 | - } | |
281 | + var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | |
282 | + if ($rootScope.licenseeAccountNumber != null) { | |
283 | + | |
284 | + AuthenticationService.UpdateLicenseTerm($rootScope.licenseeAccountNumber) | |
285 | + .then(function (result) { | |
286 | + if (result === LoginMessageConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) { | |
287 | + console.log(' Term and Condition acceptance status updated successfully.'); | |
288 | + if (currentUserDetails) { | |
289 | + var userInfo = JSON.parse(currentUserDetails); | |
290 | + | |
291 | + if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) { | |
292 | + $rootScope.isVisibleLogin = false; | |
293 | + $rootScope.userData = userInfo; | |
294 | + $rootScope.userModules = userInfo.Modules; | |
295 | + $('#dvUserModulesInfo').modal('show'); | |
296 | + } | |
297 | + } | |
298 | + } | |
299 | + else if (result == LoginConstants.SQL_CONNECTION_ERROR) { | |
300 | + console.log(result); | |
301 | + $rootScope.isVisibleLogin = true; | |
302 | + $('#dvTermCondition').fadeIn(); | |
303 | + $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE; | |
304 | + $("#messageModal").modal('show'); | |
305 | + $("#messageModal").css("z-index", 111112); | |
306 | + localStorage.removeItem("loggedInUserDetails"); | |
307 | + } | |
308 | + }, | |
309 | + function (error) { | |
310 | + console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText | |
311 | + $rootScope.isVisibleLogin = true; | |
312 | + $('#dvTermCondition').fadeIn(); | |
313 | + }); | |
314 | + } | |
300 | 315 | }; |
301 | 316 | function VerifyUrlForQuerystring() { |
302 | 317 | var url = $location.url(); |
... | ... | @@ -369,6 +384,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
369 | 384 | $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; |
370 | 385 | $("#messageModal").modal('show'); |
371 | 386 | } |
387 | + else if (result == LoginConstants.SQL_CONNECTION_ERROR) { | |
388 | + $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE; | |
389 | + $("#messageModal").modal('show'); | |
390 | + } | |
372 | 391 | else if (result == LoginConstants.MAIL_NOT_SENT) { |
373 | 392 | // alert(LoginMessageConstants.MAIL_NOT_SENT); |
374 | 393 | $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT; |
... | ... | @@ -423,7 +442,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
423 | 442 | } |
424 | 443 | }; |
425 | 444 | |
426 | - | |
445 | + | |
427 | 446 | |
428 | 447 | |
429 | 448 | function validateEmail(email) { |
... | ... | @@ -437,6 +456,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
437 | 456 | var split = url.split('?em:'); |
438 | 457 | userInfo.emailId = split[1]; |
439 | 458 | } |
459 | + | |
440 | 460 | if (userInfo.newPassword != null) { |
441 | 461 | |
442 | 462 | if (userInfo.newPassword === userInfo.confirmPassword) { |
... | ... | @@ -457,6 +477,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
457 | 477 | $("#messageModal").modal('show'); |
458 | 478 | |
459 | 479 | } |
480 | + else if (result == LoginConstants.SQL_CONNECTION_ERROR) { | |
481 | + $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE; | |
482 | + $("#messageModal").modal('show'); | |
483 | + } | |
460 | 484 | else { |
461 | 485 | //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { |
462 | 486 | if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { |
... | ... | @@ -486,7 +510,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
486 | 510 | $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY; |
487 | 511 | $("#messageModal").modal('show'); |
488 | 512 | } |
489 | - | |
513 | + | |
490 | 514 | } |
491 | 515 | |
492 | 516 | $rootScope.UnblockUser = function () { |
... | ... | @@ -537,9 +561,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
537 | 561 | dataType: "json", |
538 | 562 | success: function (result) { |
539 | 563 | $(result.root.uc.al.lx).each(function (key, value) { |
540 | - | |
564 | + | |
541 | 565 | $('#lexiconLangDropdown').append('<option val="' + this._id + '">' + this._tl + '</option>'); |
542 | - | |
566 | + | |
543 | 567 | }); |
544 | 568 | |
545 | 569 | } |
... | ... | @@ -575,7 +599,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
575 | 599 | $rootScope.isActiveLexiconLanguageClicked = false; |
576 | 600 | $("#secondLax :selected").remove(); |
577 | 601 | $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>'); |
578 | - // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
602 | + // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
579 | 603 | $rootScope.lexiconLanguageArray = []; |
580 | 604 | $("#secondLax > option").each(function () { |
581 | 605 | $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value }); |
... | ... | @@ -602,7 +626,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
602 | 626 | |
603 | 627 | if ($.browser.msie) { |
604 | 628 | $("#resetBtn").css("display", "inline-block"); |
605 | - // $rootScope.refreshCanvas(); | |
629 | + // $rootScope.refreshCanvas(); | |
606 | 630 | |
607 | 631 | } |
608 | 632 | $(function () { |
... | ... | @@ -687,7 +711,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
687 | 711 | } |
688 | 712 | $("#annotationToolBarOptions").removeClass("disableMenuoption"); |
689 | 713 | $("#optionsListManagerTab").removeClass("disableMenuoption"); |
690 | - | |
714 | + | |
691 | 715 | |
692 | 716 | if (($location.url() == "/da-body-view")) { |
693 | 717 | $rootScope.disableMenuannotation = " "; |
... | ... | @@ -710,7 +734,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
710 | 734 | $("#annotationToolBarOptions").removeClass("disableSubMenu"); |
711 | 735 | $rootScope.disableFileMenu = " "; |
712 | 736 | } |
713 | - | |
737 | + | |
714 | 738 | else if ($location.url() == "/clinical-animations-detail") { |
715 | 739 | $rootScope.disableMenuannotation = "disableMenuannotation"; |
716 | 740 | $rootScope.disableMenuoption = " "; |
... | ... | @@ -745,14 +769,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
745 | 769 | $rootScope.getModuleScrollPosition = function () { |
746 | 770 | $rootScope.refreshcheck = "check"; |
747 | 771 | $('.mCSB_container ul li').click(function () { |
748 | - | |
772 | + | |
749 | 773 | $rootScope.scrollTopPosition = $(this).position().top; |
750 | - | |
774 | + | |
751 | 775 | }); |
752 | 776 | setTimeout(function () { |
753 | 777 | |
754 | 778 | $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); |
755 | - | |
779 | + | |
756 | 780 | |
757 | 781 | |
758 | 782 | }, 300); |
... | ... | @@ -770,7 +794,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
770 | 794 | if (openViews.length > 0) { |
771 | 795 | var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; |
772 | 796 | } |
773 | - // $('#daImagePanel').remove(); | |
797 | + // $('#daImagePanel').remove(); | |
774 | 798 | if ($('#jsPanel-1').length > 0) |
775 | 799 | $('#jsPanel-1').remove(); |
776 | 800 | |
... | ... | @@ -3268,7 +3292,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3268 | 3292 | |
3269 | 3293 | $rootScope.disableAnnotationtoolOnListManager = false; |
3270 | 3294 | $rootScope.ShowListManager = function () { |
3271 | - | |
3295 | + | |
3272 | 3296 | $rootScope.switchCanvas(); |
3273 | 3297 | $("#annotationpaintbrushsize").attr("href", "#"); |
3274 | 3298 | $("#annotationpainteraser").attr("href", "#"); |
... | ... | @@ -3288,9 +3312,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3288 | 3312 | |
3289 | 3313 | $('#listManager').draggable(); |
3290 | 3314 | $rootScope.islistManagerEventAlredayDispachted = true; |
3291 | - | |
3315 | + | |
3292 | 3316 | $rootScope.$broadcast('listManagerEvent', true); |
3293 | - | |
3317 | + | |
3294 | 3318 | if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) { |
3295 | 3319 | if ($location.path() == "/module-item-view") { |
3296 | 3320 | $timeout(function () { |
... | ... | @@ -3306,7 +3330,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3306 | 3330 | $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); |
3307 | 3331 | $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); |
3308 | 3332 | } |
3309 | - } | |
3333 | + } | |
3310 | 3334 | else { |
3311 | 3335 | |
3312 | 3336 | if ($rootScope.selectedBodySystemId == undefined) { |
... | ... | @@ -3321,7 +3345,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3321 | 3345 | else { |
3322 | 3346 | $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId); |
3323 | 3347 | } |
3324 | - | |
3348 | + | |
3325 | 3349 | } |
3326 | 3350 | } |
3327 | 3351 | else { |
... | ... | @@ -3331,14 +3355,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3331 | 3355 | else { |
3332 | 3356 | $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId); |
3333 | 3357 | } |
3334 | - | |
3358 | + | |
3335 | 3359 | } |
3336 | - | |
3360 | + | |
3337 | 3361 | $timeout(function () { |
3338 | - $('#bodySystems option[selected="selected"]').prop("selected", false); | |
3339 | - $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true); | |
3340 | - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | |
3341 | - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); | |
3362 | + $('#bodySystems option[selected="selected"]').prop("selected", false); | |
3363 | + $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true); | |
3364 | + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | |
3365 | + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); | |
3342 | 3366 | }, 1000); |
3343 | 3367 | } |
3344 | 3368 | $("#optionsListManagerTab").addClass("active"); |
... | ... | @@ -3349,7 +3373,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3349 | 3373 | } |
3350 | 3374 | |
3351 | 3375 | $rootScope.CloseListManager = function () { |
3352 | - | |
3376 | + | |
3353 | 3377 | $("#btnTranparency").removeAttr('disabled', 'disabled'); |
3354 | 3378 | $("#optionsListManagerTab").removeClass("active"); |
3355 | 3379 | $rootScope.isListManagerMenuSelected = false; |
... | ... | @@ -3507,17 +3531,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3507 | 3531 | } |
3508 | 3532 | |
3509 | 3533 | $rootScope.UpdateAndCloseSetting = function (setting) { |
3510 | - // debugger; | |
3534 | + // debugger; | |
3511 | 3535 | $rootScope.UpdateSetting(setting); |
3512 | 3536 | $rootScope.loadSearchData(); |
3513 | - | |
3537 | + | |
3514 | 3538 | //$timeout(function () { |
3515 | - $('#modal-settings').css("display", "none"); | |
3516 | - $("#modelsettingsbackground").css("display", "none"); | |
3539 | + $('#modal-settings').css("display", "none"); | |
3540 | + $("#modelsettingsbackground").css("display", "none"); | |
3517 | 3541 | // $("#setting-spinner").css("display", "none"); |
3518 | - $("#setting-spinner").css("display", "block"); | |
3542 | + $("#setting-spinner").css("display", "block"); | |
3519 | 3543 | |
3520 | - // }, 6000); | |
3544 | + // }, 6000); | |
3521 | 3545 | }; |
3522 | 3546 | |
3523 | 3547 | |
... | ... | @@ -3639,7 +3663,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3639 | 3663 | $(".modal-backdrop").css("z-index", "1200001"); |
3640 | 3664 | }; |
3641 | 3665 | |
3642 | - | |
3666 | + | |
3643 | 3667 | |
3644 | 3668 | $rootScope.ShowPrintWindow = function () { // Print Active Viewer |
3645 | 3669 | html2canvas($("#canvasDiv"), { |
... | ... | @@ -3682,8 +3706,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3682 | 3706 | var curPosture = $rootScope.getLocalStorageValue('currentViewTitle'); |
3683 | 3707 | |
3684 | 3708 | if (document.getElementById('jsPanel-1')) { //document.getElementsByClassName('ppImagePanel')) { |
3685 | - if (dataURL == "" || dataURL == undefined) | |
3686 | - { | |
3709 | + if (dataURL == "" || dataURL == undefined) { | |
3687 | 3710 | |
3688 | 3711 | setTimeout(function () { |
3689 | 3712 | document.getElementById('imgPortrait').setAttribute('src', dataURL); |
... | ... | @@ -3698,8 +3721,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3698 | 3721 | } |
3699 | 3722 | }, 520); |
3700 | 3723 | } |
3701 | - else | |
3702 | - { | |
3724 | + else { | |
3703 | 3725 | setTimeout(function () { |
3704 | 3726 | document.getElementById('imgPortrait').setAttribute('src', dataURL); |
3705 | 3727 | document.getElementById('imgLandscape').setAttribute('src', dataURL); |
... | ... | @@ -3713,14 +3735,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3713 | 3735 | } |
3714 | 3736 | }, 320); |
3715 | 3737 | } |
3716 | - | |
3738 | + | |
3717 | 3739 | } |
3718 | 3740 | |
3719 | 3741 | $('#fileMenuAnchor').parent().addClass('disableFileMenu'); |
3720 | 3742 | if ($('#daImagePanel').length > 0) { |
3721 | 3743 | console.log('close') |
3722 | 3744 | //$('#daImagePanel').css('display', 'none'); |
3723 | - // $('#daImagePanel').remove(); | |
3745 | + // $('#daImagePanel').remove(); | |
3724 | 3746 | } |
3725 | 3747 | } |
3726 | 3748 | }); |
... | ... | @@ -3743,7 +3765,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3743 | 3765 | top: 70, |
3744 | 3766 | left: 1, |
3745 | 3767 | }, |
3746 | - controls: { buttons: 'closeonly'}, | |
3768 | + controls: { buttons: 'closeonly' }, | |
3747 | 3769 | size: { width: $(window).outerWidth(), height: $(window).outerHeight() + 60 }, |
3748 | 3770 | //size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, |
3749 | 3771 | }); |
... | ... | @@ -3751,9 +3773,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3751 | 3773 | $rootScope.getLocalStorageValue = function (localStorageParam) { |
3752 | 3774 | |
3753 | 3775 | |
3754 | - | |
3755 | - if ((localStorage.getItem('loggedInUserDetails') == null) && ($rootScope.isVisibleLogin == false)) | |
3756 | - { | |
3776 | + | |
3777 | + if ((localStorage.getItem('loggedInUserDetails') == null) && ($rootScope.isVisibleLogin == false)) { | |
3757 | 3778 | if ($location.url().indexOf('?') == -1) |
3758 | 3779 | $rootScope.LogoutUser(); |
3759 | 3780 | |
... | ... | @@ -3855,7 +3876,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3855 | 3876 | } |
3856 | 3877 | |
3857 | 3878 | $(document).on('click', '#jsPanel-1 .jsglyph-remove', function () { |
3858 | - $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); | |
3879 | + $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); | |
3859 | 3880 | $("#ciImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); |
3860 | 3881 | $("#annotationButton").parent().removeClass("disableMenuannotation"); |
3861 | 3882 | $("#annotationToolBarOptions").removeClass("disableMenuoption"); |
... | ... | @@ -3942,9 +3963,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3942 | 3963 | }; |
3943 | 3964 | |
3944 | 3965 | $rootScope.resetDrawing = function (e) { |
3945 | - | |
3946 | - $('#canvas').removeLayers(); | |
3947 | - | |
3966 | + | |
3967 | + $('#canvas').removeLayers(); | |
3968 | + | |
3948 | 3969 | }; |
3949 | 3970 | |
3950 | 3971 | }] | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... | ... | @@ -304,7 +304,9 @@ AIA.constant('ImageTypes', ['Illustration', 'Cadaver Photograph', 'Radiograph']) |
304 | 304 | AIA.constant("LoginConstants", { |
305 | 305 | "USER_NOT_FOUND": "User not found.", |
306 | 306 | "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", |
307 | - "MAIL_NOT_SENT": "Mail not sent." | |
307 | + "MAIL_NOT_SENT": "Mail not sent.", | |
308 | + "SQL_CONNECTION_ERROR": "SQL Connection Error", | |
309 | + "SQL_CONNECTION_ERROR_MESSAGE": "Due to some issue we are unable to connect with database. Kindly, contact customer support" | |
308 | 310 | |
309 | 311 | }) |
310 | 312 | |
... | ... | @@ -335,7 +337,10 @@ AIA.constant("LoginMessageConstants", { |
335 | 337 | "USER_UNBLOCK_SUCCESS": "User unblocked", |
336 | 338 | "USER_UNBLOCK_SUCCESS_MESSAGE": "Your account has been unblocked sucessfully.", |
337 | 339 | "USER_UNBLOCK_FAILED": "Unblock operation failed", |
338 | - "USER_ALREADY_UNBLOCKED": "User already unblocked." | |
340 | + "USER_ALREADY_UNBLOCKED": "User already unblocked.", | |
341 | + "LICENSE_TERM_CONDITION_UPDATE_SUCCESS": "License Term Accepted field updated successfully.", | |
342 | + "LICENSE_TERM_CONDITION_UPDATE_FAILED": "License Term Accepted field update failed." | |
343 | + | |
339 | 344 | //"ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", |
340 | 345 | //"MAIL_NOT_SENT": "Mail not sent." |
341 | 346 | ... | ... |