Well it is apparent i am new to c# cause i am having a problem calling a GetPaymentAmount into my GUI.
This is my interface:
namespace Invoice
{
public interface IPaytable
{
decimal GetPaymentAmount();
}
}
This is my method
public decimal GetPaymentAmount()
{
return priceper * quantity;
}
and i am completely lost as how to make it to where i can display the information from the getpaymentamount into my Results textbox as such:
restxtbx.Text += "Total for this transaction is :$" + WHAT GOES HERE? ;
Calling getpaymentamount into my gui.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

AlanRank #669 · 3.6K reputationPosted Feb 21, 2008, 11:52 PM EST
This is what you need:
restxtbx.Text += "Total for this transaction is :$" + GetPaymentAmount().ToString();
GetPaymentAmount() produces a decimal result which you then have to convert to a string to be able to add it to the first part of the line. The whole string is then added to what's already in the TextBox because of the += operator.
Steven3 reputationPosted Feb 22, 2008, 9:54 AM EST
Thanks alot for your help