/
newsList.aspx.cs
94 lines (76 loc) · 2.98 KB
/
newsList.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
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
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class _newsList : myBase
{
protected int pageVal = 1;
protected int navid = 1;
protected string leftString = string.Empty;
protected PageModel pageModel = new PageModel();
protected string description = string.Empty;
protected string description_title = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
int id = light.Common.DNTRequest.GetQueryInt("id", 0);
if (id > 0)
{
showinfo(id);
}
}
}
private void showinfo(int id)
{
switch (UserState.lng)
{
case "cn":
pageVal = 1;
break;
case "kr":
pageVal = 2;
break;
case "en":
pageVal = 3;
break;
}
List<light.Model.news> models = new light.BLL.news().GetModelList(" categoryid=" + id.ToString());
StringBuilder sb = new StringBuilder();
light.Model.newscategory model = new light.BLL.newscategory().GetModel(id);
string title = string.Empty;
string list = string.Empty;
if (pageVal == 1)
{
title = model.cname;
}
else if (pageVal == 2)
{
title = model.ename.Split('|')[1];
}
else
{
title = model.ename.Split('|')[0];
}
list = base.newsCategory(pageVal);
description =base.newsCategoryById(id);
sb.AppendLine(@" <table style=""z-index: 100"" border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"">");
sb.AppendLine(@" <tbody>");
sb.AppendLine(@" <tr>");
sb.AppendLine(@" <td style=""padding-left: 45px; color: #ffffff; font-size: 14px; font-weight: bold""");
sb.AppendLine(@" height=""39"" background=""/images/title.jpg"">" + title);
sb.AppendLine(@" </td>");
sb.AppendLine(@" </tr>");
sb.AppendLine(@" <tr>");
sb.AppendLine(@" <td style=""padding-bottom: 2px; padding-left: 5px; padding-right: 5px; padding-top: 2px""");
sb.AppendLine(@" valign=""top"">");
sb.AppendLine(@" " + list);
sb.AppendLine(@" </td>");
sb.AppendLine(@" </tr>");
sb.AppendLine(@" </tbody>");
sb.AppendLine(@" </table>");
leftString = sb.ToString();
}
}