private void lvList_DoubleClick(object sender, EventArgs e) { if (lvList.SelectedItems.Count == 1) { StockAnalysisRequest request = new StockAnalysisRequest(); request.Period = Session.Entities.GetPeriod(int.Parse(lvList.SelectedItems[0].Text)); frmStockAnalysis frm = new frmStockAnalysis(request); frm.ShowDialog(); } }
private void analysisToolStripMenuItem_Click(object sender, EventArgs e) { StockAnalysisRequest request = new StockAnalysisRequest(); for (int i = 0; i < lvList.SelectedItems.Count; i++) { if (!string.IsNullOrEmpty(lvList.SelectedItems[i].SubItems["StockCode"].Text)) { request.StockCodes.Add(lvList.SelectedItems[i].SubItems["StockCode"].Text); } } request.Period = period; request.StockCodes = request.StockCodes.Distinct().ToList(); frmStockAnalysis frm = new frmStockAnalysis(request); frm.ShowDialog(); }