Commit c36d7e0f433c843699e4dcc30153909d99cd3efc

Authored by Birendra
1 parent 907fad24

lexicon and modesty changes

Showing 21 changed files with 295 additions and 188 deletions
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs
... ... @@ -312,16 +312,18 @@ namespace AIAHTML5.ADMIN.API.Controllers
312 312 public HttpResponseMessage UpdateLicenseModestySettings(JObject jsonData)
313 313 {
314 314 bool Status = false;
315   - List<Tuple<int, int, bool>> LicenseModestyList = new List<Tuple<int, int, bool>>();
316   - Tuple<int, int, bool> LicenseModesty;
  315 + List<Tuple<int, int, bool,bool>> LicenseModestyList = new List<Tuple<int, int, bool,bool>>();
  316 + Tuple<int, int, bool,bool> LicenseModesty;
317 317 for (int i = 0; i < jsonData["obj"].Count(); i++)
318 318 {
319   - LicenseModesty = new Tuple<int, int, bool>(
  319 + LicenseModesty = new Tuple<int, int, bool,bool>(
320 320 ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["licenseEditionId"])).Value<int>(),
321 321 ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["siteId"])).Value<int>(),
322   - ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isModesty"])).Value<bool>());
  322 + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isModesty"])).Value<bool>(),
  323 + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isSiteUser"])).Value<bool>());
323 324 LicenseModestyList.Add(LicenseModesty);
324 325 }
  326 +
325 327 try
326 328 {
327 329 Status = LicenseModel.UpdateLicenseModestySettings(dbContext, LicenseModestyList);
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... ... @@ -3528,7 +3528,7 @@ namespace AIAHTML5.ADMIN.API.Entity
3528 3528 return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseBasicSettings", iLicenseIdParameter, sLicenseeFnameParameter, sLicenseeLnameParameter, sInstitutionNameParameter, sAddress1Parameter, sAddress2Parameter, sCityParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sPhoneParameter, sEmailIdParameter, status);
3529 3529 }
3530 3530  
3531   - public virtual int usp_UpdateLicenseModestySettings(Nullable<int> licenseEditionId, Nullable<int> siteId, Nullable<bool> isModesty, ObjectParameter status)
  3531 + public virtual int usp_UpdateLicenseModestySettings(Nullable<int> licenseEditionId, Nullable<int> siteId, Nullable<bool> isModesty, Nullable<bool> isSiteUser, ObjectParameter status)
3532 3532 {
3533 3533 var licenseEditionIdParameter = licenseEditionId.HasValue ?
3534 3534 new ObjectParameter("LicenseEditionId", licenseEditionId) :
... ... @@ -3542,7 +3542,11 @@ namespace AIAHTML5.ADMIN.API.Entity
3542 3542 new ObjectParameter("IsModesty", isModesty) :
3543 3543 new ObjectParameter("IsModesty", typeof(bool));
3544 3544  
3545   - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, status);
  3545 + var isSiteUserParameter = isSiteUser.HasValue ?
  3546 + new ObjectParameter("isSiteUser", isSiteUser) :
  3547 + new ObjectParameter("isSiteUser", typeof(bool));
  3548 +
  3549 + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, isSiteUserParameter, status);
3546 3550 }
3547 3551  
3548 3552 public virtual int usp_UpdateLicenseModuleStatus(Nullable<int> licenseId, string moduleStatusText, ObjectParameter status)
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... ... @@ -1495,6 +1495,7 @@
1495 1495 <Parameter Name="LicenseEditionId" Type="int" Mode="In" />
1496 1496 <Parameter Name="SiteId" Type="int" Mode="In" />
1497 1497 <Parameter Name="IsModesty" Type="bit" Mode="In" />
  1498 + <Parameter Name="isSiteUser" Type="bit" Mode="In" />
1498 1499 <Parameter Name="Status" Type="bit" Mode="InOut" />
1499 1500 </Function>
1500 1501 <Function Name="usp_UpdateLicenseModuleStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
... ... @@ -2572,6 +2573,7 @@
2572 2573 <Parameter Name="LicenseEditionId" Mode="In" Type="Int32" />
2573 2574 <Parameter Name="SiteId" Mode="In" Type="Int32" />
2574 2575 <Parameter Name="IsModesty" Mode="In" Type="Boolean" />
  2576 + <Parameter Name="isSiteUser" Mode="In" Type="Boolean" />
2575 2577 <Parameter Name="Status" Mode="InOut" Type="Boolean" />
2576 2578 </FunctionImport>
2577 2579 <FunctionImport Name="usp_UpdateLicenseModuleStatus">
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
... ... @@ -395,14 +395,14 @@ namespace AIAHTML5.ADMIN.API.Models
395 395 }
396 396 }
397 397  
398   - public static bool UpdateLicenseModestySettings(AIADatabaseV5Entities dbContext, List<Tuple<int, int, bool>> LicenseModestyList)
  398 + public static bool UpdateLicenseModestySettings(AIADatabaseV5Entities dbContext, List<Tuple<int, int, bool,bool>> LicenseModestyList)
399 399 {
400 400 var spStatus = new System.Data.Objects.ObjectParameter("Status", 0);
401 401 try
402 402 {
403 403 foreach (var item in LicenseModestyList)
404 404 {
405   - dbContext.usp_UpdateLicenseModestySettings(item.Item1, item.Item2, item.Item3, spStatus);
  405 + dbContext.usp_UpdateLicenseModestySettings(item.Item1, item.Item2, item.Item3, item.Item4, spStatus);
406 406 if (!(bool)spStatus.Value) break;
407 407 }
408 408 return (bool)spStatus.Value;
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... ... @@ -241,11 +241,13 @@ namespace AIAHTML5.API.Controllers
241 241 {
242 242 //based on old .net code(AIA flex), we get modules based on licenseId if licenseid>0.
243 243 //we verified in database that only superadmin has no licenseid so getting all modules for supeadmin
244   - int licenseId, editionId;
245   - AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId);
  244 + int licenseId, editionId, LicenseEditionId;
  245 + AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId,out LicenseEditionId);
246 246  
247 247 userInfo.LicenseId = licenseId;
248 248 userInfo.EditionId = editionId;
  249 + userInfo.LicenseEditionId = LicenseEditionId;
  250 + userInfo.isSiteUser = false;
249 251  
250 252 //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN)
251 253 if (userInfo.LicenseId == 0)
... ... @@ -271,7 +273,7 @@ namespace AIAHTML5.API.Controllers
271 273 //get use settings
272 274 string skintone;
273 275 string modesty;
274   - User us = AIAHTML5.API.Models.Users.GetUserSelectedSettings(userInfo.Id, out skintone, out modesty);
  276 + User us = AIAHTML5.API.Models.Users.GetUserSelectedSettings(userInfo.Id, false, out skintone, out modesty);
275 277 if (us != null)
276 278 {
277 279 userInfo.userselectedModesty = modesty;
... ... @@ -437,9 +439,13 @@ namespace AIAHTML5.API.Controllers
437 439 settings.userSelectedSkintone = jsonData["skintone"].Value<string>();
438 440 settings.userSelectedFont = null;
439 441 settings.Id= jsonData["userId"].Value<int>();
  442 + settings.LicenseEditionId = jsonData["LicenseEditionId"].Value<int>();
  443 + settings.isSiteUser = jsonData["isSiteUser"].Value<bool>();
  444 +
440 445 userLexicon.primaryid= jsonData["primaryid"].Value<string>();
441 446 userLexicon.secondryids = jsonData["secondryids"].Value<string>();
442 447 settings.userLexicon= userLexicon;
  448 +
443 449  
444 450 Status = AIAHTML5.API.Models.Users.SaveUserSelectedSettings(settings);
445 451 if (Status == 1)
... ...
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... ... @@ -157,6 +157,8 @@ namespace AIAHTML5.API.Models
157 157 {
158 158 hash.Add(AIAConstants.LICENSE_KEY_ID, ds.Tables[0].Rows[0][0]);
159 159 hash.Add(AIAConstants.EDITION_KEY_ID, ds.Tables[0].Rows[0][1]);
  160 + // LicenseEditionId use to update modesty in LicenseToEdition table
  161 + hash.Add("LicenseEditionId", ds.Tables[0].Rows[0][2]);
160 162 }
161 163 }
162 164  
... ... @@ -384,7 +386,7 @@ namespace AIAHTML5.API.Models
384 386 return status;
385 387 }
386 388  
387   - internal User GetSelectedSettings(int userId)
  389 + internal User GetSelectedSettings(int userId,bool isSiteUser)
388 390 {
389 391 logger.Debug(" Inside GetSelectedSettings for userId = " + userId);
390 392 UserLexicon objlexicon = null;
... ... @@ -394,18 +396,16 @@ namespace AIAHTML5.API.Models
394 396 SqlConnection conn = new SqlConnection(dbConnectionString);
395 397 SqlCommand cmd = new SqlCommand();
396 398 SqlDataAdapter adapter;
397   - SqlParameter param;
  399 +
398 400 DataSet ds = new DataSet();
399 401  
400 402 cmd.Connection = conn;
401 403 cmd.CommandText = DBConstants.GET_SETTINGS;
402 404 cmd.CommandType = CommandType.StoredProcedure;
403 405  
404   - param = new SqlParameter("@iUserId", userId);
405   - param.Direction = ParameterDirection.Input;
406   - param.DbType = DbType.Int32;
407   - cmd.Parameters.Add(param);
408   -
  406 + cmd.Parameters.AddWithValue("@iUserId", userId);
  407 + cmd.Parameters.AddWithValue("@isSiteUser", isSiteUser);
  408 +
409 409 adapter = new SqlDataAdapter(cmd);
410 410 adapter.Fill(ds);
411 411  
... ... @@ -784,6 +784,8 @@ namespace AIAHTML5.API.Models
784 784 cmd.Parameters.AddWithValue("@ifont","" );
785 785 cmd.Parameters.AddWithValue("@pLexicon", settings.userLexicon.primaryid);
786 786 cmd.Parameters.AddWithValue("@sLexicon", settings.userLexicon.secondryids);
  787 + cmd.Parameters.AddWithValue("@isSiteUser", settings.isSiteUser);
  788 + cmd.Parameters.AddWithValue("@LicenseEditionId", settings.LicenseEditionId);
787 789  
788 790  
789 791 result = cmd.ExecuteNonQuery();
... ... @@ -1249,7 +1251,7 @@ namespace AIAHTML5.API.Models
1249 1251 return dt;
1250 1252 }
1251 1253  
1252   - internal DataTable GetLicenseBySiteId(int siteId)
  1254 + internal DataTable GetLicenseBySiteId(int siteId, int editionId)
1253 1255 {
1254 1256 logger.Debug(" inside GetLicenseBySiteId for siteId= " + siteId);
1255 1257  
... ... @@ -1262,7 +1264,8 @@ namespace AIAHTML5.API.Models
1262 1264 cmd.CommandText = DBConstants.GET_LICENSE_BY_SITE_ID;
1263 1265 cmd.CommandType = CommandType.StoredProcedure;
1264 1266 cmd.Parameters.AddWithValue("@sSiteId", siteId);
1265   -
  1267 + cmd.Parameters.AddWithValue("@sEditionId", editionId);
  1268 +
1266 1269 SqlDataAdapter da = new SqlDataAdapter();
1267 1270 da.SelectCommand = cmd;
1268 1271 dt = new DataTable();
... ...
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... ... @@ -34,6 +34,8 @@ namespace AIAHTML5.API.Models
34 34 public bool IsBlocked { get; set; }
35 35 public int LicenseId { get; set; }
36 36 public int EditionId { get; set; }
  37 + public int LicenseEditionId { get; set; }
  38 + public bool isSiteUser { get; set; }
37 39 public Int16 LoginFailureCauseId { get; set; }
38 40 public bool IsModestyOn { get; set; }
39 41 public ArrayList Modules { get; set; }
... ...
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... ... @@ -114,13 +114,14 @@ namespace AIAHTML5.API.Models
114 114 return userDetails;
115 115 }
116 116  
117   - internal static void getLicenseIdForThisUser(int userId, out int licenseId, out int editionId)
  117 + internal static void getLicenseIdForThisUser(int userId, out int licenseId, out int editionId, out int LicenseEditionId)
118 118 {
119 119 logger.Debug("inside getLicenseIdForThisUser for UserId =" + userId);
120 120  
121 121 //assigning below variable to avoid compiler error for unassignd out params
122 122 licenseId = 0;
123 123 editionId = 0;
  124 + LicenseEditionId = 0;
124 125  
125 126  
126 127  
... ... @@ -133,6 +134,9 @@ namespace AIAHTML5.API.Models
133 134 if (licenseEditionHash.ContainsKey(AIAConstants.EDITION_KEY_ID))
134 135 editionId = Convert.ToInt32(licenseEditionHash[AIAConstants.EDITION_KEY_ID]);
135 136  
  137 + if (licenseEditionHash.ContainsKey("LicenseEditionId"))
  138 + LicenseEditionId = Convert.ToInt32(licenseEditionHash["LicenseEditionId"]);
  139 +
136 140  
137 141 }
138 142  
... ... @@ -356,14 +360,14 @@ namespace AIAHTML5.API.Models
356 360 return result;
357 361 }
358 362  
359   - internal static User GetUserSelectedSettings(int userId,out string skintone, out string modesty)
  363 + internal static User GetUserSelectedSettings(int userId,bool isSiteUser, out string skintone, out string modesty)
360 364 {
361 365 logger.Debug("inside GetUserSelectedSettings for userid =" + userId);
362 366  
363 367 skintone = null;
364 368 modesty = null;
365 369 DBModel objModel = new DBModel();
366   - User result = objModel.GetSelectedSettings(userId);
  370 + User result = objModel.GetSelectedSettings(userId, isSiteUser);
367 371 if (result != null)
368 372 {
369 373 skintone = result.userSelectedSkintone;
... ... @@ -538,8 +542,7 @@ namespace AIAHTML5.API.Models
538 542 bool isSubscriptionNotStart = false;
539 543  
540 544 int intLicenseId = 0;
541   - int intEditionId = Convert.ToInt16(strEdition);
542   -
  545 +
543 546 DateTime dtLogDate = DateTime.Now;
544 547  
545 548 if (string.IsNullOrEmpty(strAcccountNumber))
... ... @@ -554,8 +557,10 @@ namespace AIAHTML5.API.Models
554 557 }
555 558 else
556 559 {
  560 + int intEditionId = Convert.ToInt16(strEdition);
  561 +
557 562 DBModel objDBModel = new DBModel();
558   - DataTable dtLicense = objDBModel.GetLicenseBySiteId(intSiteId);
  563 + DataTable dtLicense = objDBModel.GetLicenseBySiteId(intSiteId, intEditionId);
559 564 if (dtLicense.Rows.Count > 0)
560 565 {
561 566  
... ... @@ -597,6 +602,8 @@ namespace AIAHTML5.API.Models
597 602 {
598 603 //User objUserContext = new User();
599 604 userInfo.Id = 0;
  605 + userInfo.siteId = intSiteId;
  606 + userInfo.isSiteUser = true;
600 607 userInfo.FirstName = licRow["LicenseeFirstName"].ToString();
601 608 userInfo.LastName = licRow["LicenseeLastName"].ToString();
602 609 userInfo.UserTypeId = AIAConstants.SITE_USER;
... ... @@ -612,6 +619,7 @@ namespace AIAHTML5.API.Models
612 619 userInfo.EditionId = (Byte)intEditionId;
613 620 userInfo.LicenseTypeId = (byte)licRow["LicenseTypeId"];
614 621 userInfo.LicenseId = Convert.ToInt32(licRow["Id"]);
  622 + userInfo.LicenseEditionId = Convert.ToInt32(licRow["LicenseEditionId"]);
615 623 userInfo.LoginId = "";
616 624 userInfo.Modesty = (bool)licRow["IsModesty"];
617 625 //Retreive ModestyMode
... ... @@ -631,8 +639,25 @@ namespace AIAHTML5.API.Models
631 639 }
632 640 }
633 641  
634   - // get edition features details
635   - userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId);
  642 + string skintone;
  643 + string modesty;
  644 + User us =GetUserSelectedSettings(userInfo.siteId,true, out skintone, out modesty);
  645 + if (us != null)
  646 + {
  647 + userInfo.userselectedModesty = modesty;
  648 + userInfo.userSelectedSkintone = skintone;
  649 + userInfo.userLexicon = us.userLexicon;
  650 + }
  651 + else
  652 + {
  653 + userInfo.userselectedModesty = null;
  654 + userInfo.userSelectedSkintone = null;
  655 + userInfo.userLexicon = null;
  656 +
  657 + }
  658 +
  659 + // get edition features details
  660 + userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId);
636 661  
637 662 if (intLicenseId > 0)
638 663 userInfo.Modules = getModuleListByLicenseId(intLicenseId);
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -31,20 +31,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
31 31 $rootScope.shapeType;
32 32 $rootScope.canvasLayerNameCollection=[];
33 33 $rootScope.islaxicanlanguageChange=false;
34   - $rootScope.globalSetting = {
35   - ethnicity: 'W',
36   - modesty: 'Y',
37   - };
38   - $rootScope.formsetting = {
39   - ethnicity: null,
40   - modesty: null
41   - };
42   - $rootScope.lexicons = {
43   - primaryid:1,
44   - secondryids:[]
45   - };
46   -
47   -
  34 +
48 35 // 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.
49 36 $rootScope.refreshcheck = null;
50 37 var isCommingSoonModel = true;
... ... @@ -1624,45 +1611,90 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1624 1611 if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) {
1625 1612 //code for modesty setting
1626 1613 if (result.LicenseInfo != null) {
1627   - if (result.Modesty) {
1628   - $rootScope.isModestyOn = true;
1629   - $rootScope.isModestyOff = false;
1630   - localStorage.setItem("globalModesty", "Y");
1631   - $rootScope.formsetting = {
1632   - ethnicity: "W",
1633   - modesty: "Y"
  1614 + if (result.userselectedModesty == undefined || result.userselectedModesty == null ||
  1615 + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) {
  1616 + if (result.Modesty) {
  1617 + $rootScope.isModestyOn = true;
  1618 + $rootScope.isModestyOff = false;
  1619 + localStorage.setItem("globalModesty", "Y");
  1620 + $rootScope.formsetting = {
  1621 + ethnicity: "W",
  1622 + modesty: "Y"
  1623 + }
  1624 +
  1625 + $rootScope.UpdateSetting($rootScope.formsetting)
  1626 + }
  1627 + else {
  1628 + $rootScope.isModestyOn = false;
  1629 + $rootScope.isModestyOff = true;
  1630 + localStorage.setItem("globalModesty", "N");
  1631 + $rootScope.formsetting = {
  1632 + ethnicity: "W",
  1633 + modesty: "N"
  1634 + }
  1635 +
  1636 + $rootScope.UpdateSetting($rootScope.formsetting)
1634 1637 }
1635   - $rootScope.UpdateSetting($rootScope.formsetting)
1636 1638 }
1637   - else {
1638   - $rootScope.isModestyOn = false;
1639   - $rootScope.isModestyOff = true;
1640   - localStorage.setItem("globalModesty", "N");
  1639 + else
  1640 + {
  1641 + localStorage.setItem("globalModesty", result.userselectedModesty);
  1642 + localStorage.setItem("globalEthnicity", result.userSelectedSkintone);
  1643 +
1641 1644 $rootScope.formsetting = {
1642   - ethnicity: "W",
1643   - modesty: "N"
  1645 + ethnicity: result.userSelectedSkintone,
  1646 + modesty: result.userselectedModesty
1644 1647 }
1645   - $rootScope.UpdateSetting($rootScope.formsetting)
  1648 +
  1649 + $rootScope.UpdateSetting($rootScope.formsetting);
  1650 +
1646 1651 }
  1652 +
  1653 + $rootScope.lexicons = {
  1654 + primaryid:result.userLexicon!=null && result.userLexicon.primaryid!=""?result.userLexicon.primaryid:"1",
  1655 + secondryids:result.userLexicon!=null && result.userLexicon.secondryids!="" ?result.userLexicon.secondryids:""
  1656 + };
  1657 +
  1658 + $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids)
  1659 +
1647 1660 }
1648   - else {
1649   - $rootScope.isModestyOn = true;
1650   - $rootScope.isModestyOff = false;
1651   - localStorage.setItem("globalModesty", "Y");
1652   - $rootScope.formsetting = {
1653   - ethnicity: "W",
1654   - modesty: "Y"
  1661 + else
  1662 + {
  1663 + if (result.userselectedModesty == undefined || result.userselectedModesty == null ||
  1664 + result.userSelectedSkintone == undefined || result.userSelectedSkintone == null) {
  1665 +
  1666 + $rootScope.isModestyOn = true;
  1667 + $rootScope.isModestyOff = false;
  1668 + localStorage.setItem("globalModesty", "Y");
  1669 + $rootScope.formsetting = {
  1670 + ethnicity: "W",
  1671 + modesty: "Y"
  1672 + }
  1673 + $rootScope.UpdateSetting($rootScope.formsetting);
  1674 + }
  1675 + else
  1676 + {
  1677 + localStorage.setItem("globalModesty", result.userselectedModesty);
  1678 + localStorage.setItem("globalEthnicity", result.userSelectedSkintone);
  1679 +
  1680 + $rootScope.formsetting = {
  1681 + ethnicity: result.userSelectedSkintone,
  1682 + modesty: result.userselectedModesty
  1683 + }
  1684 + $rootScope.UpdateSetting($rootScope.formsetting)
  1685 +
1655 1686 }
1656   - $rootScope.UpdateSetting($rootScope.formsetting)
  1687 +
  1688 + $rootScope.lexicons = {
  1689 + primaryid:result.userLexicon!=null && result.userLexicon.primaryid!=""?result.userLexicon.primaryid:"1",
  1690 + secondryids:result.userLexicon!=null && result.userLexicon.secondryids!="" ?result.userLexicon.secondryids:""
  1691 + };
  1692 +
  1693 + $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids)
  1694 +
1657 1695 }
1658 1696  
1659   - //for site user set default lexicon
1660   - $rootScope.lexicons = {
1661   - primaryid:"1",
1662   - secondryids:""
1663   - };
1664 1697  
1665   - $rootScope.InitiateLexicon( $rootScope.lexicons.primaryid, $rootScope.lexicons.secondryids)
1666 1698 //code for modesty setting
1667 1699 $rootScope.aiaModesty = $rootScope.formsetting.modesty;
1668 1700  
... ... @@ -8092,6 +8124,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8092 8124  
8093 8125 $rootScope.loadsettings = function () {
8094 8126  
  8127 + //applcation reload blank these value after assign
  8128 + $rootScope.globalSetting = {
  8129 + ethnicity: 'W',
  8130 + modesty: 'Y',
  8131 + };
  8132 + $rootScope.formsetting = {
  8133 + ethnicity: null,
  8134 + modesty: null
  8135 + };
  8136 + $rootScope.lexicons = {
  8137 + primaryid:1,
  8138 + secondryids:[]
  8139 + };
  8140 +
8095 8141 //1. For now we are by default opening DA settings tab
8096 8142 $rootScope.SettingsTab = 3;
8097 8143  
... ... @@ -8214,7 +8260,23 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8214 8260 var setting={};
8215 8261 setting.modesty =Formatsetting.modesty ;
8216 8262 setting.skintone = Formatsetting.ethnicity;
8217   - setting.userId = $rootScope.userData.Id;
  8263 +
  8264 + // var isallowToChange=false;
  8265 + if($rootScope.userData.isSiteUser)
  8266 + {
  8267 + // send as user id
  8268 + setting.userId = $rootScope.userData.siteId;
  8269 + //isallowToChange=$rootScope.userData.EditionId<3;
  8270 + }
  8271 + else
  8272 + {
  8273 + setting.userId = $rootScope.userData.Id;
  8274 + //concurrent license
  8275 + // only instructor
  8276 + //if($rootScope.userData.LicenseId!=0)
  8277 + // isallowToChange=$rootScope.userData.EditionId<3;
  8278 +
  8279 + }
8218 8280  
8219 8281 var secondLan=[]
8220 8282  
... ... @@ -8225,54 +8287,57 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8225 8287  
8226 8288 setting.primaryid = $('#primarylaxican').attr("name");
8227 8289 setting.secondryids = secondLan.join(",");
8228   -
8229   - if($rootScope.userData.Id!=0)
8230   - {
  8290 +
  8291 + setting.isSiteUser=$rootScope.userData.isSiteUser;
  8292 + setting.LicenseEditionId=$rootScope.userData.LicenseEditionId;
  8293 +
  8294 + // if(isallowToChange ||$rootScope.userData.LicenseId==0)
  8295 + // {
8231 8296 AuthenticationService.saveSetings(setting)
8232   - .then(
8233   - function (result) {
8234   - if(result==1)
8235   - {
  8297 + .then(
  8298 + function (result) {
  8299 + if(result==1)
  8300 + {
8236 8301 $timeout(function () {
8237   - $('#setting-spinner').css('visibility', 'hidden');
8238   - $('#modal-settings').css("display", "none");
8239   - $('#modelsettingsbackground').css('z-index', '12000000');
8240   - $("#modelsettingsbackground").css("display", "none");
8241   - $rootScope.UpdateSetting(Formatsetting);
8242   -
  8302 + $('#setting-spinner').css('visibility', 'hidden');
  8303 + $('#modal-settings').css("display", "none");
  8304 + $('#modelsettingsbackground').css('z-index', '12000000');
  8305 + $("#modelsettingsbackground").css("display", "none");
  8306 + $rootScope.UpdateSetting(Formatsetting);
  8307 +
8243 8308 }, 500);
8244 8309  
8245   - }
8246   - else
8247   - {
8248   - $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR;
8249   - $("#messageModal").modal('show');
8250   - }
8251   -
8252   - }),
  8310 + }
  8311 + else
  8312 + {
  8313 + $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR;
  8314 + $("#messageModal").modal('show');
  8315 + }
  8316 +
  8317 + }),
8253 8318 function (error) {
8254 8319 console.log(' Error in Saving settings = ' + error.statusText);
8255 8320 $rootScope.isVisibleLogin = true;
8256 8321 $('#setting-spinner').css('visibility', 'hidden');
8257 8322 $('#modal-settings').css("display", "none");
8258   - $('#modelsettingsbackground').css('zIndex', '12000000');
  8323 + $('#modelsettingsbackground').css('z-index', '12000000');
8259 8324 $("#modelsettingsbackground").css("display", "none");
8260 8325 $rootScope.errorMessage = error;
8261 8326 $("#messageModal").modal('show');
8262 8327 }
8263   -
8264   - }
8265   - else
8266   - {
8267   - // for site user. no user id for site license
8268   - $('#setting-spinner').css('visibility', 'hidden');
8269   - $('#modal-settings').css("display", "none");
8270   - $('#modelsettingsbackground').css('zIndex', '12000000');
8271   - $("#modelsettingsbackground").css("display", "none");
8272   - $rootScope.UpdateSetting(setting);
8273   -
8274   - }
8275   -
  8328 + // }
  8329 + // else
  8330 + // {
  8331 + // $timeout(function () {
  8332 + // $('#setting-spinner').css('visibility', 'hidden');
  8333 + // $('#modal-settings').css("display", "none");
  8334 + // $('#modelsettingsbackground').css('z-index', '12000000');
  8335 + // $("#modelsettingsbackground").css("display", "none");
  8336 + // $rootScope.UpdateSetting(Formatsetting);
  8337 +
  8338 + // }, 500);
  8339 +
  8340 + // }
8276 8341  
8277 8342 };
8278 8343  
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.html
... ... @@ -118,8 +118,8 @@
118 118 <div class="form-group marginTop5">
119 119 <label for="AccountNo" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account No <span class="red">*</span> : </label>
120 120 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
121   - <input type="text" class="form-control input-sm" id="AccountNo" formControlName="accountNumber" maxlength="16" *ngIf="license.LicenseId > 0" [attr.disabled]="license.LicenseId > 0" (blur)="OnAccountNoBlur($event.target.value)">
122   - <input type="text" class="form-control input-sm" id="AccountNo" formControlName="accountNumber" maxlength="16" *ngIf="license.LicenseId == 0" (blur)="OnAccountNoBlur($event.target.value)">
  121 + <input type="text" class="form-control input-sm" id="AccountNo" formControlName="accountNumber" maxlength="16" *ngIf="license.LicenseId > 0" [attr.disabled]="license.LicenseId > 0" (blur)="OnAccountNoBlur($event.target.value)" (keydown.space)="$event.preventDefault();">
  122 + <input type="text" class="form-control input-sm" id="AccountNo" formControlName="accountNumber" maxlength="16" *ngIf="license.LicenseId == 0" (blur)="OnAccountNoBlur($event.target.value)" (keydown.space)="$event.preventDefault();">
123 123 <div *ngIf="insertUpdateLicenseFrm.controls.accountNumber.hasError('required') && insertUpdateLicenseFrm.controls.accountNumber.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Account number is required</div>
124 124 </div>
125 125 </div>
... ... @@ -267,7 +267,7 @@
267 267 <div class="form-group marginTop5">
268 268 <label for="Zip" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Zip <span class="red">*</span> : </label>
269 269 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
270   - <input type="text" class="form-control input-sm" id="Zip" formControlName="zip" maxlength="20">
  270 + <input type="text" class="form-control input-sm" id="Zip" formControlName="zip" maxlength="20" (keydown.space)="$event.preventDefault();">
271 271 <div *ngIf="insertUpdateLicenseFrm.controls.zip.hasError('required') && insertUpdateLicenseFrm.controls.zip.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Zip is required</div>
272 272 </div>
273 273 </div>
... ... @@ -276,7 +276,7 @@
276 276 <div class="form-group marginTop5">
277 277 <label for="Phone" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Phone <span class="red">*</span> : </label>
278 278 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
279   - <input type="text" class="form-control input-sm" id="Phone" formControlName="phone" maxlength="30" (keyup)="onKeyUp($event)">
  279 + <input type="text" class="form-control input-sm" id="Phone" formControlName="phone" maxlength="30" (keyup)="onKeyUp($event)" (keydown.space)="$event.preventDefault();">
280 280 <span class="help-block">(xxx-xxx-xxxx)</span>
281 281 <div *ngIf="insertUpdateLicenseFrm.controls.phone.hasError('required') && insertUpdateLicenseFrm.controls.phone.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Phone is required</div>
282 282 <div *ngIf="insertUpdateLicenseFrm.controls.phone.hasError('pattern') && (insertUpdateLicenseFrm.controls.phone.dirty || license.LicenseId > 0)" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Phone is invalid</div>
... ... @@ -292,7 +292,7 @@
292 292 <div class="form-group marginTop5">
293 293 <label for="Email" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Email ID <span class="red">*</span> : </label>
294 294 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
295   - <input type="text" class="form-control input-sm" id="Email" formControlName="emailId" maxlength="50" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$">
  295 + <input type="text" class="form-control input-sm" id="Email" formControlName="emailId" maxlength="50" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$" (keydown.space)="$event.preventDefault();">
296 296 <div *ngIf="insertUpdateLicenseFrm.controls.emailId.hasError('required') && !insertUpdateLicenseFrm.controls.emailId.value && insertUpdateLicenseFrm.controls.emailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email is required</div>
297 297 <div *ngIf="insertUpdateLicenseFrm.controls.emailId.invalid && insertUpdateLicenseFrm.controls.emailId.value" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email is invalid</div>
298 298 </div>
... ... @@ -311,7 +311,7 @@
311 311 <label for="SubscriptionStartDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Subscription Start Date<span class="red">*</span>:</label>
312 312 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
313 313 <div id="datetimepicker1" class="input-group input-group-sm input-append date">
314   - <input type="text" class="form-control" id="SubscriptionStartDate" formControlName="subscriptionStartDate"
  314 + <input type="text" class="form-control" id="SubscriptionStartDate" formControlName="subscriptionStartDate" (keydown.space)="$event.preventDefault();"
315 315 #dp1="bsDatepicker" bsDatepicker [(bsValue)]="bsValue1"
316 316 [minDate]="minDate" [maxDate]="maxDate" [bsConfig]="bsConfig"
317 317 (bsValueChange)="DateChange(dp1)" (change)="DateChange(dp1)">
... ... @@ -331,7 +331,7 @@
331 331 <label for="SubscriptionEndDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Subscription End Date<span class="red">*</span>:</label>
332 332 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
333 333 <div id="datetimepicker2" class="input-group input-group-sm input-append date">
334   - <input type="text" class="form-control" id="SubscriptionEndDate" formControlName="subscriptionEndDate"
  334 + <input type="text" class="form-control" id="SubscriptionEndDate" formControlName="subscriptionEndDate" (keydown.space)="$event.preventDefault();"
335 335 #dp2="bsDatepicker" bsDatepicker [(bsValue)]="bsValue2"
336 336 [minDate]="minDate" [maxDate]="maxDate" [bsConfig]="bsConfig"
337 337 (bsValueChange)="DateChange(dp2)" (change)="DateChange(dp2)">
... ... @@ -351,7 +351,7 @@
351 351 <label for="RenewDate" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Renew Date <span class="red">*</span> :</label>
352 352 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
353 353 <div id="datetimepicker3" class="input-group input-group-sm input-append date">
354   - <input type="text" class="form-control" id="RenewDate" formControlName="renewDate"
  354 + <input type="text" class="form-control" id="RenewDate" formControlName="renewDate" (keydown.space)="$event.preventDefault();"
355 355 #dp3="bsDatepicker" bsDatepicker [(bsValue)]="bsValue3"
356 356 [minDate]="minDate" [maxDate]="maxDate" [bsConfig]="bsConfig"
357 357 (bsValueChange)="DateChange(dp3)" (change)="DateChange(dp3)">
... ... @@ -370,7 +370,7 @@
370 370 <div class="form-group marginTop5">
371 371 <label for="SubscriptionPrice" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Subscription Price <span class="red">*</span> : </label>
372 372 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
373   - <input type="text" class="form-control input-sm" id="SubscriptionPrice" formControlName="subscriptionPrice" maxlength="11" (blur)="SubscriptionPriceBlur()" (keyup)="onKeyPress($event)">
  373 + <input type="text" class="form-control input-sm" id="SubscriptionPrice" formControlName="subscriptionPrice" maxlength="11" (blur)="SubscriptionPriceBlur()" (keyup)="onKeyPress($event)" (keydown.space)="$event.preventDefault();">
374 374 <div *ngIf="insertUpdateLicenseFrm.controls.subscriptionPrice.hasError('required') && insertUpdateLicenseFrm.controls.subscriptionPrice.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Subscription price is required</div>
375 375 <div *ngIf="insertUpdateLicenseFrm.controls.subscriptionPrice.hasError('pattern') && insertUpdateLicenseFrm.controls.subscriptionPrice.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Subscription price must be numeric</div>
376 376 </div>
... ... @@ -381,7 +381,7 @@
381 381 <div class="form-group marginTop5">
382 382 <label for="ExportImages" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">No. of Export Images <span class="red">*</span> : </label>
383 383 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
384   - <input type="text" class="form-control input-sm" id="ExportImages" formControlName="noOfImages" maxlength="5">
  384 + <input type="text" class="form-control input-sm" id="ExportImages" formControlName="noOfImages" maxlength="5" (keydown.space)="$event.preventDefault();">
385 385 <div *ngIf="insertUpdateLicenseFrm.controls.noOfImages.hasError('required') && insertUpdateLicenseFrm.controls.noOfImages.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Number of export images is required</div>
386 386 <div *ngIf="insertUpdateLicenseFrm.controls.noOfImages.hasError('pattern') && insertUpdateLicenseFrm.controls.noOfImages.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Number of export images must be numeric</div>
387 387 </div>
... ... @@ -392,7 +392,7 @@
392 392 <div class="form-group marginTop5">
393 393 <label for="MasterSiteURL" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Master Site URL <span class="red">*</span> : </label>
394 394 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
395   - <input type="text" class="form-control input-sm" id="MasterSiteURL" formControlName="masterSiteUrl">
  395 + <input type="text" class="form-control input-sm" id="MasterSiteURL" formControlName="masterSiteUrl" (keydown.space)="$event.preventDefault();">
396 396 </div>
397 397 </div>
398 398 </div>
... ... @@ -419,7 +419,7 @@
419 419 <div class="form-group marginTop5">
420 420 <label for="UserName1" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">User Name <span class="red">*</span> : </label>
421 421 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
422   - <input type="text" class="form-control input-sm" id="UserName" formControlName="login" maxlength="50">
  422 + <input type="text" class="form-control input-sm" id="UserName" formControlName="login" maxlength="50" (keydown.space)="$event.preventDefault();">
423 423 <span class="help-block">(Minimum 8 characters)</span>
424 424 <div *ngIf="!insertUpdateLicenseFrm.controls.login.valid && insertUpdateLicenseFrm.controls.login.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">User Name of minimum 8 characters is required.</div>
425 425 </div>
... ... @@ -430,7 +430,7 @@
430 430 <div class="form-group marginTop5">
431 431 <label for="Password" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0" title="">Password <span class="red">*</span> : </label>
432 432 <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
433   - <input type="password" class="form-control input-sm" id="Password" formControlName="password" maxlength="50">
  433 + <input type="password" class="form-control input-sm" id="Password" formControlName="password" maxlength="50" (keydown.space)="$event.preventDefault();">
434 434 <span class="help-block">(Minimum 8 characters)</span>
435 435 <div *ngIf="!insertUpdateLicenseFrm.controls.password.valid && insertUpdateLicenseFrm.controls.password.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Password of minimum 8 characters is required.</div>
436 436 </div>
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts
... ... @@ -66,7 +66,7 @@ export class AddLicense implements OnInit {
66 66 this.editionLoginsText = '';
67 67 this.insertUpdateLicenseFrm = this.fb.group({
68 68 licenseId: [0],
69   - accountNumber: ['', [Validators.required,this.ClearWhitespaceValidator]],
  69 + accountNumber: ['', [Validators.required]],
70 70 accountTypeId: [0, Validators.min(1)],
71 71 productId: [''],
72 72 licenseeFirstName: ['', [Validators.required,this.noWhitespaceValidator]],
... ... @@ -78,21 +78,21 @@ export class AddLicense implements OnInit {
78 78 city: ['', [Validators.required,this.noWhitespaceValidator]],
79 79 stateId: [0, Validators.min(1)],
80 80 countryId: [0, Validators.min(1)],
81   - zip: ['', [Validators.required,this.noWhitespaceValidator]],
82   - emailId: ['', [Validators.required,this.ClearWhitespaceValidator]],
83   - phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]],
  81 + zip: ['', [Validators.required]],
  82 + emailId: ['', [Validators.required]],
  83 + phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
84 84 editionLoginArr: this.fb.array([]),
85 85 editionLogins: [''],
86 86 totalLogins: [0],
87   - subscriptionPrice: [0, [Validators.required, Validators.pattern('[0-9.]*'),this.noWhitespaceValidator]],
  87 + subscriptionPrice: [0, [Validators.required, Validators.pattern('[0-9.]*')]],
88 88 subscriptionStartDate: [this.startDate, Validators.required],
89 89 subscriptionEndDate: ['', Validators.required],
90   - noOfImages: ['', [Validators.required, Validators.pattern('[0-9]*'),this.noWhitespaceValidator]],
91   - masterSiteUrl: ['a', [Validators.required,this.noWhitespaceValidator]],
  90 + noOfImages: ['', [Validators.required, Validators.pattern('[0-9]*')]],
  91 + masterSiteUrl: ['a', [Validators.required]],
92 92 siteUrlFrom: [''],
93 93 siteUrlTo: [''],
94   - login: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
95   - password: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
  94 + login: ['a', [Validators.required, Validators.minLength(8)]],
  95 + password: ['a', [Validators.required, Validators.minLength(8)]],
96 96 securityQuestionId: [0, Validators.min(1)],
97 97 answer: ['a', [Validators.required,this.noWhitespaceValidator]],
98 98 testLicenseEditionId: [1],
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html
... ... @@ -76,7 +76,7 @@
76 76 <div class="form-group">
77 77 <label for="inputEmail3" class="col-sm-4 control-label">Email ID <span class="red">*</span> :</label>
78 78 <div class="col-sm-7">
79   - <input type="text" class="form-control input-sm" id="Email" formControlName="emailId" maxlength="50" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$">
  79 + <input type="text" class="form-control input-sm" id="Email" formControlName="emailId" maxlength="50" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$" (keydown.space)="$event.preventDefault();">
80 80 <div *ngIf="updateLicenseBasicSettingsFrm.controls.emailId.hasError('required') && !updateLicenseBasicSettingsFrm.controls.emailId.value && updateLicenseBasicSettingsFrm.controls.emailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email is required</div>
81 81 <div *ngIf="updateLicenseBasicSettingsFrm.controls.emailId.invalid && updateLicenseBasicSettingsFrm.controls.emailId.value" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email is invalid</div>
82 82 </div>
... ... @@ -108,7 +108,7 @@
108 108 <div class="form-group">
109 109 <label for="inputEmail3" class="col-sm-4 control-label">Zip <span class="red">*</span> :</label>
110 110 <div class="col-sm-7">
111   - <input type="text" class="form-control input-sm" id="Zip" formControlName="zip" maxlength="20">
  111 + <input type="text" class="form-control input-sm" id="Zip" formControlName="zip" maxlength="20" (keydown.space)="$event.preventDefault();">
112 112 <div *ngIf="updateLicenseBasicSettingsFrm.controls.zip.hasError('required') && updateLicenseBasicSettingsFrm.controls.zip.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Zip is required</div>
113 113 </div>
114 114 </div>
... ... @@ -140,7 +140,7 @@
140 140 <div class="form-group">
141 141 <label for="inputEmail3" class="col-sm-4 control-label">Phone <span class="red">*</span> :</label>
142 142 <div class="col-sm-7">
143   - <input type="text" class="form-control input-sm" id="Phone" formControlName="phone" maxlength="30" (keyup)="onKeyUp($event)">
  143 + <input type="text" class="form-control input-sm" id="Phone" formControlName="phone" maxlength="30" (keyup)="onKeyUp($event)" (keydown.space)="$event.preventDefault();">
144 144 <span class="help-block">(xxx-xxx-xxxx)</span>
145 145 <div *ngIf="updateLicenseBasicSettingsFrm.controls.phone.hasError('required') && updateLicenseBasicSettingsFrm.controls.phone.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Phone is required</div>
146 146 <div *ngIf="updateLicenseBasicSettingsFrm.controls.phone.hasError('pattern') && updateLicenseBasicSettingsFrm.controls.phone.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Phone is invalid</div>
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
... ... @@ -55,9 +55,9 @@ export class EditLicenseBasicSettings implements OnInit {
55 55 city: ['', [Validators.required,this.noWhitespaceValidator]],
56 56 stateId: [0],
57 57 countryId: [0],
58   - zip: ['', [Validators.required,this.noWhitespaceValidator]],
59   - emailId: ['', [Validators.required,this.noWhitespaceValidator]],
60   - phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]],
  58 + zip: ['', [Validators.required]],
  59 + emailId: ['', [Validators.required]],
  60 + phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
61 61 });
62 62 this.GetCountry();
63 63 this.GetState();
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts
... ... @@ -250,7 +250,8 @@ export class LicenseService{
250 250 {
251 251 'siteId': jsonObj.siteId,
252 252 'licenseEditionId': element.m_Item1,
253   - 'isModesty': element.m_Item2
  253 + 'isModesty': element.m_Item2,
  254 + 'isSiteUser': jsonObj.isSiteUser
254 255 }
255 256 );
256 257 });
... ... @@ -258,6 +259,7 @@ export class LicenseService{
258 259 var headers = new Headers({
259 260 'Content-Type': 'application/json'
260 261 });
  262 +
261 263 return this.http.post(this.commonService.resourceBaseUrl + "License/UpdateLicenseModestySettings",
262 264 JSON.stringify(jsonData), {headers: headers})
263 265 .map(this.extractData)
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts
... ... @@ -29,7 +29,7 @@ export class LicenseModestySettings implements OnInit {
29 29 isBuildingLevel: boolean = false;
30 30 LicenseId:number=0;
31 31 AccountNumber:string='';
32   -
  32 +
33 33 constructor(private _loadingService: LoadingService,private licenseService: LicenseService, public globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder,
34 34 private modalService: BsModalService, private _confirmService: ConfirmService) {
35 35 }
... ... @@ -42,6 +42,7 @@ export class LicenseModestySettings implements OnInit {
42 42 licenseId: [0],
43 43 accountNumber: ['', Validators.required],
44 44 siteId: [0],
  45 + isSiteUser:[false],
45 46 lstModesty: [this.fb.array([])],
46 47 });
47 48 $('#AccountNumber').prop('disabled', true);
... ... @@ -94,6 +95,7 @@ export class LicenseModestySettings implements OnInit {
94 95 this.lstLicenseEditionModesty = null;
95 96 this.lstLicenseSites = null;
96 97 this.selectedSiteId = 0;
  98 + this.updateModestySettingsFrm.controls['siteId'].setValue(0);
97 99 if (!this.isBuildingLevel) {
98 100 this.GetLicenseEditionModesty();
99 101 }
... ... @@ -109,6 +111,27 @@ export class LicenseModestySettings implements OnInit {
109 111 }, error => this.error = <any>error);
110 112 }
111 113 }
  114 +
  115 + GetLicenseById() {
  116 + //use for to check is siteuser or not
  117 + if (this.LicenseId != 0) {
  118 + this._loadingService.ShowLoading("global-loading");
  119 + this.licenseService.GetLicenseById(this.LicenseId)
  120 + .subscribe(st => {
  121 + if (st.LicenseId > 0) {
  122 + if(st.LicenseTypeId==3)
  123 + {
  124 + this.updateModestySettingsFrm.controls['isSiteUser'].setValue(true);
  125 + }
  126 + else
  127 + {
  128 + this.updateModestySettingsFrm.controls['isSiteUser'].setValue(false);
  129 + }
  130 + this._loadingService.HideLoading("global-loading");
  131 + }
  132 + }, error => this.error = <any>error);
  133 + }
  134 + }
112 135  
113 136 GetLicenseEditionModesty() {
114 137 this.licenseService.GetLicenseModestySettings(this.LicenseId, this.selectedSiteId)
... ... @@ -139,6 +162,7 @@ export class LicenseModestySettings implements OnInit {
139 162  
140 163 this.updateModestySettingsFrm.controls['licenseId'].setValue(LicenseId);
141 164 this.updateModestySettingsFrm.controls['accountNumber'].setValue(AccountNumber);
  165 + this.GetLicenseById()
142 166 }
143 167  
144 168  
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html
... ... @@ -22,7 +22,7 @@
22 22 <div class="form-group">
23 23 <label for="inputEmail3" class="col-sm-4 control-label">User Name <span class="red">*</span> :</label>
24 24 <div class="col-sm-7">
25   - <input type="text" class="form-control input-sm" id="name" placeholder="User Name" formControlName="UserName">
  25 + <input type="text" class="form-control input-sm" id="name" placeholder="User Name" formControlName="UserName" (keydown.space)="$event.preventDefault();">
26 26 <span class="help-block">(Minimum 8 characters)</span>
27 27 <div *ngIf="!adduserFrm.controls.UserName.valid && adduserFrm.controls.UserName.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">User Name of minimum 8 characters is required.</div>
28 28 </div>
... ... @@ -30,7 +30,7 @@
30 30 <div class="form-group">
31 31 <label for="inputPassword3" class="col-sm-4 control-label">Password <span class="red">*</span> :</label>
32 32 <div class="col-sm-7">
33   - <input type="password" class="form-control input-sm" id="password" placeholder="" formControlName="Password">
  33 + <input type="password" class="form-control input-sm" id="password" placeholder="" formControlName="Password" (keydown.space)="$event.preventDefault();">
34 34 <span class="help-block">(Minimum 8 characters)</span>
35 35 <div *ngIf="!adduserFrm.controls.Password.valid && adduserFrm.controls.Password.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Password of minimum 8 characters is required</div>
36 36 </div>
... ... @@ -38,7 +38,7 @@
38 38 <div class="form-group">
39 39 <label for="inputPassword3" class="col-sm-4 control-label">Confirm Password <span class="red">*</span> :</label>
40 40 <div class="col-sm-7">
41   - <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword">
  41 + <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword" (keydown.space)="$event.preventDefault();">
42 42 <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && !adduserFrm.controls.ConfirmPassword.value && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div>
43 43  
44 44 <div *ngIf="adduserFrm.controls.ConfirmPassword.value!=adduserFrm.controls.Password.value && adduserFrm.controls.ConfirmPassword.valid" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">
... ... @@ -49,7 +49,7 @@
49 49 <div class="form-group">
50 50 <label for="inputPassword3" class="col-sm-4 control-label">Email Id <span class="red">*</span> :</label>
51 51 <div class="col-sm-7">
52   - <input type="text" class="form-control" id="inputPassword3" placeholder="Email Id" formControlName="EmailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$">
  52 + <input type="text" class="form-control" id="inputPassword3" placeholder="Email Id" formControlName="EmailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$" (keydown.space)="$event.preventDefault();">
53 53 <div *ngIf="adduserFrm.controls.EmailId.invalid && !adduserFrm.controls.EmailId.value && adduserFrm.controls.EmailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email Id is required</div>
54 54  
55 55 <div *ngIf="adduserFrm.controls.EmailId.invalid && adduserFrm.controls.EmailId.value" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
... ... @@ -47,12 +47,12 @@ export class AddUser implements OnInit {
47 47 this.alerts = '';
48 48 this.adduserFrm = this.fb.group({
49 49 id: [''],
50   - UserName: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
51   - Password: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
52   - ConfirmPassword: ['', [Validators.required,this.ClearWhitespaceValidator]],
  50 + UserName: ['', [Validators.required, Validators.minLength(8)]],
  51 + Password: ['', [Validators.required, Validators.minLength(8)]],
  52 + ConfirmPassword: ['', [Validators.required]],
53 53 FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
54 54 LastName: ['', [Validators.required,this.noWhitespaceValidator]],
55   - EmailId: ['', [Validators.required,this.ClearWhitespaceValidator]],
  55 + EmailId: ['', [Validators.required]],
56 56 AccountNumberId: ['', Validators.required],
57 57 UserTypeId: ['', Validators.required],
58 58 ProductEditionId: ['', Validators.required]
... ... @@ -87,35 +87,7 @@ export class AddUser implements OnInit {
87 87 redirect() {
88 88 this.router.navigate(['/']);
89 89 }
90   - public ClearWhitespaceValidator(control: FormControl) {
91   - // new validation for intial whaite space
92   - //****Birendra *****/
93   - var isValid=false;
94   - if(control.value!=null)
95   - {
96   - var inputvalue=control.value;
97   - var controlLen=inputvalue.length;
98   - if(controlLen==undefined)//undefined for integer value
99   - {
100   - isValid=true;
101   - }
102   - else if(controlLen!=0)
103   - {
104   - const isWhitespace = controlLen!=inputvalue.trim().length;
105   - isValid = !isWhitespace;
106   - if(!isValid)
107   - {
108   - control.setValue(inputvalue.trim());
109   -
110   - }
111   -
112   - }
113   - }
114   - // can use also on page of input control
115   - //
116   - return isValid ? null: { 'whitespace': true };
117   -
118   - }
  90 +
119 91 public noWhitespaceValidator(control: FormControl) {
120 92 // new validation for intial whaite space
121 93 //****Birendra *****/
... ... @@ -263,12 +235,12 @@ export class AddUser implements OnInit {
263 235 _buildForm(lcid) {
264 236 this.adduserFrm = this.fb.group({
265 237 id: [''],
266   - UserName: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
267   - Password: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
268   - ConfirmPassword: ['', [Validators.required,this.ClearWhitespaceValidator]],
  238 + UserName: ['', [Validators.required, Validators.minLength(8)]],
  239 + Password: ['', [Validators.required, Validators.minLength(8)]],
  240 + ConfirmPassword: ['', [Validators.required]],
269 241 FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
270 242 LastName: ['', [Validators.required,this.noWhitespaceValidator]],
271   - EmailId: ['', [Validators.required,this.ClearWhitespaceValidator]],
  243 + EmailId: ['', [Validators.required]],
272 244 AccountNumberId: ['', Validators.required],
273 245 UserTypeId: ['', Validators.required],
274 246 ProductEditionId: ['', Validators.required]
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.html
... ... @@ -37,7 +37,7 @@
37 37 <div class="form-group">
38 38 <label for="emailId" class="col-sm-4 control-label">Email Id <span class="red">*</span> :</label>
39 39 <div class="col-sm-7">
40   - <input type="text" class="form-control" id="emailId" formControlName="emailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$">
  40 + <input type="text" class="form-control" id="emailId" formControlName="emailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$" (keydown.space)="$event.preventDefault();">
41 41 <div *ngIf="userFrm.controls.emailId.invalid && !userFrm.controls.emailId.value && userFrm.controls.emailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email Id is required</div>
42 42  
43 43 <div *ngIf="userFrm.controls.emailId.invalid && userFrm.controls.emailId.value" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;"> Email is Invalid. </div>
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts
... ... @@ -48,7 +48,7 @@ export class UpdateUserProfile implements OnInit {
48 48 id: [''],
49 49 firstName: ['', [Validators.required,this.noWhitespaceValidator]],
50 50 lastName: ['', [Validators.required,this.noWhitespaceValidator]],
51   - emailId: ['', [Validators.required,this.noWhitespaceValidator]]
  51 + emailId: ['', [Validators.required]]
52 52  
53 53 });
54 54  
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... ... @@ -203,7 +203,7 @@
203 203 <div class="form-group">
204 204 <label for="inputEmail3" class="col-sm-5 control-label">User Name <span class="red">*</span> :</label>
205 205 <div class="col-sm-7">
206   - <input type="text" class="form-control input-sm" id="name" placeholder="User Name" formControlName="UserName">
  206 + <input type="text" class="form-control input-sm" id="name" placeholder="User Name" formControlName="UserName" (keydown.space)="$event.preventDefault();">
207 207 <span class="help-block">(Minimum 8 characters)</span>
208 208 <div *ngIf="!adduserFrm.controls.UserName.valid && adduserFrm.controls.UserName.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">User Name of minimum 8 characters is required</div>
209 209 </div>
... ... @@ -211,7 +211,7 @@
211 211 <div class="form-group">
212 212 <label for="inputPassword3" class="col-sm-5 control-label">Password <span class="red">*</span> :</label>
213 213 <div class="col-sm-7">
214   - <input type="password" class="form-control input-sm" id="password" placeholder="" formControlName="Password">
  214 + <input type="password" class="form-control input-sm" id="password" placeholder="" formControlName="Password" (keydown.space)="$event.preventDefault();">
215 215 <span class="help-block">(Minimum 8 characters)</span>
216 216 <div *ngIf="!adduserFrm.controls.Password.valid && adduserFrm.controls.Password.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Password of minimum 8 characters is required</div>
217 217 </div>
... ... @@ -219,7 +219,7 @@
219 219 <div class="form-group">
220 220 <label for="inputPassword3" class="col-sm-5 control-label">Confirm Password <span class="red">*</span> :</label>
221 221 <div class="col-sm-7">
222   - <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword">
  222 + <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword"(keydown.space)="$event.preventDefault();">
223 223 <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && !adduserFrm.controls.ConfirmPassword.value && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div>
224 224 <div *ngIf="adduserFrm.controls.ConfirmPassword.value!=adduserFrm.controls.Password.value && adduserFrm.controls.ConfirmPassword.valid" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">
225 225 Password not match.
... ... @@ -229,7 +229,7 @@
229 229 <div class="form-group">
230 230 <label for="inputPassword3" class="col-sm-5 control-label">Email Id <span class="red">*</span> :</label>
231 231 <div class="col-sm-7">
232   - <input type="text" class="form-control" id="inputPassword3" placeholder="Email Id" formControlName="EmailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$">
  232 + <input type="text" class="form-control" id="inputPassword3" placeholder="Email Id" formControlName="EmailId" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$" (keydown.space)="$event.preventDefault();">
233 233 <div *ngIf="adduserFrm.controls.EmailId.invalid && !adduserFrm.controls.EmailId.value && adduserFrm.controls.EmailId.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Email Id is required</div>
234 234  
235 235 <div *ngIf="adduserFrm.controls.EmailId.invalid && adduserFrm.controls.EmailId.value" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... ... @@ -105,12 +105,12 @@ export class UsersList implements OnInit, AfterViewChecked {
105 105 });
106 106 this.adduserFrm = this.fb.group({
107 107 id: [''],
108   - UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
109   - Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
110   - ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]],
  108 + UserName: ['', [Validators.required, Validators.minLength(8)]],
  109 + Password: ['', [Validators.required, Validators.minLength(8)]],
  110 + ConfirmPassword: ['', [Validators.required]],
111 111 FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
112 112 LastName: ['', [Validators.required,this.noWhitespaceValidator]],
113   - EmailId: ['', [Validators.required,this.noWhitespaceValidator]],
  113 + EmailId: ['', [Validators.required]],
114 114 AccountNumber: [''],
115 115 UserTypeTitle: [''],
116 116 AccountTypeTitle: [''],
... ...