Reworking Stundenpage
Todo: Summary not showing anymore
This commit is contained in:
17
Jugenddienst Stunden/Models/Gemeinde.cs
Normal file
17
Jugenddienst Stunden/Models/Gemeinde.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Jugenddienst_Stunden.Models {
|
||||||
|
internal class Gemeinde {
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public Gemeinde(int id, string name) {
|
||||||
|
Id = id;
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Jugenddienst Stunden/Models/Projekt.cs
Normal file
12
Jugenddienst Stunden/Models/Projekt.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Jugenddienst_Stunden.Models {
|
||||||
|
internal class Projekt {
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,9 +36,12 @@ namespace Jugenddienst_Stunden.Models {
|
|||||||
//apiKey = "MTAyfEJZZnB1L3VwcnhoVms0dDlLZENPZWtUVy85b3xodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
|
//apiKey = "MTAyfEJZZnB1L3VwcnhoVms0dDlLZENPZWtUVy85b3xodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
|
||||||
//name = "Kathi";
|
//name = "Kathi";
|
||||||
//surname = "Wegi";
|
//surname = "Wegi";
|
||||||
//Preferences.Default.Set("apiKey", apiKey);
|
apiKey = "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
|
||||||
//Preferences.Default.Set("name", name);
|
name = "Chri";
|
||||||
//Preferences.Default.Set("surname", surname);
|
surname = "Fe";
|
||||||
|
Preferences.Default.Set("apiKey", apiKey);
|
||||||
|
Preferences.Default.Set("name", name);
|
||||||
|
Preferences.Default.Set("surname", surname);
|
||||||
|
|
||||||
|
|
||||||
Hours hours = new Hours();
|
Hours hours = new Hours();
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Windows.Input;
|
|||||||
using Microsoft.Maui.Controls;
|
using Microsoft.Maui.Controls;
|
||||||
using Microsoft.Maui.Networking;
|
using Microsoft.Maui.Networking;
|
||||||
using ZXing.Net.Maui;
|
using ZXing.Net.Maui;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
|
||||||
namespace Jugenddienst_Stunden.ViewModels {
|
namespace Jugenddienst_Stunden.ViewModels {
|
||||||
@@ -41,9 +43,40 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
|
|
||||||
public string Title { get; set; } = Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", "");
|
public string Title { get; set; } = Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", "");
|
||||||
|
|
||||||
|
public ObservableCollection<string> Options { get; }
|
||||||
|
public ObservableCollection<string> OptionsProjekt { get; }
|
||||||
|
private string selectedOption;
|
||||||
|
public string SelectedOption {
|
||||||
|
get => selectedOption;
|
||||||
|
set {
|
||||||
|
if (selectedOption != value) {
|
||||||
|
selectedOption = value;
|
||||||
|
OnPropertyChanged(nameof(SelectedOption));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public StundenViewModel() {
|
public StundenViewModel() {
|
||||||
|
|
||||||
|
|
||||||
|
Options = new ObservableCollection<string> {
|
||||||
|
"Gemeinde 1",
|
||||||
|
"Gemeinde 2",
|
||||||
|
"Gemeinde 3"
|
||||||
|
};
|
||||||
|
OptionsProjekt = new ObservableCollection<string> {
|
||||||
|
"Projekt 1",
|
||||||
|
"Projekt 2",
|
||||||
|
"Projekt 3"
|
||||||
|
};
|
||||||
_hour = new Models.Hours();
|
_hour = new Models.Hours();
|
||||||
LoadDataCommand = new AsyncRelayCommand(LoadData);
|
LoadDataCommand = new AsyncRelayCommand(LoadData);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnPropertyChanged(string propertyName) {
|
||||||
|
//PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
//public async Task LoadData() =>
|
//public async Task LoadData() =>
|
||||||
|
|||||||
@@ -9,24 +9,52 @@
|
|||||||
<models:StundenViewModel />
|
<models:StundenViewModel />
|
||||||
</ContentPage.BindingContext>
|
</ContentPage.BindingContext>
|
||||||
|
|
||||||
<VerticalStackLayout Spacing="10" Margin="15">
|
<VerticalStackLayout Spacing="10" Margin="15">
|
||||||
<Label Text="{Binding Message}" />
|
|
||||||
|
|
||||||
<Button Text="Load data" Command="{Binding LoadDataCommand}" />
|
<Label Text="{Binding Message}" />
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
|
<Button Text="Lade aktuelle Daten" Command="{Binding LoadDataCommand}" />
|
||||||
<Label Text="Soll:" Grid.Row="0" />
|
|
||||||
<Label Text="Gearbeitet:" Grid.Row="1" />
|
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
|
||||||
<Label Text="Berechnet:" Grid.Row="2" />
|
<Label Text="Soll:" Grid.Row="0" Background="DarkSalmon" />
|
||||||
<Label Text="Überstunden Monat:" Grid.Row="3" Margin="0,0,15,0" />
|
<Label Text="Gearbeitet:" Grid.Row="1" />
|
||||||
<Label Text="Überstunden Jahr:" Grid.Row="4" />
|
<Label Text="Berechnet:" Grid.Row="2" />
|
||||||
|
<Label Text="Überstunden Monat:" Grid.Row="3" Margin="0,0,15,0" />
|
||||||
|
<Label Text="Überstunden Jahr:" Grid.Row="4" />
|
||||||
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal}" />
|
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal}" Background="DarkSalmon" />
|
||||||
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitDone}" />
|
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitDone}" />
|
||||||
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated}" />
|
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated}" />
|
||||||
<Label Grid.Row="3" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth}" />
|
<Label Grid.Row="3" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth}" />
|
||||||
<Label Grid.Row="4" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime}" />
|
<Label Grid.Row="4" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</VerticalStackLayout>
|
|
||||||
|
|
||||||
|
<BoxView HeightRequest="1" Color="Red"/>
|
||||||
|
|
||||||
|
<DatePicker MinimumDate="01/01/2024"
|
||||||
|
MaximumDate="12/31/2024"
|
||||||
|
Date="06/21/2024" Format="dddd, d. MMM. yyyy" />
|
||||||
|
|
||||||
|
<Grid ColumnDefinitions="Auto,Auto">
|
||||||
|
<Picker x:Name="gempick" Title="Wähle die Gemeinde" ItemsSource="{Binding Options}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="0" >
|
||||||
|
</Picker>
|
||||||
|
<Picker x:Name="projpick" Title="Wähle das Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="1" >
|
||||||
|
</Picker>
|
||||||
|
</Grid>
|
||||||
|
<Entry x:Name="entry" Placeholder="Tätigkeit" />
|
||||||
|
<Grid ColumnDefinitions="2*,Auto,2*,Auto">
|
||||||
|
<Label Text="Beginn" Grid.Column="0" Background="Green" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0"></Label>
|
||||||
|
<TimePicker HorizontalOptions="Center" Grid.Column="1" Background="Green" />
|
||||||
|
|
||||||
|
<Label Text="Ende" Grid.Column="2" Background="Red" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0"></Label>
|
||||||
|
<TimePicker HorizontalOptions="Center" Grid.Column="3" Background="Red" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</VerticalStackLayout>
|
||||||
|
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
Reference in New Issue
Block a user