-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathStrubeExportController.cs
67 lines (50 loc) · 1.76 KB
/
StrubeExportController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using SmartStore.ComponentModel;
using SmartStore.Services;
using SmartStore.Services.Common;
using SmartStore.Services.DataExchange.Export;
using SmartStore.StrubeExport.Models;
using SmartStore.StrubeExport.Settings;
using SmartStore.Web.Framework.Controllers;
using SmartStore.Web.Framework.Security;
using SmartStore.Web.Framework.Settings;
using System;
using System.Web.Mvc;
namespace SmartStore.Controllers
{
public class StrubeExportController : AdminControllerBase
{
private readonly ICommonServices _services;
private readonly IGenericAttributeService _genericAttributeService;
private readonly Lazy<IExportProfileService> _exportService;
public StrubeExportController(
ICommonServices services,
IGenericAttributeService genericAttributeService,Lazy<IExportProfileService> exportProfileService)
{
_services = services;
_genericAttributeService = genericAttributeService;
_exportService = exportProfileService;
}
[AdminAuthorize]
[ChildActionOnly]
[LoadSetting]
public ActionResult Configure(StrubeExportSettings settings)
{
var model = new ConfigurationModel();
MiniMapper.Map(settings, model);
return View(model);
}
[HttpPost]
[AdminAuthorize]
[ChildActionOnly]
[SaveSetting]
public ActionResult Configure(StrubeExportSettings settings, ConfigurationModel model, FormCollection form)
{
if (!ModelState.IsValid)
{
return Configure(settings);
}
MiniMapper.Map(model, settings);
return RedirectToConfiguration("SmartStore.StrubeExport");
}
}
}