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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
@model DiscountModel
@{
if (!string.IsNullOrEmpty(Model.Id))
{
<vc:admin-widget widget-zone="discount_details_applied_to_vendors_top" additional-data="Model"/>
<div class="grand-card">
<div class="grand-card__header">
<a id="btnAddNewVendor" href="@(Url.Action("VendorAddPopup", "Discount", new { discountId = Model.Id, btnId = "btnRefreshVendors", formId = "discount-form", area = Constants.AreaAdmin }))" class="btn btn-outline-secondary btn-sm"><i class="bi bi-plus-lg"></i> @Loc["admin.marketing.Discounts.AppliedToVendors.AddNew"]</a>
<input type="button" id="btnRefreshVendors" style="display: none"/>
</div>
<div class="grand-card__body grand-card__body--flush">
<admin-grid id="vendors-grid"
key="VendorId"
read-url="@Url.Action("VendorList", "Discount", new { discountId = Model.Id, area = Constants.AreaAdmin })"
destroy-url="@Url.Action("VendorDelete", "Discount", new { discountId = Model.Id, area = Constants.AreaAdmin })"
pager="Compact">
<grid-column field="VendorName" title="@Loc["admin.marketing.Discounts.AppliedToVendors.Vendor"]">
<cell-template>
<a class="text-decoration-none" href="@Url.Action("Edit", "Vendor", new { area = Constants.AreaAdmin })/{{ VendorId }}">{{ VendorName }}</a>
</cell-template>
</grid-column>
<grid-commands destroy="true" width="150"/>
</admin-grid>
</div>
</div>
<vc:admin-widget widget-zone="discount_details_applied_to_vendors_bottom" additional-data="Model"/>
<script>
$(document).ready(function () {
$('#btnAddNewVendor').magnificPopup({
type: 'ajax',
settings: { cache: false, async: false },
midClick: true,
callbacks: {
parseAjax: function (mfpResponse) {
mfpResponse.data = $('<div></div>').html(mfpResponse.data);
},
ajaxContentAdded: function () {
$('.mfp-wrap').removeAttr('tabindex');
}
}
});
});
</script>
<script>
$(document).ready(function () {
$('#btnRefreshVendors').click(function () {
//refresh grid
var grid = GrandAdmin.grids.get("#vendors-grid");
grid.dataSource.read();
//return false to don't reload a page
return false;
});
});
</script>
}
else
{
<div class="note note-info">
@Loc["admin.marketing.Discounts.AppliedToVendors.SaveBeforeEdit"]
</div>
}
}