Optimierung Stundenseite
Grid statt StackLayout Monatssummen beachten jetzt auch das Jahr
This commit is contained in:
@@ -84,7 +84,7 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
set {
|
set {
|
||||||
if (dateToday != value) {
|
if (dateToday != value) {
|
||||||
dateToday = value;
|
dateToday = value;
|
||||||
LoadOverview = "Lade Summen für " + dateToday.ToString("MMMM");
|
LoadOverview = "Lade Summen für " + dateToday.ToString("MMMM yy");
|
||||||
//OnPropertyChanged();
|
//OnPropertyChanged();
|
||||||
Task.Run(() => LoadDay(value));
|
Task.Run(() => LoadDay(value));
|
||||||
}
|
}
|
||||||
@@ -119,6 +119,13 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
get => Hours.overtime_month;
|
get => Hours.overtime_month;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int Zeitausgleich {
|
||||||
|
get => Hours.zeitausgleich;
|
||||||
|
}
|
||||||
|
public int ZeitausgleichMonth {
|
||||||
|
get => Hours.zeitausgleich_month;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Monatsübersicht: Resturlaub
|
/// Monatsübersicht: Resturlaub
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -194,7 +201,7 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task LoadData() {
|
private async Task LoadData() {
|
||||||
try {
|
try {
|
||||||
BaseResponse dat = await HoursBase.LoadBase("hours&month=" + DateToday.ToString("MM"));
|
BaseResponse dat = await HoursBase.LoadBase("hours&year="+ DateToday.ToString("yyyy") + "&month=" + DateToday.ToString("MM"));
|
||||||
_hour = dat.hour;
|
_hour = dat.hour;
|
||||||
|
|
||||||
if (dat.settings.Version != AppInfo.Current.VersionString) {
|
if (dat.settings.Version != AppInfo.Current.VersionString) {
|
||||||
@@ -291,6 +298,7 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
OnPropertyChanged(nameof(Nominal));
|
OnPropertyChanged(nameof(Nominal));
|
||||||
OnPropertyChanged(nameof(Overtime));
|
OnPropertyChanged(nameof(Overtime));
|
||||||
OnPropertyChanged(nameof(OvertimeMonth));
|
OnPropertyChanged(nameof(OvertimeMonth));
|
||||||
|
OnPropertyChanged(nameof(Zeitausgleich));
|
||||||
OnPropertyChanged(nameof(ZeitCalculated));
|
OnPropertyChanged(nameof(ZeitCalculated));
|
||||||
OnPropertyChanged(nameof(Holiday));
|
OnPropertyChanged(nameof(Holiday));
|
||||||
OnPropertyChanged(nameof(Hours));
|
OnPropertyChanged(nameof(Hours));
|
||||||
|
|||||||
@@ -29,9 +29,10 @@
|
|||||||
</ContentPage.ToolbarItems>
|
</ContentPage.ToolbarItems>
|
||||||
|
|
||||||
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10">
|
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10">
|
||||||
<VerticalStackLayout Spacing="10" Margin="10">
|
<Grid RowDefinitions="50,*,Auto,80">
|
||||||
|
<!--<VerticalStackLayout Spacing="10" Margin="10">-->
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*" HeightRequest="50">
|
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*" HeightRequest="50" Grid.Row="0">
|
||||||
<DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}"
|
<DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}"
|
||||||
MaximumDate="{Binding MaximumDate}"
|
MaximumDate="{Binding MaximumDate}"
|
||||||
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
||||||
@@ -46,11 +47,13 @@
|
|||||||
|
|
||||||
<CollectionView
|
<CollectionView
|
||||||
ItemsSource="{Binding DayTimes}"
|
ItemsSource="{Binding DayTimes}"
|
||||||
x:Name="stundeItems" Margin="0"
|
x:Name="stundeItems" Margin="0,0,0,20"
|
||||||
HeightRequest="300"
|
|
||||||
SelectionMode="Single"
|
SelectionMode="Single"
|
||||||
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}"
|
||||||
|
VerticalOptions="Start"
|
||||||
|
Grid.Row="1">
|
||||||
|
|
||||||
<CollectionView.ItemsLayout>
|
<CollectionView.ItemsLayout>
|
||||||
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
||||||
@@ -110,27 +113,29 @@
|
|||||||
|
|
||||||
</CollectionView>
|
</CollectionView>
|
||||||
|
|
||||||
<BoxView HeightRequest="1" />
|
<!--<BoxView HeightRequest="1" Grid.Row="2" Margin="0,5,0,15" />-->
|
||||||
|
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" Grid.Row="2" />
|
||||||
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" />
|
<Border Padding="2" Grid.Row="3" Margin="0,10,0,0">
|
||||||
<Border Padding="2" HeightRequest="125">
|
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,Auto,*,Auto" Margin="10,2">
|
||||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,*" Margin="10,2">
|
|
||||||
<Label Grid.Row="0" Text="Soll:" />
|
<Label Grid.Row="0" Text="Soll:" />
|
||||||
<Label Grid.Row="1" Text="Summe:" />
|
<Label Grid.Row="1" Text="Summe:" />
|
||||||
<Label Grid.Row="2" Text="Differenz:" Margin="0,0,15,0" />
|
<Label Grid.Row="2" Text="Differenz:" Margin="0,0,15,0" />
|
||||||
<BoxView Grid.Row="3" Grid.ColumnSpan="2" HeightRequest="1" Color="LightGrey" Margin="0,5"/>
|
<!--<BoxView Grid.Row="3" Grid.ColumnSpan="4" HeightRequest="1" Color="LightGrey" Margin="0,5"/>-->
|
||||||
<Label Grid.Row="4" Text="Restüberstunden:" />
|
<Label Grid.Row="0" Grid.Column="2" Text="Restüberstunden:" Margin="15,0,0,0" />
|
||||||
<Label Grid.Row="5" Text="Resturlaub:" />
|
<Label Grid.Row="1" Grid.Column="2" Text="Zeitausgleich:" Margin="15,0,0,0" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="2" Text="Resturlaub:" Margin="15,0,0,0" />
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Sollstunden" />
|
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Sollstunden" />
|
||||||
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Geleistete Stunden" />
|
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Geleistete Stunden" />
|
||||||
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth, Converter={StaticResource secToTime}}" />
|
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth, Converter={StaticResource secToTime}}" />
|
||||||
<Label Grid.Row="4" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime, Converter={StaticResource secToTime}}" />
|
<Label Grid.Row="0" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime, Converter={StaticResource secToTime}}" />
|
||||||
<Label Grid.Row="5" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Holiday, Converter={StaticResource secToTime}}" />
|
<Label Grid.Row="1" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Zeitausgleich, Converter={StaticResource secToTime}}" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Holiday, Converter={StaticResource secToTime}}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</VerticalStackLayout>
|
</Grid>
|
||||||
|
<!--</VerticalStackLayout>-->
|
||||||
|
|
||||||
</RefreshView>
|
</RefreshView>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
@@ -25,17 +25,7 @@ public partial class StundenPage : ContentPage {
|
|||||||
if (!CheckLogin()) {
|
if (!CheckLogin()) {
|
||||||
NavigateToTargetPage();
|
NavigateToTargetPage();
|
||||||
}
|
}
|
||||||
#if ANDROID
|
|
||||||
heightValue = 280;
|
|
||||||
#elif IOS
|
|
||||||
heightValue = 280;
|
|
||||||
#elif WINDOWS
|
|
||||||
heightValue = 320;
|
|
||||||
#else
|
|
||||||
heightValue = 300;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SizeChanged += OnPageSizeChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Vm_AlertEvent(object? sender, string e) {
|
private void Vm_AlertEvent(object? sender, string e) {
|
||||||
@@ -77,13 +67,4 @@ public partial class StundenPage : ContentPage {
|
|||||||
await Navigation.PushAsync(new LoginPage());
|
await Navigation.PushAsync(new LoginPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPageSizeChanged(object sender, EventArgs e) {
|
|
||||||
double windowHeight = this.Height;
|
|
||||||
AdjustLayout(windowHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AdjustLayout(double height) {
|
|
||||||
// Passen Sie Ihre UI-Elemente basierend auf der Fensterh<72>he an
|
|
||||||
stundeItems.HeightRequest = height - heightValue; //Datepicker Height 50, Monatssummen Height 125, Titel + Navigation Height xyz
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user