forked from openstore-ecommerce/OpenStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProductRazorSearchSettings.ascx.cs
59 lines (49 loc) · 1.9 KB
/
ProductRazorSearchSettings.ascx.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
using System;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Exceptions;
using NBrightCore.common;
using NBrightDNN;
using Nevoweb.DNN.NBrightBuy.Base;
using Nevoweb.DNN.NBrightBuy.Components;
namespace Nevoweb.DNN.NBrightBuy
{
/// -----------------------------------------------------------------------------
/// <summary>
/// The Settings class manages Module Settings
/// </summary>
/// -----------------------------------------------------------------------------
public partial class ProductRazorSearchSettings : ModuleSettingsBase
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
// insert page header text
NBrightBuyUtils.RazorIncludePageHeader(ModuleId, Page, "settingspageheader.cshtml", ControlPath, "config", StoreSettings.Current.Settings());
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (Page.IsPostBack == false)
{
PageLoad();
}
}
private void PageLoad()
{
try
{
var obj = NBrightBuyUtils.GetSettings(PortalId,ModuleId);
obj.ModuleId = base.ModuleId; // need to pass the moduleid here, becuase it doesn;t exists in url for settings and on new settings it needs it.
var strOut = NBrightBuyUtils.RazorTemplRender(ModuleConfiguration.DesktopModule.ModuleName + "settings.cshtml", ModuleId, "", obj, ControlPath, "config", Utils.GetCurrentCulture(),StoreSettings.Current.Settings());
var lit = new Literal();
lit.Text = strOut;
phData.Controls.Add(lit);
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
}