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 {
|
||||
if (dateToday != value) {
|
||||
dateToday = value;
|
||||
LoadOverview = "Lade Summen für " + dateToday.ToString("MMMM");
|
||||
LoadOverview = "Lade Summen für " + dateToday.ToString("MMMM yy");
|
||||
//OnPropertyChanged();
|
||||
Task.Run(() => LoadDay(value));
|
||||
}
|
||||
@@ -119,6 +119,13 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
get => Hours.overtime_month;
|
||||
}
|
||||
|
||||
public int Zeitausgleich {
|
||||
get => Hours.zeitausgleich;
|
||||
}
|
||||
public int ZeitausgleichMonth {
|
||||
get => Hours.zeitausgleich_month;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Monatsübersicht: Resturlaub
|
||||
/// </summary>
|
||||
@@ -194,7 +201,7 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
/// </summary>
|
||||
private async Task LoadData() {
|
||||
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;
|
||||
|
||||
if (dat.settings.Version != AppInfo.Current.VersionString) {
|
||||
@@ -291,6 +298,7 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
OnPropertyChanged(nameof(Nominal));
|
||||
OnPropertyChanged(nameof(Overtime));
|
||||
OnPropertyChanged(nameof(OvertimeMonth));
|
||||
OnPropertyChanged(nameof(Zeitausgleich));
|
||||
OnPropertyChanged(nameof(ZeitCalculated));
|
||||
OnPropertyChanged(nameof(Holiday));
|
||||
OnPropertyChanged(nameof(Hours));
|
||||
|
||||
@@ -29,9 +29,10 @@
|
||||
</ContentPage.ToolbarItems>
|
||||
|
||||
<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}"
|
||||
MaximumDate="{Binding MaximumDate}"
|
||||
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
||||
@@ -46,11 +47,13 @@
|
||||
|
||||
<CollectionView
|
||||
ItemsSource="{Binding DayTimes}"
|
||||
x:Name="stundeItems" Margin="0"
|
||||
HeightRequest="300"
|
||||
x:Name="stundeItems" Margin="0,0,0,20"
|
||||
|
||||
SelectionMode="Single"
|
||||
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}"
|
||||
VerticalOptions="Start"
|
||||
Grid.Row="1">
|
||||
|
||||
<CollectionView.ItemsLayout>
|
||||
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
||||
@@ -109,28 +112,30 @@
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
</CollectionView>
|
||||
|
||||
<BoxView HeightRequest="1" />
|
||||
|
||||
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" />
|
||||
<Border Padding="2" HeightRequest="125">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,*" Margin="10,2">
|
||||
|
||||
<!--<BoxView HeightRequest="1" Grid.Row="2" Margin="0,5,0,15" />-->
|
||||
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" Grid.Row="2" />
|
||||
<Border Padding="2" Grid.Row="3" Margin="0,10,0,0">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,Auto,*,Auto" Margin="10,2">
|
||||
<Label Grid.Row="0" Text="Soll:" />
|
||||
<Label Grid.Row="1" Text="Summe:" />
|
||||
<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"/>
|
||||
<Label Grid.Row="4" Text="Restüberstunden:" />
|
||||
<Label Grid.Row="5" Text="Resturlaub:" />
|
||||
<!--<BoxView Grid.Row="3" Grid.ColumnSpan="4" HeightRequest="1" Color="LightGrey" Margin="0,5"/>-->
|
||||
<Label Grid.Row="0" Grid.Column="2" Text="Restüberstunden:" Margin="15,0,0,0" />
|
||||
<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="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="4" Grid.Column="1" 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="0" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime, 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>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
</Grid>
|
||||
<!--</VerticalStackLayout>-->
|
||||
|
||||
</RefreshView>
|
||||
</ContentPage>
|
||||
@@ -25,17 +25,7 @@ public partial class StundenPage : ContentPage {
|
||||
if (!CheckLogin()) {
|
||||
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) {
|
||||
@@ -77,13 +67,4 @@ public partial class StundenPage : ContentPage {
|
||||
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