/// <summary> /// 绑定新闻 /// </summary> /// <param name="id"></param> private void BindStockNews(String id) { object data = StockNewsDataHelper.GetNewsById(id, "0", "100", "desc", ""); NewsListRoot newsRoot = JsonConvert.DeserializeObject <NewsListRoot>(data.ToString()); m_gridAllStockNews.ClearRows(); foreach (NewsListNode stockNew in newsRoot.records) { GridRow row = new GridRow(); m_gridAllStockNews.AddRow(row); row.Tag = stockNew; row.AddCell("colN1", new GridStringCell(stockNew.Date)); row.AddCell("colN2", new GridStringCell(stockNew.Title)); row.AddCell("colN3", new GridStringCell(stockNew.url)); row.AddCell("colN4", new GridStringCell(stockNew.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_gridAllStockNews.Update(); m_gridAllStockNews.Invalidate(); }
/// <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(); }
/// <summary> /// 绑定公告 /// </summary> /// <param name="id"></param> private void BindNotices(String id) { object data = NoticeDataHelper.GetNoticeById(id, "0", "100", "desc", ""); NoticeListRoot noticeRoot = JsonConvert.DeserializeObject <NoticeListRoot>(data.ToString()); List <NoticeListNodeBind> bindList = new List <NoticeListNodeBind>(); foreach (NoticeListNode noticeNode in noticeRoot.records) { NoticeListNodeBind bind = new NoticeListNodeBind(); bind.Copy(noticeNode); bindList.Add(bind); } m_gridAllStockNotices.ClearRows(); foreach (NoticeListNodeBind notice in bindList) { GridRow row = new GridRow(); m_gridAllStockNotices.AddRow(row); row.Tag = notice; row.AddCell("colN1", new GridStringCell(notice.Date)); row.AddCell("colN2", new GridStringCell(notice.Title)); row.AddCell("colN3", new GridStringCell(notice.url)); row.AddCell("colN4", new GridStringCell(notice.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_gridAllStockNotices.Update(); m_gridAllStockNotices.Invalidate(); }
/// <summary> /// 过滤查找 /// </summary> public void FilterSearch() { String sText = m_searchTextBox.Text.ToUpper(); m_grid.BeginUpdate(); m_grid.ClearRows(); int row = 0; CList <GSecurity> securities = SecurityService.FilterCode(sText); if (securities != null) { int rowCount = securities.size(); for (int i = 0; i < rowCount; i++) { GSecurity security = securities.get(i); GridRow gridRow = new GridRow(); m_grid.AddRow(gridRow); gridRow.AddCell(0, new GridStringCell(security.m_code)); gridRow.AddCell(1, new GridStringCell(security.m_name)); row++; } } securities.Dispose(); m_grid.EndUpdate(); }
/// <summary> /// 设置股票账户持仓信息 /// </summary> /// <param name="stockPositionResult"></param> private void SetSecurityPosition(String stockPositionResult) { m_dictSecurityPositions.Clear(); if (stockPositionResult == null || stockPositionResult.Length == 0) { return; } String[] lines = stockPositionResult.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (lines == null || lines.Length < 2) { return; } m_gridPositionAccount.BeginUpdate(); m_gridPositionAccount.ClearRows(); for (int i = 1; i < lines.Length; i++) { SecurityPosition position = SecurityPosition.ConvertToStockPosition(lines[i]); if (position != null) { m_dictSecurityPositions[position.m_stockCode] = position; GridRow row = new GridRow(); m_gridPositionAccount.AddRow(row); GridCell cell = new GridStringCell(position.m_stockCode); row.AddCell(0, cell); cell = new GridStringCell(position.m_stockName); row.AddCell(1, cell); cell = new GridDoubleCell(position.m_stockBalance); row.AddCell(2, cell); cell = new GridDoubleCell(position.m_availableBalance); row.AddCell(3, cell); cell = new GridDoubleCell(position.m_volume); row.AddCell(4, cell); cell = new GridDoubleCell(position.m_frozenVolume); row.AddCell(5, cell); cell = new GridDoubleCell(position.m_positionProfit); row.AddCell(6, cell); cell = new GridDoubleCell(position.m_positionCost); row.AddCell(7, cell); cell = new GridDoubleCell(position.m_positionProfitRatio); row.AddCell(8, cell); cell = new GridDoubleCell(position.m_marketPrice); row.AddCell(9, cell); cell = new GridDoubleCell(position.m_marketValue); row.AddCell(10, cell); cell = new GridDoubleCell(position.m_redemptionVolume); row.AddCell(11, cell); cell = new GridStringCell(position.m_marketName); row.AddCell(12, cell); cell = new GridStringCell(position.m_investorAccount); row.AddCell(13, cell); } } m_gridPositionAccount.EndUpdate(); m_gridPositionAccount.Invalidate(); }
/// <summary> /// 设置股票账户委托信息 /// </summary> /// <param name="commissionResult"></param> private void SetSecurityCommission(String commissionResult) { if (commissionResult == null || commissionResult.Length == 0) { return; } String[] lines = commissionResult.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (lines == null || lines.Length < 2) { return; } m_gridCommissionAccount.BeginUpdate(); m_gridCommissionAccount.ClearRows(); for (int i = 1; i < lines.Length; i++) { SecurityCommission commission = SecurityCommission.ConvertToSecurityCommission(lines[i]); if (commission != null) { GridRow row = new GridRow(); m_gridCommissionAccount.AddRow(row); GridCell cell = new GridStringCell(commission.m_orderDate); row.AddCell(0, cell); cell = new GridStringCell(commission.m_stockCode); row.AddCell(1, cell); cell = new GridStringCell(commission.m_stockName); row.AddCell(2, cell); cell = new GridStringCell(commission.m_operate); row.AddCell(3, cell); cell = new GridStringCell(commission.m_remark); row.AddCell(4, cell); cell = new GridDoubleCell(commission.m_orderVolume); row.AddCell(5, cell); cell = new GridDoubleCell(commission.m_tradeVolume); row.AddCell(6, cell); cell = new GridDoubleCell(commission.m_cancelVolume); row.AddCell(7, cell); cell = new GridDoubleCell(commission.m_orderPrice); row.AddCell(8, cell); cell = new GridStringCell(commission.m_orderType); row.AddCell(9, cell); cell = new GridDoubleCell(commission.m_tradeAvgPrice); row.AddCell(10, cell); cell = new GridStringCell(commission.m_orderSysID); row.AddCell(11, cell); } } m_gridCommissionAccount.EndUpdate(); m_gridCommissionAccount.Invalidate(); }
/// <summary> /// 设置股票账户成交信息 /// </summary> /// <param name="tradeResult"></param> private void SetSecurityTrade(String tradeResult) { if (tradeResult == null || tradeResult.Length == 0) { return; } String[] lines = tradeResult.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (lines == null || lines.Length < 2) { return; } m_gridTradeAccount.BeginUpdate(); m_gridTradeAccount.ClearRows(); for (int i = 1; i < lines.Length; i++) { SecurityTrade trade = SecurityTrade.ConvertToStockTrade(lines[i]); if (trade != null) { GridRow row = new GridRow(); m_gridTradeAccount.AddRow(row); GridCell cell = new GridStringCell(trade.m_tradeDate); row.AddCell(0, cell); cell = new GridStringCell(trade.m_stockCode); row.AddCell(1, cell); cell = new GridStringCell(trade.m_stockName); row.AddCell(2, cell); cell = new GridStringCell(trade.m_operate); row.AddCell(3, cell); cell = new GridDoubleCell(trade.m_tradeVolume); row.AddCell(4, cell); cell = new GridDoubleCell(trade.m_tradeAvgPrice); row.AddCell(5, cell); cell = new GridDoubleCell(trade.m_tradeAmount); row.AddCell(6, cell); cell = new GridStringCell(trade.m_orderSysID); row.AddCell(7, cell); cell = new GridStringCell(trade.m_orderTradeID); row.AddCell(8, cell); cell = new GridDoubleCell(trade.m_cancelVolume); row.AddCell(9, cell); cell = new GridDoubleCell(trade.m_stockBalance); row.AddCell(10, cell); } } m_gridTradeAccount.EndUpdate(); m_gridTradeAccount.Invalidate(); }
/// <summary> /// 绑定服务器 /// </summary> private void BindServers() { m_gridRemotes.CellEditMode = GridCellEditMode.DoubleClick; List <RemoteInfo> remotes = DataCenter.RemoteService.m_remotes; int serversSize = remotes.Count; m_gridRemotes.ClearRows(); m_gridRemotes.BeginUpdate(); for (int i = 0; i < serversSize; i++) { RemoteInfo remote = remotes[i]; AddRemoteToGrid(remote); } m_gridRemotes.EndUpdate(); m_gridRemotes.Invalidate(); }
/// <summary> /// 绑定员工 /// </summary> private void BindProjects() { m_gridProjects.CellEditMode = GridCellEditMode.DoubleClick; List <ProjectInfo> projects = DataCenter.ProjectService.m_projects; int projectsSize = projects.Count; m_gridProjects.ClearRows(); m_gridProjects.BeginUpdate(); for (int i = 0; i < projectsSize; i++) { ProjectInfo project = projects[i]; AddProjectToGrid(project); } m_gridProjects.EndUpdate(); m_gridProjects.Invalidate(); }
/// <summary> /// 绑定员工 /// </summary> private void BindGits() { m_gridGit.CellEditMode = GridCellEditMode.DoubleClick; List <GitInfo> gits = DataCenter.GitService.m_gits; int gitsSize = gits.Count; m_gridGit.ClearRows(); m_gridGit.BeginUpdate(); for (int i = 0; i < gitsSize; i++) { GitInfo git = gits[i]; AddGitToGrid(git); } m_gridGit.EndUpdate(); m_gridGit.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindMasters() { m_gridExams.CellEditMode = GridCellEditMode.DoubleClick; List <ExamInfo> masters = DataCenter.ExamService.m_exams; int mastersSize = masters.Count; m_gridExams.ClearRows(); m_gridExams.BeginUpdate(); for (int i = 0; i < mastersSize; i++) { ExamInfo report = masters[i]; AddExamToGrid(report); } m_gridExams.EndUpdate(); m_gridExams.Invalidate(); }
/// <summary> /// 绑定线索 /// </summary> private void BindClues() { m_gridOpinions.CellEditMode = GridCellEditMode.DoubleClick; List <OpinionInfo> clues = DataCenter.OpinionService.m_opinions; int opinionsSize = clues.Count; m_gridOpinions.ClearRows(); m_gridOpinions.BeginUpdate(); for (int i = 0; i < opinionsSize; i++) { OpinionInfo opinion = clues[i]; AddOpinionToGrid(opinion); } m_gridOpinions.EndUpdate(); m_gridOpinions.Invalidate(); }
/// <summary> /// 绑定服务器 /// </summary> private void BindServers() { m_gridServers.CellEditMode = GridCellEditMode.DoubleClick; List <ServerInfo> servers = DataCenter.ServerService.m_servers; int serversSize = servers.Count; m_gridServers.ClearRows(); m_gridServers.BeginUpdate(); for (int i = 0; i < serversSize; i++) { ServerInfo server = servers[i]; AddServerToGrid(server); } m_gridServers.EndUpdate(); m_gridServers.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindFollows() { m_gridFollows.CellEditMode = GridCellEditMode.DoubleClick; List <FollowInfo> follows = DataCenter.FollowService.m_follows; int followsSize = follows.Count; m_gridFollows.ClearRows(); m_gridFollows.BeginUpdate(); for (int i = 0; i < followsSize; i++) { FollowInfo follow = follows[i]; AddFollowToGrid(follow); } m_gridFollows.EndUpdate(); m_gridFollows.Invalidate(); }
/// <summary> /// 绑定线索 /// </summary> private void BindClues() { m_gridClues.CellEditMode = GridCellEditMode.DoubleClick; List <ClueInfo> clues = DataCenter.ClueService.m_clues; int opinionsSize = clues.Count; m_gridClues.ClearRows(); m_gridClues.BeginUpdate(); for (int i = 0; i < opinionsSize; i++) { ClueInfo clue = clues[i]; AddClueToGrid(clue); } m_gridClues.EndUpdate(); m_gridClues.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindCards() { m_gridBusinessCards.CellEditMode = GridCellEditMode.DoubleClick; List <BusinessCardInfo> cards = DataCenter.BusinessCardService.m_businessCards; int cardsSize = cards.Count; m_gridBusinessCards.ClearRows(); m_gridBusinessCards.BeginUpdate(); for (int i = 0; i < cardsSize; i++) { BusinessCardInfo card = cards[i]; AddCardToGrid(card); } m_gridBusinessCards.EndUpdate(); m_gridBusinessCards.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindLevels() { m_gridLevels.CellEditMode = GridCellEditMode.DoubleClick; List <LevelInfo> levels = DataCenter.LevelService.m_levels; int levelsSize = levels.Count; m_gridLevels.ClearRows(); m_gridLevels.BeginUpdate(); for (int i = 0; i < levelsSize; i++) { LevelInfo level = levels[i]; AddLevelToGrid(level); } m_gridLevels.EndUpdate(); m_gridLevels.Invalidate(); }
/// <summary> /// 绑定员工 /// </summary> private void BindStaffs() { m_gridStaffs.CellEditMode = GridCellEditMode.DoubleClick; List <StaffInfo> staffs = DataCenter.StaffService.m_staffs; int staffsSize = staffs.Count; m_gridStaffs.ClearRows(); m_gridStaffs.BeginUpdate(); for (int i = 0; i < staffsSize; i++) { StaffInfo staff = staffs[i]; AddStaffToGrid(staff); } m_gridStaffs.EndUpdate(); m_gridStaffs.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindEvents() { m_gridEvents.CellEditMode = GridCellEditMode.DoubleClick; List <EventInfo> events = DataCenter.CalendarService.GetEvents(GetSelectedDay()); int eventsSize = events.Count; m_gridEvents.ClearRows(); m_gridEvents.BeginUpdate(); for (int i = 0; i < eventsSize; i++) { EventInfo eventInfo = events[i]; AddEventToGrid(eventInfo); } m_gridEvents.EndUpdate(); m_gridEvents.Invalidate(); }
/// <summary> /// 绑定员工 /// </summary> private void BindAwards() { m_gridAwards.CellEditMode = GridCellEditMode.DoubleClick; List <AwardInfo> awards = DataCenter.AwardService.m_awards; int awardsSize = awards.Count; m_gridAwards.ClearRows(); m_gridAwards.BeginUpdate(); for (int i = 0; i < awardsSize; i++) { AwardInfo award = awards[i]; AddAwardToGrid(award); } m_gridAwards.EndUpdate(); m_gridAwards.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindMasters() { m_gridMasters.CellEditMode = GridCellEditMode.DoubleClick; List <MasterInfo> masters = DataCenter.MasterService.m_masters; int mastersSize = masters.Count; m_gridMasters.ClearRows(); m_gridMasters.BeginUpdate(); for (int i = 0; i < mastersSize; i++) { MasterInfo master = masters[i]; AddMasterToGrid(master); } m_gridMasters.EndUpdate(); m_gridMasters.Invalidate(); }
/// <summary> /// 绑定信息 /// </summary> private void BindCodes() { m_gridBSStocks.CellEditMode = GridCellEditMode.DoubleClick; List <BSStockInfo> codes = DataCenter.BSStockService.m_bsStocks; int codesSize = codes.Count; m_gridBSStocks.ClearRows(); m_gridBSStocks.BeginUpdate(); for (int i = 0; i < codesSize; i++) { BSStockInfo bsStock = codes[i]; AddCodeToGrid(bsStock); } m_gridBSStocks.EndUpdate(); m_gridBSStocks.Invalidate(); }
/// <summary> /// 绑定待选证券到表格 /// </summary> /// <param name="securities">证券列表</param> public void BindSecuritiesToSelectSecuritiesGrid(List <Security> securities) { m_gridSelectSecurities.BeginUpdate(); m_gridSelectSecurities.ClearRows(); int securitiesSize = securities.Count; for (int i = 0; i < securitiesSize; i++) { Security security = securities[i]; GridRow row = new GridRow(); m_gridSelectSecurities.AddRow(row); row.AddCell(0, new GridStringCell(security.m_code)); row.AddCell(1, new GridStringCell(security.m_name)); } m_gridSelectSecurities.EndUpdate(); m_gridSelectSecurities.Invalidate(); }
/// <summary> /// 绑定指示 /// </summary> private void BindDialogs() { m_gridDialogs.CellEditMode = GridCellEditMode.DoubleClick; List <DialogInfo> dialogs = DataCenter.DialogService.m_dialogs; int dialogsSize = dialogs.Count; m_gridDialogs.ClearRows(); m_gridDialogs.BeginUpdate(); for (int i = 0; i < dialogsSize; i++) { DialogInfo dialog = dialogs[i]; dialog.m_date = dialog.m_date.Replace("-", ""); AddDialogToGrid(dialog); } m_gridDialogs.EndUpdate(); if (m_gridDialogs.VScrollBar != null && m_gridDialogs.VScrollBar.Visible) { m_gridDialogs.VScrollBar.ScrollToEnd(); } m_gridDialogs.Invalidate(); }
/// <summary> /// 绑定自选股类别中的证券到表格 /// </summary> /// <param name="category">类别</param> public void BindSecuritiesToSecuritiesGrid(UserSecurityCategory category) { m_gridSecurities.ClearRows(); List <Security> securities = new List <Security>(); if (category.m_codes != null && category.m_codes.Length > 0) { String[] codes = category.m_codes.Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries); int codesSize = codes.Length; for (int i = 0; i < codesSize; i++) { Security security = new Security(); bool state = m_securityService.GetSecurityByCode(codes[i], ref security); if (state) { securities.Add(security); } } } AddSecuritiesToSecuritiesGrid(securities); }
/// <summary> /// 绑定员工 /// </summary> private void BindStaffs() { m_gridStaffs.CellEditMode = GridCellEditMode.DoubleClick; List <StaffInfo> staffs = DataCenter.StaffService.GetAliveStaffs(); int staffsSize = staffs.Count; Dictionary <String, DimensionInfo> dimensionsMap = new Dictionary <String, DimensionInfo>(); List <DimensionInfo> dimensions = DataCenter.DimensionService.m_dimensions; int dimensionsSize = dimensions.Count; for (int i = 0; i < dimensionsSize; i++) { DimensionInfo dimension = dimensions[i]; if (dimension.m_jobID != null && dimension.m_jobID.Length > 0) { dimensionsMap[dimension.m_jobID] = dimension; } } m_gridStaffs.ClearRows(); m_gridStaffs.BeginUpdate(); for (int i = 0; i < staffsSize; i++) { StaffInfo staff = staffs[i]; DimensionInfo dimension = null; if (dimensionsMap.ContainsKey(staff.m_jobID)) { dimension = dimensionsMap[staff.m_jobID]; } else { dimension = new DimensionInfo(); dimension.m_business = 100; dimension.m_EQ = 100; dimension.m_IQ = 100; dimension.m_knowledge = 100; dimension.m_lead = 100; dimension.m_technology = 100; dimension.m_jobID = staff.m_jobID; } GridRow row = new GridRow(); m_gridStaffs.AddRow(row); row.AddCell("colF1", new GridStringCell(staff.m_jobID)); row.AddCell("colF2", new GridStringCell(staff.m_name)); row.AddCell("colF3", new GridIntCell(dimension.m_business)); row.AddCell("colF4", new GridIntCell(dimension.m_EQ)); row.AddCell("colF5", new GridIntCell(dimension.m_knowledge)); row.AddCell("colF6", new GridIntCell(dimension.m_IQ)); row.AddCell("colF7", new GridIntCell(dimension.m_lead)); row.AddCell("colF8", new GridIntCell(dimension.m_technology)); int avg = (dimension.m_business + dimension.m_EQ + dimension.m_knowledge + dimension.m_IQ + dimension.m_lead + dimension.m_technology) / 6; row.AddCell("colF9", new GridIntCell(avg)); List <GridCell> cells = row.GetCells(); int cellsSize = cells.Count; for (int j = 2; j < cellsSize - 1; j++) { cells[j].AllowEdit = true; } } m_gridStaffs.EndUpdate(); m_gridStaffs.Invalidate(); dimensionsMap.Clear(); }
/// <summary> /// 绑定员工 /// </summary> private void BindStaffs() { m_gridPersonals.CellEditMode = GridCellEditMode.DoubleClick; List <StaffInfo> staffs = DataCenter.StaffService.m_staffs; int staffsSize = staffs.Count; Dictionary <String, PersonalInfo> personalsMap = new Dictionary <String, PersonalInfo>(); List <PersonalInfo> personals = DataCenter.PersonalService.m_personals; int personalsSize = personals.Count; for (int i = 0; i < personalsSize; i++) { PersonalInfo personal = personals[i]; if (personal.m_jobID != null && personal.m_jobID.Length > 0) { personalsMap[personal.m_jobID] = personal; } } m_gridPersonals.ClearRows(); m_gridPersonals.BeginUpdate(); for (int i = 0; i < staffsSize; i++) { StaffInfo staff = staffs[i]; PersonalInfo personal = null; if (personalsMap.ContainsKey(staff.m_jobID)) { personal = personalsMap[staff.m_jobID]; } else { personal = new PersonalInfo(); } GridRow row = new GridRow(); m_gridPersonals.AddRow(row); row.AddCell("colS1", new GridStringCell(staff.m_jobID)); row.AddCell("colS2", new GridStringCell(staff.m_name)); row.AddCell("colS3", new GridStringCell(personal.m_marry)); row.AddCell("colS4", new GridStringCell(personal.m_loan)); row.AddCell("colS5", new GridStringCell(personal.m_house)); row.AddCell("colS6", new GridStringCell(personal.m_parent)); row.AddCell("colS7", new GridStringCell(personal.m_body)); row.AddCell("colS8", new GridStringCell(personal.m_sb)); row.AddCell("colS9", new GridStringCell(personal.m_eat)); row.AddCell("colS10", new GridStringCell(personal.m_teach)); row.AddCell("colS11", new GridStringCell(personal.m_pay)); row.AddCell("colS12", new GridStringCell(personal.m_dress)); row.AddCell("colS13", new GridStringCell(personal.m_cross)); row.AddCell("colS14", new GridStringCell(personal.m_game)); row.AddCell("colS15", new GridStringCell(personal.m_sports)); row.AddCell("colS16", new GridStringCell(personal.m_pet)); row.AddCell("colS17", new GridStringCell(personal.m_lead)); row.AddCell("colS18", new GridStringCell(personal.m_gay)); row.AddCell("colS19", new GridStringCell(personal.m_preference)); row.AddCell("colS20", new GridStringCell(personal.m_oldWork)); row.AddCell("colS21", new GridStringCell(personal.m_drink)); row.AddCell("colS22", new GridStringCell(personal.m_smoke)); List <GridCell> cells = row.GetCells(); int cellsSize = cells.Count; for (int j = 2; j < cellsSize; j++) { cells[j].AllowEdit = true; } } m_gridPersonals.EndUpdate(); m_gridPersonals.Invalidate(); personalsMap.Clear(); }
/// <summary> /// 单元格双击事件 /// </summary> /// <param name="sender">调用者</param> /// <param name="cell">单元格</param> /// <param name="mp">坐标</param> /// <param name="button">按钮</param> /// <param name="clicks">点击次数</param> /// <param name="delta">滚轮值</param> private void GridCellClick(object sender, GridCell cell, POINT mp, MouseButtonsA button, int clicks, int delta) { if (cell.Grid == m_tvIndicatorBrowser) { TreeNodeA tn = cell as TreeNodeA; if (tn.m_nodes.Count == 0) { NodeData nodeData = tn.Tag as NodeData; if (nodeData.IsCatalog) { IndicatorLeafDataPacket leafPacket = new IndicatorLeafDataPacket(nodeData.Id); ConnectManager.CreateInstance().Request(leafPacket); int tick = 0; while (leafPacket.ReserveFlag == 0 && tick < 50) { Thread.Sleep(100); tick++; } if (leafPacket.LeafNodeList.Count > 0) { List <NodeData> nodes = leafPacket.LeafNodeList; Dictionary <String, TreeNodeA> nodesMap = new Dictionary <String, TreeNodeA>(); int nodesSzie = nodes.Count; for (int i = 0; i < nodesSzie; i++) { NodeData node = nodes[i]; TreeNodeA subTn = new TreeNodeA(); subTn.Text = node.Name; subTn.Style = new GridCellStyle(); subTn.Style.ForeColor = COLOR.ARGB(255, 255, 80); subTn.Style.Font = new FONT("微软雅黑", 14, true, false, false); subTn.Name = node.Id; subTn.Tag = node; if (nodesMap.ContainsKey(node.ParentId)) { nodesMap[node.ParentId].AppendNode(subTn); nodesMap[node.Id] = subTn; } else { tn.AppendNode(subTn); nodesMap[node.Id] = subTn; } IndicatorEntityDataPacket entity = new IndicatorEntityDataPacket(node.Id); ConnectManager.CreateInstance().Request(entity); } tn.ExpendAll(); m_tvIndicatorBrowser.Update(); m_tvIndicatorBrowser.Invalidate(); } } else { StringBuilder sb = new StringBuilder(); CList <GSecurity> securities = SecurityService.FilterCode(m_txtIndicatorCode.Text); int codesSize = securities.size(); for (int i = 0; i < codesSize; i++) { sb.Append(securities.get(i).m_code); if (i != codesSize - 1) { sb.Append(","); } } m_gridIndicatorBrowser.ClearRows(); IndicatorRootData data = GetIndicatorData(nodeData.Id, "Stock", sb.ToString()); m_gridIndicatorBrowser.GetColumn("colN3").Text = data.categoryName; foreach (IndicatorItemData indicatorItem in data.items) { GridRow row = new GridRow(); m_gridIndicatorBrowser.AddRow(row); GridStringCell codeCell = new GridStringCell(indicatorItem.code); row.AddCell("colN1", codeCell); GSecurity security = new GSecurity(); SecurityService.GetSecurityByCode(indicatorItem.code, ref security); row.AddCell("colN2", new GridStringCell(security.m_name)); if (indicatorItem.type == 0) { GridStringCell valueCell = new GridStringCell(indicatorItem.text); row.AddCell("colN3", valueCell); } else if (indicatorItem.type == 1) { GridDoubleCell valueCell = new GridDoubleCell(indicatorItem.num); row.AddCell("colN3", valueCell); } row.GetCell("colN1").Style = new GridCellStyle(); row.GetCell("colN1").Style.ForeColor = COLOR.ARGB(255, 255, 80); row.GetCell("colN1").Style.Font = new FONT("微软雅黑", 14, true, false, false); row.GetCell("colN1").Style.Font = new FONT("微软雅黑", 14, true, false, false); row.GetCell("colN2").Style = new GridCellStyle(); row.GetCell("colN2").Style.ForeColor = COLOR.ARGB(255, 80, 80); row.GetCell("colN2").Style.Font = new FONT("微软雅黑", 14, true, false, false); row.GetCell("colN3").Style = new GridCellStyle(); row.GetCell("colN3").Style.ForeColor = COLOR.ARGB(80, 255, 255); row.GetCell("colN3").Style.Font = new FONT("微软雅黑", 14, true, false, false); } m_gridIndicatorBrowser.Update(); m_gridIndicatorBrowser.Invalidate(); } } } else if (cell.Grid == m_gridIndicatorBrowser) { if (clicks == 2) { m_mainFrame.SearchSecurity(cell.Row.GetCell("colN1").GetString()); } } }
/// <summary> /// 单元格双击事件 /// </summary> /// <param name="sender">调用者</param> /// <param name="cell">单元格</param> /// <param name="mp">坐标</param> /// <param name="button">按钮</param> /// <param name="clicks">点击次数</param> /// <param name="delta">滚轮值</param> private void GridCellClick(object sender, GridCell cell, POINT mp, MouseButtonsA button, int clicks, int delta) { TreeNodeA tn = cell as TreeNodeA; if (tn.m_nodes.Count == 0) { if (tn.Tag == null) { try { MacroDataType type = (MacroDataType)Enum.Parse(typeof(MacroDataType), m_cbMacIndustry.Text); DataTable dt = MongoRetriver.GetDescendantDataByService(tn.Name, type); foreach (DataRow row in dt.Rows) { if (row[0].ToString().Length > 0 && row[3].ToString().Length > 0) { TreeNodeA node = new TreeNodeA(); node.Tag = "2"; node.Style = new GridCellStyle(); node.Style.ForeColor = COLOR.ARGB(255, 255, 80); node.Style.Font = new FONT("微软雅黑", 14, true, false, false); node.Text = row["STR_MACRONAME"].ToString(); node.Name = row[0].ToString(); tn.AppendNode(node); } } tn.Tag = "1"; m_tvMacIndustry.Update(); } catch (Exception ex) { } } else if (tn.Tag.ToString() == "2") { m_gridMacIndustry.ClearRows(); m_fundCurve.Clear(); FundCurveData data = new FundCurveData(); XAxisPointData xdata = new XAxisPointData(); Dictionary <String, YAxisCurveData> yDatas = new Dictionary <String, YAxisCurveData>(); YAxisStyle ySyle = new YAxisStyle(); YAxisStyle ySyle1 = new YAxisStyle(); YAxisStyle ySyle2 = new YAxisStyle(); XAxisStyle xStyle = new XAxisStyle(); xStyle.XAxisType = XAxisType.Date; data.ChartTitle = "每日进展"; xStyle.XAxisTitle = "时间"; data.BackgroundColor = Color.Black; DataTable dt = GetMacIndustyData(tn.Name, m_cbMacIndustry.Text); YAxisCurveData yData = new YAxisCurveData(); yData.YPointValues = new List <double>(); yData.LineWidth = 3; yData.Text = xdata.Text; yData.ShowCycle = true; data.LstYAxisPointDatas.Add(yData); foreach (DataRow dr in dt.Rows) { if (dr[0].ToString().Length > 0 && dr[1].ToString().Length > 0) { GridRow row = new GridRow(); m_gridMacIndustry.AddRow(row); DateTime date = Convert.ToDateTime(dr[0]); row.AddCell("colN1", new GridStringCell(date.ToString("yyyy-MM-dd"))); row.AddCell("colN2", new GridStringCell(dr[1].ToString())); row.GetCell("colN1").Style = new GridCellStyle(); row.GetCell("colN1").Style.ForeColor = COLOR.ARGB(255, 255, 80); row.GetCell("colN1").Style.Font = new FONT("微软雅黑", 14, true, false, false); row.GetCell("colN2").Style = new GridCellStyle(); row.GetCell("colN2").Style.ForeColor = COLOR.ARGB(255, 80, 80); row.GetCell("colN2").Style.Font = new FONT("微软雅黑", 14, true, false, false); } } int rowsSize = dt.Rows.Count; for (int i = rowsSize - 1; i >= 0; i--) { DataRow dr = dt.Rows[i]; if (dr[0].ToString().Length > 0 && dr[1].ToString().Length > 0) { GridRow row = new GridRow(); m_gridMacIndustry.AddRow(row); DateTime date = Convert.ToDateTime(dr[0]); xdata.Value = date.Year * 10000 + date.Month * 100 + date.Day; xdata.Text = date.ToString("yyyyMMdd"); data.LstXAxisPointDatas.Add(xdata); yData.YPointValues.Add(CStr.ConvertStrToDouble(dr[1].ToString())); } } data.XAxisStyle = xStyle; ySyle.YAxisTitleAlign = YAxisTitleAlign.Middle; ySyle1.YAxisTitleAlign = YAxisTitleAlign.Middle; ySyle2.YAxisTitleAlign = YAxisTitleAlign.Middle; xStyle.XAxisTitleAlign = XAxisTitleAlign.Center; data.LstYAxisStyle.Add(ySyle); data.LstYAxisStyle.Add(ySyle1); data.LstYAxisStyle.Add(ySyle2); m_fundCurve.FundCurveData = data; m_gridMacIndustry.Update(); m_gridMacIndustry.Invalidate(); } } }