CS1503 Argument 1: cannot convert from 'string' to 'int'
Here is the Error that im getting.
private void btnCalculate_Click(object sender, EventArgs e)
{
string strMailingLabel;
try
{
//Create an instance of clsCustomer using the overloaded constructor
clsCustomer cobjCustomer = new clsCustomer(txtName.Text, txtStreet.Text,
txtCity.Text, txtState.Text, txtZip.Text);
strMailingLabel = cobjCustomer.Name + "\n" +
cobjCustomer.Street + "\n" +
cobjCustomer.City + ", " +
cobjCustomer.State + " " + cobjCustomer.Zip;
//Display mailing address
lblMailingLabel.Text = strMailingLabel;
//Create an instance of clsOrder using the overloaded constructor
clsOrder cobjOrder = new clsOrder
(txtDescription.Text, //Error is Here
int.Parse(txtQuantity.Text),
decimal.Parse(txtPrice.Text));
cobjOrder.calcExtendedPrice();
cobjOrder.accumulateTotals();
lblExtension.Text = cobjOrder.ExtendedPrice.ToString("C");
lblTotalCount.Text = clsOrder.TotalCount.ToString("N0");
lblTotalPrice.Text = clsOrder.TotalPrice.ToString("C");
}
Here is the Order Code
public clsOrder()
{
}
public clsOrder(int intQuantity, decimal decPrice, decimal decDescription)
{
this.Quantity = intQuantity;
this.Price = decPrice;
this.Description = decDescription;
}
//declare property methods
public int Quantity
{
get
{
return cintQuantity;
}
set
{
cintQuantity = value;
}
}
public decimal Price
{
get
{
return cdecPrice;
}
set
{
cdecPrice = value;
}
}
public decimal Description
{
get
{
return cdecDescription;
}
set
{
cdecDescription = value;
}
}
I set the description as a decimal, i know that is what i did wrong, the problem is i don't know how to code it correctly. Anyone have an idea?