locked
Beginner C#: Calculate order using combobox, checkbox and radiobutton RRS feed

  • Question


  • I am trying to create a program where you can select 1 of 3 different options in each of the 3 combo boxes with how many of the item you want. Once you calculate, it will display the subtotal plus tax. The combobox showing the quantity should be in loop (1 to 3). How should I do that? If anyone can help it would be great.

    Saturday, June 6, 2020 12:27 AM

Answers

  • Hello,

    Looks like homework/school assignment and with that here are some pointers.

    • Find a company like Domino's pizza and look how they do orders, sure it's a web page but for WPF or Window forms you would use a TabControl with each tab to select parts of the order. Even though a person can switch tabs by selecting a tab you should have a back and next button on each tab.
    • Don't have prices hard coded in the code as you currently have, instead create a a class that would represent a product e.g. properties, id, name, price etc.
    • On the last tab is where all the totaling is done.

    Even though you are a beginner I would suggest looking at implementing a builder pattern (see this example)

    If you want to stay with the current code there is real no more simple way as there are a good deal of moving parts.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Sosa Tabares Wednesday, June 10, 2020 9:42 PM
    Sunday, June 7, 2020 10:19 AM

All replies

  • Hello,

    Without seeing what you have done so far and the problem with the code we can't help you. Also indicate which version of Visual Studio and what type of project e.g. WPF, Windows forms etc.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, June 6, 2020 2:49 AM
  • Hello,

    Looks like homework/school assignment and with that here are some pointers.

    • Find a company like Domino's pizza and look how they do orders, sure it's a web page but for WPF or Window forms you would use a TabControl with each tab to select parts of the order. Even though a person can switch tabs by selecting a tab you should have a back and next button on each tab.
    • Don't have prices hard coded in the code as you currently have, instead create a a class that would represent a product e.g. properties, id, name, price etc.
    • On the last tab is where all the totaling is done.

    Even though you are a beginner I would suggest looking at implementing a builder pattern (see this example)

    If you want to stay with the current code there is real no more simple way as there are a good deal of moving parts.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Sosa Tabares Wednesday, June 10, 2020 9:42 PM
    Sunday, June 7, 2020 10:19 AM