1 Replies - 878 Views - Last Post: 15 August 2012 - 11:13 AM Rate Topic: -----

#1 ztomtomz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 21-March 12

Pre-Formatted text

Posted 15 August 2012 - 11:03 AM

Ive got a program that works out the bill for someones meal quite simply, by the number of items that had so 3 drinks, 2 starters, 2 main meals, 1 pudding. Then the total.


What i want to do is when they push the generate bill button for to take the numbers from all the categories so dinner.text etc. and add them to a pre formated bill my problem is i dont even know where i would begin to make a text document like that. I know that is is probably simple but im just looking for someone to point me in the right direction if at all possible :)

Is This A Good Question/Topic? 0
  • +

Replies To: Pre-Formatted text

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Pre-Formatted text

Posted 15 August 2012 - 11:13 AM

I would imagine you have an "Order" object with properties like:

string Server
int TableNumber
List<LineItem>
int CheckNumber
double Subtotal
double tax
string paymentMethod


Then you have a LineItem class with properties like:
string description
enum TaxClass // Liquour is taxed differently than food in many states


So a guest's receipt is an instance of the "Order" class and you keep adding LineItems as they order food and beverage

To present the bill you would loop through the order and display everything on screen. You might look up "String.Format" on MSDN. The Steve X page is probably the definitive page on formatting strings.
http://blog.stevex.n...ting-in-csharp/

Bulding an application - Part 1
Building an application - Part 2
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1