samuel_1991
Member
- Joined
- Jan 19, 2009
- Messages
- 13
- Programming Experience
- Beginner
I need help again, this time round I need to have a Submit.vb, where it is used to Confirm Order before submitting.
Now I have a main class (Public Class Submit) that has various controls etc.
Problem:
I have created more classes within this vb or not also the same.
Now I put a class named as FoodList that has 3 functions.
1st, stores various dishes ordered by customer so that later if any modifications need to be done is easier.
2nd, stores payment status where payment = 0 (Not paid yet because payment is done in another form, after the meal)
3rd, stores total amount to be paid which can be shown again later during payment.
The first portion of the code is the one on a button that confirms the order which make the program crash
The second portion is the FoodList class declaration of ArrayLists.
Assuming the restaurant has 10 dishes.
Is there a way to fix it?
Now I have a main class (Public Class Submit) that has various controls etc.
Problem:
I have created more classes within this vb or not also the same.
Now I put a class named as FoodList that has 3 functions.
1st, stores various dishes ordered by customer so that later if any modifications need to be done is easier.
2nd, stores payment status where payment = 0 (Not paid yet because payment is done in another form, after the meal)
3rd, stores total amount to be paid which can be shown again later during payment.
The first portion of the code is the one on a button that confirms the order which make the program crash
VB.NET:
FoodList.BaconList.Add(Bacon)
FoodList.CheeseList.Add(Cheese)
FoodList.GarlicList.Add(Garlic)
FoodList.HennessyList.Add(Hennessy)
FoodList.HunSoupList.Add(HunSoup)
FoodList.LambList.Add(Lamb)
FoodList.RedBeanList.Add(RedBean)
FoodList.RoyalList.Add(Royal)
FoodList.SeaBassList.Add(SeaBass)
FoodList.VealList.Add(Veal)
'Add payment status
FoodList.PaymentStatus.Add(0) '0 = Have not paid
'Add grandtotal o be paid
FoodList.ToBePaid.Add(grandtotal)
The second portion is the FoodList class declaration of ArrayLists.
VB.NET:
Public Class FoodList
Public Shared BaconList As ArrayList
Public Shared CheeseList As ArrayList
Public Shared GarlicList As ArrayList
Public Shared HennessyList As ArrayList
Public Shared HunSoupList As ArrayList
Public Shared LambList As ArrayList
Public Shared RedBeanList As ArrayList
Public Shared RoyalList As ArrayList
Public Shared SeaBassList As ArrayList
Public Shared VealList As ArrayList
[COLOR="Lime"]'Create List of customers' payment status[/COLOR]
Public Shared PaymentStatus As ArrayList
[COLOR="lime"]'Create List of customer need to pay how much[/COLOR]
Public Shared ToBePaid As ArrayList
End Class
Assuming the restaurant has 10 dishes.
Is there a way to fix it?
Last edited: