Commit 393e207e2b9e3dbe6a1650713b5db50f3914f020

Authored by Nikita Kulshreshtha
1 parent c33092da

modesty is based on license and edition

400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... ... @@ -247,7 +247,7 @@ namespace AIAHTML5.API.Controllers
247 247 {
248 248 //check Modesty settings for this license
249 249  
250   - userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId);
  250 + userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId, Convert.ToInt16(userInfo.EditionId));
251 251  
252 252  
253 253 }
... ...
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... ... @@ -1128,7 +1128,7 @@ namespace AIAHTML5.API.Models
1128 1128 return objFeatures;
1129 1129 }
1130 1130  
1131   - internal Boolean GetModestyInfo(int LicenseId)
  1131 + internal Boolean GetModestyInfo(int LicenseId, Int16 editionId)
1132 1132 {
1133 1133 logger.Debug(" inside GetModestyInfo for licenseId= " + LicenseId);
1134 1134  
... ... @@ -1142,6 +1142,8 @@ namespace AIAHTML5.API.Models
1142 1142 cmd.CommandText = DBConstants.GET_MODESTY_FOR_THIS_LICENSE;
1143 1143 cmd.CommandType = CommandType.StoredProcedure;
1144 1144 cmd.Parameters.AddWithValue("@licenseId", LicenseId);
  1145 + cmd.Parameters.AddWithValue("@editionId", editionId);
  1146 +
1145 1147 SqlDataAdapter da = new SqlDataAdapter();
1146 1148 da.SelectCommand = cmd;
1147 1149 dt = new DataTable();
... ...
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... ... @@ -599,10 +599,10 @@ namespace AIAHTML5.API.Models
599 599 return userInfo;
600 600 }
601 601  
602   - internal static Boolean IsModestyActiveForThisLicense(int LicenseId)
  602 + internal static Boolean IsModestyActiveForThisLicense(int LicenseId, Int16 editionId)
603 603 {
604 604 DBModel objModel = new DBModel();
605   - bool IsModestyOn = objModel.GetModestyInfo(LicenseId);
  605 + bool IsModestyOn = objModel.GetModestyInfo(LicenseId,editionId);
606 606 return IsModestyOn;
607 607 }
608 608 }
... ...
500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense 0 → 100644
  1 +USE [AIADatabaseV5]
  2 +GO
  3 +/****** Object: StoredProcedure [dbo].[usp_GetModestyForThisLicense] Script Date: 09/26/2018 08:02:49 ******/
  4 +SET ANSI_NULLS ON
  5 +GO
  6 +SET QUOTED_IDENTIFIER ON
  7 +GO
  8 +-- ====================================================
  9 +-- Author: Magic Software
  10 +-- Create date: 29-Jan-2018
  11 +-- Description: To get a license information on the basis of LicenseId
  12 +-- ====================================================
  13 +ALTER PROCEDURE [dbo].[usp_GetModestyForThisLicense]
  14 + -- Add the parameters for the stored procedure here
  15 + @licenseId int,
  16 + @editionId tinyint
  17 +AS
  18 +BEGIN
  19 +
  20 +Select IsModesty from LicenseToEdition WHERE LicenseId = @licenseId and EditionId = @editionId
  21 +end
0 22 \ No newline at end of file
... ...