Skip to content

Commit

Permalink
Grand.Web.Vendor - changes
Browse files Browse the repository at this point in the history
  • Loading branch information
support committed Oct 28, 2023
1 parent 3587775 commit e1fe53f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 81 deletions.
54 changes: 1 addition & 53 deletions src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/List.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@
<input type="button" id="exportexcel-selected" class="btn default" style="width: 100%;" value="@Loc["Vendor.Common.ExportToExcel.Selected"]"/>
</li>
</ul>
</div>
<button type="button" id="importexcel" name="importexcel" class="btn default">
<i class="fa fa-upload"></i>
@Loc["Vendor.Common.ImportFromExcel"]
</button>

</div>
<button type="button" name="delete-selected" id="delete-selected" class="btn red">
<i class="fa fa-trash-o"></i>
@Loc["Vendor.Common.Delete.Selected"]
Expand Down Expand Up @@ -365,53 +360,7 @@
}
</script>
</form>
@*import products form*@
<div class="modal-dialog" id="importexcel-window" style="display:none; padding: 0 10px;">
<form asp-area="@Constants.AreaVendor" asp-controller="Product" asp-action="ImportExcel" method="post" enctype="multipart/form-data">

<em>@Loc["Vendor.Catalog.Products.List.ImportFromExcelTip"]</em>
<div class="form-group">
&nbsp;
</div>
<div class="form-group">
<div class="col-md-2" style="margin-top: 2px; height: 34px; padding-left: 25px;">
<label class="control-label">
@Loc["Vendor.Common.ExcelFile"]
</label>
</div>
<div class="col-md-10">
<input type="file" id="importexcelfile" name="importexcelfile"/>
</div>
</div>
<div class="form-group">
&nbsp;
</div>
<div class="form-group">
<div class="col-md-2">
&nbsp;
</div>
<div class="col-md-10 text-right mt-10">
<input type="submit" class="k-button" value="@Loc["Vendor.Common.ImportFromExcel"]"/>
</div>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$("#importexcel").click(function (e) {
e.preventDefault();
var window = $("#importexcel-window");
if (!window.data("kendoWindow")) {
window.kendoWindow({
modal: true,
title: "@Loc["Vendor.Common.ImportFromExcel"]",
actions: ["Close"]
});
}
window.data('kendoWindow').center().open();
});
});
</script>
<script>
$(document).ready(function () {
$('#exportxml-selected').click(function (e) {
Expand All @@ -425,7 +374,6 @@
</script>
<form asp-area="@Constants.AreaVendor" asp-controller="Product" asp-action="ExportExcelSelected" method="post" id="export-excel-selected-form">

<input type="hidden" id="selectedIds" name="selectedIds" value=""/>
</form>
<script>
Expand Down
27 changes: 0 additions & 27 deletions src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1566,33 +1566,6 @@ public async Task<IActionResult> ExportExcelSelected(string selectedIds,
return File(bytes, "text/xls", "products.xlsx");
}

[PermissionAuthorizeAction(PermissionActionName.Import)]
[HttpPost]
public async Task<IActionResult> ImportExcel(IFormFile importexcelfile,
[FromServices] IImportManager<ProductDto> importManager)
{
try
{
if (importexcelfile is { Length: > 0 })
{
await importManager.Import(importexcelfile.OpenReadStream());
}
else
{
Error(_translationService.GetResource("Vendor.Common.UploadFile"));
return RedirectToAction("List");
}

Success(_translationService.GetResource("Vendor.Catalog.Products.Imported"));
return RedirectToAction("List");
}
catch (Exception exc)
{
Error(exc);
return RedirectToAction("List");
}
}

#endregion

#region Bulk editing
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Grand.Web.Vendor/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:9387",
"launchUrl": "vendor",
"sslPort": 44395
}
},
Expand All @@ -22,6 +21,7 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "vendor",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down

0 comments on commit e1fe53f

Please sign in to comment.