Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

_CreateOrUpdate.AppliedToCategories.cshtml

@model DiscountModel

@if (Model.Id > 0)
{
    <div class="card-body">
        @await Html.PartialAsync("Table", new DataTablesModel
        {
            Name = "categories-grid",
            UrlRead = new DataUrl("CategoryList", "Discount", new RouteValueDictionary { [nameof(Model.DiscountCategorySearchModel.DiscountId)] = Model.DiscountCategorySearchModel.DiscountId }),
            UrlDelete = new DataUrl("CategoryDelete", "Discount", new RouteValueDictionary { [nameof(Model.DiscountCategorySearchModel.DiscountId)] = Model.DiscountCategorySearchModel.DiscountId }),
            BindColumnNameActionDelete = nameof(DiscountCategoryModel.CategoryId),
            Length = Model.DiscountCategorySearchModel.PageSize,
            LengthMenu = Model.DiscountCategorySearchModel.AvailablePageSizes,
            ColumnCollection = new List<ColumnProperty>
            {
                new ColumnProperty(nameof(DiscountCategoryModel.CategoryName))
                {
                    Title = T("Admin.Promotions.Discounts.AppliedToCategories.Category").Text
                },
                new ColumnProperty(nameof(DiscountCategoryModel.CategoryId))
                {
                    Title = T("Admin.Common.View").Text,
                    Width = "150",
                    ClassName =  NopColumnClassDefaults.Button,
                    Render = new RenderButtonView(new DataUrl("~/Admin/Category/Edit/"))
                },
                new ColumnProperty(nameof(DiscountCategoryModel.CategoryId))
                {
                    Title = T("Admin.Common.Delete").Text,
                    Width = "150",
                    Render = new RenderButtonRemove(T("Admin.Common.Delete").Text),
                    ClassName =  NopColumnClassDefaults.Button
                }
            }
        })
    </div>
    <div class="card-footer">
        <button type="submit" id="btnAddNewCategory" onclick="javascript:OpenWindow('@(Url.Action("CategoryAddPopup", "Discount", new { discountId = Model.Id, btnId = "btnRefreshCategories", formId = "discount-form" }))', 800, 800, true); return false;" class="btn btn-primary">
            @T("Admin.Promotions.Discounts.AppliedToCategories.AddNew")
        </button>
        <button type="submit" id="btnRefreshCategories" style="display: none"></button>
        <script>
            $(function() {
                $('#btnRefreshCategories').click(function () {
                    //refresh grid
                    updateTable('#categories-grid');

                    //return false to don't reload a page
                    return false;
                });
            });
        </script>
    </div>
}
else
{
    <div class="card-body">
        @T("Admin.Promotions.Discounts.AppliedToCategories.SaveBeforeEdit")
    </div>
}