VB help with implementing a class in form code!!

coffee

New member
Joined
Feb 17, 2009
Messages
3
Programming Experience
Beginner
I am having trouble with this project I am working on. I am a beginner to vb and have some background in access databases. I will attach my project if anyone can help.

I am doing an inventory project. When you execute the form, a main form pops up that allows you to choose Production or Inventory. My issue is with the Production. In the production form that pops up after clicking Production, there are text boxes to be filled out by the user based on the production run. I need help implementing a class that will give the box count based on the box type entered. I have to use a class based on the project requirements.

Basically to calculate the usage, enter in a random number for Pods Produced, then enter in a box type (which is A box, B box, C box, D box, Master Case). I want the Public Class Box Count in the code to be able to be placed in the production form's main class code and calculate the box count based on the box type entered. If A box, box count should be 50. If B Box, box count should be 100, If any other box is typed in, the box count should be 150.

Please Help!! and THANK YOU!
 

Attachments

  • IE Project.zip
    27.5 KB · Views: 24
Last edited by a moderator:
Your Inventory form is broken.

As for your Production form, I'd recommend using a listbox and using a select case statement.
 
, but the project calls for implementing a class.
May we assume that the teacher calls for it ;)

Create a class "BoxTypes"
create a public shared readonly property Boxcount that takes a string param to define the box type and that returns an int
depending on the boxtype passed, return the correct number or do some error handling if the boxtype is unknown.
now in your form you can simply say:
txtBoxCount.Text = BoxTypes.BoxCount(txtBoxType.Text).ToString
 
Back
Top