diff --git a/Csharp/Bankrekening/Program.cs b/Csharp/Bankrekening/Program.cs index b674211..11d0459 100644 --- a/Csharp/Bankrekening/Program.cs +++ b/Csharp/Bankrekening/Program.cs @@ -19,13 +19,13 @@ class Bankrekening transacties = new List(); } - // Method to deposit money into the account - public void Storten(decimal bedrag) + // Method to deposit money into the account with a description + public void Storten(decimal bedrag, string beschrijving) { if (bedrag > 0) { saldo += bedrag; - transacties.Add(new Transactie(bedrag, "Storting")); + transacties.Add(new Transactie(bedrag, beschrijving)); } else { @@ -33,13 +33,13 @@ class Bankrekening } } - // Method to withdraw money from the account - public void Opnemen(decimal bedrag) + // Method to withdraw money from the account with a description + public void Opnemen(decimal bedrag, string beschrijving) { if (bedrag > 0 && bedrag <= saldo) { saldo -= bedrag; - transacties.Add(new Transactie(-bedrag, "Opname")); + transacties.Add(new Transactie(-bedrag, beschrijving)); } else { @@ -86,6 +86,7 @@ public class MainForm : Form private Bankrekening mijnRekening; // Bank account instance private Label saldoLabel; // Label to display balance private TextBox bedragTextBox; // TextBox to input amount + private TextBox beschrijvingTextBox; // TextBox to input transaction description private Button stortenButton; // Button to deposit money private Button opnemenButton; // Button to withdraw money private Button transactieGeschiedenisButton; // Button to view transaction history @@ -114,12 +115,24 @@ public class MainForm : Form Font = new Font("Arial", 14), BackColor = Color.White, ForeColor = Color.Black, - BorderStyle = BorderStyle.FixedSingle + BorderStyle = BorderStyle.FixedSingle, + PlaceholderText = "Aantal" // Placeholder text + }; + beschrijvingTextBox = new TextBox() + { + Top = 100, + Left = 20, + Width = 260, + Font = new Font("Arial", 14), + BackColor = Color.White, + ForeColor = Color.Black, + BorderStyle = BorderStyle.FixedSingle, + PlaceholderText = "Beschrijving" // Placeholder text }; stortenButton = new Button() { Text = "Storten", - Top = 100, + Top = 140, Left = 20, Width = 260, Height = 50, // Adjusted height @@ -131,7 +144,7 @@ public class MainForm : Form opnemenButton = new Button() { Text = "Opnemen", - Top = 160, + Top = 200, Left = 20, Width = 260, Height = 50, // Adjusted height @@ -143,7 +156,7 @@ public class MainForm : Form transactieGeschiedenisButton = new Button() { Text = "Transactiegeschiedenis", - Top = 220, + Top = 260, Left = 20, Width = 260, Height = 50, // Adjusted height @@ -161,6 +174,7 @@ public class MainForm : Form // Add controls to the form Controls.Add(saldoLabel); Controls.Add(bedragTextBox); + Controls.Add(beschrijvingTextBox); // Add the new TextBox to the form Controls.Add(stortenButton); Controls.Add(opnemenButton); Controls.Add(transactieGeschiedenisButton); @@ -177,7 +191,8 @@ public class MainForm : Form try { decimal bedrag = decimal.Parse(bedragTextBox.Text); - mijnRekening.Storten(bedrag); + string beschrijving = beschrijvingTextBox.Text; + mijnRekening.Storten(bedrag, beschrijving); saldoLabel.Text = $"Saldo: €{mijnRekening.ControleerSaldo():N2}"; } catch (Exception ex) @@ -192,7 +207,8 @@ public class MainForm : Form try { decimal bedrag = decimal.Parse(bedragTextBox.Text); - mijnRekening.Opnemen(bedrag); + string beschrijving = beschrijvingTextBox.Text; + mijnRekening.Opnemen(bedrag, beschrijving); saldoLabel.Text = $"Saldo: €{mijnRekening.ControleerSaldo():N2}"; } catch (Exception ex) @@ -224,8 +240,8 @@ class Program static void Main() { var mijnRekening = new Bankrekening("NL01BANK0123456789", 1000); - mijnRekening.Storten(100.00m); - mijnRekening.Opnemen(50.00m); + mijnRekening.Storten(100.00m, "Initial deposit"); + mijnRekening.Opnemen(50.00m, "ATM withdrawal"); Console.WriteLine("Transactiegeschiedenis:"); foreach (var transactie in mijnRekening.GetTransactieGeschiedenis()) diff --git a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.dll b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.dll index 1b349b6..9592dae 100644 Binary files a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.dll and b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.dll differ diff --git a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.exe b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.exe index 7fd8701..1787111 100644 Binary files a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.exe and b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.exe differ diff --git a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.pdb b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.pdb index d6d02db..e92d62d 100644 Binary files a/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.pdb and b/Csharp/Bankrekening/bin/Debug/net9.0-windows/Bankrekening.pdb differ diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfo.cs b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfo.cs index 666f827..f8d4a08 100644 --- a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfo.cs +++ b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Bankrekening")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fd28e1a375b6eae866ea0240eaf196c1223efab2")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1de1230437a6adbf29a45e54436a13fd85317a76")] [assembly: System.Reflection.AssemblyProductAttribute("Bankrekening")] [assembly: System.Reflection.AssemblyTitleAttribute("Bankrekening")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfoInputs.cache b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfoInputs.cache index a85fc55..b9fe17c 100644 --- a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfoInputs.cache +++ b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.AssemblyInfoInputs.cache @@ -1 +1 @@ -0c34e76bda4e4d6e48fb3434c0cdb52fb67f3cfdd67f8a9433843c2f79e2732d +c05f8d3fe11decb89b97aa547778688959ab836daef184a25d6bb4759a57bc9c diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.dll b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.dll index 1b349b6..9592dae 100644 Binary files a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.dll and b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.dll differ diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.pdb b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.pdb index d6d02db..e92d62d 100644 Binary files a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.pdb and b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.pdb differ diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.sourcelink.json b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.sourcelink.json index 1b7a76a..fbf4e9d 100644 --- a/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.sourcelink.json +++ b/Csharp/Bankrekening/obj/Debug/net9.0-windows/Bankrekening.sourcelink.json @@ -1 +1 @@ -{"documents":{"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\*":"https://raw.githubusercontent.com/Alvin-Zilverstand/ict-algemeen-opdrachten/fd28e1a375b6eae866ea0240eaf196c1223efab2/*"}} \ No newline at end of file +{"documents":{"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\*":"https://raw.githubusercontent.com/Alvin-Zilverstand/ict-algemeen-opdrachten/1de1230437a6adbf29a45e54436a13fd85317a76/*"}} \ No newline at end of file diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/apphost.exe b/Csharp/Bankrekening/obj/Debug/net9.0-windows/apphost.exe index 7fd8701..1787111 100644 Binary files a/Csharp/Bankrekening/obj/Debug/net9.0-windows/apphost.exe and b/Csharp/Bankrekening/obj/Debug/net9.0-windows/apphost.exe differ diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/ref/Bankrekening.dll b/Csharp/Bankrekening/obj/Debug/net9.0-windows/ref/Bankrekening.dll index 673c884..310e1da 100644 Binary files a/Csharp/Bankrekening/obj/Debug/net9.0-windows/ref/Bankrekening.dll and b/Csharp/Bankrekening/obj/Debug/net9.0-windows/ref/Bankrekening.dll differ diff --git a/Csharp/Bankrekening/obj/Debug/net9.0-windows/refint/Bankrekening.dll b/Csharp/Bankrekening/obj/Debug/net9.0-windows/refint/Bankrekening.dll index 673c884..310e1da 100644 Binary files a/Csharp/Bankrekening/obj/Debug/net9.0-windows/refint/Bankrekening.dll and b/Csharp/Bankrekening/obj/Debug/net9.0-windows/refint/Bankrekening.dll differ