Leistungsverzeichnis kann nun den Baustellen zugeordnet werden
This commit is contained in:
@@ -17,6 +17,7 @@ namespace KanSan.Base.Interfaces
|
||||
IRepository<Taetigkeiten> TaetigkeitenRepository { get; }
|
||||
IRepository<LeistungsverzeichnisPosition> LeistungsverzeichnisRepository { get; }
|
||||
IRepository<Fahrzeug> FahrzeugRepository { get; }
|
||||
IRepository<BaustelleLeistungsverzeichnisReferenz> LeistungsverzeichnisReferenz { get; }
|
||||
void Commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace KanSan.Base.Interfaces.UI
|
||||
public interface ILeistungsverzeichnisBaustelleViewModel
|
||||
{
|
||||
public List<Baustelle> Baustellen { get; }
|
||||
public List<ILeistungsverzeichnisViewPosition> LeistungsverzeichnisPositionen { get; }
|
||||
public List<ILeistungsverzeichnisViewPosition> LeistungsverzeichnisPositionen { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
<ProjectReference Include="..\KanSan.Base\KanSan.Base.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Leistungsverzeichnis\" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="git rev-parse HEAD >"$(ProjectDir)\version.txt" />
|
||||
</Target>
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
using KanSan.Base;
|
||||
using KanSan.Base.Interfaces;
|
||||
using KanSan.Base.Interfaces.UI;
|
||||
using KanSan.Base.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace KanSan.ViewModel
|
||||
{
|
||||
public class LeistungsverzeichnisViewPosition : ILeistungsverzeichnisViewPosition
|
||||
{
|
||||
Guid guid;
|
||||
string positionsnummer;
|
||||
string beschreibung;
|
||||
string einheit;
|
||||
string tag;
|
||||
bool isActiveInBaustelle;
|
||||
|
||||
public Guid GuidNr { get => guid; set => guid = value; }
|
||||
public string Positionsnummer { get => positionsnummer; set => positionsnummer = value; }
|
||||
public string Beschreibung { get => beschreibung; set => beschreibung = value; }
|
||||
public string Einheit { get => einheit; set => einheit = value; }
|
||||
public string Tag { get => tag; set => tag = value; }
|
||||
public bool IsActiveInBaustelle { get => isActiveInBaustelle; set => isActiveInBaustelle = value; }
|
||||
}
|
||||
public class LeistungsverzeichnisBaustelleViewModel : PropertyChangedClass, INotifyPropertyChanged, ILeistungsverzeichnisBaustelleViewModel
|
||||
{
|
||||
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
|
||||
|
||||
Baustelle selectedBaustelle = null;
|
||||
List<Baustelle> baustellen = new List<Baustelle>();
|
||||
List<ILeistungsverzeichnisViewPosition> leistungsverzeichnisViewPositions = new List<ILeistungsverzeichnisViewPosition>();
|
||||
|
||||
public void Speichern()
|
||||
{
|
||||
unitOfWork.Commit();
|
||||
}
|
||||
|
||||
public List<Baustelle> Baustellen => baustellen;
|
||||
|
||||
public List<ILeistungsverzeichnisViewPosition> LeistungsverzeichnisPositionen
|
||||
{
|
||||
get => leistungsverzeichnisViewPositions;
|
||||
set
|
||||
{
|
||||
leistungsverzeichnisViewPositions = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleActive(LeistungsverzeichnisViewPosition leistungsverzeichnisViewPosition)
|
||||
{
|
||||
leistungsverzeichnisViewPosition.IsActiveInBaustelle = !leistungsverzeichnisViewPosition.IsActiveInBaustelle;
|
||||
LeistungsverzeichnisPosition pos = unitOfWork.LeistungsverzeichnisRepository.Get(x => x.GuidNr.Equals(leistungsverzeichnisViewPosition.GuidNr)).ToList().First();
|
||||
|
||||
BaustelleLeistungsverzeichnisReferenz bauRef = new BaustelleLeistungsverzeichnisReferenz()
|
||||
{
|
||||
GuidNr = Guid.NewGuid(),
|
||||
Baustelle = selectedBaustelle,
|
||||
LVPosition = pos
|
||||
};
|
||||
|
||||
if (leistungsverzeichnisViewPosition.IsActiveInBaustelle)
|
||||
{
|
||||
|
||||
_bs.Add(bauRef);
|
||||
unitOfWork.LeistungsverzeichnisReferenz.Update(bauRef);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
BaustelleLeistungsverzeichnisReferenz referenz = _bs.FindLast(x => x.LVPosition.GuidNr.Equals(leistungsverzeichnisViewPosition.GuidNr) && x.Baustelle.Equals(selectedBaustelle));
|
||||
Trace.WriteLine(referenz);
|
||||
unitOfWork.LeistungsverzeichnisReferenz.Delete(referenz);
|
||||
|
||||
}
|
||||
buildLeistungsverzeichnisList();
|
||||
}
|
||||
|
||||
public Baustelle SelectedBaustelle
|
||||
{
|
||||
get => selectedBaustelle;
|
||||
set
|
||||
{
|
||||
if (selectedBaustelle == value) return;
|
||||
selectedBaustelle = value;
|
||||
buildLeistungsverzeichnisList();
|
||||
}
|
||||
}
|
||||
|
||||
List<BaustelleLeistungsverzeichnisReferenz> _bs = null;
|
||||
private bool IsActive(LeistungsverzeichnisPosition ps)
|
||||
{
|
||||
if(_bs == null)
|
||||
{
|
||||
if (selectedBaustelle == null) return false;
|
||||
//_bs = unitOfWork.LeistungsverzeichnisReferenz.Get(x => x.Baustelle.Equals(selectedBaustelle)).ToList();
|
||||
}
|
||||
return false;
|
||||
//List<BaustelleLeistungsverzeichnisReferenz> d = _bs.FindAll(x => x.LVPosition.GuidNr.Equals(ps.GuidNr));
|
||||
//return (d.Count > 0);
|
||||
}
|
||||
|
||||
private void buildLeistungsverzeichnisList()
|
||||
{
|
||||
List<ILeistungsverzeichnisViewPosition> poses = new List<ILeistungsverzeichnisViewPosition>();
|
||||
List<LeistungsverzeichnisPosition> allePositionen = unitOfWork.LeistungsverzeichnisRepository.Get().ToList();
|
||||
foreach (LeistungsverzeichnisPosition pos in allePositionen)
|
||||
{
|
||||
poses.Add(new LeistungsverzeichnisViewPosition()
|
||||
{
|
||||
GuidNr = pos.GuidNr,
|
||||
Beschreibung = pos.Beschreibung,
|
||||
IsActiveInBaustelle = IsActive(pos),
|
||||
Einheit = pos.Einheit,
|
||||
Positionsnummer = pos.Positionsnummer,
|
||||
Tag = pos.Tag
|
||||
});
|
||||
}
|
||||
LeistungsverzeichnisPositionen = poses;
|
||||
}
|
||||
|
||||
public LeistungsverzeichnisBaustelleViewModel()
|
||||
{
|
||||
baustellen = unitOfWork.BaustelleRepository.Get().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,10 @@ namespace KanSan.ViewModel
|
||||
LeistungsverzeichnisPosition leistungsverzeichnisPosition = new LeistungsverzeichnisPosition()
|
||||
{
|
||||
GuidNr = guid,
|
||||
Beschreibung = "TV Inspektion",
|
||||
Positionsnummer = "1.0.0.1",
|
||||
Einheit = "M",
|
||||
Tag = "JMStandard"
|
||||
};
|
||||
unitOfWork.LeistungsverzeichnisRepository.Insert(leistungsverzeichnisPosition);
|
||||
unitOfWork.Commit();
|
||||
@@ -7,7 +7,7 @@
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="UI\UCLeistungsverzeichnisPositionenBaustelle.xaml.cs">
|
||||
<Compile Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPositionenBaustelle.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\Objekte\FrmNewObjekt.xaml.cs">
|
||||
@@ -52,7 +52,7 @@
|
||||
<Compile Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPosList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\UCLeistungsverzeichnisPosition.xaml.cs">
|
||||
<Compile Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPosition.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\UCSewerMainWindow.xaml.cs">
|
||||
@@ -69,7 +69,7 @@
|
||||
<Page Update="my_controls.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\UCLeistungsverzeichnisPositionenBaustelle.xaml">
|
||||
<Page Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPositionenBaustelle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
|
||||
@@ -114,7 +114,7 @@
|
||||
<Page Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPosList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\UCLeistungsverzeichnisPosition.xaml">
|
||||
<Page Update="UI\Leistungsverzeichnis\UCLeistungsverzeichnisPosition.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\UCSewerMainWindow.xaml">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:syncfusion="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF" x:Class="KanSan.MainWindow"
|
||||
TitleTextAlignment="Center" TitleBarBackground="BlueViolet"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding ApplicationTitle}" Height="450" Width="800" WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
||||
Title="{Binding ApplicationTitle}" Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,26 @@
|
||||
<RowDefinition Height="206*" />
|
||||
<RowDefinition Height="11*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="10" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<RadioButton Name="rbKunden" Content="Kunden" Style="{StaticResource ToggelButtonList}" Checked="rbKunden_Checked" />
|
||||
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" Checked="rbProjekte_Checked" />
|
||||
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" Checked="rbBaustellen_Checked" />
|
||||
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" Checked="rbObjekte_Checked" />
|
||||
</StackPanel>
|
||||
<Line Grid.Row="1" Stroke="Black" Width="auto" Height="4" StrokeThickness="20" Fill="Black" Stretch="Fill" X1="9" X2="10" />
|
||||
<StackPanel Grid.Row="2">
|
||||
<RadioButton Name="rbLeistungsverzeichnis" Content="Leistungsverzeichnis" Style="{StaticResource ToggelButtonList}" Checked="rbLeistungsverzeichnis_Checked" />
|
||||
<RadioButton Name="rbLeistungsverzeichnisBaustellen" Content="LV / BS" Style="{StaticResource ToggelButtonList}" Checked="rbLeistungsverzeichnisBaustellen_Checked" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
|
||||
<StatusBar Grid.ColumnSpan="2" Margin="0,1,0,0" Grid.Row="1">
|
||||
<StatusBarItem Content="{Binding SelectedKunde.Vorname}" />
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace KanSan
|
||||
UI.UCBaustelleList UCBaustelleList;
|
||||
|
||||
UI.UCSewerMainMenu uCSewerMainMenu;
|
||||
UI.UCLeistungsverzeichnisPositionenBaustelle UCLeistungsverzeichnisPositionenBaustelle = new UI.UCLeistungsverzeichnisPositionenBaustelle();
|
||||
UI.UCLeistungsverzeichnisPosList UCLeistungsverzeichnisPosList = new UI.UCLeistungsverzeichnisPosList();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -158,6 +160,16 @@ namespace KanSan
|
||||
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||
ContentController.Content = uCObjekteList;
|
||||
}
|
||||
|
||||
private void rbLeistungsverzeichnis_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ContentController.Content = UCLeistungsverzeichnisPosList;
|
||||
}
|
||||
|
||||
private void rbLeistungsverzeichnisBaustellen_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ContentController.Content = UCLeistungsverzeichnisPositionenBaustelle;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@ namespace KanSan.SampleData
|
||||
string tag;
|
||||
bool isActiveInBaustelle;
|
||||
|
||||
public string Positionsnummer { get => positionsnummer; set => positionsnummer = value; }
|
||||
public string Beschreibung { get => beschreibung; set => beschreibung = value; }
|
||||
public string Einheit { get => einheit; set => einheit = value; }
|
||||
public string Tag { get => tag; set => tag = value; }
|
||||
public bool IsActiveInBaustelle { get => isActiveInBaustelle; set => isActiveInBaustelle = value; }
|
||||
}
|
||||
class LeistungsverzeichnisBaustelleViewModelSampleData : ILeistungsverzeichnisBaustelleViewModel
|
||||
{
|
||||
@@ -23,7 +28,7 @@ namespace KanSan.SampleData
|
||||
List<ILeistungsverzeichnisViewPosition> leistungsverzeichnisPositionen = new List<ILeistungsverzeichnisViewPosition>();
|
||||
public List<Baustelle> Baustellen => baustellen;
|
||||
|
||||
public List<ILeistungsverzeichnisViewPosition> LeistungsverzeichnisPositionen => leistungsverzeichnisPositionen;
|
||||
public List<ILeistungsverzeichnisViewPosition> LeistungsverzeichnisPositionen { get => leistungsverzeichnisPositionen; set => throw new NotImplementedException(); }
|
||||
|
||||
public LeistungsverzeichnisBaustelleViewModelSampleData()
|
||||
{
|
||||
@@ -38,10 +43,21 @@ namespace KanSan.SampleData
|
||||
});
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
foreach (LeistungsverzeichnisPosition item in positionen)
|
||||
{
|
||||
ILeistungsverzeichnisViewPosition postion;
|
||||
postion.Positionsnummer = item.Positionsnummer;
|
||||
bool active = (counter % 2 == 0);
|
||||
ILeistungsverzeichnisViewPosition leistungsverzeichnisViewPosition = new LeistungsverzeichnisViewPosition()
|
||||
{
|
||||
Positionsnummer = item.Positionsnummer,
|
||||
Einheit = item.Einheit,
|
||||
Beschreibung = item.Beschreibung,
|
||||
IsActiveInBaustelle = active
|
||||
};
|
||||
LeistungsverzeichnisPositionen.Add(leistungsverzeichnisViewPosition);
|
||||
counter++;
|
||||
//ILeistungsverzeichnisViewPosition postion;
|
||||
//postion.Positionsnummer = item.Positionsnummer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
<DataGridTextColumn Header="Tag" Binding="{Binding Tag}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="1" Name="NewLVPosition" Content="Neue LeistungsverzeichnisPosition" />
|
||||
<Button Grid.Row="1" Name="NewLVPosition" Content="Neue LeistungsverzeichnisPosition" Click="NewLVPosition_Click" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using KanSan.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
@@ -21,6 +22,12 @@ namespace KanSan.UI
|
||||
public UCLeistungsverzeichnisPosList()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new LeistungsverzeichnisPositionenListViewModel(string.Empty);
|
||||
}
|
||||
|
||||
private void NewLVPosition_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as LeistungsverzeichnisPositionenListViewModel).NeueLeistungsverzeichnisPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<UserControl x:Class="KanSan.UI.UCLeistungsverzeichnisPositionenBaustelle"
|
||||
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">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="./../../my_controls.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<d:UserControl.DataContext>
|
||||
<sd:LeistungsverzeichnisBaustelleViewModelSampleData />
|
||||
</d:UserControl.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="57*" />
|
||||
<RowDefinition Height="320*" />
|
||||
<RowDefinition Height="73*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox ItemsSource="{Binding Baustellen}" Name="Baustellen" SelectionChanged="Baustellen_SelectionChanged" />
|
||||
|
||||
<DataGrid Grid.Row="1" Name="Leistungsverzeichnis" ItemsSource="{Binding LeistungsverzeichnisPositionen}" AutoGenerateColumns="False">
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="Gray" />
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Header="Aktiviert" IsReadOnly="True" Binding="{Binding IsActiveInBaustelle}" ElementStyle="{StaticResource checkBoxCircleSmall}" />
|
||||
<DataGridTextColumn Header="Positionsnummer" Binding="{Binding Positionsnummer}" />
|
||||
<DataGridTextColumn Header="Beschreibung" Binding="{Binding Beschreibung}" />
|
||||
<DataGridTextColumn Header="Einheit" Binding="{Binding Einheit}" />
|
||||
<DataGridTextColumn Header="Tag" Binding="{Binding Tag}" />
|
||||
<DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="Aktivieren / Deaktivieren" Name="AktivierenDeaktivieren" Click="AktivierenDeaktivieren_Click" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="2" Content="Speichern" Name="Speichern" Click="Speichern_Click" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,53 @@
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
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 LeistungsverzeichnisPositionenBaustelle.xaml
|
||||
/// </summary>
|
||||
public partial class UCLeistungsverzeichnisPositionenBaustelle : UserControl
|
||||
{
|
||||
public UCLeistungsverzeichnisPositionenBaustelle()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new LeistungsverzeichnisBaustelleViewModel();
|
||||
}
|
||||
|
||||
private void Baustellen_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Baustelle baustelle = (Baustelle)(sender as ComboBox).SelectedItem;
|
||||
if (baustelle == null) return;
|
||||
(DataContext as LeistungsverzeichnisBaustelleViewModel).SelectedBaustelle = baustelle;
|
||||
|
||||
}
|
||||
|
||||
private void Speichern_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//Debugger.Break();
|
||||
(DataContext as LeistungsverzeichnisBaustelleViewModel).Speichern();
|
||||
}
|
||||
|
||||
private void AktivierenDeaktivieren_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LeistungsverzeichnisViewPosition leistungsverzeichnisViewPosition = (LeistungsverzeichnisViewPosition)(sender as Button).DataContext;
|
||||
if (leistungsverzeichnisViewPosition == null) return;
|
||||
(DataContext as LeistungsverzeichnisBaustelleViewModel).ToggleActive(leistungsverzeichnisViewPosition);
|
||||
|
||||
// Debugger.Break();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<UserControl x:Class="KanSan.UI.LeistungsverzeichnisPositionenBaustelle"
|
||||
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:LeistungsverzeichnisBaustelleViewModelSampleData />
|
||||
</d:UserControl.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="57*" />
|
||||
<RowDefinition Height="320*" />
|
||||
<RowDefinition Height="73*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox ItemsSource="{Binding Baustellen}" />
|
||||
|
||||
<DataGrid Grid.Row="1" ItemsSource="{Binding LeistungsverzeichnisPositionen}" AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Header="Aktiviert" Binding="{Binding Activate}" />
|
||||
<DataGridTextColumn Header="Positionsnummer" Binding="{Binding Positionsnummer}" />
|
||||
<DataGridTextColumn Header="Beschreibung" Binding="{Binding Beschreibung}" />
|
||||
<DataGridTextColumn Header="Einheit" Binding="{Binding Einheit}" />
|
||||
<DataGridTextColumn Header="Tag" Binding="{Binding Tag}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="2" Content="Speichern" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,26 +0,0 @@
|
||||
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 LeistungsverzeichnisPositionenBaustelle.xaml
|
||||
/// </summary>
|
||||
public partial class LeistungsverzeichnisPositionenBaustelle : UserControl
|
||||
{
|
||||
public LeistungsverzeichnisPositionenBaustelle()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user