forked from nbrightproject/NBrightPL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathView.ascx.cs
150 lines (109 loc) · 4.53 KB
/
View.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// --- Copyright (c) notice NevoWeb ---
// Copyright (c) 2014 SARL NevoWeb. www.nevoweb.com. The MIT License (MIT).
// Author: D.C.Lee
// ------------------------------------------------------------------------
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// ------------------------------------------------------------------------
// This copyright notice may NOT be removed, obscured or modified without written consent from the author.
// --- End copyright notice ---
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Tabs;
using NBrightCore.common;
using NBrightCore.render;
using NBrightDNN;
using DotNetNuke.Entities.Portals;
namespace Nevoweb.DNN.NBrightPL
{
/// -----------------------------------------------------------------------------
/// <summary>
/// The ViewNBrightGen class displays the content
/// </summary>
/// -----------------------------------------------------------------------------
public partial class View : Base.NBrightPLBase
{
private String _templH = "";
private String _templD = "";
private String _templF = "";
#region Event Handlers
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
try
{
_templH = "viewheader.html";
_templD = "viewbody.html";
_templF = "viewfooter.html";
// Get Display Header
var rpDataHTempl = GetTemplateData(_templH); ;
rpDataH.ItemTemplate = new GenXmlTemplate(rpDataHTempl);
// Get Display Body
var rpDataTempl = GetTemplateData(_templD);
rpData.ItemTemplate = new GenXmlTemplate(rpDataTempl);
// Get Display Footer
var rpDataFTempl = GetTemplateData(_templF);
rpDataF.ItemTemplate = new GenXmlTemplate(rpDataFTempl);
}
catch (Exception exc)
{
rpDataF.ItemTemplate = new GenXmlTemplate(exc.Message);
// catch any error and allow processing to continue, output error as footer template.
}
}
protected override void OnLoad(EventArgs e)
{
try
{
base.OnLoad(e);
if (Page.IsPostBack == false)
{
PageLoad();
}
}
catch (Exception exc) //Module failed to load
{
//display the error on the template (don;t want to log it here, prefer to deal with errors directly.)
var l = new Literal();
l.Text = exc.ToString();
phData.Controls.Add(l);
}
}
private void PageLoad()
{
base.DoDetail(rpDataH);
#region "Data Repeater"
//if (_templD.Trim() != "") // if we don;t have a template, don't do anything
//{
// var tl = DnnUtils.GetPortalTabs(PortalId);
// var l = new List<NBrightInfo>();
// foreach (var t in tl)
// {
// TabInfo tabinfo = t.Value;
// var nbiT = new NBrightInfo(true);
// nbiT.ItemID = tabinfo.TabID;
// nbiT.GUIDKey = tabinfo.TabName;
// l.Add(nbiT);
// }
//}
#endregion
// display footer
//base.DoDetail(rpDataF);
}
#endregion
#region "Events "
protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
{
var cArg = e.CommandArgument.ToString();
var param = new string[3];
}
#endregion
}
}