Ejemplo n.º 1
0
        /// <summary>
        /// 证券列表窗体关闭方法
        /// </summary>
        /// <param name="securityList">是否取消</param>
        /// <param name="cancel">是否取消</param>
        private void OnSecurityListWindowClosed(SecurityList securityList, ref bool cancel)
        {
            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);
                if (securityList.IsSubmit)
                {
                    List <Security> selectedSecurities = new List <Security>();
                    securityList.GetSelectedSecurities(selectedSecurities);
                    int    selectedSecuritiesSize = selectedSecurities.Count;
                    String codes = "";
                    for (int i = 0; i < selectedSecuritiesSize; i++)
                    {
                        codes += selectedSecurities[i].m_code;
                        if (i != selectedSecuritiesSize - 1)
                        {
                            codes += ",";
                        }
                    }
                    category.m_codes = codes;
                    m_userSecurityService.UpdateCategory(m_userSecurityService.OperatorRequestID, category);
                }
            }
            m_window.Invalidate();
        }
Ejemplo n.º 2
0
        /// <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();
            }
        }
Ejemplo n.º 3
0
        /// <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();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 证券列表窗体关闭方法
 /// </summary>
 /// <param name="securityList">证券列表窗体</param>
 /// <param name="cancel">是否取消</param>
 public void OnSecurityListWindowClosed(SecurityList securityList, ref bool cancel)
 {
     if (securityList.IsSubmit)
     {
         List <Security> selectedSecurities = new List <Security>();
         securityList.GetSelectedSecurities(selectedSecurities);
         int    selectedSecuritiesSize = selectedSecurities.Count;
         String codes = "";
         for (int i = 0; i < selectedSecuritiesSize; i++)
         {
             codes += selectedSecurities[i].m_code;
             if (i != selectedSecuritiesSize - 1)
             {
                 codes += ",";
             }
         }
         m_codes = codes;
     }
     m_window.StartTimer(m_timerID, 100);
     m_window.Invalidate();
 }