public JahreswechselView(HauptFenster mw) { ConWrLi("---- -xx- JahreswechselView (HauptFenster mw)"); _mw = mw; _wertpap = (Model.CollWertpapiere)Resources["wertpapiereXXX"]; InitializeComponent(); }
private void MachWas() { ConWrLi("---- -62- Bearbeiten Window_Loaded()"); Point location = new Point(0, 0); Left = location.X + 300; Top = location.Y; _wertpap = (Model.CollWertpapiere)_mw.Resources["wertpapiereXXX"]; if (_isin == "") { MessageBox.Show("Ein neues Wertpapier wird angelgt. NOCH"); return; } Visibility = Visibility.Visible; WindowState = WindowState.Maximized; wb1.ScriptErrorsSuppressed = true; wb1.ScrollBarsEnabled = true; wb1.GoHome(); wb1.Navigate(new Uri("https://www.google.de/")); Model.Wertpapier wp = FindWP(_isin); DataTable dtt1 = new DataTable(); DataSetAdmin.dvPortFol.Sort = "WPISIN"; dtt1 = DataSetAdmin.dtPortFol.DefaultView.ToTable(); DataSetAdmin.dtPortFol = dtt1; DataColumn[] keys1 = new DataColumn[1]; keys1[0] = DataSetAdmin.dtPortFol.Columns["WPIsin"]; DataSetAdmin.dtPortFol.PrimaryKey = keys1; _rowPortFol = DataSetAdmin.dtPortFol.Rows.Find(_isin); DataSetAdmin.dvAnlKat.Sort = "AKID"; DataColumn[] keys2 = new DataColumn[1]; keys2[0] = DataSetAdmin.dtAnlKat.Columns["AKID"]; DataSetAdmin.dtAnlKat.PrimaryKey = keys2; DataTable dtt2 = new DataTable(); DataSetAdmin.dvDepot.Sort = "DepotID"; dtt2 = DataSetAdmin.dtDepot.DefaultView.ToTable(); DataSetAdmin.dtDepot = dtt2; DataColumn[] keys3 = new DataColumn[1]; keys3[0] = DataSetAdmin.dtDepot.Columns["DepotID"]; DataSetAdmin.dtDepot.PrimaryKey = keys3; _rowDepot = FindDepotID(wp.DepotID.ToString()); if (_rowDepot != null) { DepotList.Add(_rowDepot["DepotName"].ToString()); } for (int ir = 0; ir < DataSetAdmin.dvDepot.Count; ir++) { DepotList.Add((string)DataSetAdmin.dvDepot[ir]["DepotName"].ToString()); } cbDepot.ItemsSource = DepotList; cbDepot.SelectedIndex = 0; TypeList.Add(wp.AKName); for (int ir = 0; ir < DataSetAdmin.dvAnlKat.Count; ir++) { TypeList.Add((string)DataSetAdmin.dvAnlKat[ir]["AKName"].ToString()); } cbType.ItemsSource = TypeList; cbType.SelectedIndex = 0; string url = _wertpap[_nwp].URL; if (url.Length > 0) { wb1.Navigate(new Uri(url)); } else { url = @"https://www.finanzen.net/suchergebnis.asp?strSuchString=" + _wertpap[_nwp].ISIN; wb1.Navigate(new Uri(url)); } DataContext = _wertpap[_nwp]; txtKaufKurs.Text = (_wertpap[_nwp].Kaufsumme / _wertpap[_nwp].Anzahl).ToString("#.##0,00"); DoEvents(); }