Commit 03e39b8761bd5208f4a95430b3d9573a2b300924
1 parent
5582ba90
Now concurrent user will not be able to change modesty. Other user can chnage modesty.
all user can save the settings and if login gain will get the same settings.
Showing
3 changed files
with
33 additions
and
2 deletions
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/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/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 | ... | ... |