public FormStandort(tabStandort Standort) { InitializeComponent(); this.Standort = Standort; if (this.Standort == null) { this.Standort = new tabStandort() { Id = Guid.NewGuid() } } ; gridStandort.DataContext = this.Standort; }
private void ButtonOptionen_Click(object sender, RoutedEventArgs e) { FormOptionen form = new FormOptionen(_Db); if (form.ShowDialog() ?? false) { _Standort = form.StandOrt; tblStandort.Text = _Standort.Bezeichnung; _ListeAnmeldungen.Parameter["IdStandort"] = _Standort.Id; _ListeAnmeldungen.DatenAktualisieren(); _ListeMaschinen.DatenAktualisieren(); TreeViewMaschinenAktualisieren(); _ListeMaschinen.Parameter["idStandort"] = _Standort.Id; } }
private async void Window_Loaded(object sender, RoutedEventArgs e) { _Db = new JgModelContainer(); _Standort = await _Db.tabStandortSet.FirstOrDefaultAsync(f => f.Id == Properties.Settings.Default.IdStandort); if (_Standort == null) { _Standort = await _Db.tabStandortSet.FirstOrDefaultAsync(); } tblStandort.Text = _Standort.Bezeichnung; InitListen(); _Report = new FastReport.Report() { FileName = "Datenbank" }; _ReportSettings.CustomSaveReport += (obj, repEvent) => { MemoryStream memStr = new MemoryStream(); try { repEvent.Report.Save(memStr); _Db.tabAuswertungSet.Attach(_AktAuswertung); _AktAuswertung.Report = memStr.ToArray(); _AktAuswertung.GeaendertDatum = DateTime.Now; _AktAuswertung.GeaendertName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; _Db.SaveChanges(); } catch (Exception f) { Helper.InfoBox("Fehler beim speichern des Reports!", f); } finally { memStr.Dispose(); } }; _TimerAktualisierungTreeView = new DispatcherTimer(new TimeSpan(0, 1, 0), DispatcherPriority.ApplicationIdle, (sen, erg) => { TreeViewMaschinenAktualisieren(); }, Dispatcher.CurrentDispatcher); }