Haltung exporter angefangen
This commit is contained in:
@@ -11,7 +11,7 @@ namespace SewerStammGen.ConsoleApp
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
IProjektDataService projektService = new ProjektDataService();
|
||||
IProjektDataService projektService = new ProjektDataService("");
|
||||
|
||||
Projekt neuesProjekt = new Projekt()
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SewerStammGen.DAL\SewerStammGen.DAL.csproj" />
|
||||
<ProjectReference Include="..\SewerStammGen.Shared\SewerStammGen.Shared.csproj" />
|
||||
<ProjectReference Include="..\Shared\SewerStammGen.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private Schacht parseSchacht(NpgsqlDataReader? reader)
|
||||
private Schacht parseSchacht(NpgsqlDataReader reader)
|
||||
{
|
||||
return new Schacht()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SewerStammGen.Shared\SewerStammGen.Shared.csproj" />
|
||||
<ProjectReference Include="..\Shared\SewerStammGen.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,8 +7,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Shared.Contracts
|
||||
{
|
||||
internal interface IExport
|
||||
public interface IExport
|
||||
{
|
||||
bool Export();
|
||||
Task<bool> Export(List<Kanal> haltungen, List<Schacht> schaechte);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SewerStammGen.Shared.Domain
|
||||
public string Erstelldatum { get; set; } = String.Empty;
|
||||
public string Strasse { get; set; } = String.Empty;
|
||||
public string Ort { get; set; } = String.Empty;
|
||||
public Auftraggeber Auftraggeber { get; set; }
|
||||
public Auftraggeber Auftraggeber { get; set; } = new Auftraggeber();
|
||||
public EExportType ExportType { get; set; }
|
||||
public EKodierungssystem Kodierungssystem { get; set; }
|
||||
public IList<Kanal> Kanaele { get; set; } = new List<Kanal>();
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace SewerStammGen.WPF.Commands
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
Debugger.Break();
|
||||
_haltungEditViewModel.Model = await _haltungDataService.Update(_haltungEditViewModel.Model);
|
||||
|
||||
_renavigator.Renavigate();
|
||||
|
||||
29
SewerStammGen.WPF/Commands/ProjectExportCommand.cs
Normal file
29
SewerStammGen.WPF/Commands/ProjectExportCommand.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class ProjectExportCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly IActualState _actualState;
|
||||
private readonly IExport _export;
|
||||
|
||||
public ProjectExportCommand(IActualState actualState)
|
||||
{
|
||||
_actualState = actualState;
|
||||
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
await _export.Export(new List<Kanal>(), new List<Schacht>());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
|
||||
<PackageReference Include="Syncfusion.SfGrid.WPF" Version="20.4.0.54" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace SewerStammGen.WPF.ViewModel
|
||||
}
|
||||
|
||||
public ICommand Speichern { get; set; }
|
||||
public ICommand Abbrechen { get; set; }
|
||||
|
||||
public HaltungEditViewModel(
|
||||
IHaltungDataService haltungDataService,
|
||||
@@ -153,6 +154,7 @@ namespace SewerStammGen.WPF.ViewModel
|
||||
_model = _actualState.SelectedHaltung;
|
||||
|
||||
Speichern = new HaltungEditSaveCommand(_haltungDataService, renavigator, this);
|
||||
Abbrechen = new RelayCommand((x) => Abbruch(renavigator));
|
||||
|
||||
ladeVerfuegbareSchaechte();
|
||||
|
||||
@@ -160,6 +162,11 @@ namespace SewerStammGen.WPF.ViewModel
|
||||
|
||||
}
|
||||
|
||||
private void Abbruch(IRenavigator renavigator)
|
||||
{
|
||||
renavigator.Renavigate();
|
||||
}
|
||||
|
||||
private async void ladeVerfuegbareSchaechte()
|
||||
{
|
||||
var s = await _schachtDataService.GetAllByProjekt(_actualState.ProjektID);
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace SewerStammGen.WPF.ViewModel
|
||||
|
||||
public ICommand EditCommand { get; set; }
|
||||
public ICommand AddCommand { get; set; }
|
||||
public ICommand ExportCommand { get; set; }
|
||||
|
||||
public HaltungListViewModel(IHaltungDataService haltungDataService, IActualState actualState, IRenavigator renavigator )
|
||||
{
|
||||
@@ -35,6 +36,7 @@ namespace SewerStammGen.WPF.ViewModel
|
||||
|
||||
EditCommand = new HaltungEditCommand(actualState, renavigator, this);
|
||||
AddCommand = new HaltungAddCommand();
|
||||
ExportCommand = new ProjectExportCommand(actualState);
|
||||
|
||||
LoadHaltungen();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Microsoft.Xaml.Behaviors;
|
||||
using Syncfusion.UI.Xaml.Grid;
|
||||
//using Syncfusion.UI.Xaml.Grid;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Views
|
||||
{
|
||||
/*
|
||||
public class TextBoxFilterAction : TargetedTriggerAction<SfMultiColumnDropDownControl>
|
||||
{
|
||||
protected override void Invoke(object parameter)
|
||||
@@ -15,4 +16,5 @@ namespace SewerStammGen.WPF.Views
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace SewerStammGen.WPF.ViewModel.State.Navigation
|
||||
{
|
||||
internal class MainWindowNavigator : ObservableObject, IMainWindowNavigator
|
||||
{
|
||||
private BaseViewModel _currentViewModel;
|
||||
private BaseViewModel _currentViewModel = new BaseViewModel();
|
||||
public BaseViewModel CurrentViewModel
|
||||
{
|
||||
get => _currentViewModel;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="600" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -29,11 +29,9 @@
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Untere Schacht" />
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="Haltungsbezeichnung" />
|
||||
|
||||
<!--<TextBox Grid.Row="0" Grid.Column="1" Margin="5" Text="{Binding ObereSchacht}" />-->
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" DisplayMemberPath="Objektbezeichnung" SelectedIndex="{Binding SelectedObenIndex}" ItemsSource="{Binding AvSchaechte}"></ComboBox>
|
||||
<ComboBox Grid.Row="1" Grid.Column="1" DisplayMemberPath="Objektbezeichnung" SelectedIndex="{Binding SelectedUntenIndex}" ItemsSource="{Binding AvSchaechte}"></ComboBox>
|
||||
<!--<TextBox Grid.Row="1" Grid.Column="1" Margin="5" Text="{Binding UntereSchacht}" />-->
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="5" Text="{Binding Haltungsbezeichnung}" />
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" Width="200" HorizontalAlignment="Left" Margin="5,5,5,5" DisplayMemberPath="Objektbezeichnung" SelectedIndex="{Binding SelectedObenIndex}" ItemsSource="{Binding AvSchaechte}"></ComboBox>
|
||||
<ComboBox Grid.Row="1" Grid.Column="1" Width="200" HorizontalAlignment="Left" Margin="5,5,5,5" DisplayMemberPath="Objektbezeichnung" SelectedIndex="{Binding SelectedUntenIndex}" ItemsSource="{Binding AvSchaechte}"></ComboBox>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Width="200" HorizontalAlignment="Left" Margin="5" Text="{Binding Haltungsbezeichnung}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
@@ -53,19 +51,20 @@
|
||||
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" Content="Haltungslänge" />
|
||||
<Label VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" Content="Entwässerungsart" />
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Material}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Durchmesser}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Haltungslaenge}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Width="200" HorizontalAlignment="Left" Margin="5,5,5,5" Text="{Binding Material}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Width="200" HorizontalAlignment="Left" Margin="5,5,5,5" Text="{Binding Durchmesser}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Width="100" HorizontalAlignment="Left" Margin="5,5,5,5" Text="{Binding Haltungslaenge}" Grid.ColumnSpan="2" />
|
||||
<DockPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2">
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" />
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="4">
|
||||
<Button Content="Speichern" Command="{Binding Speichern}" />
|
||||
<!--<ListBox ItemsSource="{Binding VerfuegbareSchaechte }" />-->
|
||||
</StackPanel>
|
||||
|
||||
<TabPanel Grid.Row="2">
|
||||
<Button Margin="10,10,5,10" Content="Speichern" Command="{Binding Speichern}" Width="160" Height="160" HorizontalAlignment="Left" BorderThickness="2" BorderBrush="Green" />
|
||||
<Button Margin="5,10,10,10" Content="Abbrechen" Command="{Binding Abbrechen}" Width="160" Height="160" HorizontalAlignment="Left" BorderThickness="2" BorderBrush="Red" />
|
||||
</TabPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</DataGrid>
|
||||
<Button Content="Hinzufügen" Command="{Binding AddCommand}" />
|
||||
<Button Content="Editieren" Command="{Binding EditCommand}" />
|
||||
<Button Content="Daten Exportieren" Command="{Binding ExportCommand}" Width="220" Height="220" BorderBrush="AliceBlue" BorderThickness="5" HorizontalAlignment="Left" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user