Detailseite mit Daten füllen
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Routing.RegisterRoute(nameof(Views.NotePage), typeof(Views.NotePage));
|
Routing.RegisterRoute(nameof(Views.NotePage), typeof(Views.NotePage));
|
||||||
|
Routing.RegisterRoute(nameof(Views.StundePage), typeof(Views.StundePage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks>
|
<TargetFrameworks>net8.0-maccatalyst;net8.0-android</TargetFrameworks>
|
||||||
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
|
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
|
||||||
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
|
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
|
||||||
|
|
||||||
@@ -43,14 +43,37 @@
|
|||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-maccatalyst|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-maccatalyst|AnyCPU'">
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-maccatalyst|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-maccatalyst|AnyCPU'">
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
|
<Debugger>Xamarin</Debugger>
|
||||||
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<DefaultLanguage>de-de</DefaultLanguage>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-windows10.0.26100.0|AnyCPU'">
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android34.0|AnyCPU'">
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
|
<Debugger>Xamarin</Debugger>
|
||||||
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-windows10.0.26100.0|AnyCPU'">
|
||||||
|
<ApplicationId>com.danielpichler.jugenddienststunden</ApplicationId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -95,6 +118,11 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Views\LoginPage.xaml.cs">
|
<Compile Update="Views\LoginPage.xaml.cs">
|
||||||
<DependentUpon>LoginPage.xaml</DependentUpon>
|
<DependentUpon>LoginPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -103,6 +131,13 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<MauiXaml Update="Views\LoginPage.xaml">
|
<MauiXaml Update="Views\LoginPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace Jugenddienst_Stunden.Models {
|
|||||||
var tokendata = new TokenData(apiKey);
|
var tokendata = new TokenData(apiKey);
|
||||||
|
|
||||||
//string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
//string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
||||||
string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?hours&month=" + DateTime.Today.Month, tokendata.apiKey);
|
string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?hours", tokendata.apiKey);
|
||||||
|
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
throw new Exception("Keine Daten erhalten");
|
throw new Exception("Keine Daten erhalten");
|
||||||
@@ -107,7 +107,7 @@ namespace Jugenddienst_Stunden.Models {
|
|||||||
var tokendata = new TokenData(apiKey);
|
var tokendata = new TokenData(apiKey);
|
||||||
|
|
||||||
//string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
//string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
||||||
string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?hours&date=" + date.ToString("yyyy-MM-dd"), tokendata.apiKey);
|
string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?date=" + date.ToString("yyyy-MM-dd"), tokendata.apiKey);
|
||||||
|
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
throw new Exception("Keine Daten erhalten");
|
throw new Exception("Keine Daten erhalten");
|
||||||
@@ -116,7 +116,8 @@ namespace Jugenddienst_Stunden.Models {
|
|||||||
throw new Exception("Problem mit Token");
|
throw new Exception("Problem mit Token");
|
||||||
}
|
}
|
||||||
|
|
||||||
daytimes = System.Text.Json.JsonSerializer.Deserialize<List<DayTime>>(data);
|
//daytimes = System.Text.Json.JsonSerializer.Deserialize<List<DayTime>>(data);
|
||||||
|
daytimes = JsonConvert.DeserializeObject<List<DayTime>>(data);
|
||||||
//Preferences.Default.Set("name", hours.operator_api.name);
|
//Preferences.Default.Set("name", hours.operator_api.name);
|
||||||
//Preferences.Default.Set("surname", hours.operator_api.surname);
|
//Preferences.Default.Set("surname", hours.operator_api.surname);
|
||||||
|
|
||||||
|
|||||||
63
Jugenddienst Stunden/Properties/Resources.Designer.cs
generated
Normal file
63
Jugenddienst Stunden/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Jugenddienst_Stunden.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
|
/// </summary>
|
||||||
|
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||||
|
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||||
|
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||||
|
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Jugenddienst_Stunden.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||||
|
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
101
Jugenddienst Stunden/Properties/Resources.resx
Normal file
101
Jugenddienst Stunden/Properties/Resources.resx
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 1.3
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">1.3</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1">this is my long string</data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
[base64 mime encoded serialized .NET Framework object]
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>1.3</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -28,6 +29,17 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
public ICommand DeleteCommand { get; private set; }
|
public ICommand DeleteCommand { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
public StundeViewModel() {
|
||||||
|
_stunde = new Types.DayTime();
|
||||||
|
//SaveCommand = new AsyncRelayCommand(Save);
|
||||||
|
//DeleteCommand = new AsyncRelayCommand(Delete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StundeViewModel(Types.DayTime stunde) {
|
||||||
|
_stunde = stunde;
|
||||||
|
//SaveCommand = new AsyncRelayCommand(Save);
|
||||||
|
//DeleteCommand = new AsyncRelayCommand(Delete);
|
||||||
|
}
|
||||||
|
|
||||||
//private async Task Save() {
|
//private async Task Save() {
|
||||||
// _stunde.Date = DateTime.Now;
|
// _stunde.Date = DateTime.Now;
|
||||||
@@ -42,9 +54,10 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
|
|
||||||
async void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> query) {
|
async void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> query) {
|
||||||
if (query.ContainsKey("load")) {
|
if (query.ContainsKey("load")) {
|
||||||
DateTime heute = DateTime.Now;
|
//DateTime heute = DateTime.Now;
|
||||||
//_stunde = await Models.Stunde.LoadDay(heute);
|
_stunde = await Models.Stunde.LoadEntry(Convert.ToInt32(query["load"]));
|
||||||
//_stunde = await Models.Stunde.LoadData();
|
//_stunde = await Models.Stunde.LoadData();
|
||||||
|
//_note = Models.Note.Load(query["load"].ToString());
|
||||||
//RefreshProperties();
|
//RefreshProperties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
public object Stunden { get; }
|
public object Stunden { get; }
|
||||||
|
|
||||||
|
|
||||||
private List<Types.DayTime> _stunde;
|
private List<DayTime> _stunde;
|
||||||
public List<Types.DayTime> Stunde {
|
public List<DayTime> Stunde {
|
||||||
get => _stunde;
|
get => _stunde;
|
||||||
}
|
}
|
||||||
private Types.Hours _hour;
|
private Hours _hour;
|
||||||
public Types.Hours Hours {
|
public Hours Hours {
|
||||||
get => _hour;
|
get => _hour;
|
||||||
}
|
}
|
||||||
public string ZeitDone {
|
public string ZeitDone {
|
||||||
@@ -93,51 +93,51 @@ 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> Options { get; }
|
||||||
public ObservableCollection<string> OptionsProjekt { get; }
|
//public ObservableCollection<string> OptionsProjekt { get; }
|
||||||
public ObservableCollection<string> OptionsFreistellung { get; }
|
//public ObservableCollection<string> OptionsFreistellung { get; }
|
||||||
public List<TimeDay> TimeDay { get; set; }
|
public List<TimeDay> TimeDay { get; set; }
|
||||||
|
|
||||||
private string selectedOption;
|
//private string selectedOption;
|
||||||
public string SelectedOption {
|
//public string SelectedOption {
|
||||||
get => selectedOption;
|
// get => selectedOption;
|
||||||
set {
|
// set {
|
||||||
if (selectedOption != value) {
|
// if (selectedOption != value) {
|
||||||
selectedOption = value;
|
// selectedOption = value;
|
||||||
//new AsyncRelayCommand(LoadData);
|
// //new AsyncRelayCommand(LoadData);
|
||||||
OnPropertyChanged(nameof(SelectedOption));
|
// OnPropertyChanged(nameof(SelectedOption));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
public StundenViewModel() {
|
public StundenViewModel() {
|
||||||
|
|
||||||
|
|
||||||
Options = new ObservableCollection<string> {
|
// Options = new ObservableCollection<string> {
|
||||||
"Gemeinde 1",
|
// "Gemeinde 1",
|
||||||
"Gemeinde 2",
|
// "Gemeinde 2",
|
||||||
"Gemeinde 3",
|
// "Gemeinde 3",
|
||||||
"Gemeinde 4"
|
// "Gemeinde 4"
|
||||||
};
|
//};
|
||||||
OptionsProjekt = new ObservableCollection<string> {
|
// OptionsProjekt = new ObservableCollection<string> {
|
||||||
"Projekt 1",
|
// "Projekt 1",
|
||||||
"Projekt 2",
|
// "Projekt 2",
|
||||||
"Projekt 3"
|
// "Projekt 3"
|
||||||
};
|
//};
|
||||||
OptionsFreistellung = new ObservableCollection<string> {
|
// OptionsFreistellung = new ObservableCollection<string> {
|
||||||
"Urlaub",
|
// "Urlaub",
|
||||||
"Krankheit",
|
// "Krankheit",
|
||||||
"Elternzeit"
|
// "Elternzeit"
|
||||||
};
|
//};
|
||||||
_hour = new Types.Hours();
|
_hour = new Types.Hours();
|
||||||
LoadDataCommand = new AsyncRelayCommand(LoadData);
|
LoadDataCommand = new AsyncRelayCommand(LoadData);
|
||||||
|
|
||||||
SelectEntryCommand = new AsyncRelayCommand<ViewModels.StundeViewModel>(SelectEntryAsync);
|
SelectEntryCommand = new AsyncRelayCommand<DayTime>(SelectEntryAsync);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SelectEntryAsync(ViewModels.StundeViewModel entry) {
|
private async Task SelectEntryAsync(DayTime entry) {
|
||||||
if (entry != null)
|
if (entry != null)
|
||||||
await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}");
|
await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}");
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
|
|
||||||
public event EventHandler<string> AlertEvent;
|
public event EventHandler<string> AlertEvent;
|
||||||
|
|
||||||
public async Task LoadData() {
|
private async Task LoadData() {
|
||||||
try {
|
try {
|
||||||
_hour = await Models.Stunde.LoadData();
|
_hour = await Models.Stunde.LoadData();
|
||||||
RefreshProperties();
|
RefreshProperties();
|
||||||
@@ -156,7 +156,7 @@ namespace Jugenddienst_Stunden.ViewModels {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task LoadDay(DateTime date) {
|
private async Task LoadDay(DateTime date) {
|
||||||
try {
|
try {
|
||||||
_hour.daytime = await Models.Stunde.LoadDay(date);
|
_hour.daytime = await Models.Stunde.LoadDay(date);
|
||||||
////if (_hour.zeit_total_daily_api != null) {
|
////if (_hour.zeit_total_daily_api != null) {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
x:Class="Jugenddienst_Stunden.Views.StundePage"
|
x:Class="Jugenddienst_Stunden.Views.StundePage"
|
||||||
Title="StundePage">
|
Title="StundePage">
|
||||||
|
|
||||||
<!--<ContentPage.BindingContext>
|
<ContentPage.BindingContext>
|
||||||
<models:StundeViewModel />
|
<models:StundeViewModel />
|
||||||
</ContentPage.BindingContext>-->
|
</ContentPage.BindingContext>
|
||||||
|
|
||||||
<VerticalStackLayout>
|
<VerticalStackLayout>
|
||||||
<Label
|
<Label
|
||||||
@@ -15,6 +15,9 @@
|
|||||||
Text="Welcome to .NET MAUI!"
|
Text="Welcome to .NET MAUI!"
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
HorizontalOptions="Center" />
|
HorizontalOptions="Center" />
|
||||||
|
<Label x:Name="DescBinding" Text="{Binding Stunde.description}"/>
|
||||||
|
<Label x:Name="BeginBinding" Text="{Binding Stunde.begin}"/>
|
||||||
|
<Label x:Name="EndBinding" Text="{Binding Stunde.end}"/>
|
||||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
||||||
<Button Text="Save" Clicked="GetDayTime" />
|
<Button Text="Save" Clicked="GetDayTime" />
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" />
|
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" />
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
|
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,*" Margin="10">
|
||||||
<Label Text="Soll:" Grid.Row="0" Background="DarkSalmon" />
|
<Label Text="Soll:" Grid.Row="0" Background="DarkSalmon" />
|
||||||
<Label Text="Gearbeitet:" Grid.Row="1" />
|
<Label Text="Gearbeitet:" Grid.Row="1" />
|
||||||
<Label Text="Berechnet:" Grid.Row="2" />
|
<Label Text="Berechnet:" Grid.Row="2" />
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<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}" />
|
||||||
|
<Label Grid.Row="5" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Hours.overtime}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
@@ -44,35 +45,43 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
<!--<Grid ColumnDefinitions="*,*,*">
|
<CollectionView
|
||||||
<Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding Options}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="0" >
|
ItemsSource="{Binding DayTimes}"
|
||||||
</Picker>
|
x:Name="stundeItems" Margin="0"
|
||||||
<Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="1" >
|
SelectionMode="Single"
|
||||||
</Picker>
|
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||||
<Picker x:Name="pick_freistellung" Title="Freistellung" ItemsSource="{Binding OptionsFreistellung}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="2" >
|
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
||||||
</Picker>
|
|
||||||
|
<CollectionView.ItemsLayout>
|
||||||
|
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
||||||
|
</CollectionView.ItemsLayout>
|
||||||
|
|
||||||
|
<CollectionView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Padding="15,10,0,0">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
|
||||||
|
<Label Grid.Row="0" Grid.Column="0" Text="{Binding begin}"/>
|
||||||
|
<Label Text="bis" Padding="10,0,10,0"/>
|
||||||
|
<Label Grid.Row="0" Grid.Column="1" Text="{Binding end}"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
|
||||||
|
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding description}" Padding="0,0,0,15"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Entry x:Name="entry" Placeholder="Tätigkeit" />
|
</DataTemplate>
|
||||||
|
</CollectionView.ItemTemplate>
|
||||||
|
|
||||||
<FlexLayout Direction="Row" AlignItems="Start" Wrap="Wrap">
|
|
||||||
<Border Background="LightGreen">
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="Beginn" TextColor="Gray" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
|
|
||||||
<TimePicker x:Name="TimeBegin" HorizontalOptions="Center" TextColor="Gray" Format="HH:mm" MinimumWidthRequest="80" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
<Border Background="OrangeRed">
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="Ende" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
|
|
||||||
<TimePicker x:Name="TimeEnd" TextColor="White" Format="HH:mm" MinimumWidthRequest="80" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</FlexLayout>-->
|
|
||||||
|
|
||||||
|
</CollectionView>
|
||||||
|
|
||||||
<!--<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never" ItemSelected="{Binding SelectEntryCommand}">-->
|
<!--<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never" ItemSelected="{Binding SelectEntryCommand}">-->
|
||||||
<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never">
|
<!--<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ViewCell>
|
<ViewCell>
|
||||||
@@ -96,7 +105,7 @@
|
|||||||
</ViewCell>
|
</ViewCell>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
</ListView>
|
</ListView>-->
|
||||||
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
</VerticalStackLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user