Money Anzeigen

This commit is contained in:
NBTEMP\bib
2026-09-09 11:14:57 +02:00
parent b2078c38b4
commit 6b2136fadf
6 changed files with 23 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
+2 -1
View File
@@ -12,7 +12,7 @@ namespace Casino
internal class Database
{
private string myConnectionString = "server=mysql.pb.bib.de;uid=pbg2h25ala;pwd=a7TP2aRv7Xdu;database=pbg2h25ala_Casino";
public ObservableCollection<User> SelectTask()
public ObservableCollection<User> GetUser()
{
ObservableCollection<User> user = new ObservableCollection<User>();
@@ -104,5 +104,6 @@ namespace Casino
return soundBytes;
}
}
}
+2 -1
View File
@@ -50,12 +50,13 @@ namespace Casino
{
Database db = new Database();
ObservableCollection<User> users = new ObservableCollection<User>();
users = db.SelectTask();
users = db.GetUser();
for (int i = 0; i < users.Count(); i++)
{
if (name.Equals(users[i].Name))
{
if(passwort.Equals(users[i].Passwort)) {
MainWindow.currentUser = i;
return true;
}
return false;
+1
View File
@@ -16,6 +16,7 @@ namespace Casino
/// </summary>
public partial class MainWindow : Window
{
public static int currentUser;
public MainWindow()
{
InitializeComponent();
+4 -2
View File
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Casino"
mc:Ignorable="d"
Title="Slots" Height="1080" Width="1920"
Title="Slots" Height="1080" Width="1800"
WindowState="Maximized"
WindowStyle="None"
Background="Transparent">
@@ -60,7 +60,9 @@
<Image Grid.Column="9" Grid.Row="3" x:Name="Bild_35"/>
<Image Grid.Column="11" Grid.Row="3" x:Name="Bild_36"/>
<Button Content="Spin" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="1" Height="40" Width="79" Click="Spin"/>
<Button Content="Spin" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="0" Height="50" Width="100" Click="Spin" Margin="0,100,0,0" Background="DarkRed" Foreground="Silver"/>
<Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100" Height="50"/>
<TextBlock x:Name="Konto" Grid.Column="12" Grid.Row="4" Height="30" Width="100" Margin="0,100,0,0" Background="DarkRed" Foreground="Silver" TextAlignment="Right" FontSize="25"/>
</Grid>
+13 -2
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
@@ -25,12 +26,13 @@ namespace Casino
private Random _random = new Random();
Database db = new Database();
private List<Byte[]> AlleBilder;
ObservableCollection<User> users = new ObservableCollection<User>();
public Slots()
{
InitializeComponent();
users = db.GetUser();
_bilder = new List<Image>
{
@@ -45,6 +47,8 @@ namespace Casino
db.GetCardImage(8),db.GetCardImage(9),db.GetCardImage(10),
};
Konto.Text = users[MainWindow.currentUser].Geld.ToString();
}
@@ -68,6 +72,7 @@ namespace Casino
}
private async Task Spin()
{
users[MainWindow.currentUser].Geld += 100;
for (int i = 0; i < 50; i++)
{
foreach (var image in _bilder)
@@ -85,5 +90,11 @@ namespace Casino
{
await Spin();
}
private void Hauptmenue(object sender, RoutedEventArgs e)
{
Close();
}
}
}