I am having some trouble when calling a method from class A in class B.
Here is the method being called in class B
public double monthlyExpense
{
get
{
return RealEstateApp.GetExpenses();
}
The method itself from class A is
public static double GetExpenses()
{
double insurance;
double taxes;
double utilities;
string inValue;
inValue = _insurance;
insurance = double.Parse(inValue);
inValue = _tax;
taxes = double.Parse(inValue);
inValue = _utilities;
utilities = double.Parse(inValue);
return (insurance / 12 + taxes / 12 + utilities);
}
I get the exception a the insurance = double.Parse(inValue);
line.
The _insurance etc variables are being read from various text boxes:
RealEstateApp._insurance = txtBoxInsurance.Text;
RealEstateApp._tax = txtBoxTax.Text;
RealEstateApp._utilities = txtBoxUtilities.Text;
Any help would be hugely appreciated.