Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using checkingAccount;
namespace BankAccount
{
public partial class Form1 : Form
{
double depCheck;
double witCheck;
double checkingBalance;
double currentBalance;
double checkAmount;
double takeAmount;
double depSavings;
double witSavings;
double savingsBalance;
double savingsAmount;
public Form1()
{
InitializeComponent();
}
private void chkDepost_Click(object sender, EventArgs e)
{
checkAmount = Convert.ToInt32(chkDeposit.Text);
depCheck = checkingAccount.checkingAccount.depositChecking(checkingBalance, checkAmount);
currentBalance = currentBalance + depCheck;
chkBalance.Text = Convert.ToString(currentBalance);
}
private void chkWithdraw_Click(object sender, EventArgs e)
{
takeAmount = Convert.ToInt32(chkWithdrawn.Text);
witCheck = checkingAccount.checkingAccount.withdrawlChecking(checkingBalance, takeAmount);
currentBalance = currentBalance - witCheck;
chkBalance.Text = Convert.ToString(currentBalance);
}
private void balDeposit_Click(object sender, EventArgs e)
{
takeAmount = Convert.ToInt32(savDeposit.Text);
depSavings = savingsAccount.Class1.depositSavings(savingsBalance, takeAmount);
currentBalance = currentBalance + depSavings;
savBalance.Text = Convert.ToString(currentBalance);
}
private void savWithdraw_Click(object sender, EventArgs e)
{
takeAmount = Convert.ToInt32(saveWithdraw.Text);
witSavings = savingsAccount.Class1.withdrawlSavings(savingsBalance, takeAmount);
currentBalance = currentBalance - witSavings;
savBalance.Text = Convert.ToString(currentBalance);
}
}
}
program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using BankAccount;
namespace banking_account
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
CheckingAccount.cs (this is one of the dll's)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace checkingAccount
{
public class checkingAccount
{
public static double depositChecking(double currentBalance, double customerDeposit)
{
return currentBalance + customerDeposit;
}
public static double withdrawlChecking(double currentBalance, double customerDeposit)
{
return currentBalance - customerDeposit;
}
}
}
SavingsAccount.cs (this is the second dll)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace savingsAccount
{
public class Class1
{
public static double depositSavings(double currentBalance, double customerDeposit)
{
return currentBalance + customerDeposit;
}
public static double withdrawlSavings(double currentBalance, double customerDeposit)
{
return currentBalance - customerDeposit;
}
}
}
VulpesPosted Mar 25, 2012, 1:52 PM
James majorPosted Mar 25, 2012, 12:04 PM
Sam HobbsPosted Mar 25, 2012, 2:50 AM