コード例 #1
0
        public void cbAcctAccount_SelectedIndexChanged()
        {
            string strAccount = m_mainForm.cbAcctAccount.SelectedItem.ToString();

            strAccount = strAccount.Replace("-", "");

            string strName = m_iYuantaAPI.YOA_GetAccountInfo(CommDef.ACCOUNT_INFO_NAME, strAccount);

            if (0 < strName.Length)
            {
                m_mainForm.lblAcctName.Text = strName;
            }
        }
コード例 #2
0
        private void InitAccount()
        {
            lvAcctList.BeginUpdate();

            lvAcctList.Items.Clear();

            ListViewItem item        = null;
            string       strAccount  = "";
            string       strAcctName = "";

            int nCount = m_iYuantaAPI.YOA_GetAccountCount();

            for (int i = 0; i < nCount; i++)
            {
                item = new ListViewItem(Convert.ToString(i + 1));

                strAccount = m_iYuantaAPI.YOA_GetAccount(i);
                if (1 == strAccount.Length % 2)
                {
                    strAccount = strAccount.Insert(5, "-");
                    strAccount = strAccount.Insert(3, "-");
                }
                else
                {
                    strAccount = strAccount.Insert(8, "-");
                    strAccount = strAccount.Insert(4, "-");
                }

                strAcctName = m_iYuantaAPI.YOA_GetAccountInfo(CommDef.ACCOUNT_INFO_NAME, strAccount);

                item.SubItems.Add(strAccount);
                item.SubItems.Add(strAcctName);

                lvAcctList.Items.Add(item);
            }


            lvAcctList.EndUpdate();
        }