username@email.com
2022-01-21 b18a7c8e54b51a5caa400e55cb8cc428c0301a0c
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.BLL.Sys;
using CY.Model;
using CY.Infrastructure.Common;
using System.Data;
namespace CY.WebForm.Pages.Templet.Default
{
    public partial class CompanyNewsDetail : TempletBasePage
    {
        Info_ContentBLL bll_Info_ContentBLL = null;
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
        Info_SortBLL bll_Info_SortBLL = null;
        //初始化
        public CompanyNewsDetail()
        {
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
            bll_Info_ContentBLL = new Info_ContentBLL();
            bll_Info_SortBLL = new Info_SortBLL();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();
                InitialData();
            }
        }
 
        protected void InitialData()
        {
            this.TemplateList.InnerHtml = InitialSelectNewsData();
        }
 
        protected string InitialSelectNewsData()
        {
            DataTable ds = bll_Info_SortBLL.SelectList(CurrentWeb().MemberId.ToGuid2());
            string SortTypeHtml = "";
            if (ds != null && ds.Rows.Count > 0)
            {
                SortTypeHtml = "<ul>";
                GetDataByLevelNews(ref SortTypeHtml, ds, bll_Sys_DictionaryBLL.GetKeyIdByKeyid(3, "网站资讯类型"), 1);
            }
            SortTypeHtml += "</ul>";
            return SortTypeHtml;
        }
 
        //遍历数据
        public void GetDataByLevelNews(ref string SortTypeHtml, DataTable data, int? parentId, int level)
        {
 
            DataRow[] result = data.Select(string.Format("ParentId={0}", parentId));
 
            foreach (var item in result)
            {
                SortTypeHtml += "<li style=\" line-height:30px; height:30px; font-size:14px;\"><a href='/Pages/Templet/Default/CompanyNewsList.aspx?i=" + CurrentWeb().bid + "&sortid=" + item["Keyid"] + "'>" + item["Title"].ToString2().JSubString(30, "..") + "</a></li>";
            }
 
 
        }
 
        //绑定数据
        private void BindList()
        {
            EC_MemberBasicBLL b_EC_MemberBasicBLL = new EC_MemberBasicBLL();
            EC_MemberBasic mx_EC_MemberBasic = b_EC_MemberBasicBLL.GetMemberByMemberId(CurrentWeb().MemberId);
            this.Title += "-" + mx_EC_MemberBasic.Name;
            Info_Content m_Info_Content = new Info_Content();
            if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0)
                m_Info_Content = bll_Info_ContentBLL.SelectModelBySortId(Request["Keyid"].ToInt32());
 
            if (m_Info_Content != null)
            {
                this.divTitle.InnerText = m_Info_Content.Title.ToString2();
 
                Info_Sort m_Info_Sort = bll_Info_SortBLL.SelectModelByKeyId(m_Info_Content.SortID);
 
                this.divContent.InnerHtml = m_Info_Content.InfoContent.ToString2();
            }
        }
    }
}