this.unitPriceTextBox.Text = aOrder.CalcQuote(this.unitPriceTextBox.Text, this.unitsTextBox.Text);.Text is expecting a string, CalcQuote() is returning a decimal. You need another conversion in there.
>private void addButton_Click(object sender, EventArgs e) > { > //Instantiate a business tier object. > //Biz_Tier aOrder = new > // Biz_Tier(this.unitPriceTextBox.Text, this.unitsTextBox.Text); > Biz_Tier aOrder = new Biz_Tier(); > this.unitPriceTextBox.Text = aOrder.CalcQuote(this.unitPriceTextBox.Text, this.unitsTextBox.Text); > } >>
>using System; >using System.Collections.Generic; >using System.Text; > >namespace CarpetCleaningQuote >{ > class Biz_Tier > { > //Class level variables > private string priceString, unitString; > decimal quoteDecimal; > > public decimal CalcQuote(string Price, string Units) > { > decimal priceDecimal = decimal.Parse(Price); > int unitStringInteger = int.Parse(Units); > quoteDecimal = (unitStringInteger * priceDecimal); > return quoteDecimal; > } > > private string Quantity > { > set > { > this.priceString = value; > } > } > > private string Units > { > set > { > this.unitString = value; > } > } > > private decimal quote > { > get > { > return this.quoteDecimal; > } > } > } >} >