C
C#16mo ago
brunofrancis

❔ Trying to make ATM WPF application, Connecting SQLite with Microsoft entity framework core. Help

So far I have built database over DB Browser (SQLite), and over couple of videos on Youtube I made it pass login screen. Now I am looking to find solution how to make my program read data from my DB and update it if I do option "Uplata" (eng. Deposit), "Isplata" (eng. Withdrawl), "Stanje" (eng. Balance). Izlaz (eng. Exit) I made that was one line of code. My User class:
using System.ComponentModel.DataAnnotations;

namespace Bankomat
{
public class User
{

[Key]
public int Id { get; set; }
public string brojKartice { get; set; }
public string pin { get; set; }
public string ime { get; set; }
public string prezime { get; set; }
public double balance { get; set; }


}
}
using System.ComponentModel.DataAnnotations;

namespace Bankomat
{
public class User
{

[Key]
public int Id { get; set; }
public string brojKartice { get; set; }
public string pin { get; set; }
public string ime { get; set; }
public string prezime { get; set; }
public double balance { get; set; }


}
}
This is Stanje (eng. Balance) code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPF_Login;

namespace Bankomat
{

public partial class Stanje : Window
{
public Stanje()
{
InitializeComponent();
}


private void BtnUcitajClick(object sender, RoutedEventArgs e) ///Load balance from DB
{


}


private void BtnOdustaniClick(object sender, RoutedEventArgs e)
{
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
this.Close();
}


}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPF_Login;

namespace Bankomat
{

public partial class Stanje : Window
{
public Stanje()
{
InitializeComponent();
}


private void BtnUcitajClick(object sender, RoutedEventArgs e) ///Load balance from DB
{


}


private void BtnOdustaniClick(object sender, RoutedEventArgs e)
{
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
this.Close();
}


}
}
I can post more along the way. Thanks to anyone for considering to help me build my first project.
3 Replies
brunofrancis
brunofrancis16mo ago
brunofrancis
brunofrancis16mo ago
This was my "idea" of making it since I got no clue how would text just display balance although it would be cleaner if it just displayed balance(stanje) once it got into this part of the menu.
Accord
Accord16mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.