private void btnKLineAM_Click(object sender, EventArgs e) { listKLine.Items.Clear(); short sKLineType = short.Parse(boxKLine.SelectedIndex.ToString()); short sOutType = short.Parse(boxOutType.SelectedIndex.ToString()); short sTradeSession = short.Parse(boxTradeSession.SelectedIndex.ToString()); if (sKLineType < 0) { MessageBox.Show("請選擇KLine類型"); return; } if (sOutType < 0) { MessageBox.Show("請選擇輸出格式類型"); return; } if (sTradeSession < 0) { MessageBox.Show("請選擇盤別"); return; } m_nCode = SKQuoteLib.SKQuoteLib_RequestKLineAM(txtKLine.Text.Trim(), sKLineType, sOutType, sTradeSession); SendReturnMessage("Quote", m_nCode, "SKQuoteLib_RequestKLineAM"); //boxTradeSession }
private void btnKLine_Click(object sender, EventArgs e) { short sKLineType = short.Parse(boxKLine.SelectedIndex.ToString()); short sOutType = short.Parse(boxOutType.SelectedIndex.ToString()); short sTradeSession = short.Parse(boxTradeSession.SelectedIndex.ToString()); //4 =完整日線 //0 舊版輸出 listKLine.Items.Clear(); if (sKLineType < 0) { MessageBox.Show("請選擇KLine類型"); return; } if (sOutType < 0) { MessageBox.Show("請選擇輸出格式類型"); return; } if (sTradeSession < 0) { MessageBox.Show("請選擇輸出盤別"); return; } //FUNCITON NOT COMPLETED //Download quote based on Page No, if (searchtype2.SelectedIndex == 1) { using (SqlConnection connection = new SqlConnection(connectionstr)) { string[] bstrDataset = new string[5]; SqlCommand sqlcmd = new SqlCommand(); int count = 0; string sqlwhere = ""; connection.Open(); sqlwhere = " WHERE PageNo=" + txtKLine.Text.ToString(); sqlcmd.CommandText = @"SELECT [StockNo] FROM [dbo].[StockList]" + sqlwhere; sqlcmd.Connection = connection; sqlcmd.CommandType = CommandType.Text; using (SqlDataReader reader = sqlcmd.ExecuteReader()) { while (reader.Read()) { count++; for (int i = 0; i < reader.FieldCount; i++) { m_nCode = SKQuoteLib.SKQuoteLib_RequestKLineAM(txtKLine.Text.Trim(), sKLineType, sOutType, sTradeSession); SendReturnMessage("Quote", m_nCode, "SKQuoteLib_RequestKLineAM"); } } } } } else { m_nCode = SKQuoteLib.SKQuoteLib_RequestKLineAM(txtKLine.Text.Trim(), sKLineType, sOutType, sTradeSession); SendReturnMessage("Quote", m_nCode, "SKQuoteLib_RequestKLineAM"); } }