diff --git a/deployment/Deploy.ps1 b/deployment/Deploy.ps1 index e8095561..fdd8d81d 100644 --- a/deployment/Deploy.ps1 +++ b/deployment/Deploy.ps1 @@ -27,7 +27,6 @@ Param( [string][Parameter()]$LogoURLpng, # URL for Publisher .png logo [string][Parameter()]$LogoURLico, # URL for Publisher .ico logo [string][Parameter()]$KeyVault, # Name of KeyVault - [switch][Parameter()]$MeteredSchedulerSupport, # Add this key like -MeteredSchedulerSupport to the command to enable Metered Scheduler Support [switch][Parameter()]$Quiet #if set, only show error / warning output from script commands ) @@ -372,7 +371,7 @@ Write-host " ➡️ Setup access to KeyVault" az keyvault set-policy --name $KeyVault --object-id $WebAppNameAdminId --secret-permissions get list --key-permissions get list --resource-group $ResourceGroupForDeployment --output $azCliOutput Write-host " ➡️ Set Configuration" az webapp config connection-string set -g $ResourceGroupForDeployment -n $WebAppNameAdmin -t SQLAzure --output $azCliOutput --settings DefaultConnection=$DefaultConnectionKeyVault -az webapp config appsettings set -g $ResourceGroupForDeployment -n $WebAppNameAdmin --output $azCliOutput --settings KnownUsers=$PublisherAdminUsers SaaSApiConfiguration__AdAuthenticationEndPoint=https://login.microsoftonline.com SaaSApiConfiguration__ClientId=$ADApplicationID SaaSApiConfiguration__ClientSecret=$ADApplicationSecretKeyVault SaaSApiConfiguration__FulFillmentAPIBaseURL=https://marketplaceapi.microsoft.com/api SaaSApiConfiguration__FulFillmentAPIVersion=2018-08-31 SaaSApiConfiguration__GrantType=client_credentials SaaSApiConfiguration__MTClientId=$ADMTApplicationID SaaSApiConfiguration__Resource=20e940b3-4c77-4b0b-9a53-9e16a1b010a7 SaaSApiConfiguration__TenantId=$TenantID SaaSApiConfiguration__SignedOutRedirectUri=https://$WebAppNamePrefix-portal.azurewebsites.net/Home/Index/ SaaSApiConfiguration__SupportmeteredBilling=$MeteredSchedulerSupport SaaSApiConfiguration_CodeHash=$SaaSApiConfiguration_CodeHash +az webapp config appsettings set -g $ResourceGroupForDeployment -n $WebAppNameAdmin --output $azCliOutput --settings KnownUsers=$PublisherAdminUsers SaaSApiConfiguration__AdAuthenticationEndPoint=https://login.microsoftonline.com SaaSApiConfiguration__ClientId=$ADApplicationID SaaSApiConfiguration__ClientSecret=$ADApplicationSecretKeyVault SaaSApiConfiguration__FulFillmentAPIBaseURL=https://marketplaceapi.microsoft.com/api SaaSApiConfiguration__FulFillmentAPIVersion=2018-08-31 SaaSApiConfiguration__GrantType=client_credentials SaaSApiConfiguration__MTClientId=$ADMTApplicationID SaaSApiConfiguration__Resource=20e940b3-4c77-4b0b-9a53-9e16a1b010a7 SaaSApiConfiguration__TenantId=$TenantID SaaSApiConfiguration__SignedOutRedirectUri=https://$WebAppNamePrefix-portal.azurewebsites.net/Home/Index/ SaaSApiConfiguration_CodeHash=$SaaSApiConfiguration_CodeHash az webapp config set -g $ResourceGroupForDeployment -n $WebAppNameAdmin --always-on true --output $azCliOutput Write-host " 🔵 Customer Portal WebApp" diff --git a/docs/Advanced-Instructions.md b/docs/Advanced-Instructions.md index 180307a6..77b5edd6 100644 --- a/docs/Advanced-Instructions.md +++ b/docs/Advanced-Instructions.md @@ -87,7 +87,6 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass | SQLAdminLoginPassword | SQL Admin password. Default: secure random password. | | LogoURLpng | The url of the company logo image in .png format with a size of 96x96 to be used on the website | | LogoURLico | The url of the company logo image in .ico format | -| MeteredSchedulerSupport | Enable the metered scheduler. This is deployed by default. Use **true** to enable the feature. More information [here](https://github.com/Azure/Commercial-Marketplace-SaaS-Accelerator/blob/main/docs/Metered-Scheduler-Manager-Instruction.md). | Quiet | Disable verbose output when running the script diff --git a/docs/Installation-Instructions.md b/docs/Installation-Instructions.md index c33ac361..a8314f1e 100644 --- a/docs/Installation-Instructions.md +++ b/docs/Installation-Instructions.md @@ -60,7 +60,6 @@ The script above will perform the following actions. -ADMTApplicationID "xxxx-xxx-xxx-xxx-xxxx" ` -LogoURLpng "https://company_com/company_logo.png" ` -LogoURLico "https://company_com/company_logo.ico" ` - -MeteredSchedulerSupport -Quiet ``` @@ -103,7 +102,6 @@ cd ./Commercial-Marketplace-SaaS-Accelerator/deployment; ` | SQLAdminLoginPassword | SQL Admin password. Default: secure random password. | | LogoURLpng | The url of the company logo image in .png format with a size of 96x96 to be used on the website | | LogoURLico | The url of the company logo image in .ico format | -| MeteredSchedulerSupport | Enable the metered scheduler. This is deployed by default. Use **true** to enable the feature. More information [here](https://github.com/Azure/Commercial-Marketplace-SaaS-Accelerator/blob/main/docs/Metered-Scheduler-Manager-Instruction.md). | Quiet | Disable verbose output when running the script ## Setting up a development environment diff --git a/docs/Metered-Scheduler-Manager-Instruction.md b/docs/Metered-Scheduler-Manager-Instruction.md index f6d2dfe2..e8047d41 100644 --- a/docs/Metered-Scheduler-Manager-Instruction.md +++ b/docs/Metered-Scheduler-Manager-Instruction.md @@ -6,15 +6,12 @@ Metered Scheduler Manager is a feature where Publisher can schedule **FIX Quanti 1. Monthly 1. Yearly 1. OneTime -## Enable and Disable Metered Scheduler Manager Feature During Installation -By default, this feature is disabled during the installation. Publisher can enable this feature during the installion process by passing an optional parameter **MeteredSchedulerSupport**. Please refer to the installation steps [here](./Installation-Instructions.md) - ## Enable and Disable Metered Scheduler Manager Feature Post Installation -Publisher can active the **Metered Scheduler** feature by updating Admin portal web configuration and set **SaaSApiConfiguration__SupportmeteredBilling** to **true** +Publisher can active the **Metered Scheduler** feature by updating Admin portal App Setting and set **IsMeteredBillingEnabled** to **true** ![home](./images/scheduler-config.png) -Publisher can disable the feature by feature by updating Admin portal web configuration and set **SaaSApiConfiguration__SupportmeteredBilling** to **false** +Publisher can disable the feature by feature by updating Admin portal web configuration and set **IsMeteredBillingEnabled** to **false** ## IMPORTANT: Enable Scheduler Frequencies Publisher must enable scheduler Frequencies before start scheduling tasks. From **App Config**, publisher can enable or disable available frequencies per business needs. Without enable the frequencies, Publisher will not able to add tasks also the scheduler engine will skip any disabled frequencies. diff --git a/docs/images/scheduler-config.png b/docs/images/scheduler-config.png index e84d86d2..9604d7fa 100644 Binary files a/docs/images/scheduler-config.png and b/docs/images/scheduler-config.png differ diff --git a/src/AdminSite/Controllers/ApplicationConfigController.cs b/src/AdminSite/Controllers/ApplicationConfigController.cs index 35aa53a4..fb191132 100644 --- a/src/AdminSite/Controllers/ApplicationConfigController.cs +++ b/src/AdminSite/Controllers/ApplicationConfigController.cs @@ -6,6 +6,8 @@ using System.Web; using Marketplace.SaaS.Accelerator.DataAccess.Contracts; using Marketplace.SaaS.Accelerator.DataAccess.Entities; +using Marketplace.SaaS.Accelerator.DataAccess.Services; +using Marketplace.SaaS.Accelerator.Services.Configurations; using Marketplace.SaaS.Accelerator.Services.Services; using Marketplace.SaaS.Accelerator.Services.Utilities; using Microsoft.AspNetCore.Http; @@ -30,9 +32,10 @@ public class ApplicationConfigController : BaseController /// private readonly IEmailTemplateRepository emailTemplateRepository; - public ApplicationConfigController( - ApplicationConfigService appConfigService, - IEmailTemplateRepository emailTemplateRepository, SaaSClientLogger logger) + public ApplicationConfigController(ApplicationConfigService appConfigService, + IEmailTemplateRepository emailTemplateRepository, + SaaSClientLogger logger, + IApplicationConfigRepository appConfigRepository) : base(appConfigRepository) { this.appConfigService = appConfigService; this.emailTemplateRepository = emailTemplateRepository; @@ -46,7 +49,7 @@ public ApplicationConfigController( [ServiceFilter(typeof(ExceptionHandlerAttribute))] public IActionResult Index() { - var getAllAppConfigData = this.appConfigService.GetAllApplicationConfiguration(); + var getAllAppConfigData = this.appConfigService.GetAllApplicationConfiguration(); return this.View(getAllAppConfigData); } diff --git a/src/AdminSite/Controllers/ApplicationLogController.cs b/src/AdminSite/Controllers/ApplicationLogController.cs index b5955126..3297137b 100644 --- a/src/AdminSite/Controllers/ApplicationLogController.cs +++ b/src/AdminSite/Controllers/ApplicationLogController.cs @@ -4,6 +4,8 @@ using System.Text.RegularExpressions; using Marketplace.SaaS.Accelerator.DataAccess.Contracts; using Marketplace.SaaS.Accelerator.DataAccess.Entities; +using Marketplace.SaaS.Accelerator.DataAccess.Services; +using Marketplace.SaaS.Accelerator.Services.Configurations; using Marketplace.SaaS.Accelerator.Services.Services; using Marketplace.SaaS.Accelerator.Services.Utilities; using Microsoft.AspNetCore.Mvc; @@ -20,7 +22,9 @@ public class ApplicationLogController : BaseController private readonly IApplicationLogRepository appLogRepository; - public ApplicationLogController(IApplicationLogRepository applicationLogRepository, SaaSClientLogger logger) + public ApplicationLogController(IApplicationLogRepository applicationLogRepository, + SaaSClientLogger logger, + IApplicationConfigRepository applicationConfigRepository) : base(applicationConfigRepository) { this.appLogRepository = applicationLogRepository; this.logger = logger; diff --git a/src/AdminSite/Controllers/BaseController.cs b/src/AdminSite/Controllers/BaseController.cs index cecb004e..afe4c7eb 100644 --- a/src/AdminSite/Controllers/BaseController.cs +++ b/src/AdminSite/Controllers/BaseController.cs @@ -1,10 +1,13 @@ using System.Linq; using System.Web; +using Marketplace.SaaS.Accelerator.DataAccess.Contracts; using Marketplace.SaaS.Accelerator.Services.Models; +using Marketplace.SaaS.Accelerator.Services.Services; using Marketplace.SaaS.Accelerator.Services.Utilities; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; namespace Marketplace.SaaS.Accelerator.AdminSite.Controllers; @@ -18,11 +21,32 @@ public class BaseController : Controller /// Initializes a new instance of the class. /// /// - public BaseController() + private readonly IApplicationConfigRepository applicationConfigRepository; + private readonly ApplicationConfigService applicationConfigService; + public BaseController(IApplicationConfigRepository applicationConfigRepository) { + this.applicationConfigRepository = applicationConfigRepository; + this.applicationConfigService = new ApplicationConfigService(this.applicationConfigRepository); this.CheckAuthentication(); } + public override void OnActionExecuting(ActionExecutingContext filterContext) + { + if (TempData is not null) + { + bool.TryParse(this.applicationConfigService.GetValueByName("IsMeteredBillingEnabled"), out bool supportMeteredBilling); + if (supportMeteredBilling) + { + TempData["SupportMeteredBilling"] = "1"; + } + else + { + TempData["SupportMeteredBilling"] = "0"; + } + } + + base.OnActionExecuting(filterContext); + } /// /// Gets Current Logged in User Email Address. /// @@ -64,6 +88,8 @@ public PartnerDetailViewModel GetCurrentUserDetail() return new PartnerDetailViewModel(); } + + /// /// Checks the authentication. /// diff --git a/src/AdminSite/Controllers/HomeController.cs b/src/AdminSite/Controllers/HomeController.cs index 8836107e..6a5121cc 100644 --- a/src/AdminSite/Controllers/HomeController.cs +++ b/src/AdminSite/Controllers/HomeController.cs @@ -132,7 +132,26 @@ public class HomeController : BaseController /// The offers repository. /// The offers attribute repository. public HomeController( - IUsersRepository usersRepository, IMeteredBillingApiService billingApiService, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository, IMeteredDimensionsRepository dimensionsRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IUsersRepository userRepository, IFulfillmentApiService fulfillApiService, IApplicationLogRepository applicationLogRepository, IEmailTemplateRepository emailTemplateRepository, IPlanEventsMappingRepository planEventsMappingRepository, IEventsRepository eventsRepository, SaaSApiClientConfiguration saaSApiClientConfiguration, ILoggerFactory loggerFactory, IEmailService emailService, IOffersRepository offersRepository, IOfferAttributesRepository offersAttributeRepository, SaaSClientLogger logger) + IUsersRepository usersRepository, + IMeteredBillingApiService billingApiService, + ISubscriptionsRepository subscriptionRepo, + IPlansRepository planRepository, + ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository, + IMeteredDimensionsRepository dimensionsRepository, + ISubscriptionLogRepository subscriptionLogsRepo, + IApplicationConfigRepository applicationConfigRepository, + IUsersRepository userRepository, + IFulfillmentApiService fulfillApiService, + IApplicationLogRepository applicationLogRepository, + IEmailTemplateRepository emailTemplateRepository, + IPlanEventsMappingRepository planEventsMappingRepository, + IEventsRepository eventsRepository, + SaaSApiClientConfiguration saaSApiClientConfiguration, + ILoggerFactory loggerFactory, + IEmailService emailService, + IOffersRepository offersRepository, + IOfferAttributesRepository offersAttributeRepository, + SaaSClientLogger logger):base(applicationConfigRepository) { this.billingApiService = billingApiService; this.subscriptionRepo = subscriptionRepo; @@ -212,12 +231,6 @@ public IActionResult Index() this.applicationConfigService.SaveFileToDisk("FaviconFile", "favicon.ico"); var userId = this.userService.AddUser(this.GetCurrentUserDetail()); - - if (this.saaSApiClientConfiguration.SupportMeteredBilling) - { - this.TempData.Add("SupportMeteredBilling", "1"); - this.HttpContext.Session.SetString("SupportMeteredBilling", "1"); - } return this.View(); } catch (Exception ex) diff --git a/src/AdminSite/Controllers/KnownUsersController.cs b/src/AdminSite/Controllers/KnownUsersController.cs index 8ff43b88..ad5c53cf 100644 --- a/src/AdminSite/Controllers/KnownUsersController.cs +++ b/src/AdminSite/Controllers/KnownUsersController.cs @@ -3,6 +3,9 @@ using System.Web; using Marketplace.SaaS.Accelerator.DataAccess.Contracts; using Marketplace.SaaS.Accelerator.DataAccess.Entities; +using Marketplace.SaaS.Accelerator.DataAccess.Services; +using Marketplace.SaaS.Accelerator.Services.Configurations; +using Marketplace.SaaS.Accelerator.Services.Services; using Marketplace.SaaS.Accelerator.Services.Utilities; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -24,7 +27,9 @@ public class KnownUsersController : BaseController /// The known users repository. /// The logger. - public KnownUsersController(IKnownUsersRepository knownUsersRepository, SaaSClientLogger logger) + public KnownUsersController(IKnownUsersRepository knownUsersRepository, + SaaSClientLogger logger, + IApplicationConfigRepository applicationConfigRepository) : base(applicationConfigRepository) { this.knownUsersRepository = knownUsersRepository; this.logger = logger; diff --git a/src/AdminSite/Controllers/OffersController.cs b/src/AdminSite/Controllers/OffersController.cs index a186be48..a0f8d947 100644 --- a/src/AdminSite/Controllers/OffersController.cs +++ b/src/AdminSite/Controllers/OffersController.cs @@ -49,7 +49,8 @@ public OffersController( IApplicationConfigRepository applicationConfigRepository, IUsersRepository usersRepository, IValueTypesRepository valueTypesRepository, - IOfferAttributesRepository offersAttributeRepository, SaaSClientLogger logger) + IOfferAttributesRepository offersAttributeRepository, + SaaSClientLogger logger) : base(applicationConfigRepository) { this.applicationConfigRepository = applicationConfigRepository; this.usersRepository = usersRepository; diff --git a/src/AdminSite/Controllers/PlansController.cs b/src/AdminSite/Controllers/PlansController.cs index 868a9d6a..b31ae9bd 100644 --- a/src/AdminSite/Controllers/PlansController.cs +++ b/src/AdminSite/Controllers/PlansController.cs @@ -51,7 +51,13 @@ public class PlansController : BaseController /// The offer attribute repository. /// The offer repository. /// The logger. - public PlansController(ISubscriptionsRepository subscriptionRepository, IUsersRepository usersRepository, IApplicationConfigRepository applicationConfigRepository, IPlansRepository plansRepository, IOfferAttributesRepository offerAttributeRepository, IOffersRepository offerRepository, SaaSClientLogger logger) + public PlansController(ISubscriptionsRepository subscriptionRepository, + IUsersRepository usersRepository, + IApplicationConfigRepository applicationConfigRepository, + IPlansRepository plansRepository, + IOfferAttributesRepository offerAttributeRepository, + IOffersRepository offerRepository, + SaaSClientLogger logger) : base(applicationConfigRepository) { this.subscriptionRepository = subscriptionRepository; this.usersRepository = usersRepository; diff --git a/src/AdminSite/Controllers/SchedulerController.cs b/src/AdminSite/Controllers/SchedulerController.cs index 9c67063d..f597061f 100644 --- a/src/AdminSite/Controllers/SchedulerController.cs +++ b/src/AdminSite/Controllers/SchedulerController.cs @@ -5,9 +5,11 @@ using System.Web; using Marketplace.SaaS.Accelerator.DataAccess.Contracts; using Marketplace.SaaS.Accelerator.DataAccess.Entities; +using Marketplace.SaaS.Accelerator.Services.Configurations; using Marketplace.SaaS.Accelerator.Services.Models; using Marketplace.SaaS.Accelerator.Services.Services; using Marketplace.SaaS.Accelerator.Services.Utilities; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Logging; @@ -46,6 +48,7 @@ public class SchedulerController : BaseController /// private readonly IUsersRepository usersRepository; + /// /// Initializes a new instance of the class. /// @@ -64,7 +67,8 @@ public SchedulerController(ISubscriptionsRepository subscriptionRepository, ISchedulerManagerViewRepository schedulerViewRepository, IUsersRepository usersRepository, SaaSClientLogger logger, - ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository,IApplicationConfigRepository applicationConfigRepository) + ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository, + IApplicationConfigRepository applicationConfigRepository) : base(applicationConfigRepository) { this.usersRepository = usersRepository; @@ -72,6 +76,7 @@ public SchedulerController(ISubscriptionsRepository subscriptionRepository, this.meteredRepository = meteredRepository; this.schedulerService = new MeteredPlanSchedulerManagementService(frequencyRepository, schedulerRepository, schedulerViewRepository,subscriptionUsageLogsRepository,applicationConfigRepository); this.subscriptionService = new SubscriptionService(subscriptionRepository,plansRepository); + } @@ -81,21 +86,29 @@ public SchedulerController(ISubscriptionsRepository subscriptionRepository, /// return All subscription. public IActionResult Index() { - this.logger.Info("Scheduler Controller / Get all data"); - try + if (this.User.Identity.IsAuthenticated) { - List getAllSchedulerManagerViewData = new List(); - this.TempData["ShowWelcomeScreen"] = "True"; - var currentUserDetail = this.usersRepository.GetPartnerDetailFromEmail(this.CurrentUserEmailAddress); - getAllSchedulerManagerViewData = this.schedulerService.GetAllSchedulerManagerList(); + this.logger.Info("Scheduler Controller / Get all data"); - return this.View(getAllSchedulerManagerViewData); + try + { + List getAllSchedulerManagerViewData = new List(); + this.TempData["ShowWelcomeScreen"] = "True"; + var currentUserDetail = this.usersRepository.GetPartnerDetailFromEmail(this.CurrentUserEmailAddress); + + getAllSchedulerManagerViewData = this.schedulerService.GetAllSchedulerManagerList(); + return this.View(getAllSchedulerManagerViewData); + } + catch (Exception ex) + { + this.logger.LogError($"Message:{ex.Message} :: {ex.InnerException}"); + return this.View("Error", ex); + } } - catch (Exception ex) + else { - this.logger.LogError($"Message:{ex.Message} :: {ex.InnerException}"); - return this.View("Error", ex); + return this.RedirectToAction(nameof(this.Index)); } } @@ -272,9 +285,11 @@ public IActionResult DeleteSchedulerItem(string id) public IActionResult SchedulerLogDetail(string id) { + this.logger.Info(HttpUtility.HtmlEncode($"Scheduler Controller / Get Schedule Item Details: Id {id}")); try { + var SchedulerItem = this.schedulerService.GetSchedulerManagerById(int.Parse(id)); var detail = this.schedulerService.GetSchedulerItemRunHistory(int.Parse(id)); SchedulerUsageViewModel schedulerUsageViewModel = new SchedulerUsageViewModel(); diff --git a/src/AdminSite/Views/Home/Index.cshtml b/src/AdminSite/Views/Home/Index.cshtml index 683a34bb..9a4e9f58 100644 --- a/src/AdminSite/Views/Home/Index.cshtml +++ b/src/AdminSite/Views/Home/Index.cshtml @@ -109,7 +109,7 @@ - @if (this.TempData["SupportMeteredBilling"]!=null) + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString()== "1")) {
  • Scheduler diff --git a/src/AdminSite/Views/Home/RecordUsage.cshtml b/src/AdminSite/Views/Home/RecordUsage.cshtml index d763f6fe..a1d1e235 100644 --- a/src/AdminSite/Views/Home/RecordUsage.cshtml +++ b/src/AdminSite/Views/Home/RecordUsage.cshtml @@ -40,9 +40,12 @@
    -
    - -
    + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString() == "1")) + { +
    + +
    + } diff --git a/src/AdminSite/Views/Scheduler/Index.cshtml b/src/AdminSite/Views/Scheduler/Index.cshtml index 2fcd9fab..6843f420 100644 --- a/src/AdminSite/Views/Scheduler/Index.cshtml +++ b/src/AdminSite/Views/Scheduler/Index.cshtml @@ -5,6 +5,8 @@
    + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString() == "1")) + {
    @@ -112,6 +114,15 @@ float-right cm-button-default">Add New Scheduled Metered Trigger }
    + } + else + { + +
    +

    Please activate Scheduler feature to access this section

    +
    + } +
    diff --git a/src/AdminSite/Views/Scheduler/NewScheduler.cshtml b/src/AdminSite/Views/Scheduler/NewScheduler.cshtml index e23cef0b..756850ac 100644 --- a/src/AdminSite/Views/Scheduler/NewScheduler.cshtml +++ b/src/AdminSite/Views/Scheduler/NewScheduler.cshtml @@ -46,7 +46,8 @@ - + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString() == "1")) + {
    @@ -124,7 +125,15 @@
    - + } + else + { + +
    +

    Please activate Scheduler feature to access this section

    + +
    + } diff --git a/src/AdminSite/Views/Scheduler/SchedulerLogDetail.cshtml b/src/AdminSite/Views/Scheduler/SchedulerLogDetail.cshtml index 3ef4dbf4..b70e1bea 100644 --- a/src/AdminSite/Views/Scheduler/SchedulerLogDetail.cshtml +++ b/src/AdminSite/Views/Scheduler/SchedulerLogDetail.cshtml @@ -33,7 +33,8 @@ detailModal.style.display = "block"; } - + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString() == "1")) + {
    - \ No newline at end of file + } + else + { + +
    +

    Please activate Scheduler feature to access this section

    + +
    + } + \ No newline at end of file diff --git a/src/AdminSite/Views/Shared/_Layout.cshtml b/src/AdminSite/Views/Shared/_Layout.cshtml index 6b966dc8..c5cd95c4 100644 --- a/src/AdminSite/Views/Shared/_Layout.cshtml +++ b/src/AdminSite/Views/Shared/_Layout.cshtml @@ -106,7 +106,7 @@ - @if (this.Context.Session.GetString("SupportMeteredBilling") != null) + @if ((this.TempData["SupportMeteredBilling"] != null) && (this.TempData["SupportMeteredBilling"].ToString() == "1")) {