Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Dicount rule plugin - fix namespace

support030d02112c9f
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
index c72164035..bdc188ad6 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
@@ -1,4 +1,4 @@
-using DiscountRules.CustomerGroups.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
@@ -9,7 +9,7 @@ using Grand.Web.Common.Filters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.CustomerGroups.Controllers
+namespace DiscountRules.Standard.Areas.Admin.Controllers
{
[Area("Admin")]
[AuthorizeAdmin]
@@ -46,7 +46,7 @@ namespace DiscountRules.CustomerGroups.Controllers
return Content("Failed to load requirement.");
}
- var model = new RequirementModel {
+ var model = new RequirementCustomerGroupsModel {
RequirementId = !string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "",
DiscountId = discountId,
CustomerGroupId = discountRequirement?.Metadata
@@ -61,7 +61,7 @@ namespace DiscountRules.CustomerGroups.Controllers
ViewData.TemplateInfo.HtmlFieldPrefix =
$"DiscountRulesCustomerGroups{(!string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "")}";
- return View(model);
+ return View((object)model);
}
[HttpPost]
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
index e8d07def7..1db1723f8 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
@@ -1,14 +1,14 @@
-using Grand.Business.Core.Interfaces.Catalog.Discounts;
+using DiscountRules.Standard.Models;
+using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Discounts;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
-using Grand.Domain.Discounts;
using Microsoft.AspNetCore.Mvc;
-using DiscountRules.Standard.HadSpentAmount.Models;
using System.Globalization;
-namespace DiscountRules.Standard.HadSpentAmount.Controllers
+namespace DiscountRules.Standard.Areas.Admin.Controllers
{
[Area("Admin")]
[AuthorizeAdmin]
@@ -44,7 +44,7 @@ namespace DiscountRules.Standard.HadSpentAmount.Controllers
spentAmountRequirement = Convert.ToDouble(discountRequirement.Metadata);
}
- var model = new RequirementModel {
+ var model = new RequirementSpentAmountModel {
RequirementId = !string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "",
DiscountId = discountId,
SpentAmount = spentAmountRequirement
@@ -54,7 +54,7 @@ namespace DiscountRules.Standard.HadSpentAmount.Controllers
ViewData.TemplateInfo.HtmlFieldPrefix =
$"DiscountRulesHadSpentAmount{discount.Id}-{(!string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "")}";
- return View(model);
+ return View((object)model);
}
[HttpPost]
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
index 6f998b30c..ba89820c0 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
@@ -1,11 +1,11 @@
-using DiscountRules.HasAllProducts.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
@@ -16,7 +16,7 @@ using Grand.Web.Common.Filters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.HasAllProducts.Controllers
+namespace DiscountRules.Standard.Areas.Admin.Controllers
{
[Area("Admin")]
[AuthorizeAdmin]
@@ -67,7 +67,7 @@ namespace DiscountRules.HasAllProducts.Controllers
restrictedProductIds = discountRequirement.Metadata;
}
- var model = new RequirementModel {
+ var model = new RequirementAllProductsModel {
RequirementId = !string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "",
DiscountId = discountId,
Products = restrictedProductIds
@@ -77,7 +77,7 @@ namespace DiscountRules.HasAllProducts.Controllers
ViewData.TemplateInfo.HtmlFieldPrefix =
$"DiscountRulesHasAllProducts{discount.Id}-{(!string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "")}";
- return View(model);
+ return View((object)model);
}
[HttpPost]
@@ -120,7 +120,7 @@ namespace DiscountRules.HasAllProducts.Controllers
if (!await _permissionService.Authorize(StandardPermission.ManageProducts))
return Content("Access denied");
- var model = new RequirementModel.AddProductModel {
+ var model = new RequirementAllProductsModel.AddProductModel {
//a vendor should have access only to his products
IsLoggedInAsVendor = _workContext.CurrentVendor != null
};
@@ -143,12 +143,12 @@ namespace DiscountRules.HasAllProducts.Controllers
ViewBag.productIdsInput = productIdsInput;
ViewBag.btnId = btnId;
- return View(model);
+ return View((object)model);
}
[HttpPost]
[AutoValidateAntiforgeryToken]
- public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command, RequirementModel.AddProductModel model)
+ public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command, RequirementAllProductsModel.AddProductModel model)
{
if (!await _permissionService.Authorize(StandardPermission.ManageProducts))
return Content("Access denied");
@@ -174,7 +174,7 @@ namespace DiscountRules.HasAllProducts.Controllers
showHidden: true
)).products;
var gridModel = new DataSourceResult {
- Data = products.Select(x => new RequirementModel.ProductModel {
+ Data = products.Select(x => new RequirementAllProductsModel.ProductModel {
Id = x.Id,
Name = x.Name,
Published = x.Published
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
index b37a663e4..a52d5e0cd 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
@@ -1,11 +1,11 @@
-using DiscountRules.HasOneProduct.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
@@ -16,7 +16,7 @@ using Grand.Web.Common.Filters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.HasOneProduct.Controllers
+namespace DiscountRules.Standard.Areas.Admin.Controllers
{
[Area("Admin")]
[AuthorizeAdmin]
@@ -66,7 +66,7 @@ namespace DiscountRules.HasOneProduct.Controllers
restrictedProductIds = discountRequirement.Metadata;
}
- var model = new RequirementModel {
+ var model = new RequirementOneProductModel {
RequirementId = !string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "",
DiscountId = discountId,
Products = restrictedProductIds
@@ -76,7 +76,7 @@ namespace DiscountRules.HasOneProduct.Controllers
ViewData.TemplateInfo.HtmlFieldPrefix =
$"DiscountRulesHasOneProduct{discount.Id}-{(!string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "")}";
- return View(model);
+ return View((object)model);
}
[HttpPost]
@@ -119,7 +119,7 @@ namespace DiscountRules.HasOneProduct.Controllers
if (!await _permissionService.Authorize(StandardPermission.ManageProducts))
return Content("Access denied");
- var model = new RequirementModel.AddProductModel {
+ var model = new RequirementOneProductModel.AddProductModel {
//a vendor should have access only to his products
IsLoggedInAsVendor = _workContext.CurrentVendor != null
};
@@ -142,12 +142,12 @@ namespace DiscountRules.HasOneProduct.Controllers
ViewBag.productIdsInput = productIdsInput;
ViewBag.btnId = btnId;
- return View(model);
+ return View((object)model);
}
[HttpPost]
[AutoValidateAntiforgeryToken]
- public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command, RequirementModel.AddProductModel model)
+ public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command, RequirementOneProductModel.AddProductModel model)
{
if (!await _permissionService.Authorize(StandardPermission.ManageProducts))
return Content("Access denied");
@@ -174,7 +174,7 @@ namespace DiscountRules.HasOneProduct.Controllers
showHidden: true
)).products;
var gridModel = new DataSourceResult {
- Data = products.Select(x => new RequirementModel.ProductModel {
+ Data = products.Select(x => new RequirementOneProductModel.ProductModel {
Id = x.Id,
Name = x.Name,
Published = x.Published
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
index b6a266582..b2bd7833e 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
@@ -1,14 +1,14 @@
-using Grand.Business.Core.Interfaces.Catalog.Discounts;
+using DiscountRules.Standard.Models;
+using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Discounts;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
-using Grand.Domain.Discounts;
-using Grand.Plugin.DiscountRules.ShoppingCart.Models;
using Microsoft.AspNetCore.Mvc;
using System.Globalization;
-namespace DiscountRules.Standard.Controllers
+namespace DiscountRules.Standard.Areas.Admin.Controllers
{
[AuthorizeAdmin]
[Area("Admin")]
@@ -43,7 +43,7 @@ namespace DiscountRules.Standard.Controllers
spentAmountRequirement = Convert.ToDouble(discountRequirement.Metadata);
}
- var model = new RequirementModel {
+ var model = new RequirementShoppingCartModel {
RequirementId = !string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "",
DiscountId = discountId,
SpentAmount = spentAmountRequirement
@@ -53,7 +53,7 @@ namespace DiscountRules.Standard.Controllers
ViewData.TemplateInfo.HtmlFieldPrefix =
$"DiscountRulesShoppingCart{(!string.IsNullOrEmpty(discountRequirementId) ? discountRequirementId : "")}";
- return View(model);
+ return View((object)model);
}
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml
index 1b5d893f6..edf0c0d12 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.CustomerGroups.Models.RequirementModel
+@model DiscountRules.Standard.Models.RequirementCustomerGroupsModel
<script>
$(document).ready(function () {
@@ -22,7 +22,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@(Url.Action("Configure", "CustomerGroups"))",
+ url: "@Url.Action("Configure", "CustomerGroups")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml
index d4c52f957..e1c9a0658 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.Standard.HadSpentAmount.Models.RequirementModel
+@model DiscountRules.Standard.Models.RequirementSpentAmountModel
<script>
$(document).ready(function () {
@@ -20,7 +20,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@(Url.Action("Configure", "HadSpentAmount"))",
+ url: "@Url.Action("Configure", "HadSpentAmount")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml
index dbf8e7448..1a353e8e9 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.HasAllProducts.Models.RequirementModel
+@model DiscountRules.Standard.Models.RequirementAllProductsModel
<script>
$(document).ready(function () {
@@ -20,7 +20,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@(Url.Action("Configure", "HasAllProducts"))",
+ url: "@Url.Action("Configure", "HasAllProducts")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml
index a071bb0f0..a4d865596 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.HasAllProducts.Models.RequirementModel.AddProductModel
+@model DiscountRules.Standard.Models.RequirementAllProductsModel.AddProductModel
@using Grand.Domain.Common;
@inject AdminAreaSettings adminAreaSettings
@{
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml
index 9ca596fd2..18048f56a 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.HasOneProduct.Models.RequirementModel
+@model DiscountRules.Standard.Models.RequirementOneProductModel
<script>
$(document).ready(function () {
@@ -20,7 +20,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@(Url.Action("Configure", "HasOneProduct"))",
+ url: "@Url.Action("Configure", "HasOneProduct")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml
index 906740f6e..d768aeb97 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model DiscountRules.HasOneProduct.Models.RequirementModel.AddProductModel
+@model DiscountRules.Standard.Models.RequirementOneProductModel.AddProductModel
@using Grand.Domain.Common;
@inject AdminAreaSettings adminAreaSettings
@{
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/ShoppingCartAmount/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/ShoppingCartAmount/Configure.cshtml
index 36610070a..d66dbe636 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/ShoppingCartAmount/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/ShoppingCartAmount/Configure.cshtml
@@ -1,7 +1,7 @@
@{
Layout = "";
}
-@model Grand.Plugin.DiscountRules.ShoppingCart.Models.RequirementModel
+@model DiscountRules.Standard.Models.RequirementShoppingCartModel
<script>
$(document).ready(function () {
$('#saveShoppingCartrequirement@(Model.RequirementId)').click(function () {
@@ -11,7 +11,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@(Url.Action("Configure", "ShoppingCartAmount"))",
+ url: "@Url.Action("Configure", "ShoppingCartAmount")",
data: { "discountId": discountId, "discountRequirementId": requirementId, "spentAmount": spentAmount },
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/DiscountProvider.cs b/src/Plugins/DiscountRules.Standard/DiscountProvider.cs
index c669d6d36..45d1151f6 100644
--- a/src/Plugins/DiscountRules.Standard/DiscountProvider.cs
+++ b/src/Plugins/DiscountRules.Standard/DiscountProvider.cs
@@ -1,4 +1,4 @@
-using DiscountRules.Provider;
+using DiscountRules.Standard.Providers;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
namespace DiscountRules.Standard
diff --git a/src/Plugins/DiscountRules.Standard/EndpointProvider.cs b/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
index fc2f558b0..95a3a9ff2 100644
--- a/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
+++ b/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
@@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
-namespace DiscountRules
+namespace DiscountRules.Standard
{
public class EndpointProvider : IEndpointProvider
{
diff --git a/src/Plugins/DiscountRules.Standard/Models/RequirementModel.cs b/src/Plugins/DiscountRules.Standard/Models/RequirementModel.cs
index a345bf283..fa6cb8db1 100644
--- a/src/Plugins/DiscountRules.Standard/Models/RequirementModel.cs
+++ b/src/Plugins/DiscountRules.Standard/Models/RequirementModel.cs
@@ -3,160 +3,147 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace DiscountRules.CustomerGroups.Models
+namespace DiscountRules.Standard.Models;
+
+public class RequirementCustomerGroupsModel
{
- public class RequirementModel
+ public RequirementCustomerGroupsModel()
{
- public RequirementModel()
- {
- AvailableCustomerGroups = new List<SelectListItem>();
- }
+ AvailableCustomerGroups = new List<SelectListItem>();
+ }
- [GrandResourceDisplayName("Plugins.DiscountRules.CustomerGroups.Fields.CustomerGroup")]
- public string CustomerGroupId { get; set; }
+ [GrandResourceDisplayName("Plugins.DiscountRules.CustomerGroups.Fields.CustomerGroup")]
+ public string CustomerGroupId { get; set; }
- public string DiscountId { get; set; }
+ public string DiscountId { get; set; }
- public string RequirementId { get; set; }
+ public string RequirementId { get; set; }
- public IList<SelectListItem> AvailableCustomerGroups { get; set; }
- }
+ public IList<SelectListItem> AvailableCustomerGroups { get; set; }
}
-namespace DiscountRules.Standard.HadSpentAmount.Models
+public class RequirementSpentAmountModel
{
- public class RequirementModel
- {
- [GrandResourceDisplayName("Plugins.DiscountRules.Standard.HadSpentAmount.Fields.Amount")]
- public double SpentAmount { get; set; }
+ [GrandResourceDisplayName("Plugins.DiscountRules.Standard.HadSpentAmount.Fields.Amount")]
+ public double SpentAmount { get; set; }
- public string DiscountId { get; set; }
+ public string DiscountId { get; set; }
- public string RequirementId { get; set; }
- }
+ public string RequirementId { get; set; }
}
-namespace DiscountRules.HasAllProducts.Models
+public class RequirementAllProductsModel
{
- public class RequirementModel
- {
- [GrandResourceDisplayName("Plugins.DiscountRules.HasAllProducts.Fields.Products")]
- public string Products { get; set; }
+ [GrandResourceDisplayName("Plugins.DiscountRules.HasAllProducts.Fields.Products")]
+ public string Products { get; set; }
- public string DiscountId { get; set; }
+ public string DiscountId { get; set; }
- public string RequirementId { get; set; }
+ public string RequirementId { get; set; }
- #region Nested classes
+ #region Nested classes
- public class AddProductModel : BaseModel
+ public class AddProductModel : BaseModel
+ {
+ public AddProductModel()
{
- public AddProductModel()
- {
- AvailableStores = new List<SelectListItem>();
- AvailableVendors = new List<SelectListItem>();
- AvailableProductTypes = new List<SelectListItem>();
- }
-
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")]
- public string SearchProductName { get; set; }
- [UIHint("Category")]
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")]
- public string SearchCategoryId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCollection")]
- [UIHint("Collection")]
- public string SearchCollectionId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchStore")]
- public string SearchStoreId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")]
- public string SearchVendorId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")]
- public int SearchProductTypeId { get; set; }
+ AvailableStores = new List<SelectListItem>();
+ AvailableVendors = new List<SelectListItem>();
+ AvailableProductTypes = new List<SelectListItem>();
+ }
+
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")]
+ public string SearchProductName { get; set; }
+ [UIHint("Category")]
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")]
+ public string SearchCategoryId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCollection")]
+ [UIHint("Collection")]
+ public string SearchCollectionId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchStore")]
+ public string SearchStoreId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")]
+ public string SearchVendorId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")]
+ public int SearchProductTypeId { get; set; }
- public IList<SelectListItem> AvailableStores { get; set; }
- public IList<SelectListItem> AvailableVendors { get; set; }
- public IList<SelectListItem> AvailableProductTypes { get; set; }
+ public IList<SelectListItem> AvailableStores { get; set; }
+ public IList<SelectListItem> AvailableVendors { get; set; }
+ public IList<SelectListItem> AvailableProductTypes { get; set; }
- //vendor
- public bool IsLoggedInAsVendor { get; set; }
- }
+ //vendor
+ public bool IsLoggedInAsVendor { get; set; }
+ }
- public class ProductModel : BaseEntityModel
- {
- public string Name { get; set; }
+ public class ProductModel : BaseEntityModel
+ {
+ public string Name { get; set; }
- public bool Published { get; set; }
- }
- #endregion
+ public bool Published { get; set; }
}
+ #endregion
}
-namespace DiscountRules.HasOneProduct.Models
+public class RequirementOneProductModel
{
- public class RequirementModel
- {
- [GrandResourceDisplayName("Plugins.DiscountRules.HasOneProduct.Fields.Products")]
- public string Products { get; set; }
+ [GrandResourceDisplayName("Plugins.DiscountRules.HasOneProduct.Fields.Products")]
+ public string Products { get; set; }
- public string DiscountId { get; set; }
+ public string DiscountId { get; set; }
- public string RequirementId { get; set; }
+ public string RequirementId { get; set; }
- #region Nested classes
+ #region Nested classes
- public class AddProductModel : BaseModel
+ public class AddProductModel : BaseModel
+ {
+ public AddProductModel()
{
- public AddProductModel()
- {
- AvailableStores = new List<SelectListItem>();
- AvailableVendors = new List<SelectListItem>();
- AvailableProductTypes = new List<SelectListItem>();
- }
-
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")]
- public string SearchProductName { get; set; }
- [UIHint("Category")]
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")]
- public string SearchCategoryId { get; set; }
- [UIHint("Collection")]
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCollection")]
- public string SearchCollectionId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchStore")]
- public string SearchStoreId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")]
- public string SearchVendorId { get; set; }
- [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")]
- public int SearchProductTypeId { get; set; }
-
- public IList<SelectListItem> AvailableStores { get; set; }
- public IList<SelectListItem> AvailableVendors { get; set; }
- public IList<SelectListItem> AvailableProductTypes { get; set; }
-
- //vendor
- public bool IsLoggedInAsVendor { get; set; }
+ AvailableStores = new List<SelectListItem>();
+ AvailableVendors = new List<SelectListItem>();
+ AvailableProductTypes = new List<SelectListItem>();
}
- public class ProductModel : BaseEntityModel
- {
- public string Name { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductName")]
+ public string SearchProductName { get; set; }
+ [UIHint("Category")]
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCategory")]
+ public string SearchCategoryId { get; set; }
+ [UIHint("Collection")]
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchCollection")]
+ public string SearchCollectionId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchStore")]
+ public string SearchStoreId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchVendor")]
+ public string SearchVendorId { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Products.List.SearchProductType")]
+ public int SearchProductTypeId { get; set; }
+
+ public IList<SelectListItem> AvailableStores { get; set; }
+ public IList<SelectListItem> AvailableVendors { get; set; }
+ public IList<SelectListItem> AvailableProductTypes { get; set; }
+
+ //vendor
+ public bool IsLoggedInAsVendor { get; set; }
+ }
- public bool Published { get; set; }
- }
+ public class ProductModel : BaseEntityModel
+ {
+ public string Name { get; set; }
- #endregion
+ public bool Published { get; set; }
}
+
+ #endregion
}
-namespace Grand.Plugin.DiscountRules.ShoppingCart.Models
+public class RequirementShoppingCartModel
{
- public class RequirementModel
- {
- [GrandResourceDisplayName("Plugins.DiscountRules.ShoppingCart.Fields.Amount")]
- public double SpentAmount { get; set; }
+ [GrandResourceDisplayName("Plugins.DiscountRules.ShoppingCart.Fields.Amount")]
+ public double SpentAmount { get; set; }
- public string DiscountId { get; set; }
+ public string DiscountId { get; set; }
- public string RequirementId { get; set; }
- }
+ public string RequirementId { get; set; }
}
\ No newline at end of file
diff --git a/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
index a31d81ff6..bac6007c1 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Utilities.Catalog;
-namespace DiscountRules.Provider
+namespace DiscountRules.Standard.Providers
{
public class CustomerGroupDiscountRule : IDiscountRule
{
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
index 79e6a4482..b8aaa147f 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Catalog.Discounts;
-using Grand.Business.Core.Utilities.Catalog;
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Utilities.Catalog;
using Grand.Domain.Orders;
-namespace DiscountRules.Provider
+namespace DiscountRules.Standard.Providers
{
public class HadSpentAmountDiscountRule : IDiscountRule
{
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
index bfcf58d5d..89555cef4 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
@@ -2,7 +2,7 @@ using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Utilities.Catalog;
using Grand.Domain.Orders;
-namespace DiscountRules.Provider
+namespace DiscountRules.Standard.Providers
{
public class HasAllProductsDiscountRule : IDiscountRule
{
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
index b2eb41f15..1397562a6 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
@@ -2,7 +2,7 @@ using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Utilities.Catalog;
using Grand.Domain.Orders;
-namespace DiscountRules.Provider
+namespace DiscountRules.Standard.Providers
{
public class HasOneProductDiscountRule : IDiscountRule
{
diff --git a/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
index 749f50133..f3e7d36ec 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
@@ -6,7 +6,7 @@ using Grand.Domain.Orders;
using Grand.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
-namespace DiscountRules.Provider
+namespace DiscountRules.Standard.Providers
{
public class ShoppingCartDiscountRule : IDiscountRule
{
diff --git a/src/Plugins/DiscountRules.Standard/StartupApplication.cs b/src/Plugins/DiscountRules.Standard/StartupApplication.cs
index 703c61e3f..629998e3f 100644
--- a/src/Plugins/DiscountRules.Standard/StartupApplication.cs
+++ b/src/Plugins/DiscountRules.Standard/StartupApplication.cs
@@ -1,4 +1,4 @@
-using DiscountRules.Provider;
+using DiscountRules.Standard.Providers;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;