BarcodeScanner
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Jugenddienst_Stunden {
|
||||
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi", "OTI6Y1JVUS9RTG1jMTZUbnN2c2JZRm5yRDNiUTZz" }); //Angelika
|
||||
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi", "Njc6cjltcVJ1SmtITUtFZ3llUVpJcWJzc2NDejVZ" }); //Dario
|
||||
|
||||
Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi?hours", "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=" }); //Christine
|
||||
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi?hours", "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=" }); //Christine
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.17763.0</TargetFrameworks>
|
||||
<!-- 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> -->
|
||||
|
||||
@@ -32,7 +31,7 @@
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">34.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">29.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
|
||||
@@ -57,7 +56,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BarcodeScanning.Native.Maui" Version="1.5.7" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
@@ -66,6 +64,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Maui.Graphics" Version="8.0.80" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="ZXing.Net.Maui.Controls" Version="0.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using BarcodeScanning;
|
||||
//using BarcodeScanning;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using Microsoft.Maui.Hosting;
|
||||
using ZXing.Net.Maui.Controls;
|
||||
|
||||
|
||||
namespace Jugenddienst_Stunden {
|
||||
@@ -14,7 +13,7 @@ namespace Jugenddienst_Stunden {
|
||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||
})
|
||||
.UseBarcodeScanning();
|
||||
.UseBarcodeReader();
|
||||
|
||||
#if DEBUG
|
||||
builder.Logging.AddDebug();
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Jugenddienst_Stunden.Models {
|
||||
public class Hours {
|
||||
public class Hours : ObservableObject {
|
||||
public string zeit;
|
||||
public string nominal;
|
||||
public Dictionary<DateOnly,NominalDay> nominal_day_api;
|
||||
public Dictionary<int,NominalWeek> nominal_week_api;
|
||||
//public List<string> time_line;
|
||||
public string zeit_total;
|
||||
//public List<string> zeit_total_daily;
|
||||
public Dictionary<int,decimal> zeit_total_daily;
|
||||
//public List<string> wochensumme;
|
||||
public string overtime_month;
|
||||
public string overtime;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.Maui.Networking;
|
||||
using Microsoft.Maui.Controls;
|
||||
|
||||
|
||||
namespace Jugenddienst_Stunden.Models {
|
||||
internal class Stunde : ObservableObject {
|
||||
|
||||
private static readonly string BaseAddress = "http://hours.dauni.mine.nu:81";
|
||||
private static readonly string apiKey = "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //Christine
|
||||
//private static readonly string apiKey = "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //Christine
|
||||
private static readonly string apiKey = "MTU0fGpkQUNYTGkvcjMvVk4rNkMyK0dDQkJmMkFwVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //Damian
|
||||
private static readonly string requestUrl = $"{BaseAddress}/appapi?hours";
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
@@ -13,15 +17,23 @@ namespace Jugenddienst_Stunden.Models {
|
||||
|
||||
|
||||
public static async Task<Hours> LoadData() {
|
||||
string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
||||
Hours hours = new Hours();
|
||||
if (Connectivity.Current.NetworkAccess == NetworkAccess.None) {
|
||||
await App.Current.MainPage.DisplayAlert("Keine Internetverbindung",
|
||||
"Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es erneut.",
|
||||
"OK");
|
||||
//throw new Exception("Keine Internetverbindung");
|
||||
} else {
|
||||
string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
|
||||
|
||||
if (data == null) {
|
||||
throw new Exception("Keine Daten erhalten");
|
||||
}
|
||||
|
||||
hours = JsonConvert.DeserializeObject<Hours>(data);
|
||||
|
||||
if(data == null) {
|
||||
throw new Exception("Keine Daten erhalten");
|
||||
}
|
||||
|
||||
Hours hours = JsonConvert.DeserializeObject<Hours>(data);
|
||||
|
||||
return hours ?? new Hours();
|
||||
return hours;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
@@ -30,5 +28,7 @@
|
||||
<string>This app uses barcode scanning to...</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="0" y="0" width="456" height="456" fill="#512BD4" />
|
||||
</svg>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<rect x="0" y="0" width="456" height="456" style="fill:white;"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 521 B |
@@ -1,15 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g>
|
||||
<g transform="matrix(22.2941,0,0,22.2941,98.8839,198.508)">
|
||||
<path d="M0,-3.714L-0.975,-2.74C0.142,-1.712 1.017,-1.478 2.005,-1.41C0.353,-0.367 -0.526,0.977 -0.589,2.746L0.738,2.746C0.818,0.147 4.023,-1.803 6.659,0.273L7.469,-0.818C6.543,-1.485 5.629,-1.85 4.727,-1.91C6.463,-2.847 7.345,-4.363 7.371,-6.46L6.054,-6.458C5.994,-4.279 4.646,-3.056 3.167,-2.754C1.988,-2.512 0.719,-2.865 0,-3.714" style="fill:rgb(255,203,0);fill-rule:nonzero;"/>
|
||||
<g transform="matrix(0.96485,0,0,0.96485,104.499,104.499)">
|
||||
<g transform="matrix(12.0607,0,0,12.0607,101.169,256)">
|
||||
<path d="M0,-11.938L0,-4.95C0,-3.918 -0.071,-3.151 -0.214,-2.644C-0.359,-2.069 -0.604,-1.583 -0.95,-1.184C-1.624,-0.397 -2.515,0 -3.626,0C-4.117,0 -4.588,-0.075 -5.04,-0.226L-5.04,-2.305L-4.999,-2.375C-4.509,-2.048 -4.052,-1.884 -3.626,-1.884C-3.026,-1.884 -2.612,-2.112 -2.382,-2.565C-2.141,-3.019 -2.02,-3.817 -2.02,-4.95L-2.02,-11.938L0,-11.938" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(22.2941,0,0,22.2941,151.984,391.017)">
|
||||
<path d="M0,-13.122C0,-13.648 0.426,-14.075 0.952,-14.075C1.478,-14.075 1.904,-13.648 1.904,-13.122C1.904,-12.597 1.478,-12.171 0.952,-12.171C0.426,-12.171 0,-12.597 0,-13.122M-1.894,0.281L-1.894,-1.315C-1.125,-0.579 0.254,-0.668 0.254,-2.329L0.254,-8.308L1.791,-8.308L1.791,-2.825C1.793,-0.178 0,0.953 -1.894,0.281" style="fill:rgb(29,29,27);"/>
|
||||
<g transform="matrix(0,12.0607,12.0607,0,87.6884,17.5193)">
|
||||
<path d="M1.249,-1.246C0.559,-1.246 -0.002,-0.687 -0.002,0.002C-0.002,0.692 0.559,1.249 1.249,1.249C1.936,1.249 2.497,0.692 2.497,0.002C2.497,-0.687 1.936,-1.246 1.249,-1.246" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(22.2941,0,0,22.2941,344.587,381.767)">
|
||||
<path d="M0,-13.314L1.537,-13.314L1.537,-0.187L0.109,-0.187L0.109,-0.939C-0.575,-0.353 -1.466,0 -2.438,0C-4.601,0 -6.354,-1.753 -6.354,-3.916C-6.354,-6.079 -4.601,-7.833 -2.438,-7.833C-1.518,-7.833 -0.671,-7.515 0,-6.983L0,-13.314ZM-4.902,-3.916C-4.902,-5.277 -3.799,-6.381 -2.438,-6.381C-1.075,-6.381 0.026,-5.277 0.026,-3.916C0.026,-2.554 -1.075,-1.451 -2.438,-1.451C-3.799,-1.451 -4.902,-2.554 -4.902,-3.916" style="fill:rgb(29,29,27);"/>
|
||||
<g transform="matrix(12.0607,0,0,12.0607,32.4324,105.748)">
|
||||
<path d="M0,-5.018C0.88,-4.169 2.079,-3.647 3.398,-3.647C6.103,-3.647 8.293,-5.838 8.293,-8.539L8.288,-8.768L10.103,-8.768L10.107,-8.539C10.107,-5.953 8.64,-3.705 6.49,-2.586C7.743,-2.48 8.98,-2.02 10.042,-1.19L10.221,-1.044L9.103,0.384L8.926,0.242C6.796,-1.425 3.719,-1.044 2.055,1.084C1.43,1.878 1.096,2.811 1.03,3.75L-0.788,3.75C-0.72,2.42 -0.256,1.095 0.626,-0.033C1.239,-0.816 1.992,-1.427 2.82,-1.857C1.229,-1.993 -0.204,-2.685 -1.283,-3.737L0,-5.018" style="fill:rgb(247,147,29);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(12.0607,0,0,12.0607,109.437,86.7078)">
|
||||
<path d="M0,7.464C0,4.526 2.384,2.142 5.325,2.142C6.633,2.142 7.832,2.61 8.758,3.395L8.758,-5.324L10.746,-5.324L10.746,12.598L8.758,12.598L8.758,11.534C7.832,12.318 6.633,12.788 5.325,12.788C2.384,12.788 0,10.404 0,7.464M2.113,7.401C2.113,9.234 3.598,10.719 5.432,10.719C7.263,10.719 8.747,9.234 8.747,7.401C8.747,5.569 7.263,4.083 5.432,4.083C3.598,4.083 2.113,5.569 2.113,7.401" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,8 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||
</svg>
|
||||
<svg width="100%" height="100%" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g>
|
||||
<g transform="matrix(12.0607,0,0,12.0607,201.169,356)">
|
||||
<path d="M0,-11.938L0,-4.95C0,-3.918 -0.071,-3.151 -0.214,-2.644C-0.359,-2.069 -0.604,-1.583 -0.95,-1.184C-1.624,-0.397 -2.515,0 -3.626,0C-4.117,0 -4.588,-0.075 -5.04,-0.226L-5.04,-2.305L-4.999,-2.375C-4.509,-2.048 -4.052,-1.884 -3.626,-1.884C-3.026,-1.884 -2.612,-2.112 -2.382,-2.565C-2.141,-3.019 -2.02,-3.817 -2.02,-4.95L-2.02,-11.938L0,-11.938" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(0,12.0607,12.0607,0,187.688,117.519)">
|
||||
<path d="M1.249,-1.246C0.559,-1.246 -0.002,-0.687 -0.002,0.002C-0.002,0.692 0.559,1.249 1.249,1.249C1.936,1.249 2.497,0.692 2.497,0.002C2.497,-0.687 1.936,-1.246 1.249,-1.246" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(12.0607,0,0,12.0607,132.432,205.748)">
|
||||
<path d="M0,-5.018C0.88,-4.169 2.079,-3.647 3.398,-3.647C6.103,-3.647 8.293,-5.838 8.293,-8.539L8.288,-8.768L10.103,-8.768L10.107,-8.539C10.107,-5.953 8.64,-3.705 6.49,-2.586C7.743,-2.48 8.98,-2.02 10.042,-1.19L10.221,-1.044L9.103,0.384L8.926,0.242C6.796,-1.425 3.719,-1.044 2.055,1.084C1.43,1.878 1.096,2.811 1.03,3.75L-0.788,3.75C-0.72,2.42 -0.256,1.095 0.626,-0.033C1.239,-0.816 1.992,-1.427 2.82,-1.857C1.229,-1.993 -0.204,-2.685 -1.283,-3.737L0,-5.018" style="fill:rgb(247,147,29);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(12.0607,0,0,12.0607,209.437,186.708)">
|
||||
<path d="M0,7.464C0,4.526 2.384,2.142 5.325,2.142C6.633,2.142 7.832,2.61 8.758,3.395L8.758,-5.324L10.746,-5.324L10.746,12.598L8.758,12.598L8.758,11.534C7.832,12.318 6.633,12.788 5.325,12.788C2.384,12.788 0,10.404 0,7.464M2.113,7.401C2.113,9.234 3.598,10.719 5.432,10.719C7.263,10.719 8.747,9.234 8.747,7.401C8.747,5.569 7.263,4.083 5.432,4.083C3.598,4.083 2.113,5.569 2.113,7.401" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,6 +1,7 @@
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.Windows.Input;
|
||||
using BarcodeScanning;
|
||||
using Microsoft.Maui.Dispatching;
|
||||
//using BarcodeScanning;
|
||||
|
||||
namespace Jugenddienst_Stunden.ViewModels {
|
||||
internal class AboutViewModel {
|
||||
@@ -19,14 +20,31 @@ namespace Jugenddienst_Stunden.ViewModels {
|
||||
async Task ShowMoreInfo() =>
|
||||
await Launcher.Default.OpenAsync(MoreInfoUrl);
|
||||
|
||||
|
||||
|
||||
private static void BarcodesDetected(object sender, OnDetectionFinishedEventArg e) {
|
||||
if (e.BarcodeResults.Length > 0) {
|
||||
// Hier verarbeiten Sie den erkannten Barcode
|
||||
Console.WriteLine($"Detected barcode: {e.BarcodeResults.GetType()} {e.BarcodeResults.ToString()}");
|
||||
}
|
||||
}
|
||||
//private async void SetupBarcodeScanner() {
|
||||
// try {
|
||||
// var scanner = new BarcodeScanner();
|
||||
// var result = await scanner.ScanAsync();
|
||||
|
||||
// if (result != null) {
|
||||
// await DisplayAlert("Scan-Ergebnis", $"Barcode: {result.Barcode}", "OK");
|
||||
// } else {
|
||||
// await DisplayAlert("Scan Abgebrochen", "Der Barcode-Scan wurde abgebrochen.", "OK");
|
||||
// }
|
||||
// } catch (Exception ex) {
|
||||
// await DisplayAlert("Fehler", $"Ein Fehler ist aufgetreten: {ex.Message}", "OK");
|
||||
// }
|
||||
//}
|
||||
|
||||
//private static void BarcodesDetected(object sender, OnDetectionFinishedEventArg e) {
|
||||
// if (e.BarcodeResults.Length > 0) {
|
||||
// // Hier verarbeiten Sie den erkannten Barcode
|
||||
// //Console.WriteLine($"Detected barcode: {e.BarcodeResults.GetType()} {e.BarcodeResults.ToString()}");
|
||||
// await DisplayAlert("Scan-Ergebnis", $"Barcode: {e.BarcodeResults.GetType()} {e.BarcodeResults.ToString()}", "OK");
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.Windows.Input;
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.Networking;
|
||||
|
||||
|
||||
namespace Jugenddienst_Stunden.ViewModels {
|
||||
@@ -16,6 +18,12 @@ namespace Jugenddienst_Stunden.ViewModels {
|
||||
public Models.Hours Hours {
|
||||
get => _hour;
|
||||
}
|
||||
public string ZeitDone {
|
||||
get => _hour.zeit;
|
||||
}
|
||||
public string ZeitCalculated {
|
||||
get => _hour.zeit_total;
|
||||
}
|
||||
public string Nominal {
|
||||
get => _hour.nominal;
|
||||
}
|
||||
@@ -35,14 +43,18 @@ namespace Jugenddienst_Stunden.ViewModels {
|
||||
// await Models.Stunde.LoadData();
|
||||
|
||||
public async Task LoadData() {
|
||||
_hour = await Models.Stunde.LoadData();
|
||||
RefreshProperties();
|
||||
_hour = await Models.Stunde.LoadData();
|
||||
Models.Hours Hours = new Models.Hours();
|
||||
RefreshProperties();
|
||||
}
|
||||
|
||||
private void RefreshProperties() {
|
||||
OnPropertyChanged(nameof(Nominal));
|
||||
OnPropertyChanged(nameof(Overtime));
|
||||
OnPropertyChanged(nameof(OvertimeMonth));
|
||||
OnPropertyChanged(nameof(ZeitCalculated));
|
||||
OnPropertyChanged(nameof(ZeitDone));
|
||||
OnPropertyChanged(nameof(Hours));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
||||
xmlns:scanner="clr-namespace:BarcodeScanning;assembly=BarcodeScanning.Native.Maui"
|
||||
xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
|
||||
x:Class="Jugenddienst_Stunden.Views.AboutPage">
|
||||
|
||||
<ContentPage.BindingContext>
|
||||
<models:AboutViewModel />
|
||||
</ContentPage.BindingContext>
|
||||
@@ -24,6 +25,11 @@
|
||||
OnDetectionFinished="BarcodesDetected"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand" />-->
|
||||
|
||||
<zxing:CameraBarcodeReaderView x:Name="barcodeScannerView"
|
||||
BarcodesDetected="BarcodesDetected"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using ZXing;
|
||||
using ZXing.Net.Maui.Controls;
|
||||
namespace Jugenddienst_Stunden.Views;
|
||||
|
||||
public partial class AboutPage : ContentPage
|
||||
@@ -5,6 +7,22 @@ public partial class AboutPage : ContentPage
|
||||
public AboutPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
barcodeScannerView.Options = new ZXing.Net.Maui.BarcodeReaderOptions {
|
||||
Formats = ZXing.Net.Maui.BarcodeFormat.QrCode,
|
||||
AutoRotate = true,
|
||||
Multiple = false
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private void BarcodesDetected(object sender, ZXing.Net.Maui.BarcodeDetectionEventArgs e) {
|
||||
var first = e.Results?.FirstOrDefault();
|
||||
if (first is null) {
|
||||
return;
|
||||
}
|
||||
Dispatcher.DispatchAsync(async () => {
|
||||
await DisplayAlert("Scan-Ergebnis", $"Barcode: {first.Value}", "OK");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,14 +12,19 @@
|
||||
|
||||
<Button Text="Load data" Command="{Binding LoadDataCommand}" />
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
|
||||
<Label Text="Nominal:" Grid.Row="0" />
|
||||
<Label Text="Overtime:" Grid.Row="1" />
|
||||
<Label Text="OvertimeMonth:" Grid.Row="2" Margin="0,0,5,0" />
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
|
||||
<Label Text="Soll:" Grid.Row="0" />
|
||||
<Label Text="Gearbeitet:" Grid.Row="1" />
|
||||
<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 BackgroundColor="AliceBlue" Grid.Row="0" Grid.Column="1" Text="{Binding Nominal}" />
|
||||
<Label BackgroundColor="AliceBlue" Grid.Row="1" Grid.Column="1" Text="{Binding Overtime}" />
|
||||
<Label BackgroundColor="LightSlateGray" Grid.Row="2" Grid.Column="1" Text="{Binding OvertimeMonth}" />
|
||||
<Label BackgroundColor="AliceBlue" Grid.Row="1" Grid.Column="1" Text="{Binding ZeitDone}" />
|
||||
<Label BackgroundColor="AliceBlue" Grid.Row="2" Grid.Column="1" Text="{Binding ZeitCalculated}" />
|
||||
<Label BackgroundColor="AliceBlue" Grid.Row="3" Grid.Column="1" Text="{Binding OvertimeMonth}" />
|
||||
<Label BackgroundColor="AliceBlue" Grid.Row="4" Grid.Column="1" Text="{Binding Overtime}" />
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
||||
@@ -1,110 +0,0 @@
|
||||
{
|
||||
"CodeGenerationMode": 4,
|
||||
"ContextClassName": "jugenddienst_stundenContext",
|
||||
"ContextNamespace": null,
|
||||
"FilterSchemas": false,
|
||||
"IncludeConnectionString": true,
|
||||
"ModelNamespace": null,
|
||||
"OutputContextPath": null,
|
||||
"OutputPath": "Models",
|
||||
"PreserveCasingWithRegex": true,
|
||||
"ProjectRootNamespace": "Jugenddienst_Stunden",
|
||||
"Schemas": null,
|
||||
"SelectedHandlebarsLanguage": 2,
|
||||
"SelectedToBeGenerated": 0,
|
||||
"T4TemplatePath": null,
|
||||
"Tables": [
|
||||
{
|
||||
"Name": "j_department",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_gemeinde",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_hour",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_hour_gemeinde",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_hour_projekt",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_hour_type",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_login",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_operator",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_projekt",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_saved_hours",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_setting",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_settings",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_timetable",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_timetable_dates",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_translation",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_worktype",
|
||||
"ObjectType": 0
|
||||
},
|
||||
{
|
||||
"Name": "j_year_holidays",
|
||||
"ObjectType": 0
|
||||
}
|
||||
],
|
||||
"UiHint": null,
|
||||
"UncountableWords": null,
|
||||
"UseAsyncStoredProcedureCalls": true,
|
||||
"UseBoolPropertiesWithoutDefaultSql": false,
|
||||
"UseDatabaseNames": false,
|
||||
"UseDateOnlyTimeOnly": true,
|
||||
"UseDbContextSplitting": false,
|
||||
"UseDecimalDataAnnotationForSprocResult": true,
|
||||
"UseFluentApiOnly": true,
|
||||
"UseHandleBars": false,
|
||||
"UseHierarchyId": false,
|
||||
"UseInflector": true,
|
||||
"UseLegacyPluralizer": false,
|
||||
"UseManyToManyEntity": false,
|
||||
"UseNoDefaultConstructor": false,
|
||||
"UseNoNavigations": false,
|
||||
"UseNoObjectFilter": false,
|
||||
"UseNodaTime": false,
|
||||
"UseNullableReferences": false,
|
||||
"UsePrefixNavigationNaming": false,
|
||||
"UseSchemaFolders": false,
|
||||
"UseSchemaNamespaces": false,
|
||||
"UseSpatial": false,
|
||||
"UseT4": false
|
||||
}
|
||||
BIN
appicon.afdesign
Normal file
BIN
appicon.afdesign
Normal file
Binary file not shown.
Binary file not shown.
BIN
splash.afdesign
Normal file
BIN
splash.afdesign
Normal file
Binary file not shown.
Reference in New Issue
Block a user