From 393e207e2b9e3dbe6a1650713b5db50f3914f020 Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 26 Sep 2018 16:06:27 +0530 Subject: [PATCH] modesty is based on license and edition --- 400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs | 2 +- 400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs | 4 +++- 400-SOURCECODE/AIAHTML5.API/Models/Users.cs | 4 ++-- 500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense | 21 +++++++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index 2bb6536..ad19998 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -247,7 +247,7 @@ namespace AIAHTML5.API.Controllers { //check Modesty settings for this license - userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId); + userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId, Convert.ToInt16(userInfo.EditionId)); } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 1cc00dc..ace28ee 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -1128,7 +1128,7 @@ namespace AIAHTML5.API.Models return objFeatures; } - internal Boolean GetModestyInfo(int LicenseId) + internal Boolean GetModestyInfo(int LicenseId, Int16 editionId) { logger.Debug(" inside GetModestyInfo for licenseId= " + LicenseId); @@ -1142,6 +1142,8 @@ namespace AIAHTML5.API.Models cmd.CommandText = DBConstants.GET_MODESTY_FOR_THIS_LICENSE; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@licenseId", LicenseId); + cmd.Parameters.AddWithValue("@editionId", editionId); + SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; dt = new DataTable(); diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index b4b4fc4..652cf45 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -599,10 +599,10 @@ namespace AIAHTML5.API.Models return userInfo; } - internal static Boolean IsModestyActiveForThisLicense(int LicenseId) + internal static Boolean IsModestyActiveForThisLicense(int LicenseId, Int16 editionId) { DBModel objModel = new DBModel(); - bool IsModestyOn = objModel.GetModestyInfo(LicenseId); + bool IsModestyOn = objModel.GetModestyInfo(LicenseId,editionId); return IsModestyOn; } } diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense b/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense new file mode 100644 index 0000000..507f0ed --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense @@ -0,0 +1,21 @@ +USE [AIADatabaseV5] +GO +/****** Object: StoredProcedure [dbo].[usp_GetModestyForThisLicense] Script Date: 09/26/2018 08:02:49 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +-- ==================================================== +-- Author: Magic Software +-- Create date: 29-Jan-2018 +-- Description: To get a license information on the basis of LicenseId +-- ==================================================== +ALTER PROCEDURE [dbo].[usp_GetModestyForThisLicense] + -- Add the parameters for the stored procedure here + @licenseId int, + @editionId tinyint +AS +BEGIN + +Select IsModesty from LicenseToEdition WHERE LicenseId = @licenseId and EditionId = @editionId +end \ No newline at end of file -- libgit2 0.21.4