Leistungsverzeichnisposition kann nun bearbeitet werden
This commit is contained in:
@@ -123,6 +123,8 @@ namespace KanSan
|
||||
|
||||
private void rbKunden_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbLeistungsverzeichnis.IsChecked = false;
|
||||
rbLeistungsverzeichnisBaustellen.IsChecked = false;
|
||||
UCKundeList = new UI.UCKundeList();
|
||||
UCKundeList.KundeAdded += UCKundeList_KundeAdded;
|
||||
UCKundeList.KundeSelect += UCKundeList_KundeSelect;
|
||||
@@ -131,6 +133,8 @@ namespace KanSan
|
||||
|
||||
private void rbProjekte_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbLeistungsverzeichnis.IsChecked = false;
|
||||
rbLeistungsverzeichnisBaustellen.IsChecked = false;
|
||||
Kunde client = (DataContext as MainWindowViewModel).SelectedKunde;
|
||||
if (client == null) return;
|
||||
UCProjektList = new UI.UCProjektList(client);
|
||||
@@ -142,6 +146,8 @@ namespace KanSan
|
||||
|
||||
private void rbBaustellen_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbLeistungsverzeichnis.IsChecked = false;
|
||||
rbLeistungsverzeichnisBaustellen.IsChecked = false;
|
||||
Projekt projekt = (DataContext as MainWindowViewModel).SelectedProjekt;
|
||||
if (projekt == null) return;
|
||||
UCBaustelleList = new UI.UCBaustelleList(projekt);
|
||||
@@ -153,6 +159,8 @@ namespace KanSan
|
||||
|
||||
private void rbObjekte_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbLeistungsverzeichnis.IsChecked = false;
|
||||
rbLeistungsverzeichnisBaustellen.IsChecked = false;
|
||||
rbObjekte.IsChecked = true;
|
||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||
@@ -161,12 +169,28 @@ namespace KanSan
|
||||
|
||||
private void rbLeistungsverzeichnis_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbBaustellen.IsChecked = false;
|
||||
rbKunden.IsChecked = false;
|
||||
rbObjekte.IsChecked = false;
|
||||
rbProjekte.IsChecked = false;
|
||||
UCLeistungsverzeichnisPosList = new UI.UCLeistungsverzeichnisPosList();
|
||||
UCLeistungsverzeichnisPosList.LeistungsverzeichnisEdited += UCLeistungsverzeichnisPosList_LeistungsverzeichnisEdited;
|
||||
ContentController.Content = UCLeistungsverzeichnisPosList;
|
||||
}
|
||||
|
||||
private void UCLeistungsverzeichnisPosList_LeistungsverzeichnisEdited(object sender, UI.SelectedLeistungsverzeichnisEventArgs e)
|
||||
{
|
||||
|
||||
UI.UCLeistungsverzeichnisPosition uCLeistungsverzeichnisPosition = new UI.UCLeistungsverzeichnisPosition(e.LeistungsverzeichnisPosition);
|
||||
ContentController.Content = uCLeistungsverzeichnisPosition;
|
||||
}
|
||||
|
||||
private void rbLeistungsverzeichnisBaustellen_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbBaustellen.IsChecked = false;
|
||||
rbKunden.IsChecked = false;
|
||||
rbObjekte.IsChecked = false;
|
||||
rbProjekte.IsChecked = false;
|
||||
UCLeistungsverzeichnisPositionenBaustelle = new UI.UCLeistungsverzeichnisPositionenBaustelle();
|
||||
ContentController.Content = UCLeistungsverzeichnisPositionenBaustelle;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<RowDefinition Height="373*" />
|
||||
<RowDefinition Height="77*" />
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid ItemsSource="{Binding LVPositionen}" AutoGenerateColumns="False">
|
||||
<DataGrid ItemsSource="{Binding LVPositionen}" Name="dgLeistungsverzeichnis" AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Positionsnummer" Binding="{Binding Positionsnummer}" />
|
||||
<DataGridTextColumn Header="Beschreibung" Binding="{Binding Beschreibung}" />
|
||||
@@ -23,6 +23,15 @@
|
||||
<DataGridTextColumn Header="Tag" Binding="{Binding Tag}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="1" Name="NewLVPosition" Content="Neue LeistungsverzeichnisPosition" Click="NewLVPosition_Click" />
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Name="EditLVPosition" Content="Leistungsverzeichnis Position Editieren" Click="EditLVPosition_Click" />
|
||||
<Button Grid.Row="1" Name="NewLVPosition" Content="Neue LeistungsverzeichnisPosition" Click="NewLVPosition_Click" />
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using KanSan.ViewModel;
|
||||
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;
|
||||
@@ -19,6 +21,7 @@ namespace KanSan.UI
|
||||
/// </summary>
|
||||
public partial class UCLeistungsverzeichnisPosList : UserControl
|
||||
{
|
||||
public event EventHandler<SelectedLeistungsverzeichnisEventArgs> LeistungsverzeichnisEdited;
|
||||
public UCLeistungsverzeichnisPosList()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -29,5 +32,28 @@ namespace KanSan.UI
|
||||
{
|
||||
(DataContext as LeistungsverzeichnisPositionenListViewModel).NeueLeistungsverzeichnisPosition();
|
||||
}
|
||||
|
||||
private void EditLVPosition_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LeistungsverzeichnisPosition pos = (dgLeistungsverzeichnis.SelectedItem as LeistungsverzeichnisPosition);
|
||||
if (pos == null) return;
|
||||
OnClickLeistungsverzeichnisEdit(new SelectedLeistungsverzeichnisEventArgs()
|
||||
{
|
||||
LeistungsverzeichnisPosition = pos
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnClickLeistungsverzeichnisEdit(SelectedLeistungsverzeichnisEventArgs e)
|
||||
{
|
||||
EventHandler<SelectedLeistungsverzeichnisEventArgs> handler = LeistungsverzeichnisEdited;
|
||||
if (handler != null)
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
public class SelectedLeistungsverzeichnisEventArgs : EventArgs
|
||||
{
|
||||
public LeistungsverzeichnisPosition LeistungsverzeichnisPosition { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Einheit}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Tag}" />
|
||||
|
||||
<Button Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" Content="Speichern" Name="Save" />
|
||||
<Button Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" Content="Speichern" Name="Save" Click="Save_Click" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
@@ -18,9 +20,16 @@ namespace KanSan.UI
|
||||
/// </summary>
|
||||
public partial class UCLeistungsverzeichnisPosition : UserControl
|
||||
{
|
||||
public UCLeistungsverzeichnisPosition()
|
||||
public UCLeistungsverzeichnisPosition(LeistungsverzeichnisPosition leistungsverzeichnisPosition)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new LeistungsverzeichnisPositionViewModel(leistungsverzeichnisPosition);
|
||||
|
||||
}
|
||||
|
||||
private void Save_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as LeistungsverzeichnisPositionViewModel).Speichern();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ControlTemplate TargetType="{x:Type Calendar}">
|
||||
<StackPanel HorizontalAlignment="Center" Name="PART_Root">
|
||||
<CalendarItem Background="{TemplateBinding Control.Background}" BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="{TemplateBinding Control.BorderThickness}" Name="PART_CalendarItem" Style="{TemplateBinding Calendar.CalendarItemStyle}" />
|
||||
<Button Content="Today" Command="local:CalendarCommands.SelectToday" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Button Content="Heute" Command="local:CalendarCommands.SelectToday" CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Mitarbeiter}" />
|
||||
|
||||
<Calendar Style="{StaticResource DefaultCalendar}" Grid.Row="2" Grid.Column="1" Name="Calender" SelectedDate="{Binding ZeitStempel}"/>
|
||||
<ComboBox Grid.Row="3" Grid.Column="1" ItemsSource="{Binding LVPositionen}" SelectedItem="{Binding Leistungsverzeichnis}">
|
||||
<Calendar Style="{StaticResource DefaultCalendar}" Grid.Row="2" Grid.Column="1" Name="Calender" SelectedDate="{Binding ZeitStempel}" Margin="-220,0,0,0"/>
|
||||
<ComboBox Grid.Row="3" Grid.Column="1" ItemsSource="{Binding LVPositionen}" SelectedItem="{Binding Leistungsverzeichnis}" IsSynchronizedWithCurrentItem="True">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Beschreibung}" />
|
||||
|
||||
Reference in New Issue
Block a user