Client wird gespeichert mittels interface

This commit is contained in:
HuskyTeufel
2021-09-14 19:08:55 +02:00
parent 8eccf7c478
commit bbffb270bc
13 changed files with 149 additions and 70 deletions

View File

@@ -1,19 +1,14 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services;
using DaSaSo.Domain.Services.ClientServices;
using DaSaSo.EntityFramework;
using DaSaSo.EntityFramework.Services;
using DaSaSo.ViewModel;
using DaSaSo.ViewModel.Factories;
using DaSaSo.ViewModel.Interface;
using DaSaSo.ViewModel.State.ActualState;
using DaSaSo.ViewModel.State.Navigation;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace DaSaSo.Wpf
@@ -23,7 +18,7 @@ namespace DaSaSo.Wpf
/// </summary>
public partial class App : Application
{
protected override async void OnStartup(StartupEventArgs e)
protected override void OnStartup(StartupEventArgs e)
{
IServiceProvider serviceProvider = CreateServiceProvider();
@@ -43,6 +38,8 @@ namespace DaSaSo.Wpf
services.AddSingleton<IViewModelAbstractFactory, ViewModelAbstractFactory>();
services.AddSingleton<IViewModelFactory<HomeViewModel>, HomeViewModelFactory>();
services.AddSingleton<IViewModelFactory<ClientListViewModel>, ClientListViewModelFactory>();
services.AddSingleton<IViewModelFactory<ClientEditViewModel>, ClientEditViewModelFactory>();
services.AddScoped<IActualProject, ActualProject>();
services.AddScoped<INavigator, Navigator>();
services.AddScoped<MainWindowViewModel>();

View File

@@ -15,7 +15,7 @@
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<RadioButton Grid.Row="0" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Clients}" />
<RadioButton Grid.Row="1" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Projects}" />
<RadioButton Grid.Row="1" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.ClientEdit}" />
<RadioButton Grid.Row="2" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Buildingsites}" />
<RadioButton Grid.Row="3" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.SewerObjects}" />
</Grid>

View File

@@ -13,7 +13,7 @@
<StackPanel>
<TextBlock Text="Kundenliste" />
<ListView ItemsSource="{Binding Clients}" DisplayMemberPath="Firstname" SelectedItem="{Binding SelectedClient, Mode=TwoWay}"/>
<Button Content="Kunde auswählen" Command="{Binding SelectClientCommand}" />
<Button Content="Kunde auswählen" Command="{Binding SelectCommand}" />
<Button Content="Kunde Editieren" Command="{Binding EditClientCommand}"/>
<Button Content="Kunde Hinzufügen" Command="{Binding AddNewClientCommand}" />
</StackPanel>