private void Page_Loaded(object sender, RoutedEventArgs e) { var tools = new libc1DatagridTools.ManageC1GridColumns(c1GridDetais); tools.LoadGridSettings(Properties.Settings.Default.DatagridSettingsLagerliste); this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; }
private void Window_Loaded(object sender, RoutedEventArgs e) { try { Trace.WriteLine("EditArtikelListe.Xaml.cs Window Loaded Start"); Trace.Flush(); LoggingTool.addDatabaseLogging("", 0, 0, "EditArtikelListe.Xaml.cs - Window Loaded Start", DateTime.Now.ToLongTimeString()); db = new SteinbachEntities(); Kategorien = ((System.Windows.Data.CollectionViewSource)(this.FindResource("Kategorien"))); Lieferanten = ((System.Windows.Data.CollectionViewSource)(this.FindResource("Lieferanten"))); WKZ = ((System.Windows.Data.CollectionViewSource)(this.FindResource("WKZ"))); Mitarbeiter = ((System.Windows.Data.CollectionViewSource)(this.FindResource("Mitarbeiter"))); Kategorien.Source = CommonTools.Tools.HelperTools.GetAuswahlEintraege("ArtikelKategorie", 1); Lieferanten.Source = db.firmen.Where(f => f.istFirma == 1); WKZ.Source = db.StammWaehrungen; Mitarbeiter.Source = db.personen; DoLoadColumns(); ShowSelectedColumns(); var tools = new libc1DatagridTools.ManageC1GridColumns(c1DataGrid1); tools.LoadGridSettings(Properties.Settings.Default.DatagridSettingsLagerliste); Trace.WriteLine("EditArtikelListe.Xaml.cs Window Loaded done"); Trace.Flush(); LoggingTool.addDatabaseLogging("", 0, 0, "EditArtikelListe.Xaml.cs - Window Loaded Stop", DateTime.Now.ToLongTimeString()); } catch (Exception ex) { CommonTools.Tools.ErrorMethods.HandleStandardError(ex); } }
private void FillProject() { db = new SteinbachEntities(); dbArt = new SteinbachEntities(); ViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ThisViewSource"))); DetailsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("DetailsViewSource"))); UnterartikelViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("UnterartikelViewSource"))); ParentartikelViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ParentartikelViewSource"))); OberArtikelViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("OberArtikelViewSource"))); LagerortViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("LagerortViewSource"))); BewegungsartViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("BewegungsartViewSource"))); LieferantenViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("LieferantenViewSource"))); KategorieViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("KategorieViewSource"))); var pTemplate = (DataTemplate)this.FindResource("ParentsTemplate"); var oaTemplate = (DataTemplate)this.FindResource("OberArtikelTemplate"); //OberartkelComboBox.onfcbChanged += new UserControls.FilteredComboBox.FiteredBoxChanged(OberartkelComboBox_onfcbChanged); //OberartkelComboBox.OnFcb_SelectionChanged += new UserControls.FilteredComboBox.FilteredBoxSelectionChanged(OberartkelComboBox_OnFcb_SelectionChanged); //OberartkelComboBox.SetSimpleBinding("id_parent", "id", pTemplate, BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged); //fcbArtikel.cBoxItemTemplate = pTemplate; //fcbArtikel.onfcbChanged += new UserControls.FilteredComboBox.FiteredBoxChanged(fcbArtikel_onfcbChanged); //fcbArtikel.OnFcb_SelectionChanged += new UserControls.FilteredComboBox.FilteredBoxSelectionChanged(fcbArtikel_OnFcb_SelectionChanged); LieferantenViewSource.Source = db.firmen.Where(id => id.istFirma == 1); KategorieViewSource.Source = CommonTools.Tools.HelperTools.GetAuswahlEintraege("ArtikelKategorie", 1); var WaehrungenLookUp = ((CollectionViewSource)(this.FindResource("WaehrungenLookUp"))); var curQuery = from c in db.StammWaehrungen select c; var cQ = db.StammWaehrungen; WaehrungenLookUp.Source = curQuery; if (ID == 0) { var Query = from n in db.lagerlisten select n; ViewSource.Source = new ArtikelCollection(Query, db); View = (ListCollectionView)ViewSource.View; var i = (lagerliste)View.AddNew(); i.bezeichnung = "Artikel Neu"; i.einheit = "Pcs"; View.CommitNew(); c1GridDetails.Visibility = System.Windows.Visibility.Hidden; // bNew = true; } else { var Query = from n in db.lagerlisten where n.id == ID select n; ViewSource.Source = Query; CheckStandardRadioButtonListeBewegungen(); // LoadBewegungen(90); //this.fcbArtikel.ComboBoxViewSource = FillParentArtikelListe("", ID); // this.OberartkelComboBox.ComboBoxViewSource = FillParentArtikelListe("", ID); c1GridDetails.Visibility = System.Windows.Visibility.Visible; var tools = new libc1DatagridTools.ManageC1GridColumns(c1GridDetails); tools.LoadGridSettings(Properties.Settings.Default.DatagridSettingsArtikelDetails); } }