/
MyAccount.aspx.cs
59 lines (53 loc) · 2.2 KB
/
MyAccount.aspx.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
//--------------------------------------------------
// Project: AdvantShop.NET
// Web site: http:\\www.advantshop.net
//--------------------------------------------------
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using AdvantShop.BonusSystem;
using AdvantShop.Configuration;
using AdvantShop.Controls;
using AdvantShop.Core.UrlRewriter;
using AdvantShop.Customers;
using AdvantShop.Modules;
using AdvantShop.Modules.Interfaces;
using AdvantShop.SEO;
using Resources;
namespace ClientPages
{
public partial class MyAccount : AdvantShopClientPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!CustomerContext.CurrentCustomer.RegistredUser)
Response.Redirect("default.aspx");
bonusTab.Visible = bonusContent.Visible = BonusSystem.IsActive;
SetMeta(
new MetaInfo(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Client_MyAccount_MyAccount)),
string.Empty);
foreach (var type in AttachedModules.GetModules<IMyAccountControls>())
{
var mac = (IMyAccountControls)Activator.CreateInstance(type, null);
for (int i = 0; i < mac.Controls.Count; i++)
{
Control c =
(this).LoadControl(
UrlService.GetAbsoluteLink(string.Format("/Modules/{0}/{1}", mac.ModuleStringId,
mac.Controls[i].File)));
if (c != null)
{
var div = new Panel() {CssClass = "tab-content"};
div.Attributes.Add("data-tabs-content", "true");
div.Controls.Add(c);
tabscontents.Controls.Add(div);
liDopTabs.Text +=
string.Format(
"<div class=\"tab-header\" id=\"{0}{1}\" data-tabs-header=\"true\"><span class=\"tab-inside\">{2}</span><span class=\"right\"></span></div>",
mac.ModuleStringId.ToLower(), i + 1, mac.Controls[i].NameTab);
}
}
}
}
}
}