/// <summary> /// 添加证券成份 /// </summary> public void AddSecurities() { List <GridRow> selectedCategoryRows = m_gridCategory.SelectedRows; int rowsSize = selectedCategoryRows.Count; if (rowsSize > 0) { UserSecurityCategory category = new UserSecurityCategory(); m_userSecurityService.GetCategory(selectedCategoryRows[0].GetCell(0).GetString(), ref category); SecurityList securityList = new SecurityList(m_native); securityList.Show(); WindowEx window = securityList.Window; window.IsChildWindow = true; window.Tag = securityList; if (category.m_codes != null && category.m_codes.Length > 0) { List <Security> securities = new List <Security>(); m_securityService.GetSecuritiesByCodes(category.m_codes, securities); securityList.AddSecuritiesToSecuritiesGrid(securities); } WindowClosingEvent windowClosingEvent = new WindowClosingEvent(SecurityListWindowClosed); window.RegisterEvent(windowClosingEvent, EVENTID.WINDOWCLOSING); m_native.Invalidate(); } }
/// <summary> /// 表格选中行改变方法 /// </summary> public void OnGridSelectedRowsChanged() { List <GridRow> selectedRows = m_tvBlock.SelectedRows; int selectedRowsSize = selectedRows.Count; if (selectedRowsSize > 0) { TreeNodeA node = selectedRows[0].GetCell(0) as TreeNodeA; TreeNodeA parentNode = node.Parent; if (parentNode != null && parentNode.Text == "自选股") { String categoryID = node.Value; UserSecurityCategory category = new UserSecurityCategory(); m_userSecurityService.GetCategory(categoryID, ref category); List <Security> securities = new List <Security>(); m_securityService.GetSecuritiesByCodes(category.m_codes, securities); BindSecuritiesToSelectSecuritiesGrid(securities); } else { if (node.GetChildNodes().Count == 0) { String blockID = node.Value; m_securityService.GetSecuritiesByBlockID(m_securitiesRequestID, blockID); } } } }
/// <summary> /// 选择股票 /// </summary> public void SelectSecurities() { SecurityList securityList = new SecurityList(m_native); securityList.Show(); WindowEx window = securityList.Window; window.IsChildWindow = true; window.Tag = securityList; if (m_codes != null && m_codes.Length > 0) { List <Security> securities = new List <Security>(); m_securityService.GetSecuritiesByCodes(m_codes, securities); securityList.AddSecuritiesToSecuritiesGrid(securities); } WindowClosingEvent windowClosingEvent = new WindowClosingEvent(SecurityListWindowClosed); window.RegisterEvent(windowClosingEvent, EVENTID.WINDOWCLOSING); m_native.Invalidate(); }