Tätigkeiten erfassen angefangen

This commit is contained in:
Husky
2020-06-12 16:22:19 +02:00
parent 06fc472965
commit 9442d94de5
15 changed files with 239 additions and 6 deletions

View File

@@ -15,11 +15,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.0" />
<PackageReference Include="Syncfusion.DocIO.Wpf" Version="18.1.0.44" />
<PackageReference Include="Syncfusion.DocToPDFConverter.Wpf" Version="18.1.0.44" />
<PackageReference Include="Syncfusion.Grid.WPF" Version="18.1.0.44" />
<PackageReference Include="Syncfusion.Shared.WPF" Version="18.1.0.44" />
<PackageReference Include="Syncfusion.XlsIO.Wpf" Version="18.1.0.44" />
<PackageReference Include="Syncfusion.DocIO.Wpf" Version="18.1.0.55" />
<PackageReference Include="Syncfusion.DocToPDFConverter.Wpf" Version="18.1.0.55" />
<PackageReference Include="Syncfusion.Grid.WPF" Version="18.1.0.55" />
<PackageReference Include="Syncfusion.Shared.WPF" Version="18.1.0.55" />
<PackageReference Include="Syncfusion.XlsIO.Wpf" Version="18.1.0.55" />
</ItemGroup>
<ItemGroup>
@@ -27,4 +27,10 @@
<ProjectReference Include="..\KanSan.ViewModel\KanSan.ViewModel.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="aufmass.xls">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -67,6 +67,9 @@
<Compile Update="UI\SanMaßnahmen\UCTaetigkeitEdit.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="UI\Tätigkeiten\UCTätigkeitenNew.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="MainWindow.xaml">
@@ -138,5 +141,8 @@
<Page Update="UI\SanMaßnahmen\UCTaetigkeitEdit.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="UI\Tätigkeiten\UCTätigkeitenNew.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View File

@@ -18,6 +18,7 @@ using KanSan.Base.Models;
using KanSan.ViewModel;
using Microsoft.EntityFrameworkCore;
using Syncfusion.Windows.Shared;
using Syncfusion.XlsIO;
namespace KanSan
{
@@ -38,7 +39,10 @@ namespace KanSan
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
(this.DataContext as MainWindowViewModel).GenerateExcelFile();
#if DEBUG
System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Critical;
#endif

View File

@@ -0,0 +1,28 @@
using KanSan.Base.Interfaces.UI;
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace KanSan.SampleData
{
class TätigkeitNewViewModelSampleData : ITätigkeitNewViewModel
{
List<LeistungsverzeichnisPosition> lvPositionen = new List<LeistungsverzeichnisPosition>();
public List<LeistungsverzeichnisPosition> LVPositionen => lvPositionen;
public TätigkeitNewViewModelSampleData()
{
for (int i = 1; i <= 10; i++)
{
lvPositionen.Add(new Base.Models.LeistungsverzeichnisPosition()
{
Beschreibung = "TV Inspektion DN " + i + "00"
});
}
}
}
}

View File

@@ -21,6 +21,7 @@
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<DataGrid CanUserAddRows="False" IsReadOnly="True" Grid.Row="0" ItemsSource="{Binding Schaeden}" Background="Gray" AutoGenerateColumns="False" Margin="0,0,0,0">
<DataGrid.RowStyle>
@@ -52,5 +53,6 @@
</DataGrid.Columns>
</DataGrid>
<Button Grid.Row="1" Name="NewSchaden" Click="NewSchaden_Click" Content="Neue Schäden Hinzufügen" />
<Button Grid.Row="2" Name="GenerateExcel" Content="Schadensbericht erstellen" Click="GenerateExcel_Click" />
</Grid>
</UserControl>

View File

@@ -70,6 +70,11 @@ namespace KanSan.UI
schaeden = schaeden
});
}
private void GenerateExcel_Click(object sender, RoutedEventArgs e)
{
(DataContext as SchaedenListViewModel).GenerateExcelFile();
}
}
public class SelectSchaedenEventArgs : EventArgs
{

View File

@@ -0,0 +1,27 @@
<UserControl x:Class="KanSan.UI.UCTätigkeitenNew"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:KanSan.UI"
xmlns:sd="clr-namespace:KanSan.SampleData"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<d:UserControl.DataContext>
<sd:TätigkeitNewViewModelSampleData />
</d:UserControl.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="./../../my_controls.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<ContentControl Grid.Row="0" Content="{Binding }" ContentTemplate="{StaticResource SelectNewTätigkeitenLVPosition}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace KanSan.UI
{
/// <summary>
/// Interaktionslogik für UCTätigkeitenNew.xaml
/// </summary>
public partial class UCTätigkeitenNew : UserControl
{
public UCTätigkeitenNew()
{
InitializeComponent();
}
}
}

BIN
KanSan/aufmass.xls Normal file

Binary file not shown.

View File

@@ -5,6 +5,22 @@
<DataTemplate x:Key="SanierungViewModelDataTemplate" DataType="{x:Type l:UCHarzSanierung }">
<l:UCHarzSanierung />
</DataTemplate>
<DataTemplate x:Key="SelectNewTätigkeitenLVPosition" DataType="{x:Type l:UCTätigkeitNewSelect}">
<Border BorderThickness="2" BorderBrush="Red">
<ItemsControl ItemsSource="{Binding LVPositionen }">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="8" Columns="3" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding Beschreibung}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</DataTemplate>
<Style x:Key="ToggelButtonList" TargetType="{x:Type ToggleButton}">
<Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>