Beispiel #1
0
 public void Load(bool IsFirstStart = false)
 {
     if (IsFirstStart)
     {
         _DB.Add(new MPerson()
         {
             Id       = Guid.NewGuid().ToString(),
             VName    = "Max",
             NName    = "Mustermann",
             Mid      = "001",
             TaughtNr = "",
             Stunden  = new ObservableCollection <MStunden>()
         });
         _DB.Add(new MPerson()
         {
             Id       = Guid.NewGuid().ToString(),
             VName    = "Maria",
             NName    = "Mustermann",
             Mid      = "002",
             TaughtNr = "",
             Stunden  = new ObservableCollection <MStunden>()
         });
         _DB.Add(new MPerson()
         {
             Id       = Guid.NewGuid().ToString(),
             VName    = "Nino",
             NName    = "Mustermann",
             Mid      = "003",
             TaughtNr = "001",
             Stunden  = new ObservableCollection <MStunden>()
         });
         _DB.Add(new MPerson()
         {
             Id       = Guid.NewGuid().ToString(),
             VName    = "Nena",
             NName    = "Mustermann",
             Mid      = "004",
             TaughtNr = "002",
             Stunden  = new ObservableCollection <MStunden>()
         });
         ObservableCollection <MPerson> mp = _DB.Load();
         foreach (MPerson p in mp)
         {
             _DB.AddStunden(new MStunden()
             {
                 Id = Guid.NewGuid().ToString(), Start = "01.01.2020 08:00", Ende = "01.01.2020 17:00", Pause = "1,0"
             }, p);
         }
     }
     Value.Clear();
     ValueStunden.Clear();
     foreach (MPerson p in _DB.Load())
     {
         Value.Add(p);
         LoadStunden(p);
     }
 }
Beispiel #2
0
 public void LoadStunden(MPerson value = null)
 {
     if (value != null)
     {
         foreach (MStunden std in value.Stunden)
         {
             ValueStunden.Add(std);
         }
     }
 }
Beispiel #3
0
 public void EditStundenCommand_Click()
 {
     Dialog.DStundenAddEdit EditStunden = new Dialog.DStundenAddEdit(SelectedStunden);
     if (EditStunden.ShowDialog() == true)
     {
         _DB.UpdateStunden(EditStunden.Value);
     }
     ValueStunden.Clear();
     LoadStunden(Selected);
     Selected        = null;
     SelectedStunden = null;
 }
Beispiel #4
0
 public void AddCommand_Click()
 {
     Dialog.DPersonAddEdit AddPerson = new Dialog.DPersonAddEdit();
     if (AddPerson.ShowDialog() == true)
     {
         _DB.Add(AddPerson.Value);
     }
     ValueStunden.Clear();
     LoadStunden(Selected);
     Selected        = null;
     SelectedStunden = null;
 }