Leerzeilen, Kommentare
This commit is contained in:
@@ -98,9 +98,6 @@ internal static class BaseFunc {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
internal static Note Load(string filename) {
|
internal static Note Load(string filename) {
|
||||||
filename = System.IO.Path.Combine(FileSystem.AppDataDirectory, filename);
|
filename = System.IO.Path.Combine(FileSystem.AppDataDirectory, filename);
|
||||||
|
|
||||||
@@ -113,14 +110,11 @@ internal static class BaseFunc {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stundeneintrag speichern
|
/// Stundeneintrag speichern
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static async Task SaveItemAsync(string url, string token, DayTime item, bool isNewItem = false) {
|
internal static async Task SaveItemAsync(string url, string token, DayTime item, bool isNewItem = false) {
|
||||||
|
|
||||||
|
|
||||||
//Uhrzeiten sollten sinnvolle Werte haben - außer bei Freistellungen, da wäre eigentlich null
|
//Uhrzeiten sollten sinnvolle Werte haben - außer bei Freistellungen, da wäre eigentlich null
|
||||||
if (item.TimeSpanVon == item.TimeSpanBis && item.FreistellungAktiv == null) {
|
if (item.TimeSpanVon == item.TimeSpanBis && item.FreistellungAktiv == null) {
|
||||||
throw new Exception("Beginn und Ende sind gleich");
|
throw new Exception("Beginn und Ende sind gleich");
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ namespace Jugenddienst_Stunden.Models;
|
|||||||
internal static class HoursBase {
|
internal static class HoursBase {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// what can be: settings, hours, date=YYYY-MM-DD, id=<int>
|
/// what can be: "settings", "hours", date="YYYY-MM-DD", id=<int/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns>Entire response</returns>
|
||||||
internal static async Task<BaseResponse> LoadBase(string what) {
|
internal static async Task<BaseResponse> LoadBase(string what) {
|
||||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?"+what, GlobalVar.ApiKey);
|
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?"+what, GlobalVar.ApiKey);
|
||||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||||
@@ -17,6 +18,7 @@ internal static class HoursBase {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Einstellungen
|
/// Einstellungen
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns>Settings only</returns>
|
||||||
internal static async Task<Settings> LoadSettings() {
|
internal static async Task<Settings> LoadSettings() {
|
||||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?settings", GlobalVar.ApiKey);
|
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?settings", GlobalVar.ApiKey);
|
||||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||||
@@ -26,12 +28,17 @@ internal static class HoursBase {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Daten laden
|
/// Daten laden
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns>Hours only</returns>
|
||||||
internal static async Task<Hours> LoadData() {
|
internal static async Task<Hours> LoadData() {
|
||||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?hours", GlobalVar.ApiKey);
|
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?hours", GlobalVar.ApiKey);
|
||||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||||
return res.hour;
|
return res.hour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Benutzerdaten laden
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>User-Object</returns>
|
||||||
public static async Task<User> LoadUser(string apiKey) {
|
public static async Task<User> LoadUser(string apiKey) {
|
||||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl, apiKey);
|
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl, apiKey);
|
||||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||||
@@ -62,7 +69,6 @@ internal static class HoursBase {
|
|||||||
/// Eintrag speichern
|
/// Eintrag speichern
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static async Task<DayTime> SaveEntry(DayTime stunde) { //, string begin, string end, string freistellung, string bemerkung) {
|
internal static async Task<DayTime> SaveEntry(DayTime stunde) { //, string begin, string end, string freistellung, string bemerkung) {
|
||||||
|
|
||||||
bool isNew = false;
|
bool isNew = false;
|
||||||
if (stunde.Id == null)
|
if (stunde.Id == null)
|
||||||
isNew = true;
|
isNew = true;
|
||||||
|
|||||||
@@ -53,9 +53,6 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
get => _hour;
|
get => _hour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mindest-Datum für den Datepicker
|
/// Mindest-Datum für den Datepicker
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -86,7 +83,6 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Monatsübersicht: Geleistete Stunden
|
/// Monatsübersicht: Geleistete Stunden
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
namespace Jugenddienst_Stunden.Views;
|
namespace Jugenddienst_Stunden.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Einzelne Notiz
|
||||||
|
/// </summary>
|
||||||
public partial class NotePage : ContentPage {
|
public partial class NotePage : ContentPage {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CTOR
|
||||||
|
/// </summary>
|
||||||
public NotePage() {
|
public NotePage() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user