Ejemplo n.º 1
0
        /// <summary>
        /// 绑定研报
        /// </summary>
        /// <param name="id"></param>
        private void BindReports(String id)
        {
            object                    data       = ReportDataHelper.GetReportByTreeNode("", "", id, "0", "100", "desc", "", "");
            ReportListRoot            reportRoot = JsonConvert.DeserializeObject <ReportListRoot>(data.ToString());
            List <ReportListNodeBind> bindList   = new List <ReportListNodeBind>();

            foreach (ReportListNode noticeNode in reportRoot.records)
            {
                ReportListNodeBind bind = new ReportListNodeBind();
                bind.Copy(noticeNode);
                bindList.Add(bind);
            }
            m_gridAllStockReports.ClearRows();
            foreach (ReportListNodeBind report in bindList)
            {
                GridRow row = new GridRow();
                m_gridAllStockReports.AddRow(row);
                row.Tag = report;
                row.AddCell("colN1", new GridStringCell(report.date));
                row.AddCell("colN2", new GridStringCell(report.Title));
                row.AddCell("colN3", new GridStringCell(report.Url));
                row.AddCell("colN4", new GridStringCell(report.id));
                row.GetCell("colN1").Style           = new GridCellStyle();
                row.GetCell("colN1").Style.ForeColor = COLOR.ARGB(255, 255, 80);
                row.GetCell("colN2").Style           = new GridCellStyle();
                row.GetCell("colN2").Style.ForeColor = COLOR.ARGB(255, 80, 80);
                row.GetCell("colN3").Style           = new GridCellStyle();
                row.GetCell("colN3").Style.ForeColor = COLOR.ARGB(255, 80, 255);
            }
            m_gridAllStockReports.Update();
            m_gridAllStockReports.Invalidate();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建新闻
        /// </summary>
        public AllStockReports(MainFrame mainFrame)
        {
            m_mainFrame           = mainFrame;
            m_gridAllStockReports = mainFrame.GetGrid("gridAllStockReports");
            m_gridAllStockReports.GridLineColor      = COLOR.EMPTY;
            m_gridAllStockReports.BackColor          = COLOR.ARGB(0, 0, 0);
            m_gridAllStockReports.RowStyle           = new GridRowStyle();
            m_gridAllStockReports.RowStyle.BackColor = COLOR.ARGB(0, 0, 0);
            m_gridAllStockReports.RegisterEvent(new GridCellMouseEvent(GridCellClick), EVENTID.GRIDCELLCLICK);
            m_tvAllStockReports                    = mainFrame.GetTree("tvAllStockReports");
            m_tvAllStockReports.BackColor          = COLOR.ARGB(0, 0, 0);
            m_tvAllStockReports.ForeColor          = COLOR.ARGB(255, 255, 255);
            m_tvAllStockReports.RowStyle           = new GridRowStyle();
            m_tvAllStockReports.RowStyle.BackColor = COLOR.ARGB(0, 0, 0);
            m_tvAllStockReports.RegisterEvent(new GridCellMouseEvent(GridCellClick), EVENTID.GRIDCELLCLICK);
            object       data     = ReportDataHelper.GetLeftTree("F004|S004004");
            NewsTypeRoot newsRoot = JsonConvert.DeserializeObject <NewsTypeRoot>(data.ToString());

            foreach (NewsTypeNode node in newsRoot.NodeList)
            {
                if (node.NodeList != null && node.NodeList.Count > 0)
                {
                    TreeNodeA tn = new TreeNodeA();
                    tn.Text            = node.Name;
                    tn.Style           = new GridCellStyle();
                    tn.Style.ForeColor = COLOR.ARGB(255, 255, 255);
                    tn.Style.Font      = new FONT("微软雅黑", 14, true, false, false);
                    m_tvAllStockReports.AppendNode(tn);
                    foreach (NewsTypeNode subNode in node.NodeList)
                    {
                        TreeNodeA subTn = new TreeNodeA();
                        subTn.Text            = subNode.Name;
                        subTn.Style           = new GridCellStyle();
                        subTn.Style.ForeColor = COLOR.ARGB(255, 255, 255);
                        subTn.Style.Font      = new FONT("微软雅黑", 14, true, false, false);
                        tn.AppendNode(subTn);
                        subTn.Tag = subNode.Id;
                    }
                }
            }
            m_tvAllStockReports.Update();
            BindReports("S103001");
        }