private void AddBtn_Click(object sender, RoutedEventArgs e) { int count = 0; var instrumentSource = new InstrumentManager(); foreach (FredUtils.FredSeries series in InstrumentGrid.SelectedItems) { var newInstrument = FredUtils.SeriesToInstrument(series); newInstrument.Datasource = _thisDS; try { if (instrumentSource.AddInstrument(newInstrument) != null) { count++; } AddedInstruments.Add(newInstrument); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } StatusLabel.Content = string.Format("{0}/{1} instruments added.", count, InstrumentGrid.SelectedItems.Count); }
private void AddBtn_Click(object sender, RoutedEventArgs e) { int count = 0; var instrumentSource = new InstrumentManager(); foreach (Instrument newInstrument in InstrumentGrid.SelectedItems) { if (newInstrument.Exchange != null) { newInstrument.ExchangeID = newInstrument.Exchange.ID; } if (newInstrument.PrimaryExchange != null) { newInstrument.PrimaryExchangeID = newInstrument.PrimaryExchange.ID; } try { if (instrumentSource.AddInstrument(newInstrument) != null) { count++; } AddedInstruments.Add(newInstrument); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } StatusLabel.Content = string.Format("{0}/{1} instruments added.", count, InstrumentGrid.SelectedItems.Count); }
private void AddBtn_Click(object sender, RoutedEventArgs e) { int count = 0; var instrumentSource = new InstrumentManager(); foreach (Instrument newInstrument in InstrumentGrid.SelectedItems) { try { if (instrumentSource.AddInstrument(newInstrument) != null) { count++; AddedInstruments.Add(newInstrument); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } StatusLabel.Content = string.Format("{0}/{1} instruments added.", count, InstrumentGrid.SelectedItems.Count); }
private void AddBtn_Click(object sender, RoutedEventArgs e) { int count = 0; var instrumentSource = new InstrumentManager(); foreach (FredUtils.FredSeries series in InstrumentGrid.SelectedItems) { var newInstrument = FredUtils.SeriesToInstrument(series); newInstrument.Datasource = _thisDS; try { if (instrumentSource.AddInstrument(newInstrument) != null) count++; AddedInstruments.Add(newInstrument); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } StatusLabel.Content = string.Format("{0}/{1} instruments added.", count, InstrumentGrid.SelectedItems.Count); }