Baustellen können nun angelegt und ausgewählt werden

This commit is contained in:
Husky
2020-03-11 19:21:10 +01:00
parent 7a4068439c
commit 47beb8b598
19 changed files with 405 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ namespace KanSan
UI.UCKundeEdit UCKundeEdit;
UI.UCKundeList UCKundeList;
UI.UCProjektList UCProjektList;
UI.UCBaustelleList UCBaustelleList;
public MainWindow()
{
@@ -92,6 +93,39 @@ namespace KanSan
{
ContentController.Content = "MainView";
}
private void btnBaustellen_Click(object sender, RoutedEventArgs e)
{
Projekt projekt = (DataContext as MainWindowViewModel).SelectedProjekt;
if (projekt == null) return;
UCBaustelleList = new UI.UCBaustelleList(projekt);
UCBaustelleList.BaustelleAdded += UCBaustelleList_BaustelleAdded;
UCBaustelleList.BaustelleEdited += UCBaustelleList_BaustelleEdited;
UCBaustelleList.BaustelleSelected += UCBaustelleList_BaustelleSelected;
ContentController.Content = UCBaustelleList;
}
private void UCBaustelleList_BaustelleSelected(object sender, UI.SelectBaustelleEventArgs e)
{
(DataContext as MainWindowViewModel).SelectedBaustelle = e.baustelle;
}
private void UCBaustelleList_BaustelleEdited(object sender, UI.SelectBaustelleEventArgs e)
{
if (e.baustelle == null) return;
UI.UCBaustelleEdit uCBaustelleEdit = new UI.UCBaustelleEdit(e.baustelle);
uCBaustelleEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = uCBaustelleEdit;
}
private void UCBaustelleList_BaustelleAdded(object sender, UI.SelectBaustelleEventArgs e)
{
/*if (e.baustelle == null) return;
UI.UCBaustelleEdit uBaustelleEdit = new UI.UCBaustelleEdit(e.baustelle);
*/
}
}
}