diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index e129023..aed9fea 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -312,16 +312,18 @@ namespace AIAHTML5.ADMIN.API.Controllers public HttpResponseMessage UpdateLicenseModestySettings(JObject jsonData) { bool Status = false; - List> LicenseModestyList = new List>(); - Tuple LicenseModesty; + List> LicenseModestyList = new List>(); + Tuple LicenseModesty; for (int i = 0; i < jsonData["obj"].Count(); i++) { - LicenseModesty = new Tuple( + LicenseModesty = new Tuple( ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["licenseEditionId"])).Value(), ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["siteId"])).Value(), - ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isModesty"])).Value()); + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isModesty"])).Value(), + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isSiteUser"])).Value()); LicenseModestyList.Add(LicenseModesty); } + try { Status = LicenseModel.UpdateLicenseModestySettings(dbContext, LicenseModestyList); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index d5540dc..f0d76f1 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3528,7 +3528,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseBasicSettings", iLicenseIdParameter, sLicenseeFnameParameter, sLicenseeLnameParameter, sInstitutionNameParameter, sAddress1Parameter, sAddress2Parameter, sCityParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sPhoneParameter, sEmailIdParameter, status); } - public virtual int usp_UpdateLicenseModestySettings(Nullable licenseEditionId, Nullable siteId, Nullable isModesty, ObjectParameter status) + public virtual int usp_UpdateLicenseModestySettings(Nullable licenseEditionId, Nullable siteId, Nullable isModesty, Nullable isSiteUser, ObjectParameter status) { var licenseEditionIdParameter = licenseEditionId.HasValue ? new ObjectParameter("LicenseEditionId", licenseEditionId) : @@ -3542,7 +3542,11 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("IsModesty", isModesty) : new ObjectParameter("IsModesty", typeof(bool)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, status); + var isSiteUserParameter = isSiteUser.HasValue ? + new ObjectParameter("isSiteUser", isSiteUser) : + new ObjectParameter("isSiteUser", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, isSiteUserParameter, status); } public virtual int usp_UpdateLicenseModuleStatus(Nullable licenseId, string moduleStatusText, ObjectParameter status) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index acab4d3..bae6689 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -1495,6 +1495,7 @@ + @@ -2572,6 +2573,7 @@ + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index b033d7b..f3662ac 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -395,14 +395,14 @@ namespace AIAHTML5.ADMIN.API.Models } } - public static bool UpdateLicenseModestySettings(AIADatabaseV5Entities dbContext, List> LicenseModestyList) + public static bool UpdateLicenseModestySettings(AIADatabaseV5Entities dbContext, List> LicenseModestyList) { var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); try { foreach (var item in LicenseModestyList) { - dbContext.usp_UpdateLicenseModestySettings(item.Item1, item.Item2, item.Item3, spStatus); + dbContext.usp_UpdateLicenseModestySettings(item.Item1, item.Item2, item.Item3, item.Item4, spStatus); if (!(bool)spStatus.Value) break; } return (bool)spStatus.Value; diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index 14b2327..8100d42 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -241,11 +241,13 @@ namespace AIAHTML5.API.Controllers { //based on old .net code(AIA flex), we get modules based on licenseId if licenseid>0. //we verified in database that only superadmin has no licenseid so getting all modules for supeadmin - int licenseId, editionId; - AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId); + int licenseId, editionId, LicenseEditionId; + AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId,out LicenseEditionId); userInfo.LicenseId = licenseId; userInfo.EditionId = editionId; + userInfo.LicenseEditionId = LicenseEditionId; + userInfo.isSiteUser = false; //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN) if (userInfo.LicenseId == 0) @@ -271,7 +273,7 @@ namespace AIAHTML5.API.Controllers //get use settings string skintone; string modesty; - User us = AIAHTML5.API.Models.Users.GetUserSelectedSettings(userInfo.Id, out skintone, out modesty); + User us = AIAHTML5.API.Models.Users.GetUserSelectedSettings(userInfo.Id, false, out skintone, out modesty); if (us != null) { userInfo.userselectedModesty = modesty; @@ -437,9 +439,13 @@ namespace AIAHTML5.API.Controllers settings.userSelectedSkintone = jsonData["skintone"].Value(); settings.userSelectedFont = null; settings.Id= jsonData["userId"].Value(); + settings.LicenseEditionId = jsonData["LicenseEditionId"].Value(); + settings.isSiteUser = jsonData["isSiteUser"].Value(); + userLexicon.primaryid= jsonData["primaryid"].Value(); userLexicon.secondryids = jsonData["secondryids"].Value(); settings.userLexicon= userLexicon; + Status = AIAHTML5.API.Models.Users.SaveUserSelectedSettings(settings); if (Status == 1) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index d43fb98..292fc3c 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -157,6 +157,8 @@ namespace AIAHTML5.API.Models { hash.Add(AIAConstants.LICENSE_KEY_ID, ds.Tables[0].Rows[0][0]); hash.Add(AIAConstants.EDITION_KEY_ID, ds.Tables[0].Rows[0][1]); + // LicenseEditionId use to update modesty in LicenseToEdition table + hash.Add("LicenseEditionId", ds.Tables[0].Rows[0][2]); } } @@ -384,7 +386,7 @@ namespace AIAHTML5.API.Models return status; } - internal User GetSelectedSettings(int userId) + internal User GetSelectedSettings(int userId,bool isSiteUser) { logger.Debug(" Inside GetSelectedSettings for userId = " + userId); UserLexicon objlexicon = null; @@ -394,18 +396,16 @@ namespace AIAHTML5.API.Models SqlConnection conn = new SqlConnection(dbConnectionString); SqlCommand cmd = new SqlCommand(); SqlDataAdapter adapter; - SqlParameter param; + DataSet ds = new DataSet(); cmd.Connection = conn; cmd.CommandText = DBConstants.GET_SETTINGS; cmd.CommandType = CommandType.StoredProcedure; - param = new SqlParameter("@iUserId", userId); - param.Direction = ParameterDirection.Input; - param.DbType = DbType.Int32; - cmd.Parameters.Add(param); - + cmd.Parameters.AddWithValue("@iUserId", userId); + cmd.Parameters.AddWithValue("@isSiteUser", isSiteUser); + adapter = new SqlDataAdapter(cmd); adapter.Fill(ds); @@ -784,6 +784,8 @@ namespace AIAHTML5.API.Models cmd.Parameters.AddWithValue("@ifont","" ); cmd.Parameters.AddWithValue("@pLexicon", settings.userLexicon.primaryid); cmd.Parameters.AddWithValue("@sLexicon", settings.userLexicon.secondryids); + cmd.Parameters.AddWithValue("@isSiteUser", settings.isSiteUser); + cmd.Parameters.AddWithValue("@LicenseEditionId", settings.LicenseEditionId); result = cmd.ExecuteNonQuery(); @@ -1249,7 +1251,7 @@ namespace AIAHTML5.API.Models return dt; } - internal DataTable GetLicenseBySiteId(int siteId) + internal DataTable GetLicenseBySiteId(int siteId, int editionId) { logger.Debug(" inside GetLicenseBySiteId for siteId= " + siteId); @@ -1262,7 +1264,8 @@ namespace AIAHTML5.API.Models cmd.CommandText = DBConstants.GET_LICENSE_BY_SITE_ID; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sSiteId", siteId); - + cmd.Parameters.AddWithValue("@sEditionId", editionId); + SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; dt = new DataTable(); diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index 24e3719..b0ae88f 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -34,6 +34,8 @@ namespace AIAHTML5.API.Models public bool IsBlocked { get; set; } public int LicenseId { get; set; } public int EditionId { get; set; } + public int LicenseEditionId { get; set; } + public bool isSiteUser { get; set; } public Int16 LoginFailureCauseId { get; set; } public bool IsModestyOn { get; set; } public ArrayList Modules { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 0e69933..5c24061 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -114,13 +114,14 @@ namespace AIAHTML5.API.Models return userDetails; } - internal static void getLicenseIdForThisUser(int userId, out int licenseId, out int editionId) + internal static void getLicenseIdForThisUser(int userId, out int licenseId, out int editionId, out int LicenseEditionId) { logger.Debug("inside getLicenseIdForThisUser for UserId =" + userId); //assigning below variable to avoid compiler error for unassignd out params licenseId = 0; editionId = 0; + LicenseEditionId = 0; @@ -133,6 +134,9 @@ namespace AIAHTML5.API.Models if (licenseEditionHash.ContainsKey(AIAConstants.EDITION_KEY_ID)) editionId = Convert.ToInt32(licenseEditionHash[AIAConstants.EDITION_KEY_ID]); + if (licenseEditionHash.ContainsKey("LicenseEditionId")) + LicenseEditionId = Convert.ToInt32(licenseEditionHash["LicenseEditionId"]); + } @@ -356,14 +360,14 @@ namespace AIAHTML5.API.Models return result; } - internal static User GetUserSelectedSettings(int userId,out string skintone, out string modesty) + internal static User GetUserSelectedSettings(int userId,bool isSiteUser, out string skintone, out string modesty) { logger.Debug("inside GetUserSelectedSettings for userid =" + userId); skintone = null; modesty = null; DBModel objModel = new DBModel(); - User result = objModel.GetSelectedSettings(userId); + User result = objModel.GetSelectedSettings(userId, isSiteUser); if (result != null) { skintone = result.userSelectedSkintone; @@ -538,8 +542,7 @@ namespace AIAHTML5.API.Models bool isSubscriptionNotStart = false; int intLicenseId = 0; - int intEditionId = Convert.ToInt16(strEdition); - + DateTime dtLogDate = DateTime.Now; if (string.IsNullOrEmpty(strAcccountNumber)) @@ -554,8 +557,10 @@ namespace AIAHTML5.API.Models } else { + int intEditionId = Convert.ToInt16(strEdition); + DBModel objDBModel = new DBModel(); - DataTable dtLicense = objDBModel.GetLicenseBySiteId(intSiteId); + DataTable dtLicense = objDBModel.GetLicenseBySiteId(intSiteId, intEditionId); if (dtLicense.Rows.Count > 0) { @@ -597,6 +602,8 @@ namespace AIAHTML5.API.Models { //User objUserContext = new User(); userInfo.Id = 0; + userInfo.siteId = intSiteId; + userInfo.isSiteUser = true; userInfo.FirstName = licRow["LicenseeFirstName"].ToString(); userInfo.LastName = licRow["LicenseeLastName"].ToString(); userInfo.UserTypeId = AIAConstants.SITE_USER; @@ -612,6 +619,7 @@ namespace AIAHTML5.API.Models userInfo.EditionId = (Byte)intEditionId; userInfo.LicenseTypeId = (byte)licRow["LicenseTypeId"]; userInfo.LicenseId = Convert.ToInt32(licRow["Id"]); + userInfo.LicenseEditionId = Convert.ToInt32(licRow["LicenseEditionId"]); userInfo.LoginId = ""; userInfo.Modesty = (bool)licRow["IsModesty"]; //Retreive ModestyMode @@ -631,8 +639,25 @@ namespace AIAHTML5.API.Models } } - // get edition features details - userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId); + string skintone; + string modesty; + User us =GetUserSelectedSettings(userInfo.siteId,true, out skintone, out modesty); + if (us != null) + { + userInfo.userselectedModesty = modesty; + userInfo.userSelectedSkintone = skintone; + userInfo.userLexicon = us.userLexicon; + } + else + { + userInfo.userselectedModesty = null; + userInfo.userSelectedSkintone = null; + userInfo.userLexicon = null; + + } + + // get edition features details + userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId); if (intLicenseId > 0) userInfo.Modules = getModuleListByLicenseId(intLicenseId); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 1034db3..ccbcf22 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -31,20 +31,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.shapeType; $rootScope.canvasLayerNameCollection=[]; $rootScope.islaxicanlanguageChange=false; - $rootScope.globalSetting = { - ethnicity: 'W', - modesty: 'Y', - }; - $rootScope.formsetting = { - ethnicity: null, - modesty: null - }; - $rootScope.lexicons = { - primaryid:1, - secondryids:[] - }; - - + // 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. $rootScope.refreshcheck = null; var isCommingSoonModel = true; @@ -1647,45 +1634,90 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) { //code for modesty setting if (result.LicenseInfo != null) { - if (result.Modesty) { - $rootScope.isModestyOn = true; - $rootScope.isModestyOff = false; - localStorage.setItem("globalModesty", "Y"); - $rootScope.formsetting = { - ethnicity: "W", - modesty: "Y" + if (result.userselectedModesty == undefined || result.userselectedModesty == null || + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) { + if (result.Modesty) { + $rootScope.isModestyOn = true; + $rootScope.isModestyOff = false; + localStorage.setItem("globalModesty", "Y"); + $rootScope.formsetting = { + ethnicity: "W", + modesty: "Y" + } + + $rootScope.UpdateSetting($rootScope.formsetting) + } + else { + $rootScope.isModestyOn = false; + $rootScope.isModestyOff = true; + localStorage.setItem("globalModesty", "N"); + $rootScope.formsetting = { + ethnicity: "W", + modesty: "N" + } + + $rootScope.UpdateSetting($rootScope.formsetting) } - $rootScope.UpdateSetting($rootScope.formsetting) } - else { - $rootScope.isModestyOn = false; - $rootScope.isModestyOff = true; - localStorage.setItem("globalModesty", "N"); + else + { + localStorage.setItem("globalModesty", result.userselectedModesty); + localStorage.setItem("globalEthnicity", result.userSelectedSkintone); + $rootScope.formsetting = { - ethnicity: "W", - modesty: "N" + ethnicity: result.userSelectedSkintone, + modesty: result.userselectedModesty } - $rootScope.UpdateSetting($rootScope.formsetting) + + $rootScope.UpdateSetting($rootScope.formsetting); + } + + $rootScope.lexicons = { + primaryid:result.userLexicon!=null && result.userLexicon.primaryid!=""?result.userLexicon.primaryid:"1", + secondryids:result.userLexicon!=null && result.userLexicon.secondryids!="" ?result.userLexicon.secondryids:"" + }; + + $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids) + } - else { - $rootScope.isModestyOn = true; - $rootScope.isModestyOff = false; - localStorage.setItem("globalModesty", "Y"); - $rootScope.formsetting = { - ethnicity: "W", - modesty: "Y" + else + { + if (result.userselectedModesty == undefined || result.userselectedModesty == null || + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) { + + $rootScope.isModestyOn = true; + $rootScope.isModestyOff = false; + localStorage.setItem("globalModesty", "Y"); + $rootScope.formsetting = { + ethnicity: "W", + modesty: "Y" + } + $rootScope.UpdateSetting($rootScope.formsetting); + } + else + { + localStorage.setItem("globalModesty", result.userselectedModesty); + localStorage.setItem("globalEthnicity", result.userSelectedSkintone); + + $rootScope.formsetting = { + ethnicity: result.userSelectedSkintone, + modesty: result.userselectedModesty + } + $rootScope.UpdateSetting($rootScope.formsetting) + } - $rootScope.UpdateSetting($rootScope.formsetting) + + $rootScope.lexicons = { + primaryid:result.userLexicon!=null && result.userLexicon.primaryid!=""?result.userLexicon.primaryid:"1", + secondryids:result.userLexicon!=null && result.userLexicon.secondryids!="" ?result.userLexicon.secondryids:"" + }; + + $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids) + } - //for site user set default lexicon - $rootScope.lexicons = { - primaryid:"1", - secondryids:"" - }; - $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids) //code for modesty setting $rootScope.aiaModesty = $rootScope.formsetting.modesty; @@ -8134,6 +8166,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.loadsettings = function () { + //applcation reload blank these value after assign + $rootScope.globalSetting = { + ethnicity: 'W', + modesty: 'Y', + }; + $rootScope.formsetting = { + ethnicity: null, + modesty: null + }; + $rootScope.lexicons = { + primaryid:1, + secondryids:[] + }; + //1. For now we are by default opening DA settings tab $rootScope.SettingsTab = 3; @@ -8256,7 +8302,23 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var setting={}; setting.modesty =Formatsetting.modesty ; setting.skintone = Formatsetting.ethnicity; - setting.userId = $rootScope.userData.Id; + + // var isallowToChange=false; + if($rootScope.userData.isSiteUser) + { + // send as user id + setting.userId = $rootScope.userData.siteId; + //isallowToChange=$rootScope.userData.EditionId<3; + } + else + { + setting.userId = $rootScope.userData.Id; + //concurrent license + // only instructor + //if($rootScope.userData.LicenseId!=0) + // isallowToChange=$rootScope.userData.EditionId<3; + + } var secondLan=[] @@ -8267,54 +8329,57 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data setting.primaryid = $('#primarylaxican').attr("name"); setting.secondryids = secondLan.join(","); - - if($rootScope.userData.Id!=0) - { + + setting.isSiteUser=$rootScope.userData.isSiteUser; + setting.LicenseEditionId=$rootScope.userData.LicenseEditionId; + + // if(isallowToChange ||$rootScope.userData.LicenseId==0) + // { AuthenticationService.saveSetings(setting) - .then( - function (result) { - if(result==1) - { + .then( + function (result) { + if(result==1) + { $timeout(function () { - $('#setting-spinner').css('visibility', 'hidden'); - $('#modal-settings').css("display", "none"); - $('#modelsettingsbackground').css('z-index', '12000000'); - $("#modelsettingsbackground").css("display", "none"); - $rootScope.UpdateSetting(Formatsetting); - + $('#setting-spinner').css('visibility', 'hidden'); + $('#modal-settings').css("display", "none"); + $('#modelsettingsbackground').css('z-index', '12000000'); + $("#modelsettingsbackground").css("display", "none"); + $rootScope.UpdateSetting(Formatsetting); + }, 500); - } - else - { - $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR; - $("#messageModal").modal('show'); - } - - }), + } + else + { + $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR; + $("#messageModal").modal('show'); + } + + }), function (error) { console.log(' Error in Saving settings = ' + error.statusText); $rootScope.isVisibleLogin = true; $('#setting-spinner').css('visibility', 'hidden'); $('#modal-settings').css("display", "none"); - $('#modelsettingsbackground').css('zIndex', '12000000'); + $('#modelsettingsbackground').css('z-index', '12000000'); $("#modelsettingsbackground").css("display", "none"); $rootScope.errorMessage = error; $("#messageModal").modal('show'); } - - } - else - { - // for site user. no user id for site license - $('#setting-spinner').css('visibility', 'hidden'); - $('#modal-settings').css("display", "none"); - $('#modelsettingsbackground').css('zIndex', '12000000'); - $("#modelsettingsbackground").css("display", "none"); - $rootScope.UpdateSetting(setting); - - } - + // } + // else + // { + // $timeout(function () { + // $('#setting-spinner').css('visibility', 'hidden'); + // $('#modal-settings').css("display", "none"); + // $('#modelsettingsbackground').css('z-index', '12000000'); + // $("#modelsettingsbackground").css("display", "none"); + // $rootScope.UpdateSetting(Formatsetting); + + // }, 500); + + // } }; diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html index 2207eeb..e80cc3d 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html @@ -118,8 +118,8 @@
- - + +
Account number is required
@@ -267,7 +267,7 @@
- +
Zip is required
@@ -276,7 +276,7 @@
- + (xxx-xxx-xxxx)
Phone is required
Phone is invalid
@@ -292,7 +292,7 @@
- +
Email is required
Email is invalid
@@ -311,7 +311,7 @@
- @@ -331,7 +331,7 @@
- @@ -351,7 +351,7 @@
- @@ -370,7 +370,7 @@
- +
Subscription price is required
Subscription price must be numeric
@@ -381,7 +381,7 @@
- +
Number of export images is required
Number of export images must be numeric
@@ -392,7 +392,7 @@
- +
@@ -419,7 +419,7 @@
- + (Minimum 8 characters)
User Name of minimum 8 characters is required.
@@ -430,7 +430,7 @@
- + (Minimum 8 characters)
Password of minimum 8 characters is required.
diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts index c70171f..4620f26 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts @@ -66,7 +66,7 @@ export class AddLicense implements OnInit { this.editionLoginsText = ''; this.insertUpdateLicenseFrm = this.fb.group({ licenseId: [0], - accountNumber: ['', [Validators.required,this.ClearWhitespaceValidator]], + accountNumber: ['', [Validators.required]], accountTypeId: [0, Validators.min(1)], productId: [''], licenseeFirstName: ['', [Validators.required,this.noWhitespaceValidator]], @@ -78,21 +78,21 @@ export class AddLicense implements OnInit { city: ['', [Validators.required,this.noWhitespaceValidator]], stateId: [0, Validators.min(1)], countryId: [0, Validators.min(1)], - zip: ['', [Validators.required,this.noWhitespaceValidator]], - emailId: ['', [Validators.required,this.ClearWhitespaceValidator]], - phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]], + zip: ['', [Validators.required]], + emailId: ['', [Validators.required]], + phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]], editionLoginArr: this.fb.array([]), editionLogins: [''], totalLogins: [0], - subscriptionPrice: [0, [Validators.required, Validators.pattern('[0-9.]*'),this.noWhitespaceValidator]], + subscriptionPrice: [0, [Validators.required, Validators.pattern('[0-9.]*')]], subscriptionStartDate: [this.startDate, Validators.required], subscriptionEndDate: ['', Validators.required], - noOfImages: ['', [Validators.required, Validators.pattern('[0-9]*'),this.noWhitespaceValidator]], - masterSiteUrl: ['a', [Validators.required,this.noWhitespaceValidator]], + noOfImages: ['', [Validators.required, Validators.pattern('[0-9]*')]], + masterSiteUrl: ['a', [Validators.required]], siteUrlFrom: [''], siteUrlTo: [''], - login: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], - password: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], + login: ['a', [Validators.required, Validators.minLength(8)]], + password: ['a', [Validators.required, Validators.minLength(8)]], securityQuestionId: [0, Validators.min(1)], answer: ['a', [Validators.required,this.noWhitespaceValidator]], testLicenseEditionId: [1], diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html index e7ab12c..d1a8f71 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html @@ -76,7 +76,7 @@
- +
Email is required
Email is invalid
@@ -108,7 +108,7 @@
- +
Zip is required
@@ -140,7 +140,7 @@
- + (xxx-xxx-xxxx)
Phone is required
Phone is invalid
diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts index dc6cb82..14a140e 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts @@ -55,9 +55,9 @@ export class EditLicenseBasicSettings implements OnInit { city: ['', [Validators.required,this.noWhitespaceValidator]], stateId: [0], countryId: [0], - zip: ['', [Validators.required,this.noWhitespaceValidator]], - emailId: ['', [Validators.required,this.noWhitespaceValidator]], - phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]], + zip: ['', [Validators.required]], + emailId: ['', [Validators.required]], + phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]], }); this.GetCountry(); this.GetState(); diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts index ade6329..a8d9af9 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts @@ -250,7 +250,8 @@ export class LicenseService{ { 'siteId': jsonObj.siteId, 'licenseEditionId': element.m_Item1, - 'isModesty': element.m_Item2 + 'isModesty': element.m_Item2, + 'isSiteUser': jsonObj.isSiteUser } ); }); @@ -258,6 +259,7 @@ export class LicenseService{ var headers = new Headers({ 'Content-Type': 'application/json' }); + return this.http.post(this.commonService.resourceBaseUrl + "License/UpdateLicenseModestySettings", JSON.stringify(jsonData), {headers: headers}) .map(this.extractData) diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts index e6f6420..6773236 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts @@ -29,7 +29,7 @@ export class LicenseModestySettings implements OnInit { isBuildingLevel: boolean = false; LicenseId:number=0; AccountNumber:string=''; - + constructor(private _loadingService: LoadingService,private licenseService: LicenseService, public globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService, private _confirmService: ConfirmService) { } @@ -42,6 +42,7 @@ export class LicenseModestySettings implements OnInit { licenseId: [0], accountNumber: ['', Validators.required], siteId: [0], + isSiteUser:[false], lstModesty: [this.fb.array([])], }); $('#AccountNumber').prop('disabled', true); @@ -94,6 +95,7 @@ export class LicenseModestySettings implements OnInit { this.lstLicenseEditionModesty = null; this.lstLicenseSites = null; this.selectedSiteId = 0; + this.updateModestySettingsFrm.controls['siteId'].setValue(0); if (!this.isBuildingLevel) { this.GetLicenseEditionModesty(); } @@ -109,6 +111,27 @@ export class LicenseModestySettings implements OnInit { }, error => this.error = error); } } + + GetLicenseById() { + //use for to check is siteuser or not + if (this.LicenseId != 0) { + this._loadingService.ShowLoading("global-loading"); + this.licenseService.GetLicenseById(this.LicenseId) + .subscribe(st => { + if (st.LicenseId > 0) { + if(st.LicenseTypeId==3) + { + this.updateModestySettingsFrm.controls['isSiteUser'].setValue(true); + } + else + { + this.updateModestySettingsFrm.controls['isSiteUser'].setValue(false); + } + this._loadingService.HideLoading("global-loading"); + } + }, error => this.error = error); + } + } GetLicenseEditionModesty() { this.licenseService.GetLicenseModestySettings(this.LicenseId, this.selectedSiteId) @@ -139,6 +162,7 @@ export class LicenseModestySettings implements OnInit { this.updateModestySettingsFrm.controls['licenseId'].setValue(LicenseId); this.updateModestySettingsFrm.controls['accountNumber'].setValue(AccountNumber); + this.GetLicenseById() } diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html index 16141a8..49bd0a1 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html @@ -22,7 +22,7 @@
- + (Minimum 8 characters)
User Name of minimum 8 characters is required.
@@ -30,7 +30,7 @@
- + (Minimum 8 characters)
Password of minimum 8 characters is required
@@ -38,7 +38,7 @@
- +
Confirm Password is required
@@ -49,7 +49,7 @@
- +
Email Id is required
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts index 1f90e32..5353d5b 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts @@ -47,12 +47,12 @@ export class AddUser implements OnInit { this.alerts = ''; this.adduserFrm = this.fb.group({ id: [''], - UserName: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], - Password: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], - ConfirmPassword: ['', [Validators.required,this.ClearWhitespaceValidator]], + UserName: ['', [Validators.required, Validators.minLength(8)]], + Password: ['', [Validators.required, Validators.minLength(8)]], + ConfirmPassword: ['', [Validators.required]], FirstName: ['', [Validators.required,this.noWhitespaceValidator]], LastName: ['', [Validators.required,this.noWhitespaceValidator]], - EmailId: ['', [Validators.required,this.ClearWhitespaceValidator]], + EmailId: ['', [Validators.required]], AccountNumberId: ['', Validators.required], UserTypeId: ['', Validators.required], ProductEditionId: ['', Validators.required] @@ -87,35 +87,7 @@ export class AddUser implements OnInit { redirect() { this.router.navigate(['/']); } - public ClearWhitespaceValidator(control: FormControl) { - // new validation for intial whaite space - //****Birendra *****/ - var isValid=false; - if(control.value!=null) - { - var inputvalue=control.value; - var controlLen=inputvalue.length; - if(controlLen==undefined)//undefined for integer value - { - isValid=true; - } - else if(controlLen!=0) - { - const isWhitespace = controlLen!=inputvalue.trim().length; - isValid = !isWhitespace; - if(!isValid) - { - control.setValue(inputvalue.trim()); - - } - - } - } - // can use also on page of input control - // - return isValid ? null: { 'whitespace': true }; - - } + public noWhitespaceValidator(control: FormControl) { // new validation for intial whaite space //****Birendra *****/ @@ -263,12 +235,12 @@ export class AddUser implements OnInit { _buildForm(lcid) { this.adduserFrm = this.fb.group({ id: [''], - UserName: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], - Password: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]], - ConfirmPassword: ['', [Validators.required,this.ClearWhitespaceValidator]], + UserName: ['', [Validators.required, Validators.minLength(8)]], + Password: ['', [Validators.required, Validators.minLength(8)]], + ConfirmPassword: ['', [Validators.required]], FirstName: ['', [Validators.required,this.noWhitespaceValidator]], LastName: ['', [Validators.required,this.noWhitespaceValidator]], - EmailId: ['', [Validators.required,this.ClearWhitespaceValidator]], + EmailId: ['', [Validators.required]], AccountNumberId: ['', Validators.required], UserTypeId: ['', Validators.required], ProductEditionId: ['', Validators.required] diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html index 2d229f2..961924e 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html @@ -37,7 +37,7 @@
- +
Email Id is required
Email is Invalid.
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts index 222d4d6..94d77f8 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts @@ -48,7 +48,7 @@ export class UpdateUserProfile implements OnInit { id: [''], firstName: ['', [Validators.required,this.noWhitespaceValidator]], lastName: ['', [Validators.required,this.noWhitespaceValidator]], - emailId: ['', [Validators.required,this.noWhitespaceValidator]] + emailId: ['', [Validators.required]] }); diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html index b63d467..bdf181b 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html @@ -203,7 +203,7 @@
- + (Minimum 8 characters)
User Name of minimum 8 characters is required
@@ -211,7 +211,7 @@
- + (Minimum 8 characters)
Password of minimum 8 characters is required
@@ -219,7 +219,7 @@
- +
Confirm Password is required
Password not match. @@ -229,7 +229,7 @@
- +
Email Id is required
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts index f5488d6..45d9111 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts @@ -105,12 +105,12 @@ export class UsersList implements OnInit, AfterViewChecked { }); this.adduserFrm = this.fb.group({ id: [''], - UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]], - Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]], - ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]], + UserName: ['', [Validators.required, Validators.minLength(8)]], + Password: ['', [Validators.required, Validators.minLength(8)]], + ConfirmPassword: ['', [Validators.required]], FirstName: ['', [Validators.required,this.noWhitespaceValidator]], LastName: ['', [Validators.required,this.noWhitespaceValidator]], - EmailId: ['', [Validators.required,this.noWhitespaceValidator]], + EmailId: ['', [Validators.required]], AccountNumber: [''], UserTypeTitle: [''], AccountTypeTitle: [''],