-
all user can save the settings and if login gain will get the same settings.
-
now need to save selected skintone n modesty in DB and load saved settings at time of login
Showing
11 changed files
400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <RootNamespace>AIAHTML5.API</RootNamespace> |
15 | 15 | <AssemblyName>AIAHTML5.API</AssemblyName> |
16 | 16 | <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
17 | - <UseIISExpress>true</UseIISExpress> | |
17 | + <UseIISExpress>false</UseIISExpress> | |
18 | 18 | <IISExpressSSLPort /> |
19 | 19 | <IISExpressAnonymousAuthentication /> |
20 | 20 | <IISExpressWindowsAuthentication /> |
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | <AutoAssignPort>True</AutoAssignPort> |
182 | 182 | <DevelopmentServerPort>63874</DevelopmentServerPort> |
183 | 183 | <DevelopmentServerVPath>/</DevelopmentServerVPath> |
184 | - <IISUrl>http://localhost:63874/</IISUrl> | |
184 | + <IISUrl>http://localhost/AIAHTML5.API</IISUrl> | |
185 | 185 | <NTLMAuthentication>False</NTLMAuthentication> |
186 | 186 | <UseCustomServer>False</UseCustomServer> |
187 | 187 | <CustomServerUrl>http://182.19.10.91/AIAHTML5</CustomServerUrl> | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... | ... | @@ -49,7 +49,7 @@ namespace AIAHTML5.API.Constants |
49 | 49 | public const string VALIDATED_CLIENT = "Valid Client."; |
50 | 50 | public const string INVALID_CLIENT = "InValid Client."; |
51 | 51 | public const string MSG_NOT_AUTHORIZE_SITE_USER = "User is not authorized."; |
52 | - | |
52 | + public const string SETTINGS_SAVE_FAILURE = "We are unable to save your Settings. Please try again."; | |
53 | 53 | |
54 | 54 | public const string STATUS_OK = "ok"; |
55 | 55 | public const string STATUS_NOT_OK = "notok"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs
... | ... | @@ -19,6 +19,10 @@ namespace AIAHTML5.API.Constants |
19 | 19 | public const string UPDATE_LICENSE_TERM_STATUS = "UpdateLicenseTermAcceptedStatus"; |
20 | 20 | public const string GET_TERMS_AND_CONDITIONS = "GetTermsAndConditions"; |
21 | 21 | public const string INSERT_LOGIN_DETAIL = "InsertLoginDetail"; |
22 | + public const string SAVE_SETTINGS = "usp_SaveUserSettings"; | |
23 | + public const string GET_SETTINGS = "usp_GetUserSettings"; | |
24 | + | |
25 | + | |
22 | 26 | public const string INSERT_INCORRECT_LOGIN_ATTEMPTS = "InsertIncorrectLoginAttempt"; |
23 | 27 | public const string GET_INCORRECT_LOGIN_ATTEMPTS = "GetIncorrectLoginAttempt"; |
24 | 28 | public const string UPDATE_INCORRECT_LOGIN_ATTEMPTS = "UpdateIncorrectLoginAttempts"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -261,9 +261,24 @@ namespace AIAHTML5.API.Controllers |
261 | 261 | } |
262 | 262 | |
263 | 263 | // get exported image detail |
264 | - | |
265 | 264 | userInfo.UserExportImageDetail = GetLicenseExportImageDetail(userInfo.LicenseId); |
265 | + | |
266 | 266 | } |
267 | + //get use settings | |
268 | + string skintone; | |
269 | + string modesty; | |
270 | + User us = AIAHTML5.API.Models.Users.GetUserSelectedSettings(userInfo.Id, out skintone, out modesty); | |
271 | + if (us != null) | |
272 | + { | |
273 | + userInfo.userselectedModesty = modesty; | |
274 | + userInfo.userSelectedSkintone = skintone; | |
275 | + } | |
276 | + else | |
277 | + { | |
278 | + userInfo.userselectedModesty = null; | |
279 | + userInfo.userSelectedSkintone = null; | |
280 | + | |
281 | + } | |
267 | 282 | } |
268 | 283 | |
269 | 284 | private static void CheckLicenseStatus(User userInfo) |
... | ... | @@ -361,6 +376,43 @@ namespace AIAHTML5.API.Controllers |
361 | 376 | return insertImageResult; |
362 | 377 | } |
363 | 378 | |
379 | + | |
380 | + | |
381 | + [HttpPost] | |
382 | + [Route("api/SaveUserSettings")] | |
383 | + public HttpResponseMessage SaveUserSettings([FromBody]JObject jsonData) | |
384 | + { | |
385 | + int Status = 0; | |
386 | + dynamic responseData; | |
387 | + User settings = new User(); | |
388 | + | |
389 | + try | |
390 | + { | |
391 | + settings.userselectedModesty =jsonData["modesty"].Value<string>(); | |
392 | + settings.userSelectedSkintone = jsonData["skintone"].Value<string>(); | |
393 | + settings.userSelectedFont = null; | |
394 | + settings.Id= jsonData["userId"].Value<int>(); | |
395 | + | |
396 | + Status = AIAHTML5.API.Models.Users.SaveUserSelectedSettings(settings); | |
397 | + if (Status == 1) | |
398 | + | |
399 | + { | |
400 | + responseData = "1"; | |
401 | + | |
402 | + } | |
403 | + else | |
404 | + { | |
405 | + responseData = AIAConstants.SETTINGS_SAVE_FAILURE; | |
406 | + } | |
407 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(responseData) }; | |
408 | + | |
409 | + } | |
410 | + catch (Exception ex) | |
411 | + { | |
412 | + // Log exception code goes here | |
413 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
414 | + } | |
415 | + } | |
364 | 416 | // PUT api/authenticate/5 |
365 | 417 | public void Put(int id, [FromBody]string value) |
366 | 418 | { | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -310,6 +310,53 @@ namespace AIAHTML5.API.Models |
310 | 310 | return objUser; |
311 | 311 | } |
312 | 312 | |
313 | + internal User GetSelectedSettings(int userId) | |
314 | + { | |
315 | + logger.Debug(" Inside GetSelectedSettings for userId = " + userId); | |
316 | + | |
317 | + User objUser = null; | |
318 | + DBModel objModel = new DBModel(); | |
319 | + | |
320 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
321 | + SqlCommand cmd = new SqlCommand(); | |
322 | + SqlDataAdapter adapter; | |
323 | + SqlParameter param; | |
324 | + DataSet ds = new DataSet(); | |
325 | + | |
326 | + cmd.Connection = conn; | |
327 | + cmd.CommandText = DBConstants.GET_SETTINGS; | |
328 | + cmd.CommandType = CommandType.StoredProcedure; | |
329 | + | |
330 | + param = new SqlParameter("@iUserId", userId); | |
331 | + param.Direction = ParameterDirection.Input; | |
332 | + param.DbType = DbType.Int32; | |
333 | + cmd.Parameters.Add(param); | |
334 | + | |
335 | + adapter = new SqlDataAdapter(cmd); | |
336 | + adapter.Fill(ds); | |
337 | + | |
338 | + | |
339 | + if (ds != null && ds.Tables.Count > 0) | |
340 | + { | |
341 | + DataTable dt = ds.Tables[0]; | |
342 | + | |
343 | + if (dt.Rows.Count > 0) | |
344 | + { | |
345 | + foreach (DataRow dr in dt.Rows) | |
346 | + { | |
347 | + objUser = new User(); | |
348 | + | |
349 | + objUser.Id = Convert.ToInt32(dr["UserId"]); | |
350 | + objUser.userSelectedSkintone = dr["Skintone"].ToString(); | |
351 | + objUser.userselectedModesty = dr["Modesty"].ToString(); | |
352 | + logger.Debug("objUser.Id= " + objUser.Id + ",objUser.userselectedModesty= " + objUser.userselectedModesty + ",objUser.userSelectedSkintone= " + objUser.userSelectedSkintone + ",objUser.Password= " + objUser.Password + ",objUser.SecurityQuestionId= " + objUser.SecurityQuestionId); | |
353 | + } | |
354 | + } | |
355 | + } | |
356 | + | |
357 | + return objUser; | |
358 | + } | |
359 | + | |
313 | 360 | internal static int UpdateUserPassword(dynamic userInfo, string loginId, string emailId) |
314 | 361 | { |
315 | 362 | logger.Debug(" Inside UpdateUserPassword for LoginId: " + loginId + ", EmailId: " + emailId); |
... | ... | @@ -637,6 +684,42 @@ namespace AIAHTML5.API.Models |
637 | 684 | return result; |
638 | 685 | } |
639 | 686 | |
687 | + | |
688 | + internal int SaveSettings(User settings) | |
689 | + { | |
690 | + logger.Debug(" inside InsertSettings for UserId= " + settings.Id); | |
691 | + | |
692 | + int result = 0; | |
693 | + SqlConnection conn = null; | |
694 | + try | |
695 | + { | |
696 | + conn = new SqlConnection(dbConnectionString); | |
697 | + SqlCommand cmd = new SqlCommand(); | |
698 | + conn.Open(); | |
699 | + cmd.Connection = conn; | |
700 | + cmd.CommandText = DBConstants.SAVE_SETTINGS; | |
701 | + cmd.CommandType = CommandType.StoredProcedure; | |
702 | + cmd.Parameters.AddWithValue("@iUserId", settings.Id); | |
703 | + cmd.Parameters.AddWithValue("@iModesty", settings.userselectedModesty); | |
704 | + cmd.Parameters.AddWithValue("@iSkintone",settings. userSelectedSkintone); | |
705 | + cmd.Parameters.AddWithValue("@ifont","" ); | |
706 | + | |
707 | + | |
708 | + result = cmd.ExecuteNonQuery(); | |
709 | + } | |
710 | + catch (SqlException ex) | |
711 | + { | |
712 | + logger.Fatal("Exception in InsertLoginDetails for UserId= " + settings.Id + ", Exception= " + ex.Message + ", STACKTRACE=" + ex.StackTrace); | |
713 | + throw; | |
714 | + } | |
715 | + finally | |
716 | + { | |
717 | + conn.Dispose(); | |
718 | + } | |
719 | + | |
720 | + return result; | |
721 | + } | |
722 | + | |
640 | 723 | internal int InsertIncorrectLoginAttempts(int userId) |
641 | 724 | { |
642 | 725 | logger.Debug(" inside InsertIncorrectLoginAttempts for UserId= " + userId); | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... | ... | @@ -39,6 +39,10 @@ namespace AIAHTML5.API.Models |
39 | 39 | public ArrayList Modules { get; set; } |
40 | 40 | public int siteId { get; set; } |
41 | 41 | public string pwd { get; set; } |
42 | + public String userSelectedSkintone { get; set; } | |
43 | + public string userselectedModesty { get; set; } | |
44 | + public string userSelectedFont { get; set; } | |
45 | + | |
42 | 46 | |
43 | 47 | public License LicenseInfo { get; set; } |
44 | 48 | public LicenseSubscriptionDetails LicenseSubscriptions { get; set; } | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -149,6 +149,8 @@ namespace AIAHTML5.API.Models |
149 | 149 | return result; |
150 | 150 | } |
151 | 151 | |
152 | + | |
153 | + | |
152 | 154 | internal static bool isUSerActive(User user) |
153 | 155 | { |
154 | 156 | if (user.IsActive) |
... | ... | @@ -306,6 +308,33 @@ namespace AIAHTML5.API.Models |
306 | 308 | } |
307 | 309 | |
308 | 310 | |
311 | + internal static int SaveUserSelectedSettings(User selectedSettings) | |
312 | + { | |
313 | + logger.Debug("inside SaveUserSelectedSettings for Image =" + selectedSettings.Id); | |
314 | + | |
315 | + int result = 0; | |
316 | + | |
317 | + DBModel objModel = new DBModel(); | |
318 | + result = objModel.SaveSettings(selectedSettings); | |
319 | + | |
320 | + return result; | |
321 | + } | |
322 | + | |
323 | + internal static User GetUserSelectedSettings(int userId,out string skintone, out string modesty) | |
324 | + { | |
325 | + logger.Debug("inside GetUserSelectedSettings for userid =" + userId); | |
326 | + | |
327 | + skintone = null; | |
328 | + modesty = null; | |
329 | + DBModel objModel = new DBModel(); | |
330 | + User result = objModel.GetSelectedSettings(userId); | |
331 | + if (result != null) | |
332 | + { | |
333 | + skintone = result.userSelectedSkintone; | |
334 | + modesty = result.userselectedModesty; | |
335 | + } | |
336 | + return result; | |
337 | + } | |
309 | 338 | |
310 | 339 | internal static void isCredentialCorrect(Newtonsoft.Json.Linq.JObject credentials, User userInfo, out bool isCorrectLoginId, out bool isCorrectPassword) |
311 | 340 | { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/Web.config
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | |
22 | 22 | </location> |
23 | 23 | <system.webServer> |
24 | - <rewrite> | |
24 | + <!--<rewrite> | |
25 | 25 | <rules> |
26 | 26 | <rule name="AngularJS Routes" stopProcessing="true"> |
27 | 27 | <match url=".*" /> |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | <action type="Rewrite" url="/" /> |
34 | 34 | </rule> |
35 | 35 | </rules> |
36 | - </rewrite> | |
36 | + </rewrite>--> | |
37 | 37 | <staticContent> |
38 | 38 | |
39 | 39 | <remove fileExtension=".mp3" /> |
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> |
45 | 45 | <mimeMap fileExtension=".mp3" mimeType="audio/mpeg" /> |
46 | 46 | <mimeMap fileExtension=".vtt" mimeType="text/vtt" /> |
47 | - <mimeMap fileExtension=".json" mimeType="application/json" /> | |
47 | + <!--<mimeMap fileExtension=".json" mimeType="application/json" />--> | |
48 | 48 | |
49 | 49 | </staticContent> |
50 | 50 | <defaultDocument enabled="true"> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -548,36 +548,65 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
548 | 548 | |
549 | 549 | //code for modesty setting |
550 | 550 | if (result.LicenseInfo != null) { |
551 | - if (result.IsModestyOn) { | |
552 | - $rootScope.isModestyOn = true; | |
553 | - $rootScope.isModestyOff = false; | |
554 | - localStorage.setItem("globalModesty", "Y"); | |
555 | - $rootScope.formsetting = { | |
556 | - ethnicity: null, | |
557 | - modesty: "Y" | |
551 | + if (result.userselectedModesty == undefined || result.userselectedModesty == null || | |
552 | + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) { | |
553 | + if (result.IsModestyOn) { | |
554 | + $rootScope.isModestyOn = true; | |
555 | + $rootScope.isModestyOff = false; | |
556 | + localStorage.setItem("globalModesty", "Y"); | |
557 | + $rootScope.formsetting = { | |
558 | + ethnicity: null, | |
559 | + modesty: "Y" | |
560 | + } | |
561 | + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) | |
562 | + } | |
563 | + else { | |
564 | + $rootScope.isModestyOn = false; | |
565 | + $rootScope.isModestyOff = true; | |
566 | + localStorage.setItem("globalModesty", "N"); | |
567 | + $rootScope.formsetting = { | |
568 | + ethnicity: null, | |
569 | + modesty: "N" | |
570 | + } | |
571 | + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) | |
558 | 572 | } |
559 | - $rootScope.UpdateAndCloseSetting($rootScope.formsetting) | |
560 | 573 | } |
561 | 574 | else { |
562 | - $rootScope.isModestyOn = false; | |
563 | - $rootScope.isModestyOff = true; | |
564 | - localStorage.setItem("globalModesty", "N"); | |
575 | + localStorage.setItem("globalModesty", result.userselectedModesty); | |
576 | + localStorage.setItem("globalEthnicity", result.userSelectedSkintone); | |
577 | + | |
565 | 578 | $rootScope.formsetting = { |
566 | - ethnicity: null, | |
567 | - modesty: "N" | |
579 | + ethnicity: result.userSelectedSkintone, | |
580 | + modesty: result.userselectedModesty | |
568 | 581 | } |
569 | 582 | $rootScope.UpdateAndCloseSetting($rootScope.formsetting) |
583 | + | |
570 | 584 | } |
571 | 585 | } |
572 | 586 | else { |
573 | - $rootScope.isModestyOn = true; | |
574 | - $rootScope.isModestyOff = false; | |
575 | - localStorage.setItem("globalModesty", "Y"); | |
576 | - $rootScope.formsetting = { | |
577 | - ethnicity: null, | |
578 | - modesty: "Y" | |
587 | + if (result.userselectedModesty == undefined || result.userselectedModesty == null || | |
588 | + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) { | |
589 | + | |
590 | + $rootScope.isModestyOn = true; | |
591 | + $rootScope.isModestyOff = false; | |
592 | + localStorage.setItem("globalModesty", "Y"); | |
593 | + $rootScope.formsetting = { | |
594 | + ethnicity: null, | |
595 | + modesty: "Y" | |
596 | + } | |
597 | + $rootScope.UpdateAndCloseSetting($rootScope.formsetting); | |
598 | + } | |
599 | + else { | |
600 | + localStorage.setItem("globalModesty", result.userselectedModesty); | |
601 | + localStorage.setItem("globalEthnicity", result.userSelectedSkintone); | |
602 | + | |
603 | + $rootScope.formsetting = { | |
604 | + ethnicity: result.userSelectedSkintone, | |
605 | + modesty: result.userselectedModesty | |
606 | + } | |
607 | + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) | |
608 | + | |
579 | 609 | } |
580 | - $rootScope.UpdateAndCloseSetting($rootScope.formsetting) | |
581 | 610 | } |
582 | 611 | //code for modesty setting |
583 | 612 | $rootScope.aiaModesty = $rootScope.formsetting.modesty; |
... | ... | @@ -701,6 +730,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
701 | 730 | |
702 | 731 | } |
703 | 732 | |
733 | + if (result.UserTypeId == 6) { | |
734 | + $('#modestyDiv').css('pointerEvent', 'none'); | |
735 | + $('#modestyDiv').css('opacity', 0.4); | |
736 | + $("#modestyDiv").find("*").prop('disabled', true); | |
737 | + } | |
738 | + | |
704 | 739 | if (result.LicenseInfo != null) { |
705 | 740 | |
706 | 741 | // set license id |
... | ... | @@ -5883,10 +5918,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
5883 | 5918 | if (currentmodsetting == 'Y') { |
5884 | 5919 | $rootScope.isModestyOn = true; |
5885 | 5920 | $rootScope.isModestyOff = false; |
5921 | + $("#modon").prop("checked", true); | |
5922 | + $("#modoff").prop("checked", false); | |
5923 | + | |
5886 | 5924 | } |
5887 | 5925 | else { |
5888 | 5926 | $rootScope.isModestyOn = false; |
5889 | 5927 | $rootScope.isModestyOff = true; |
5928 | + $("#modon").prop("checked", false); | |
5929 | + $("#modoff").prop("checked", true); | |
5890 | 5930 | } |
5891 | 5931 | } |
5892 | 5932 | |
... | ... | @@ -5942,10 +5982,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
5942 | 5982 | |
5943 | 5983 | } |
5944 | 5984 | $rootScope.isApplyBtnClicked = false; |
5945 | - $rootScope.CloseSetting = function () { | |
5985 | + $rootScope.CancelSetting = function () { | |
5946 | 5986 | $rootScope.isCloseSettingClicked = true; |
5947 | 5987 | $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); |
5948 | 5988 | $rootScope.setModestySettings($rootScope.globalSetting.modesty); |
5989 | + | |
5990 | + | |
5991 | + | |
5949 | 5992 | if ($rootScope.isApplyBtnClicked == false) { |
5950 | 5993 | |
5951 | 5994 | $rootScope.deSelectLanguageOptions(); |
... | ... | @@ -5957,7 +6000,48 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
5957 | 6000 | $('#modal-settings').css("display", "none"); |
5958 | 6001 | $("#modelsettingsbackground").css("display", "none"); |
5959 | 6002 | } |
6003 | + $rootScope.CloseSetting = function () { | |
6004 | + // $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; | |
6005 | + $("#saveSettingsMessageModal").modal('show'); | |
6006 | + $("#saveSettingsMessageModal").css('zIndex', 80000000000); | |
6007 | + //$('#modal-settings').css("display", "none"); | |
6008 | + //$("#modelsettingsbackground").css("display", "none"); | |
6009 | + } | |
6010 | + $rootScope.saveSettings = function () { | |
6011 | + | |
6012 | + var currentSkintone = $rootScope.globalSetting.ethnicity; | |
6013 | + var currentModesty = $rootScope.globalSetting.modesty; | |
6014 | + var setting={}; | |
6015 | + setting.modesty =currentModesty ; | |
6016 | + setting.skintone = currentSkintone; | |
6017 | + setting.userId = $rootScope.userData.Id; | |
6018 | + AuthenticationService.saveSetings(setting) | |
6019 | + .then( | |
6020 | + | |
6021 | + function (result) { | |
6022 | + var k= result; | |
6023 | + if(result==1){ | |
6024 | + $rootScope.errorMessage = AIAConstants.SETTINGS_SAVED ; | |
6025 | + $('#modal-settings').css("display", "none"); | |
6026 | + $("#modelsettingsbackground").css("display", "none"); | |
6027 | + | |
6028 | + } | |
6029 | + else{ | |
6030 | + $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR; | |
5960 | 6031 | |
6032 | + } | |
6033 | + $("#messageModal").css('zIndex', 80000000000); | |
6034 | + $("#messageModal").modal('show'); | |
6035 | + | |
6036 | + }), | |
6037 | + function (error) { | |
6038 | + console.log(' Error in Saving settings = ' + error.statusText); | |
6039 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
6040 | + $rootScope.isVisibleLogin = true; | |
6041 | + $rootScope.errorMessage = error; | |
6042 | + $("#messageModal").modal('show'); | |
6043 | + } | |
6044 | + } | |
5961 | 6045 | $rootScope.UpdateAndCloseSetting = function (setting) { |
5962 | 6046 | |
5963 | 6047 | $rootScope.UpdateSetting(setting); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... | ... | @@ -525,7 +525,9 @@ AIA.constant("AIAConstants", { |
525 | 525 | "COOKIES_MESSAGE": "You need to enable your browser's cookies to run this application.", |
526 | 526 | "SAVED_LAB_EXERCISE_NOT_FOUND": "Saved Lab Exercise not found.", |
527 | 527 | "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", |
528 | - "PLEASE_ENTER_SEARCH_TEXT":"Please enter the text to search." | |
528 | + "PLEASE_ENTER_SEARCH_TEXT": "Please enter the text to search.", | |
529 | + "SETTINGS_SAVED": "Your current settings has been saved.", | |
530 | + "SETTING_SAVE_ERROR":"There is some error in saving your current settings. Please try after sometime." | |
529 | 531 | }) |
530 | 532 | |
531 | 533 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
... | ... | @@ -43,6 +43,29 @@ |
43 | 43 | return deferred.promise; |
44 | 44 | }, |
45 | 45 | |
46 | + | |
47 | + saveSetings: function (settings) { | |
48 | + var deferred = $q.defer(); | |
49 | + | |
50 | + $http.post('/API/api/SaveUserSettings', JSON.stringify(settings), { | |
51 | + headers: { | |
52 | + 'Content-Type': 'application/json' | |
53 | + } | |
54 | + }) | |
55 | + .success(function (data, status, headers, config) { | |
56 | + console.log('success') | |
57 | + deferred.resolve(data); | |
58 | + }).error(function (data, status, headers, config) { | |
59 | + console.log('error') | |
60 | + deferred.reject(data); | |
61 | + $rootScope.errorMessage = data; | |
62 | + $("#messageModal").modal('show'); | |
63 | + | |
64 | + }); | |
65 | + return deferred.promise; | |
66 | + }, | |
67 | + | |
68 | + | |
46 | 69 | validateClientSite: function (clientInfo) { |
47 | 70 | var deferred = $q.defer(); |
48 | 71 | ... | ... |